PDA

View Full Version : Full-Screen OpenGL App



MKAI
06-14-2003, 02:34 AM
Hi Everyone

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

Thanks everyone

mdog1234
06-14-2003, 09:26 AM
every openGL tutorial on gametutorials.com shows how to use windows code to make a fullscreen gl app

06-14-2003, 10:02 AM
This site has the full basecode for both fullscreen and windowed modes.
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01

06-14-2003, 02:39 PM
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);

MKAI
06-15-2003, 09:32 PM
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

Mihail121
06-15-2003, 11:33 PM
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?

mdog1234
06-16-2003, 06:40 AM
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.

MKAI
06-17-2003, 01:16 AM
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.