08.07.06
Switching to fullscreen in OpenGL (MS windows)
Switching between windowed mode and fullscreen is usually done by creating a new window just to change the window style. There is however an easier way to change the style without creating a new window.
//Remove the window decoration. LONG dwStyle = GetWindowLong(hWnd, GWL_STYLE) ^ WS_OVERLAPPEDWINDOW; //Add back the window decoration. LONG dwStyle = GetWindowLong(hWnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW; //Set the selected style. SetWindowLong(hWnd, GWL_STYLE, dwStyle); //Redraw your window. SetWindowPos(hWnd, HWND_TOP, x, y, width, height, SWP_FRAMECHANGED);