PDA

View Full Version : GlutEnterGameMode();



scriptlord
06-03-2002, 08:53 AM
How do you make your window full screen with this statement

pleopard
06-03-2002, 09:34 AM
I believe that you don't have a choice, it is always fullscreen.

This code snippet may help ...

std::string m_GameModeString("1280x1024:32@72");
...

// OpenGL init
glutInit(&m_Argc, m_Argv);

if (m_GameModeString.length()>0)
{
glutGameModeString(m_GameModeString.c_str());
glutEnterGameMode();
}
else
{
glutInitWindowSize(m_WinWidth,m_WinHeight);
glutInitWindowPosition(m_XPos,m_YPos);
glutCreateWindow(m_Title.c_str());
}

scriptlord
06-03-2002, 09:54 AM
I need your class, or header with the m_ and the std::string stuff

pleopard
06-03-2002, 01:08 PM
I assumed you would be able to figure that out ... translated (assuming you always want game mode) ...

main(int argc, char** argv)
{
// do stuff ...

// Initialize Glut ... the sequence of the following 3 lines is imperative ...

glutInit(&argc,argv);
glutGameModeString("1280x1024:32@72");
glutEnterGameMode();

// do more stuff...

}


This will setup GLUT in game mode, full screen at 1280x1024 resolution, 32 bit color, 72Hz refresh rate. It will fail if this combination of video options is not supported by your card.



[This message has been edited by pleopard (edited 06-03-2002).]

marcus256
06-03-2002, 09:15 PM
It will fail if this combination of video options is not supported by your card.

...which is why GLFW (http://hem.passagen.se/opengl/glfw) is so much easier to use when it comes to fullscreen management. GLFW never fails with opening a window in fullscreen mode (at least not because a video mode was not supported) - it always choses the closest match.

scriptlord
06-04-2002, 08:39 AM
I have become aware that the code that was given to me doesn't work do to a lack of declarations which I do not have the values to please give me some better, or more extensive code.