Jump to content
  • Advertisement
Sign in to follow this  
Shawn619

OpenGL OpenGL fullscreen mode

This topic is 1786 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

My game runs in full screen mode(glutEnterGameMode()) without a problem. However, my game is an FPS shooter, and because of this I'm locking my cursor invisible in the middle of the screen. So when I minimize the game, the cursor pops up again but it is still locked in the middle of the screen, so the only option is to restart your computer. Is there a GLUT function to detect whether its window is minimized or maximized or something to that effect so I may "free" the locked cursor when the window(game) is minimized?

Share this post


Link to post
Share on other sites
Advertisement

You'd want to unbind the mouse when the opengl window is out of context, not when it's minimized.

I'm not sure how to accomplish this with glut.

Share this post


Link to post
Share on other sites

Yeah, I can't find any solution to my problem in GLUT docs, so I'll just put a disclaimer on my game that says not to minimize.

 

What's the best window API to render openGL, other than GLUT? 

Share this post


Link to post
Share on other sites

Define "best".

 

The native platform API is ultimately the most flexible, since multi-platform libraries to some degree has to pick the lowest common denominators of all platforms. GLUT is one of the best APIs if you value rapid development time for quick applications, since you can get a window with keyboard and mouse handling up and running in just a handful or lines of code. Libraries such as SDL, SFML and GLFW are in-between, and qualifies as "best" in other areas.

Share this post


Link to post
Share on other sites

I assumed GLUT was the best overall in terms of ease of use and portability. After seeing the comments I thought GLUT was deprecated in some fashion or there were better API's overall, not just in terms of window handling. But I think i'll just stick to GLUT, and I don't think many other API's can beat the simplicity of keyboard&mouse handling in a handful of line of code like you said.

 

Thanks!

Share this post


Link to post
Share on other sites

I don't believe glut is maintained anymore. I've worked with it before and It does make settings things up quite easy, but be wary of that alluring fact. Things can get quite annoying once you start to get into the meat of game programming.

Others you may want to consider are SDL and GLFW. Personally I like GLFW because it does everything I need it to do: window context creation and input handling.

SDL is another great choice, but I feel it tries to do everything, and at times it doesn't do them very good. It supports sound and the such, but i'd rather write my own code for sound with OpenAL. But that's my choice.

I suppose it would depend what you want to do. Glut for little demos or for proofs of concepts, SDL for getting started into game programming right away, or GLFW which takes a little more set up and you have to do a good bit yourself, but it gives you more control and maybe even the chance to learn more.

Edited by PandaDragonThing

Share this post


Link to post
Share on other sites

If you just need it to work on Windows you can probably include Windows.h and cstring and do a test like

char str[255] = {0};
GetWindowTextA(GetFocus(), str, 255);
if(strcmp(str, "your window title here") != 0)
  iDontHaveFocusAnymore();

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!