🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

OpenGL Fullscreen Rendering

Started by
1 comment, last by PRISMA 24 years, 5 months ago
Hi, I am having trouble creating a fullscreen OGL app. I can''t do it. The best I can do is to create a window that covers the whole screen after setting the desired video mode, but the frame rate and rendering is still done as if it were rendering in windowed mode(which it is). Can anyone help please.
Advertisement
Creating a border/titlebarless window that covers the entire screen is indeed the best you can reach with OpenGL.

There is no way to couple a GL context to a DDraw surface or something. Unfortunately.

These are the correct settings for a fullscreen opengl window class.
static int sys_RegisterWindowClass()
{
WNDCLASS wndClass;

/* register window class */
wndClass.style = CS_OWNDC; /* owns the screen */
wndClass.lpfnWndProc = (WNDPROC)WindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = 0;
wndClass.hInstance = hInstance;
wndClass.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndClass.hbrBackground = NULL;
wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = "someclassname";
if (RegisterClass(&wndClass))
return(1);
return(0);
}

//and some matching window creation settings are these:
hWnd = CreateWindow("someclassname", "Window Title",
WS_POPUP / WS_MAXIMIZE / WS_CLIPSIBLINGS / WS_CLIPCHILDREN,
// you really only *need* WS_POPUP / WS_CLIPSIBLINGS
0, 0, width, height, NULL, NULL, hInstance, NULL);

Yes, it's technically a window, but it also owns the screen's rendering context and any driver should provide full acceleration. This will give you the best performance possible. If it's any worse than DirectX, your drivers and/or code are probably not written very well.

Edited by - Belandrew on 1/11/00 8:32:27 PM

This topic is closed to new replies.

Advertisement