Cross platform (X11/Windows) fullscreen with OpenGL

Started by
3 comments, last by FILO 16 years, 6 months ago
Hi All, I have been going through the excellent tutorial section at http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01 In the first tutorial he creates a simple blank screen and offers you the choice of having it in fullscreen or windowed mode. The code used to do this looks windows specific. My question: Is there a platform neutral (linux/win/mac) way to do this and if so could some point me in the direction of a tutorial/example. Thanks once again for all the help. -H
Advertisement
If you scroll to the end of that tutorial, you'll find links to various implementations for X11, Windows and Mac in various programming languages.

If you need a fullblown toolkit with support for OpenGL (for, eg, a 3D editor), and need it to be crossplatform, you should check out Qt or wxWidgets. I'm assuming C++.

OTOH, if all you want is a window to get an OpenGL context from (for, eg, games), then something like SDL is maybe more appropriate. Most NeHe tutorials have been ported to SDL (just scroll down).
Thank you so much. Using sdl, you do the command for fullscreen/OpenGL:

int flags = SDL_OPENGL | SDL_FULLSCREEN;


/* Create a 760x480 OpenGL screen */
if ( SDL_SetVideoMode(760, 480, 0, flags) == NULL ) {
fprintf(stderr, "Unable to create OpenGL screen: %s\n", SDL_GetError());
SDL_Quit();
exit(2);
}


Another alternative is GLFW, which is literally a cross-platform OpenGL Framework.

GLFW Website
That looks interesting Jason. Thanks for the link.

-H

This topic is closed to new replies.

Advertisement