[Pas2js] Multi dimensional static array to dynamic array?

Ryan Joseph ryan at thealchemistguild.com
Tue May 15 14:51:36 CEST 2018



> On May 15, 2018, at 6:44 PM, Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
> 
>> TJSFloat32List = array of GLfloat;
>> data: array[0..3, 0..3] of GLfloat;
>> list: TJSFloat32List;
>> 
>> list := TJSFloat32List(data); // no go
> 
> Rightfully so.

What are you suggesting then? uniformMatrix4fv takes an array of GLfloat which we translated as TJSFloat32List. In Pascal I would use @data to pass the address of the start of the array and that works just fine. If this was JS I’m pretty sure I could have passed that array as the parameter also. It seems we have a problem with the static and dynamic array syntax not being compatible but no workaround when they need to be passed to JS functions.

Regards,
	Ryan Joseph



More information about the Pas2js mailing list