Turning on fullscreen

Maybe a bit unrelated question, but how do I turn on fullscreen mode in Windows C/C++ Application (for use with OpenGL)? I know, there is function in GLUT, but I prefer to stay within plain GL.

And is there vertical sync function available?

Piece of code appreciated.


Full-Screen mode it’s a request to a Windows Manager, OpenGL is not depending on any windows system, you need to use glut(or other manager).

OK, I’ll stick with GLUT. Thanks for clarificaton.

Strictly speaking, there is no such thing as “fullscreen mode”. You just change the resolution (with some windows API call that’s not related to GL), and then you make a window without decorations that covers the whole screen.

GLUT does exactly that when you request a fullscreen window. Of course you can also do this yourself, if you prefer to do it with plain GL + Win32 API.

VSync is done automatically at swapbuffers when it is enabled. It can either be enabled in the driver settings, or for enabling it in the program, look at the extension WGL_EXT_swap_control.