or I could:
That way I'll only have to edit the TypePtr definition if the type changes.
I still think VarPtr(t.mytype) should do it for me, or there could be a TypePtr() function in BlitzMax.
In these simple float examples you can use an array, but when you want to match a more complex C struct, it gets more tricky.
Type color4f Field r#,g#,b#,a# Method TypePtr:Float Ptr() Return Varptr r End Method End Type glLightfv GL_LIGHT0, GL_AMBIENT, ambient.TypePtr()
That way I'll only have to edit the TypePtr definition if the type changes.
I still think VarPtr(t.mytype) should do it for me, or there could be a TypePtr() function in BlitzMax.
In these simple float examples you can use an array, but when you want to match a more complex C struct, it gets more tricky.