Jump to content
  • Advertisement
Sign in to follow this  
FILO

Cross platform (X11/Windows) fullscreen with OpenGL

This topic is 3921 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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);
}


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!