# C /C++ and OpenGL



## profx (Apr 17, 2003)

Hi,

I am doing a Computer graphics course at university.  We have to use micro$oft .net to develop our assignments.  But we use no low level (hardware dependant) c or c++ commands.

How would i go about changing the source of the assignment so it uses the mac osx GL, GLU and GLUT librarys?

here is the source provided by the lecturer http://www.cs.auckland.ac.nz/compsci372s1c/assignments/Ass2/Ass2Sources.zip 

Can anyone help me to get this running on my mac?

Any help appreciated!!  Save me a trip into uni so i can use the lab computers!


----------



## Captain Code (Apr 17, 2003)

You will need the developer tools installed, and in your project you will need to link to the GLUT framework which is installed at
/System/Library/Frameworks/GLUT.framework/
glut.h is at 
/System/Library/Frameworks/GLUT.framework/Versions/A/Headers/glut.h
If you don't have that framework already listed, I think there's a way to add a new framework into the project and just tell it the path of the framework.

I *think* the path for the opengl headers is already included in your project, but if not, you might have to do something similar to the above to link to the opengl framework.


----------



## profx (Apr 17, 2003)

I have all the developer tools installed, im just not sure how to get the source to compile properly in project builder do i create a c/c++ tool or what?

Thanks for the reply


----------



## Captain Code (Apr 17, 2003)

Yes, a C++ tool is what you want to create since it's a command line program.


----------



## profx (Apr 20, 2003)

Ok

so what  are the .h file includes called in Mac OS X

for windows:
	
	



```
#include windows.h
#include gl/gl.h
#include gl/glu.h
#include gl/glut.h
```
those all have angle brackets around them but this forum wont display them ... argh


but for mac??

once i have these i think i will be set


ALL help appeciated!!


----------



## Captain Code (Apr 20, 2003)

I think the OpenGL headers are in the same location, and the GLUT ones are at GLUT/glut.h


----------



## r4bid (Apr 21, 2003)

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=MacOSX

I think that should help you out.


----------



## PowerMacX (Apr 22, 2003)

windows.h -> delete this line
gl/gl.h        -> OpenGL/gl.h
gl/glu.h      -> OpenGL/glu.h
gl/glut.h     -> GLUT/glut.h

Also, glut.h already includes gl.h & glu.h so you could delete those lines too.


----------



## Winn (Apr 28, 2003)

You will find an example how to use OpenGL in Mac OS X on the Apple Developer Side, watch the CubePuzzle...

Regards Winn


----------

