PDA

View Full Version : Initialization question



steve_j
05-01-2004, 02:31 AM
Hi!

All of my OpenGL test applications seem to leave the last buffer in memory. That means, when I start app 1 that draws a Triangle and close it and start app 2 that should display nothing but a black screen, I still can see the triangle of the last app. Can anyone give me a hint what I have to do to prevent this? I am using MFC.

regards,
steve

plasmonster
05-01-2004, 02:37 PM
That means, when I start app 1 that draws a Triangle and close it and start app 2 that should display nothing but a black screen, I still can see the triangle of the last app.
steve_j,

If your screen is not black, then clear it:

glClearColor(0,0,0,0);
glClear( GL_COLOR_BUFFER_BIT );

steve_j
05-02-2004, 12:31 AM
Hi!

Thanks for that hint, I had the glClear Command not in the OnPaint function. Now it works like it should.

regards,
steve