Jump to content

  • Log In with Google      Sign In   
  • Create Account

OpenGL fullscreen mode


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Shawn619   Members   -  Reputation: 342

Like
0Likes
Like

Posted 27 August 2013 - 03:12 PM

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?



Sponsor:

#2 3TATUK2   Members   -  Reputation: 730

Like
0Likes
Like

Posted 27 August 2013 - 07:46 PM

1. don't use glut

2. at drastic times use ctrl+alt+del to kill the program and unlock mouse



#3 PandaDragonThing   Members   -  Reputation: 311

Like
0Likes
Like

Posted 27 August 2013 - 08:27 PM

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.



#4 Shawn619   Members   -  Reputation: 342

Like
0Likes
Like

Posted 28 August 2013 - 07:25 AM

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? 



#5 Brother Bob   Moderators   -  Reputation: 8606

Like
2Likes
Like

Posted 28 August 2013 - 07:45 AM

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.



#6 Shawn619   Members   -  Reputation: 342

Like
0Likes
Like

Posted 28 August 2013 - 08:22 AM

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!



#7 PandaDragonThing   Members   -  Reputation: 311

Like
1Likes
Like

Posted 28 August 2013 - 02:31 PM

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, 28 August 2013 - 03:00 PM.


#8 Erik Rufelt   Crossbones+   -  Reputation: 3638

Like
2Likes
Like

Posted 28 August 2013 - 03:49 PM

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();





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS