Using a mac to write windows openGL?

I am trying to write an openGL program for windows (using codewarrior 8) on my mac. It seems like a lot of people would like to know how to do this since most consumers use windows despite the ass-kickocity of macs.

There is a glut.h, GL/glut.h, and a glut.h file in a GL/ directory. (That is 3 files with different names/locations.) All that is rather confusing. Is one for mac and one for windows?

To write opengl programs on a mac for windows, what kind of libraries/headers must be used and how does this differ from the mac build setup?

Anyone else share my confusion? Honestly, it seems like the hardest part of programming is just setting up all the headers and libraries.

I don’t think I can be much help, but on the assumption that you’re not going to get anything more useful:

The 3 copies of the header file in the Apple OpenGL SDK are all identical, and they’re all for the Mac. They exist to cope with the different ways the file could be included and different CW settings (#include “glut.h”, #include “GL/glut.h”, and #include “GL/glut.h” with “interpret DOS & UNIX paths”).

I think you’ll need to get some kind of Windows OpenGL SDK from Microsoft to do this.

That is interesting, because some of them (like glut.h and GL/glut.h) are different. I (apparently erroneously) deduced that one was for windows and one was for mac.

Oddly, the ones that work on my mac have parts that are references to windows stuff, like “#if defined(_WIN32)”.

I can get a version of an openGL program to compile for windows, but it is one that uses that glaux library, which is windows only, and it also seems to rely on tons of windows only code.
For example, one program I got to compile successfully was http://homepage.mac.com/clevertrevor/lesson02win.cp
And it won’t let me use stuff like
glutInit(&argc, argv);

The previous code is from the NeHe turorials. The following is the mac code for that same lesson. http://homepage.mac.com/clevertrevor/lesson2mac.cp

From the port note:
“I’ve changed a few things from the example code posted on the site. most notably, I’ve used the GLUT library for the application framework (obviously the windows code won’t work).”

So I think the problem is I am thinking of the GLUT functions, like glutInit(&argc, argv);, that are near and dear, as basic openGL when in fact they are part of a small subset, and not core openGL.

So I shall now focus my seach and try to specifically get GLUT, not just openGL, to work for windows.

I will post later if I figure it out to help others avoid this pitfall.

Thanks, OneSadCookie.

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