To GLUT, or not to GLUT?

Member
Posts: 89
Joined: 2005.06
Post: #16
what is "endian" sounds like Indian. is that how you pronounce it? anyway, what is it?
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #17
Volte Wrote:what is "endian" sounds like Indian. is that how you pronounce it? anyway, what is it?
See here. It's a fundamental difference between PowerPC and x86 processors that we're all going to have to deal with when we switch to Intel.

You pronounce it like 'indian', but with an 'e'. Wink

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Member
Posts: 89
Joined: 2005.06
Post: #18
Rasp thats why I said it sounds like Indian.
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #19
I'm having this same debate now, glut or not to glut-
I have some full screen carbon code but to be frank, its a little..slovenly. I'm looking into "glutFullscreen()" which apparently will do everything I need to get a fullscreen contex, or at least, according to the paragraph on apple's site that I've just read. Once I figure it all out, I'll pass along word of how it works.

I have had some pretty good sucess with glut's keyboard input- anyone else want to weigh in on why one would want to avoid it for a more complicated bit of business? (keeping in mind that its really just up to the tastes of the individual; I realize glut is just not a good solution to everything- I just dont know what the actual downside is.)

Thanks
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #20
keyboard input is broken 'cos you can't tell what keys were pressed to produce a given character -- eg. if you get a 2, was it the number keys or the keypad? If you get a $ was it a shift-4 on a US keyboard or a goodness-only-knows-what-key-combination on a UK keyboard?

Don't use glutFullScreen, it doesn't do what you want. glutEnterGameMode does.

glutEnterGameMode ain't great 'cos you've got no way to find what resolutions are supported. If you're willing to use a bit of CoreGraphics code, that's entirely fixable. Also, glutLeaveGameMode doesn't work on the Mac (may have been fixed recently, dunno).
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #21
yeah I was JUST realizing that. This is one thing apple has wonderful documentation on:
http://developer.apple.com/documentation...Get.3.html
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #22
Using glutGameModeGet(GLUT_GAME_MODE_POSSIBLE), you can tell if your system supports going in game mode. I'm gonna start playing around with this.

Another great link to check out is this:
http://developer.apple.com/documentation...ode.3.html

As for EnterGameMode and FullScreen:
quote:
Note that the glutEnterGameMode and glutFullScreen routines operate
differently. glutFullScreen simply makes the current window match the
size of the screen. glutFullScreen does not change the screen display
format and does not disable any GLUT features such as pop-up menus;
glutFullScreen continues to operate in a "windowed" mode of operation.
glutEnterGameMode creates a new window style, possibly changes the
screen display mode, limits GLUT functionality, and hides other appli-applications.
cations.

Back with more later!
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #23
Okay so I have it working- I have a cursor on the screen, but I'll worry about that another time.
Here's a great page to help set up EnterGameMode correctly:
http://www.nullterminator.net/glut.html
(as he says, "Think of it as a replacement to your usual call of glutCreateWindow.")
...
// 640x480, 16bit pixel depth, 60Hz refresh rate
glutGameModeString( "640x480:16@60" );
// start fullscreen game mode
glutEnterGameMode();
// setup window callbacks
glutDisplayFunc( display );
...

I'm sure this info could be in its own thread; if thats the case, we can split it.. eitherway, I'm sure there are lots of people who might find this setup useful.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #24
Code:
glutSetCursor(GLUT_CURSOR_NONE);
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #25
This cursor issue is being a lot tougher than I've thought; I've read through old posts, and the prevailing opinion is to use system-specific cursor-hiding function calls. I was hoping to keep this glut, to be honest. So here's my questions:
1. I'm not going to debug the GLUT source. is there really no way to repair this GLUT bug, or a workaround I can use?
2. I'm linking against the openGL/GLUT frameworks. I hear this stuff has been ported using cocoa/objC, so I can assume I wont need the carbon solution of hideCursor(); Assuming I want to take the other direction, using "CGDisplayHideCursor"-- the question is this: How?
I'm dead serious- I haven't gotten into cocoa yet and I really have no idea how to set up "CGDisplayHideCursor" within my framework of glut calls- I don't even know how to use it- I asume its a method to a class that I haven't instantiated an object from. Or maybe I have, transparently through glut. Okay for real I'm talking out of my ass at this point- any help would be really appreciated.

Thanks!
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #26
Yeah, I'm running into a problem that seems to have happened to other people- calling "glutSetCursor(GLUT_CURSOR_NONE);" doesn't actually hide the cursor- I can get the cursor to blink once, but alas it comes back. I should have specified that. Maybe I'm putting it in the wrong place? (i've tried a few, including trying it in the display callback... all same results)
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #27
weird, I've not had problems on 10.4 at least... it'll come back randomly in windowed mode, but doesn't in full-screen.

I've got it immediately after glutEnterGameMode: http://onesadcookie.com/svn/repos/Ascent...by/main.rb
Quote this message in a reply
Moderator
Posts: 592
Joined: 2002.12
Post: #28
OneSadCookie Wrote:If you get a $ was it a shift-4 on a US keyboard or a goodness-only-knows-what-key-combination on a UK keyboard?

Just for your information it is shift-4. It is the # key that has been hidden away on UK Apple keyboards.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GLUT and VBL syncing in Mac OSX supersonic 1 3,963 Jul 21, 2011 06:09 AM
Last Post: Skorche
  question about glut NelsonMandella 10 4,631 Apr 1, 2010 05:31 AM
Last Post: Ingemar
  Using GLUT With Multitouch and Command Keys Rasterman 7 4,701 Feb 10, 2010 07:40 PM
Last Post: Rasterman
  glut polygon winding strangeness OptimisticMonkey 2 3,083 Sep 7, 2009 06:27 PM
Last Post: OptimisticMonkey
  GLUT Textures? mikey 0 2,859 May 30, 2009 03:40 AM
Last Post: mikey