[…]
I thought about periodically calling an extra
mouse-event-paint-function from my renderfunction,
but isn’t there another, nicer way?
I’m afraid there isn’t. You can probably get around the event handling
issues with SDL one way or another, but asynchronous rendering into
different pages of the same OpenGL context would probably require
platform and/or driver specific hacks, if it’s at all possible
without driver modifications.
If we disregard the fact that there is no support for rendering
directly into the front/display page in SDL or OpenGL, the next issue
is synchronization in the driver. Most serious OpenGL drivers should
be able to (sort of) handle this, if you do the pointer rendering
through a different OpenGL context. However, (older?) consumer cards
and any cards running game oriented drivers may have performance
issues, because they cannot switch GPU task at any time, like in the
middle of rasterizing a polygon. Keep in mind that it’s not
sufficient that the driver/GPU can handle multiple command queues;
the GPU also has to be able to switch target buffer as a separate
operation; not just as part of the page flip operation. Workstation
cards are designed to handle this (for asynchronous rendering in
multiple windows or contexts), but I wouldn’t be surprized if some
gamer setups work on frame granularity - which would of course render
your efforts completely meaningless.
Anyway, what kind of scenes are you rendering? There might be a
shortcut that’ll work everywhere - but be warned that this will cause
severe tearing and/or flickering if you try it with your average full
screen 3D game!
1. Tile the rendering! Keep track of the average frame rate,
and render only as much of the screen at a time, that you
can finish before the next retrace. (If you have multiple
windows or similar, you can repaint one at a time, for
example.)
2. Redraw the mouse cursor and flip pages for every tile.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Thursday 12 May 2005 14.53, Florian Liefers wrote: