2018-05-01 4:50 GMT+02:00 Ryan Joseph <r...@thealchemistguild.com>: > > >> On Apr 25, 2018, at 9:43 PM, Michael Van Canneyt <mich...@freepascal.org> >> wrote: >> >> Ah, webgl... >> >> I had a look at this some time ago, and got depressed. Quickly closed the >> browser and didn't look back. Same for webaudio :(
The API of WebGL is actually mostly a subset of OpenGLES which is a subset of OpenGL. WebGL is quite small, if you compare it to other graphic APIs :) OpenGL(ES), Direct3D, Vulkan, Metal are way more complicated and larger. > > I’m actually a little curious about this myself because I’ve been using > OpenGL often recently. I’ve seen the Ingemar’s demos but I only slightly > grasp how it’s working. > > The wiki says you’re actually parsing the Pascal (not compiling it) and > outputting JavaScript. If that’s the case then how does porting libraries > work in practice? For examples lets say I want to translate a single OpenGL > function, how does that look? > I suspect that we will have a unit like WebGL in pas2js that exposes the necessary JS functions for Pascal applications. Engine like Castle Game Engine will used this unit when compiled with pas2js (instead of GL when compiled with FPC for desktop, or GLES20 when compiled with FPC for mobile). And then CGE can expose an API that looks the same (both in pas2js and FPC). (Yes, I want to port Castle Game Engine one day to pas2js :) ) Regards, Michalis _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal