Hi guys,
does anyone know how to erase shapes and things in opengGL? i have draughts that i want to erase once the are taken, but i don't know how?
thnx
Hi guys,
does anyone know how to erase shapes and things in opengGL? i have draughts that i want to erase once the are taken, but i don't know how?
thnx
Erase the whole screen, and redraw the board in it's new state.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
...which if you are not already doing you are using OpenGL incorrectly. Double buffering is the answer to your problem.
Hang on. Does he mean erase the screen, or "erase" the objects (as in delete them from memory or whatever so they won't be drawn)?
M.Eng Computer Engineering CandidateB.Sc Computer Science
Robotics and graphics enthusiast.
Dunno - the question could be vague enough to mean either.
I thought that since he mentioned OpenGL that it referred to the visual representation of the board state, not the internal board representation used by the game logic.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i love you guys, get me thinking logically, expect more noob questions, it is my first program, sorry......
Noob questions are fine so long as we can understand the question.
Expand a bit on your problem and we will be able to help more. What we all are saying is that in all cases you should be updating the screen based on memory contents. Therefore if you wish to 'erase' an object you do not render that 'object' in the next frame.
If you think of the game world and data as the document and the renderer as the view you can arrive at the doc/view architecture. The view does not handle the document, it merely displays the document data so that the user can understand and use the data. So if you change the document, the view changes automatically since it just renders or draws according to the document data. Notice now that the view can also change in which case this would be another way to present the same data.
Last edited by VirtualAce; 04-02-2007 at 11:06 PM.