So I’m using the magical UpdateRects to just limit my screen updating to
stricly those regions that need to be updated. But I’ve got another
question: I need to draw terrain on the screen. The way I’m currently doing
it is to plot pixels at all the coordinates on screen where a terrain pixel
should be. This only needs to be done in a few instances, like the
beginning, and if I need to blow a hole in the terrain and animate the
pixels falling downwards. My question is this: should I directly plot the
pixels to the screen (locking it of course) and then do my UpdateRects() to
draw my smaller objects, or is there a way more efficient way? Thanks for
your help.--------------------------------------------------------
Jeff W.
ICQ: #17989474
The problem is that in setups where SDL_UpdateRects() does what you want
(blits from the software back buffer to the “physic” [as they called it
in STOS and AMOS :-)] screen buffer), you can’t perform direct rendering
at all, so you’d still need to call SDL_UpdateRects() for the areas
you’ve changed.
This is where the “direct access to front buffer” feature would come in
handy. (Currently, you can only lock the back buffer, as the SDL API
doesn’t have a notion of back and front buffers; there’s only the “screen
surface” - and locking that in double buffered mode gives you the back
surface.)
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia | ----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Thursday 11 October 2001 06:19, Jeff W. wrote:
So I’m using the magical UpdateRects to just limit my screen updating
to stricly those regions that need to be updated. But I’ve got another
question: I need to draw terrain on the screen. The way I’m currently
doing it is to plot pixels at all the coordinates on screen where a
terrain pixel should be. This only needs to be done in a few
instances, like the beginning, and if I need to blow a hole in the
terrain and animate the pixels falling downwards. My question is this:
should I directly plot the pixels to the screen (locking it of course)
and then do my UpdateRects() to draw my smaller objects, or is there a
way more efficient way? Thanks for your help.