Peter Seibel wrote: > P.S. sdl:quit takes, it seems, an optional argument, not a > keyword arg. I assume the correct value is T?
You are right, my Lisp knowledge is getting rusty with all the Java coding I have to do on the job :-) > Okay, so suppose I do fire up the window in a separate thread > and use with-events to track events. What's the best way to > modify the board from another thread--i.e. when I figure out > that I want to add a stone to the board I need somehow to inject > an event right, to tell the draw-board function to update things. If I would do it in Java or Windows GDI, I would change the modell and then post a repaint event. But I don't know, if this is the right way for SDL. > P.S. I noticed that with no event loop, if the window gets occluded > and then uncovered, it doesn't redraw, presumably because I'm not > handling the :video-expose-event. Just for grins is there some > other way to fix that? I don't think there are clean solutions for this without a main event loop, because if the Windows GDI works behind the scenes, you have to response with a repaint on a WM_PAINT event (I assume this is mapped to the :video-expose-event in SDL). > Mmmm, spinning is bad, I have other uses for my CPU. ;-) Take a look at the sdl_drawing example, where I used sdl:SDL_WaitEvent instead of with-events, which uses SDL_PollEvent. Maybe we should implement with-poll-events and with-wait-events (idea for implementing: a genereal with-events-impl macro, with a parameter for poll and wait, with which both macros can be defined). > I know there's a patch floating > around to allow user events to be put on the SDL queue. Is that > the right solution? This sounds like a good solution, maybe Luke knows more about it, if he added the patch to SVN. Calling SDL functions from multiple threads sounds dangerous for me and I'm not sure, if it would work on every system. I think there was something different with Mac OS X event loop compared to the Windows event loop and the thread safety of GUI functions and I don't know if SDL hides this. I think the usual case, which works on all systems, is one event loop, which does all the SDL stuff. -- Frank Buss, [EMAIL PROTECTED] http://www.frank-buss.de, http://www.it4-systems.de _______________________________________________ application-builder mailing list [email protected] http://www.lispniks.com/mailman/listinfo/application-builder
