[fpc-pascal] pas2js Webgl unit committed

Ryan Joseph ryan at thealchemistguild.com
Tue May 1 17:14:34 CEST 2018



> On May 1, 2018, at 9:56 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> You must do
>  gl := TJSWebGLRenderingContext(canvas.getContext('webgl'));
> 
> because getContext can return various classes depending on the argument.

Ok so getContext is method of TJSElement I guess.

Btw I’ve been reading and I don’t see WebGL examples using interlaced vertex data like I suggested in my record question. Rather they all seem to be using different buffer objects for each type of vertex attribute (position, color, texture coord etc…).

Can anyone confirm WebGL just doesn’t support this? OpenGL heavily relies on the idea of pointers with byte offsets but perhaps JavaScript just can’t support that so they opted for 0-offset single type arrays in all cases. That would be too bad though since it makes laying out data more difficult.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list