How to program with OpenGL on mac?

Hi, I’ve just started a class which requires programming in opengl. Now all i’ve found to program in C++ on mac is MPW(if you know a better free editor/compiler tell me about it). Now I really want to do my programming in my house rather than at school, so how can I manage to import opengl in a C++ program in MPW?
Please send me all the help you can, i am used to programming on Linux.

Oh and i also have a demo of the program i have to do, but not the source code(obviously) and my mac beleive it’s a document, not an app, though it’s an app which uses opengl. How can I make it work?

I am dying to do opengl apps on my mac, Please tell me how.
Thank you.

Originally posted by Evil Potato:
[b] Hi, I’ve just started a class which requires programming in opengl. Now all i’ve found to program in C++ on mac is MPW(if you know a better free editor/compiler tell me about it).

Thank you.[/b]

… …
First you need the openGL SDK from apple
(libs, headers, examples). You can get it from developer.apple.com
Also you find there all stuff you need to know to write a MacOS application.

When you dont want to learn the MacOS toolbox use the GLUT library as application framework.

Metrowerks provides educational versions of CodeWarrior …
adios, dariusz

Originally posted by Evil Potato:
Hi, I’ve just started a class which requires programming in opengl. Now all i’ve found to program in C++ on mac is MPW(if you know a better free editor/compiler tell me about it).

You could always use Project Builder under MacOSX, basicly its a front end to gcc/g++/gdb which does all the work anyways so you might mind this a little more intuitive coming from a linux background. But MPW works just fine, its what I’ve been using for a while now, though you’ll need to rebuild GLUT, AUX, MUI, etc if you expect to use them.


Oh and i also have a demo of the program i have to do, but not the source code(obviously) and my mac beleive it’s a document, not an app, though it’s an app which uses opengl. How can I make it work?

Uhh… if its not a mac app, run it at school? Otherwise you can always use resedit to fix encoding/compression screw ups.

Hope that helps,
<-d0n->

Rebuild GLUT ?
Could you explain?

Yes i’d really like to get my hands on MacOSX, but 20$ for a beta is a bit to much according to me(especially since i live in canada -> 40$), i’ll wait for the 1.0 release.
I’ll try all this tomorrow, get the OpenGl SDK, and import opengl librairies in my apps with MPW. I’ll make a reply here to tell you how i managed, hope it’ll work well.

Thank you very much guys, i appreciate.
E.P.

He isn’t saying rebuild GLUT, he is saying change the file atributes using ResEdit. i.e. the reason your mac is making the file show up as a text file instead of an application is that it has lost it’s creator and file type when you put it on a PC. Change them to something like file type - ‘APPL’ and creator to ‘???’.

Also, if it uses GLUT, make sure and get OGL 1.2 of the apple web site. (Look in the support and updates section for this) because it makes GLUT about 50 times faster than v 1.1.2

I have a similar question on building OpenGL with MPW. I’ve found that putting the headers of the OpenGL SDK in the CIncludes folder, and the OpenGL SDK Libraries in the SharedLibraries folder works, as long as you edit the .make file to include them in the build. However, I’m unable to use glut because glut.lib is a CodeWarrior Library file, and cannot be opened in the MPW.
-Tilgovi

Originally posted by Tilgovi:

However, I’m unable to use glut because glut.lib is a CodeWarrior Library file, and cannot be opened in the MPW.
-Tilgovi

What you need to do is to recompile the GLUT source into a .o file or a shared lib. It does takes a little bit of “greasing” to get the code to compile properly, but it works for both the 1.0 & 1.2 sdk versions of glut.
All you need to do then is simply link against your new glut.o file and your good to go.
Anyway, I hope this helps.
<-d0n->

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.