SDL problems on Mac OS X in Python and Ruby
So I wanted to get the SDL working on my Mac at home so I can tinker with game programming in either Python or Ruby.
My preference would be Ruby since I think the language is cooler… but both RuDL and Ruby_SDL kept giving me this weird NSInternalInconsistencyException that I didn’t know what to do with… “Huh,” I thought. “These projects must not be very stable yet.”
Then, using Fink I started installing Pygame and started getting a similar problem even though Pygame had been working the previous week! (I had downloaded it from somewhere but wanted to get latest) WTF!! Turns out, more specifically, that the problem was in making windows… going fullscreen worked just fine. It was making windows that was causing the problem.
Thank God for the Interweb. This guy used this post to diagnose what was wrong with my finky installation of pygame. So, once I’d made the simple change in my init python script in pygame… voila!
Makes me want to go find RuDL and Ruby-sdl in my trash and see if I can’t fix’em.
BTW, the code I had to hack is this:
from objc import loadBundleFunctions
import AppKit
import Foundation
+ if not AppKit.NSApp():
+ AppKit.NSApplicationLoad()
except ImportError:
raise ImportError(“PyObjC 1.2 or later is required to use pygame on Mac OS X”)
The +s indicate where you should add the lines and eventually I’ll get around to fixing my site so I can display code properly (indenting and all that). Whew!