[cl-opengl-devel] bug fixes & new darwin patch

xristos xristos at suspicious.org
Wed Jul 8 22:12:12 UTC 2009


I fixed the following bugs:

* enable-event & disable-event do not check if the event
is already enabled/disabled. This can lead to enabling
the idle callback more than once for a given window
which can break the event loop in various ways.
For instance, in current cl-opengl, rb-double enables
idle once per mouseclick and this leads to multiple
entires in *windows-with-idle-event* which in turn
means that the idle method will get called multiple times
breaking the logic.

* Currently the idle callback is disabled only in close,
and only when *windows-with-idle-event* is nil. We need to
do the same check in disable-event too. Currently this
manifests in gears.lisp. If you minimize the window,
(disable-event :idle) will get called but the callback
will continue to run -> 100% cpu usage.


Now for darwin, i fixed all the issues i could find.
It now works on sbcl/ccl/ccl64 with no issues. Instead of
forcing the glut event loop on the initial thread, i used
the trick from ccl opengl-ffi on sbcl too.

This means that, on sbcl and ccl/ccl64, a new thread is created
(GLUT-thread) which will run the glut event loop. This also
has the bonus of making cl-glut work without any changes under
slime. The only issue when developing interactively is that one
can not call glut functions from a thread other than GLUT-thread
_while_ the glut event loop is running. I added warnings to indicate
when the event loop runs/stops. If the glut event loop is not running
(example: leave-main-loop is called), you can call glut functions
from any thread and they will take effect when the glut event loop  
starts
running again. This shouldn't affect normal development, i had to  
mention
it because osx has the tendency to kill the process when one ignores  
this :-)

(All the changes apart from the bug fixes are only for darwin.)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cl-opengl-darwin2.diff
Type: application/octet-stream
Size: 17880 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-opengl-devel/attachments/20090708/2dc146a8/attachment.obj>
-------------- next part --------------





More information about the cl-opengl-devel mailing list