[Pas2js] pas2js Webgl unit committed

Michael Van Canneyt michael at freepascal.org
Thu May 10 15:17:56 CEST 2018



On Thu, 10 May 2018, Ryan Joseph wrote:

>
>
>> On May 10, 2018, at 7:23 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
>> 
>> {$modeswitch externalclass} 
>> 
>
> Thanks, that’s what I was missing.
>
> So back to my array questions now. ;)
>
> v.pos is "array of single” which I’m trying to cast to TJSArray which UInt8Array.set 
> accepts as the first parameter according to the docs but pas2js only accepts a TJSTypedArray 
> and it’s not allowing me to cast to TJSTypedArray. 
> I understand that a JSArray of floats may crash but it should at least compile right? Maybe the method needs an overload so it works with either type?

You are right. It needs an overload. I will add 2 overloads.
One with TJSArray and one with an actual array of integer/float/etc.

Michael.


More information about the Pas2js mailing list