Full-Screen OpenGL App

Hi Everyone

Does anyone know how should I make a full-screen OpenGL program in windows?

Thanks everyone

every openGL tutorial on gametutorials.com shows how to use windows code to make a fullscreen gl app

This site has the full basecode for both fullscreen and windowed modes.
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01

Making a fullscreen program is the same as any program. When you create the main app window (I guess I am assuming you use windows) you just tell windows that you want the window to be the same size as the screen.

int nScreenX = GetDeviceCaps(hDesktopDC, HORZRES);
int nScreenY = GetDeviceCaps(hDesktopDC, VERTRES);

This will get you the dimensions of the desktop.

Then make sure their is no title bar by adding WS_POPUP to the dwStyle parameter of the CreateWindow function. Here is how I do it:

hWnd = CreateWindow(lpszAppName,
lpszAppName,
WS_POPUP |WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
0, 0,
nScreenX, nScreenY,
NULL,
NULL,
hInstance,
NULL);

Hi

In the gametutorials.com’s triangle tutorial, full-screen mode was created with the ChangeDeviseSettings WinAPI function. The MSDN description for this mode of full-screen display was this: “The mode is temporary in nature”. In addition the tutorial excutes flikering on my PC (it’s a P4 with A SiS 64MB graphics card and Win98). All my drivers are updated.

What now?

Thanks
MKAI

Now?!Now you stop reading the Microsoft junks about the cool question OpenGL and you start thinking with your own head.Can we see the code for our fullscreen-mode function please?

MKAI, the reason it flickers is because of the way that gametutorials has set it up. They are showing fullscreen modes that will work on anyones computer. The way that gametutorials sets up fullscreen is the most efficent way to do it. You will need to play with the settings yourself.

Ok. I will play with the settings.

Hey Mihail121! take it easy. The SetDeviceSettings is a microsoft function and nothing more than microsoft’s documentation can be trustworthy about it.