3b / cl-opengl

cl-opengl is a set of CFFI bindings to the OpenGL, GLU and GLUT APIs.
http://common-lisp.net/project/cl-opengl/
Other
279 stars 59 forks source link

Problems running multiple cl-glut things at once #111

Open 3b opened 11 months ago

3b commented 11 months ago

there are a few possible cases with varying amounts of problems:

For the run-examples case, avoid that pattern in examples, and maybe add some notes to display-window.

For opening windows from callbacks, set a special to avoid running nested main loop, and add an example to test it?

Multiple threads case is harder, but possibly could help with #9. Would probably need to notice there is a running main loop, and then in that case send display-window commands to that instead of running them directly. Not sure if we can actually wake up the other main loop from the outside though? Might need to force an idle or timer callback, or switch to the freeglut polling API (glutMainLoopEvent)? Possibly worth just refusing to even try to create windows on other threads while a main-loop is running on other threads to start with, so it at least fails predictably and informatively.