PDA

View Full Version : display method troubles......



03-25-2002, 09:25 AM
im adding texture mapped objects(alot of them, and one at a time) to my screen but when i do the screen is cleared due to the glClear call. What would be the best way to set up the display method so that all these objects can be displayed and kept on the screen at all times. Also their size and position may change and these changes will also have to be displayed accordingly.

nexusone
03-25-2002, 09:58 AM
You call glClear only once per frame of your scene. From what I am reading you are clearing the screen each time you draw an object.

Your code should be setup something like this:

Setup screen type, size, etc.

Setup Objects and load textures //

Main loop:

glClear

Draw objects // Here you have a varaible stating which objects should be drawn at this frame.

Update all objects location, rotation, size, etc. // this could also be located before drawing the objects.

glutSwapBuffers // Display your updated screen

repeat loop:



Originally posted by sham:
im adding texture mapped objects(alot of them, and one at a time) to my screen but when i do the screen is cleared due to the glClear call. What would be the best way to set up the display method so that all these objects can be displayed and kept on the screen at all times. Also their size and position may change and these changes will also have to be displayed accordingly.



[This message has been edited by nexusone (edited 03-25-2002).]