PDA

View Full Version : Fullscreen



Tresher
08-12-2002, 02:13 AM
What is the most reliable / fast method for using fullscreen mode ?
With the corresponding glut function and another fullscreen code that i found in some tutorial program my program used to crash, especially when pressing the Windows Key or while closing the window http://www.opengl.org/discussion_boards/ubb/frown.gif

I would appreciate some nice code...of course this is kind of lame, but hey it just concerns the video / fullscreen mode.

Sincerely,
Martin.

Morglum
08-12-2002, 04:55 AM
GLUT has much more than glutFullScreen for you !

glutFullScreen
1) gives no performance boost;
2) is crashy indeed.

Instead, use the glut game mode. The glut functions for this are : glutGameModeString, glutEnterGameMode, glutLeaveGameMode...
1) it gives a _huge_ performance boost (50%-120%)
2) it is more reliable than glutFullScreen
3) it lets you choose the resolution, color depth, and refresh rate.

marcus256
08-12-2002, 04:59 AM
...or GLFW (http://hem.passagen.se/opengl/glfw/) , which has a nice (functional) fullscreen mode. It handles things like ALT-TAB, iconification (WIN+M), closing etc. It can also prevent many of these actions by disabling most system key combinations.

Morglum
08-12-2002, 05:15 AM
Ah, Marcus256, I was looking for you. I've read the recent GLFW announcement on this site, saying it had now code for bitmap loading. I'd like to know which formats GLFW can load ? In particular, does it load jpeg, jpeg2000, png, or gif ? I didn't find this info in the GLFW features page.

Tresher
08-12-2002, 05:23 AM
Very funny, that nothing is reported about these glut functions in the glut-3.spec.pdf !

Morglum
08-12-2002, 05:25 AM
That's normal, these functions are quite new. They do exist only since version 3.7

marcus256
08-13-2002, 06:53 AM
Originally posted by Morglum:
Ah, Marcus256, I was looking for you. I've read the recent GLFW announcement on this site, saying it had now code for bitmap loading. I'd like to know which formats GLFW can load ? In particular, does it load jpeg, jpeg2000, png, or gif ? I didn't find this info in the GLFW features page.

Sorry, I'll update the page (it's "only" mentioned in the docs and the news section). GLFW only supports TGA, which I think is the best texture format, next to PNG.

Since GLFW is a minimalist API, which will hopefully never rely on 3rd party software (such as libjpeg, libpng etc), only "plain" texture formats will be supported (like BMP, PPM etc), if there is a demand for more formats than TGA. For loading JPEG, PNG and other formats, better look at image libraries. After all, the GLFW DLL is only 24 KB. It would be a shame to include a giant such as libpng too, just to save a few lines of code in the user program, wouldn't it?

The goal of the texture loading support in GLFW is to provide a quick'n easy to use tool for adding textures to small programs. For larger projects, I expect ppl to use tools like zlib, libpng etc.

I hope this does not come as dissapointing news. (?)


BTW. The GLFW documentation (in PDF format) is always up to date, since it is released at the same time as the corresponding GLFW source code is relased - which is one of the reasons for the delay of the v2.1 release (but it's worth it, IMHO).



[This message has been edited by marcus256 (edited 08-13-2002).]

Morglum
08-13-2002, 07:33 AM
ok marcus 256, if you can keep your dll at such a small size, it's worth limiting the number of texture formats. I've already got tga loading code (thans WhatEver http://www.opengl.org/discussion_boards/ubb/smile.gif). I agree that it's an excellent format but for my purpose it'd be good to support more compressed formats. I think I'll look for devIL...

Morglum