To GLUT, or not to GLUT?

Member
Posts: 64
Joined: 2005.06
Post: #1
Would you guys suggest using GLUT, or not? I don't really like how GLUT takes control of windows and other such things, when I really want Cocoa to stay in control of that. Anyone have anything to say in the matter?
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #2
The only reason to use GLUT is to have it do all the work for you. If you can live with the very basic events and GUI features it gives you, you can have an app set up and start working on your real graphics code in under 5 minutes.

You're not really supposed to use GLUT's GUI toolkit as part of a larger application; it's meant to be the skeleton. If you're already setting up a window and handling events, you have no need for GLUT at all.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
I'll always start with GLUT, simply because it's so easy to get to the core of things.

If I need something GLUT doesn't provide, like decent keyboard input or decent mouselook or a list of available display modes, I'll switch to a more fundamental API.
Quote this message in a reply
DJBlufire
Unregistered
 
Post: #4
Try SDL. I found it to be much more open ended and less constricting than GLUT (that was hell). Plus, if you want to use cocoa to control stuff as well, you probably could, considering that the OSX implementation of SDL is based on Cocoa itself!
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #5
I've used GLUT and SDL, and SDL is easier to "insulate" from your code, so you can change your mind later without having to change your code a lot. The only thing I don't like is SDL's windows resizing and full screen handling. It forces you to create a new context, and you lose all your textures. Besides, GLUT's window resize is much smoother. But, in general, I still prefer SDL.
(BTW - maybe there is better way to resize in SDL, if anybody knows please tell me! Wink )
Quote this message in a reply
Member
Posts: 156
Joined: 2002.11
Post: #6
PowerMacX Wrote:But, in general, I still prefer SDL.

I prefer neither. I guess I am a control freak. Wink
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #7
FCCovett Wrote:I prefer neither. I guess I am a control freak. Wink

If I'm making a Mac only app or game, I use mac-only stuff too, but I'm still a little pissed off by all the time I wasted learning how to use DrawSprockets & InputSprockets, QuickDraw, the MemoryManager and a lot more "now useless" stuff!! Wink
Quote this message in a reply
Member
Posts: 156
Joined: 2002.11
Post: #8
I hear you. It's really frustrating to put so much effort on learning stuff that's going to be called legacy in less than five years or so.
Quote this message in a reply
Member
Posts: 75
Joined: 2002.04
Post: #9
PowerMacX Wrote:I'm still a little pissed off by all the time I wasted learning how to use DrawSprockets & InputSprockets, QuickDraw, the MemoryManager and a lot more "now useless" stuff!! Wink

Aren't we all Mad

Chris Burkhardt
Quote this message in a reply
Member
Posts: 89
Joined: 2005.06
Post: #10
Ok, so I am a little confused. Which is the best library to use? Say one were creating a vast 3D world. Which do you think would be better for handling basic functions? Should I go with SDL or GLUT. I've been doing a bunch of tutorials on GLUT, and found them really straight forward, however this thread has placed doubt in my mind as to its functionality at higher levels. Any Ideas?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #11
start with GLUT, 'cos it's easiest.

if/when you need more, switch to something better. SDL may or may not be that "something better"; it has its own limitations.
Quote this message in a reply
Member
Posts: 89
Joined: 2005.06
Post: #12
well... I don't want to get 80% thru my programming and then have to convert all my massive code. Can you suggest something that many/most major game developers use? (as far as OpenGL/C++).

EDIT: Also, could you give me an example under which either SDL or GLUT would fall thru in regards to functionality, performance, or robustness?
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #13
Volte Wrote:well... I don't want to get 80% thru my programming and then have to convert all my massive code. Can you suggest something that many/most major game developers use? (as far as OpenGL/C++).
The conventional way to deal with this issue is to ensure that your game code doesn't depend on anything about the application framework you're using. For example, don't pass SDL_Events directly to your game objects, convert them into a data format that is specific to your game, and only allow your game code to access its own data formats. Then, if you decide to change the framework you're using, you only have to change the wrapper code.

There's no escaping that you have to do some work when you switch application frameworks, but you can certainly minimise the effort this way.

Quote:EDIT: Also, could you give me an example under which either SDL or GLUT would fall thru in regards to functionality, performance, or robustness?
I haven't used GLUT enough to comment, but SDL is limited in that it can only support one window/screen, it doesn't provide any reasonable way of putting up a GUI using standard OS features, and in general it's hard to make your game feel 'Mac like'. You'll probably also want to use some extra libraries such as SDL_image, SDL_mixer/OpenGL to get better image format and sound support. (I believe GLUT doesn't have any sound support at all.)

Those things aside, SDL is pretty good.

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #14
SDL is great; window stuff aside, it already has image code, sound code, endian code, reading/writing code, etc, built in.

It's not magic, it's Ruby.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #15
endian code, oops. I had to write my own a couple weeks ago because I didnt know that.
How do you acces the endian code?

Sir, e^iπ + 1 = 0, hence God exists; reply!
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,877 Jul 21, 2011 06:09 AM
Last Post: Skorche
  question about glut NelsonMandella 10 4,567 Apr 1, 2010 05:31 AM
Last Post: Ingemar
  Using GLUT With Multitouch and Command Keys Rasterman 7 4,587 Feb 10, 2010 07:40 PM
Last Post: Rasterman
  glut polygon winding strangeness OptimisticMonkey 2 2,998 Sep 7, 2009 06:27 PM
Last Post: OptimisticMonkey
  GLUT Textures? mikey 0 2,826 May 30, 2009 03:40 AM
Last Post: mikey