 |
 |
gl/glut.h for OS X?
|
 |
|
 |
|
Junior Member
Join Date: Oct 2001
Location: Los Angeles
Status:
Offline
|
|
I am taking an intorductory course to programming comuputer graphics. A programming example I am working from is meant to run on a Solaris machine. It makes use of OpenGL and GLUT.
It has the following include:
#include <GL/glut.h>
To see if I had the header file on OS X, I ran a quick search for the file. None turned up. However, I did come across a file called "glut.h". I also know that OS X supports OpenGL calls through some APIs somewhere (no idea what header file though).
What equivalent header files can I use to replace the GL/glut.h file? Are the API calls the same? I also have XFree86 installed. I assume any graphics windowing programs will have to be done through there?
Any ideas? Thanks for any advice.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 2001
Location: Bethesda, MD
Status:
Offline
|
|
#include <GLUT/glut.h>
also don't forget to include the proper frameworks when linking:
-framework GLUT -framework OpenGL -framework Foundation
dave
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Dec 2000
Location: Boston, MA USA
Status:
Offline
|
|
davechen is correct. To clarify, the header file exists inside the GLUT framework rather than a "GL" directory (as it is on a Solaris machine). You will see this a lot when porting applications.
So, just use "Add Framework..." to add "GLUT.framework" and "OpenGL.framework" (you may not need them both), and change the #include to find the file inside one of these frameworks.
- Ross
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status:
Offline
|
|
To make it a whole lot easier on you, if you work on the code on Solaris and Mac OS X, use an include statement like this:
<font face = "courier">
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
</font>
|
|
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2001
Location: Los Angeles
Status:
Offline
|
|
Awesome. Simply Cool.  Thanks for your help.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jan 2002
Location: Trondhjem, Norway
Status:
Offline
|
|
I'm also doing some introductory things in GLUT and OpenGL!  It's cool!
Just wanted to say that there are many examples in /Developer/Examples/GLUTExamples (I have the Dec 2001 tools).
|
|
זרו
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status:
Offline
|
|
Originally posted by alien:
<STRONG>I'm also doing some introductory things in GLUT and OpenGL!  It's cool!</STRONG>
Yeah it is! I just learned it last semester, and it's very dangerous stuff. I often found my self playing with my OpenGL code instead of the projects for other classes.
I made a little wave simulation in case anyones interested
|
|
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2001
Location: Los Angeles
Status:
Offline
|
|
Groovy. But I don't suppose we will do much actual OpenGL stuff. I think the prof plans only to use it as a canvas of sorts. I think then we'll be doing some rather low level operations starting with 2D and then onto 3D ending with raytracing (very excited about that). We'll see how it goes.
Mactoid, I tried your suggestion, but I am returned an error because there is no if for the else. 
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2001
Location: Los Angeles
Status:
Offline
|
|
D'oh. By looking at your code, Mactoid, I figured out what I was doing wrong: forgot the #endif. Ugh. Lame me.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|