05-05-2004, 08:06 AM
I want to make a fullscreen drawing using OpenGL. Using GetDC() with NULL as the parameter while creating the rendering context doesn't seem to work (I don't think it is meant to be used that way). Please suggest some other means to do so.
05-05-2004, 06:21 PM
One way to get a fullscreen window is to create your window like this:
ZeroMemory( &cls, sizeof(cls) );
cls.cbSize = sizeof(cls);
cls.style = CS_OWNDC;
cls.lpszClassName = "myWindowClassName";
cls.lpfnWndProc = myWindowProc;
cls.hInstance = hInstance;
cls.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
cls.hCursor = LoadCursor(NULL,IDC_ARROW);
cls.hIcon = 0; // whatever
cls.hIconSm = 0; // whatever
RegisterClassEx( &cls );
HWND hWnd = CreateWindowEx( WS_EX_TOPMOST,
WS_VISIBLE | WS_POPUP,
GetSystemMetrics( SM_CXSCREEN ),
GetSystemMetrics( SM_CYSCREEN ),
HDC hDC = GetDC( hWnd );
// now setup a gl render context using this dc.
...This would do if you are content to render in the current desktop resolution and color depth.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.