问题
I want to give the user ability to choose from double buffering and triple buffering, because on some cards (or OS?) the triple buffering is enabled by default, and its causing some performance problems.
How can i do this?
回答1:
You cannot do this from OpenGL itself, since OpenGL only deals with drawing calls, etc. You need to use the vendor specific calls for this. In Windows, there is the WGL for handling context creation, etc.
回答2:
There are no such function in OpenGL.
The closest what I found is glutInitDisplayMode, where you can pass GLUT_DOUBLE or GLUT_SINGLE to enable or disable double buffering. Other window managers, like for example SDL have other call :
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
来源:https://stackoverflow.com/questions/4827570/opengl-how-to-control-which-buffering-method-my-window-will-use