Good afternoon all. I am experimenting with cl-opengl with the idea of porting a project to linux from Mac/Windows (Macintosh CL/ Allegro CL). Most of the interaction with current versions is graphical - menus and dialogs, but I have become accustomed to a cycle of using the system to get results from data analyses, then doodling in the repl to explore one or two aspects of the result, before returning to the system's window,menus, etc.; perhaps even firing off commands from the repl to one or more existing windows to add certain objects to themselves.
As far as I can see from the examples and my readings in the redbook, this sort of cycle is not possible when using OpenGL since the toploop is taken over by the event loop of the graphics processes; when I run the example files I certainly lose access to the repl.
I should have said that I'm using cmucl19e under ubuntu-8.10, both in 32bit mode. My copy of the cl-opengl files is dated, by ls -lt, 2008-11-11.
If there are sources of examples other then those which came with that copy of cl-opengl, I would be grateful for pointers to them.
Thx for any and all advice and assistance Cheers /Greg Bennett
On Sat, Jan 17, 2009 at 12:55 PM, Greg Bennett gwbennett@sentex.ca wrote:
As far as I can see from the examples and my readings in the redbook, this sort of cycle is not possible when using OpenGL since the toploop is taken over by the event loop of the graphics processes; when I run the example files I certainly lose access to the repl.
It is possible, but might take some work depending on implementation.
With single threaded SBCL and SLIME with *communication-style* set to :fd-handler, putting (sb-sys:serve-all-events 0) into the main loop somewhere (or an idle callback or similar) makes SLIME's repl usable. Same should work for cmucl, except with system:serve-all-events. Should also work with other swank based IDEs like cusp i think. Other lisps might have a similar mechanism as well.
If you use a lisp with OS level threads and :spawn *communication-style*, you get a usable repl for free (or at most for the cost of starting the app in a separate thread by hand), but things get more complicated due to GL not liking commands from multiple threads without extra setup. That isn't too bad if you only want to modify data or functions though, and not call GL interactively.
With :sigio *communication-style*, things might work automatically, don't remember if i ever tried that or not...
If you don't use slime or something like it, the easiest solution is probably to start using it :) Otherwise, if you have threads, the same situation as with :spawn applies. If not, the best option is probably to implement a simple repl in the main loop.
- -b-
cl-opengl-devel@common-lisp.net