We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 222

Summary: SDL_macgl loads wrong GL library
Product: SDL Reporter: Anders F Bj <afb>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 1.2   
Hardware: PowerPC   
OS: Mac OS X (All)   
Bug Depends on:    
Bug Blocks: 53    
Attachments: SDL12-macgl-mach.patch
testgl-sharedlibs.txt

Description Anders F Bj 2006-05-09 17:48:46 UTC
SDL_macgl loads CFM library (OpenGLLibrary) even in Mach-O,
when it should be loading the OpenGL.framework code instead
Comment 1 Anders F Bj 2006-05-09 17:49:21 UTC
Created attachment 119 [details]
SDL12-macgl-mach.patch
Comment 2 Ryan C. Gordon 2006-05-10 00:57:40 UTC
We don't use the "maccommon" target on OS X, we use the "quartz" one.

Is it time to remove the MacOS Classic support yet?   :)

--ryan.

Comment 3 Sam Lantinga 2006-05-10 01:09:20 UTC
Under what configuration is this coming up?  Carbon build on OS X?
Comment 4 Anders F Bj 2006-05-10 02:47:41 UTC
Regarding Comment #2: this was when building the Carbon Mach-O target for Mac OS X (the Cocoa Mach-O target uses "quartz"). There is no Classic involved, though.
But no: I do *not* think that the Classic support should be removed from SDL...

Regarding Comment #3: Yes, this is under a CodeWarrior Mach-O target on Mac OS X which uses Carbon.framework and OpenGL.framework instead of CarbonLib and OpenGLLibrary that the CodeWarrior CFM target uses on Mac OS X. (both "Carbon")
Comment 5 Sam Lantinga 2006-05-10 02:51:54 UTC
Shouldn't this be loading AGL.framework?
Comment 6 Anders F Bj 2006-05-10 02:56:21 UTC
Here are the build settings for the SDL-cw9.mcp CodeWarrior project:

Carbon:
#define SDL_VIDEO_DRIVER_TOOLBOX 1
#define SDL_VIDEO_DRIVER_QUARTZ	0

Cocoa:
#define SDL_VIDEO_DRIVER_TOOLBOX 0
#define SDL_VIDEO_DRIVER_QUARTZ	1

(See Bug #221, in order for that to work)

They match the new configure settings of:
--enable-video-carbon
--enable-video-cocoa


For audio, these drivers are used for both:
#define SDL_AUDIO_DRIVER_COREAUDIO	1
#define SDL_AUDIO_DRIVER_SNDMGR	1
Comment 7 Anders F Bj 2006-05-10 03:00:14 UTC
Comment #5: AGL.framework only has the AGL functions (compare WGL, GLX, etc) - all the OpenGL functions (glBegin, etc.) are in the main OpenGL framework

But in theory you are right, Carbon uses Carbon.framework and AGL.framework and Cocoa uses Cocoa.framework and OpenGL.framework for the "non-glXXX" functions (i.e. CGL)

Anyway, doing it like this made the "testgl" program work with Carbon Mach-O.
Comment 8 Anders F Bj 2006-05-10 03:11:23 UTC
Created attachment 122 [details]
testgl-sharedlibs.txt

Here are the shared libs used/linked (from "otool -L")
Comment 9 Sam Lantinga 2006-05-10 03:16:41 UTC
Okay, your patch is in Subversion.
Comment 10 Anders F Bj 2006-05-10 03:17:27 UTC
Thanks, and it's conditionalized so it shouldn't hurt the Classic/CFM variant.