Glut? Agl?

Member
Posts: 45
Joined: 2002.04
Post: #1
What exactly is the difference in these frameworks:

AGL
OpenGL
GLUT

??

can someone explain, I am little confused, in the carbon examples of OpenGL AGL was included along with OpenGL... but in the Cocoa examples only the OpenGL framework was part of the project...

what exactly is GLUT? and why do people say I should use it?

does GLUT just allow you to program directly with OpenGL? and bypass interaction with Cocoa/carbon api's? or am I talking out of my ass...

I'd like to understand the difference if I am going to start investing time learning about it..

any thoughts?

-Hank

/* Drunk...... fix later.... */
Quote this message in a reply
Member
Posts: 269
Joined: 2005.04
Post: #2
AGL is Apple's implementation of OpenGL that is used in Carbon. It's built on top of CGL or Core OpenGL. I don't think the Cocoa implementation has a nifty acronym, but it's just a different way to get to CGL. GLUT is the OpenGL Utility Toolkit. It's a cross-platform library built on top of OpenGL that takes care of things like event handling, input, windows, etc. It's handy for learning OpenGL as it takes care of some stuff for you, but it's *slow*. There's also GLU, or OpenGL Utility Library, that adds additional features like NURBs and other complex features. You won't be using it much if ever.

Overview of OpenGL used in OS X: http://developer.apple.com/techpubs/maco...index.html
Quote this message in a reply
Founder
Posts: 1,138
Joined: 2002.04
Post: #3
Mayhap this is in our FAQ?

Carlos A. Camacho,
Founder
iDevGames
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Quote:Originally posted by Bachus
[GLUT] It's handy for learning OpenGL as it takes care of some stuff for you, but it's *slow*.

Not any slower than Carbon/AGL or Cocoa/NSGL in my experience...

Basically: Carbon is the Mac API for creating a window and getting events, AGL is the Mac API for attaching an OpenGL context to a Carbon window. Cocoa is the Mac OS X API for creating a window and getting events, NSGL is the Mac OS X API for attaching an OpenGL context to a Cocoa window. GLUT is a cross-platform API for creating a window, getting events, and attaching an OpenGL context.

GLUT is a very simple API to use, which is why I recommend it as a good starting point. It gets you to doing the OpenGL stuff very fast, and it won't really let you down until you try to create a completely polished key control system, by which point you're probably OK to move to at least SDL if not Carbon or Cocoa.
Quote this message in a reply
Zoldar256
Unregistered
 
Post: #5
I've found GLUT to be pretty fast on Mac OS X. On *other* operating systems it might be slower, but the OS X implementation is very nice. For instance, before even looking at the GLUT source I wrote a CGL application wrapper for games in cocoa. It consisted of a custom NSApplication with run and sendEvent overrided to get a really tight fast event loop. So when my game is running, nothing stands in my way of getting events, and when my game isn't running I can still have a cocoa gui.

I was very pleased with the performance of this game loop. Finding it has a very small overhead and still allowing me to use cocoa when I want.

When I checked out the GLUT source I saw almost the same thing. There are a few more lines for handling timers, but not enough to make a big difference.

I bet there is a faster way, but I'm pretty happy with the method GLUT uses.

So I'd say GLUT is fast.
Quote this message in a reply
Post Reply