I’m working with a very simple 2D/ortho application where I want to clear the background just once at the beginning (so that all shapes leave a trail.) I’m programming in C++ on Windows. It works 100% fine when windowed, but as soon as I run it fullscreen, there is a terrible flicker (and you can see the computer’s desktop behind my app.) I’ve tried with and w/o glut.
In other words, the app starts up with “once = true” then:
once = false;
If you use double-buffering, then you swap buffers each frame via glutSwapBuffers. It swaps teh back buffer (one you render to) and the front buffer (one you see). The problem is that the back buffer is usually undefined after swapping, so you most probably get a lot of “waste” in it (like the desktop window).
As to a solution of your problem, I don’t really know, because I never did anything similar. I suggest that you render the trail anew each frame if possible, or use the accumulation buffer.
1)Use EnumeDisplaySettings()to get the current settings( So current refresh rate of monitor ).If the current refresh rate is 60 HZ, EnumeDisplaySettings() sets the refresh rate to 60 HZ. If it’s 85HZ, this function sets the refresh rate to 85HZ.
2) Remove once variable and see the results. Does it solve the flicker problem?If not, don’t remove this variable, since this is part of your program.
3)Does glDrawBuffer( GL_BACK ) solve your problem?
I want to clear the background just once at the beginning (so that all shapes leave a trail.)
Then, as a GL beginner, your best bet is use single buffering (or always draw to GL_FRONT and do not use swapbuffers !).