Full Screen Mode

Does anybody know how set something like an exlusive mode using Only OpenGL, without having any business with DirectX? And to adjust Screen Resolution I want?
Thnx.

Glut

i prefer sdl to glut

It cant be done with OpenGL alone. Why? Because OpenGL is not a windowing API, rather it is a graphics API for rendering stuff in previously acquired contexts. You can use glutFullScreen() if you are using the GLUT tooliit, you can use ChangeDisplaySettings() in the Win32 API. I am sure there are other ways but the answer is that OpenGL aint gonna do it for ya.

Ok. glut. But I’m using Borland Builder C++ and it doesn’t support neither GLUT nor GLAUX! What should I Do?
Isn’t it dangerous to use DirectDraw, for instance, with OpenGL. I mean functions like:

  • SetCooperativeLevel;
  • SetDisplayMode.
    Thnx

There’s a plain vanilla Win32 call named ChangeDisplaySettings. It should do what you need, so do look it up.

You might want to take a look at this tutorial:http://nehe.gamedev.net/tutorials/lesson01.asp

It explains how to set up a full screen app. without Glut. There should be a link at the bottom for a Borland 5.0 implementation of it. Hope it helps.

Thank You ALL. It works. I hope for Your help in future

I’m not sure about how GLUT does it, but the NeHe version has some flaws (for instance it does not handle ALT+TAB situations). Version 2.0 of GLFW will do the trick. It will hopefully be released within a few weeks, until then you can check out GLFW 1.0.2 at http://opengl.freehosting.net/glfw/

With GLFW you open a fullscreen window with the command:

// GLFW v1.x
glfwOpenWindow(
    640, 480,        // Screen size
    5, 6, 5,         // R,G,B bits
    0,               // Alpha bits
    16,              // Depth bits
    0,               // Stencil bits
    GL_TRUE          // We want fullscreen
);

// GLFW v2.x
glfwOpenWindow(
    640, 480,        // Screen size
    5, 6, 5,         // R,G,B bits
    0,               // Alpha bits
    16,              // Depth bits
    0,               // Stencil bits                
    GLFW_FULLSCREEN  // We want fullscreen
);

Unlike the NeHe code, you will always get fullscreen mode if you request it (but it may have other dimensions and/or color/alpha/stencil buffer depths than you request). Under GLFW v2.0 things like Alt+Tab are handled (and can even be disabled with the command glfwDisable( GLFW_SYSTEM_KEYS ) .