http://qs321.pair.com?node_id=11149551


in reply to Re: Graphics: OpenGL in Perl/Tk ... with GLUT
in thread Graphics: OpenGL in Perl/Tk ... with GLUT

Thanks for this suggestion! My browser experiments so far were focused on Web3D (and the X3D format to store 3D models).

I understand that WebGL is similar to OpenGL as a low-level graphics API, targeted at the HTML5 canvas. But like with "pure" OpenGL ... it doesn't come with an event loop and GUI toolkit. That's what I use Tk for, and what I would have to rewrite for the HTML canvas.

Also, being based on OpenGL ES which is "a well-defined subset of desktop OpenGL suitable for low-power devices", it seems to lack the interactive glRenderMode feature which I need to use. Or maybe I just failed to find it?

  • Comment on Re^2: Graphics: OpenGL in Perl/Tk ... with GLUT

Replies are listed 'Best First'.
Re^3: Graphics: OpenGL in Perl/Tk ... with GLUT
by cavac (Parson) on Jan 13, 2023 at 09:13 UTC

    JavaScript doesn't have what you would call an "event loop", it uses callbacks to react to events. As for cyclic stuff (rendering, physics, etc), you just use setInterval().

    As far as communication with the Perl backend, i make extensive use of Websockets. It really depends on your webserver setup on how you do that, but with my own webserver i use a (slightly adapted) version of Protocol::WebSocket::Frame

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP