Fullscreen mode

this may seem a silly question… but… how do you make an OpenGL program run in full screen?

In Windows I presume? If so, you just change into the graphics mode you want to use, then create a pop-up window that is the same size as the screen. Then create the render context and initialize OpenGL.

[This message has been edited by DFrey (edited 02-25-2001).]

Then I still have a taskbar and title bar… and how do I change screen modes?

Use ChangeDisplaySettings( … )

Add the topmost flag to get rid of the taskbar. It is not necessary to change display settings. Here is a hacked version of NeHe tutorial 5 that demonstrates different fullscreen modes: http://sites.netscape.net/ptrpck/switch.zip

Are you suggesting that it is not necessary to change into 640x480x16 mode if I want to run fullscreen at that setting and the desktop is in 1024x768x32 mode?

Talking with me?

Uh, no, mango. He wrote, “It is not necessary to change display settings”. But it obviously is necessary to change the display mode if you want to run full screen at a resolution and/or color depth that is different from the desktop.

The question was “how do you make an OpenGL program run in full screen?” and the answer is that you creates a windows that is completly covering the screen without the GUI stuff. You do not have to change display settings for doing that.

DFrey, your reply gave a rude impression and if that was your intention do I suggest that you stop. Instead of writing about things you belive is obvious true could you have examined the sample program.

Yes, a fullscreen window is a window that covers the entire screne, and does not have any fancy buttons/bars/whatever. But what is your desktop is 1280x1024x32, and you want your application to run in fullscreen 640x480x16. How can you do that without change the display settings?

You can’t. Why don’t you want to do that?

To me, it seems the most common reason for writing a fullscreen app would be to change the display mode to get better performance. Obviously, you can write a fullscreen app without changing the display mode, and there might be cases where this is what you’d want, but most games that run fullscreen DO change the display mode. Actually, I’m not aware of any that don’t unless you are already running your desktop in the mode the game wants to use.

Yes, but changing display settings can be difficult. I think it is best to start the game in fullscreen mode without changing display settings so that the players can select settings that works on their systems.

If your desktop is 1280x1024x32 can you not enter 640x480x16 mode without changing the display settings. My previous post seems to say that but I was annoyed by having to defend things I never wrote and I guess that affected me.

Fullscreen mode is just a special kind of window in the same size as the screen and display settings is something else. It does not make sense to treat them as one.

Initialise directx and select your video mode, then initialise opengl under directx doing all that wgl stuff with the hwnd and hdc. This works under NT, haven’t tried 95/98/2000, personally I was surprised that this worked, but its perfect!

[This message has been edited by Leo (edited 03-06-2001).]

that sounds hard

There is a way to run GLUT full-screen I bet - I just don’t know what it is. Anyone?


Even better:

Tutorial here: http://www.dev-gallery.com/programming/opengl/fullscreen/fullscreen.htm

This tutorial is also very helpful. It explains how to use fullscreen with Win32 http://nehe.gamedev.net/tutorials/lesson01.asp

I will personally track down and frag anyone who initializes their display mode with DirectX to use OpenGL If I recall correctly (and I might not) Microsoft does NOT garuntee that using OpenGL after initializing a DirectX window will work (though that might not apply in this situation…).

Thats a lot of hard work that is unnecessary, ChangeDisplaySettings() is very easy to use.

Glut is better but I’d prefer not to use it (personal opinion) unless I planned on writing a multiplatform application (in that case I would probably still learn how to do it myself the other platforms).

Malevolent, take a look at NeHe’s tutorial that dpgraves suggested, thats exactly where I (and many thousands of others) have started.

And no, it is not necessary to change the display mode to create a fullscreen window. But on every card made since the late 80’s its safer to start in 640x480 than ANY other mode (8bit too ). I’m having the current problem with my new GeForce 2 MX with the Vulpine GLMark demo that it gives me “Frequency over range” on my monitor EVEN WHEN I’M RUNNING THE SAME RESOLUTION AS MY DESKTOP!!! (obviously something is fishy there, there shouldnt be any problem using a mode thats in use) but why even make a fullscreen GL program to select settings? Why not just pop a dialog box (with a handy checkbox to make sure it never asks me again please).