> On May 1, 2018, at 3:17 PM, Mattias Gaertner <[email protected]>
> wrote:
>
> JS only knows double for numbers.
>
> At compile time you can use almost all the normal types: byte,
> word, longint, etc.
> pas2js has an alias single, but because internally it is a double this
> gives warnings.
what do we do for records then? We often need to pass arrays of specific types
for functions such as glBufferData.
type
TVec2f = record
x, y: GLfloat;
end;
type
TVec2b = record
x, y: GLubyte;
end;
var
verts: array[0..2] of TVec2f;
begin
glBufferData(GL_ARRAY_BUFFER, sizeof(TVec2f) * 3, @verts, GL_STATIC_DRAW); //
pass an array of TVec2 but how does JS know this?
Regards,
Ryan Joseph
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal