PDA

View Full Version : how to draw new object while preserving the current objects and bkgnd?



coda
12-11-2003, 08:58 PM
suppose i already drew an object and set the background. How do i add another object into the scene without re-drawing the original scene?

ZbuffeR
12-11-2003, 09:51 PM
Just draw your new object on top of the rest.
If you swaped buffers though, you probably need to redraw your whole scene. It is not so costly, you know, hardawre is fast.

coda
12-11-2003, 11:24 PM
how do i draw on top of the old scene without swapping buffers? I am currently using swapped buffers.

ZbuffeR
12-12-2003, 04:27 AM
May you actually read my two solutions ?

Or be more specific about what you are trying to do ?

nexusone
12-12-2003, 05:14 AM
In most cased you must re-draw the whole scene each time you add an object.

There are some cases in which you can get away with not re-drawing the whole scene.

If you do not do a clear screen each time you draw, then you can draw on top of you last scene using a single buffer. But this only works if you are draw on top of other object and not needing them to be below.


If objects in your scene will be changing Z location, that is an past draw object going in front of a new object. Then you must redraw the whole scene with the new object added or with an updated position of an object has changed location.


Originally posted by coda:
suppose i already drew an object and set the background. How do i add another object into the scene without re-drawing the original scene?