PDA

View Full Version : Sdl + Glut


PowerMacX
2003.04.30, 06:12 PM
I have made a couple of GLUT programs, and also some SDL based ones. They all work fine and compile without any errors or warnings. Recently, I downloaded some sample SDL based code wich ALSO uses GLUT. GLUT is based on carbon, but SDL uses cocoa... Is there any way to make a GLUT + SDL program work on OS X?
:???:

Mars_999
2003.04.30, 06:13 PM
Originally posted by PowerMacX
I have made a couple of GLUT programs, and also some SDL based ones. They all work fine and compile without any errors or warnings. Recently, I downloaded some sample SDL based code wich ALSO uses GLUT. GLUT is based on carbon, but SDL uses cocoa... Is there any way to make a GLUT + SDL program work on OS X?
:???:

Why would you want to do that?

OneSadCookie
2003.04.30, 06:18 PM
GLUT is based on Cocoa on Mac OS X.

But what on earth would a program use both for?! They serve the same purpose!

PowerMacX
2003.05.06, 04:01 PM
I DON'T want to use both. The reason I'm trying to use both is because I found some nice tutorials with windows based code. It used GLUT, but also some Windows-specific code. Anyway, an SDL port was available for Linux, but I later found out that it used both GLUT and SDL (SDL code was in place of the windows-specific code).
Also, are you sure GLUT uses cocoa? I could't find anything Obj-C like in the headers or anywhere else...:???:

OneSadCookie
2003.05.06, 06:05 PM
Yes, GLUT.framework on Mac OS X uses Cocoa.

There's no reason why that would have to show in the API! After all, SDL uses Cocoa but that doesn't show anywhere...

PowerMacX
2003.05.06, 08:05 PM
Actually, SDL projects created using the provided ProjectBuilder template have a default file SDL_Main.m (or something like that -I'm writing this on a crappy PC) wich is Cocoa code. On the other hand, SDL sample code (from the official site) is pure C/C++, and it doesn't use any *.m, but in order to make them work I have to include SDL_Main.m & SDL_Main.h on the PB project.
Anyway, I'll just try to replace the GLUT code with SDL, because GLUT & SDL don't seem to like each other on OS X :( . I first tought that maybe the problem was that GLUT was a carbon framework but since both GLUT & SDL use cocoa now I don't have any idea why they don't work!
Thanks anyway!