Monday, January 23, 2012

Fly on Windows: debugging Pygame/SDL

I've been spending a little too much time mystified by Pygame's inexplicable refusal to see any SDL events under Windows. Today, I discovered an incompatibility with the central StoppableThread architecture of the application, so I think maybe I'm on the track to getting this thing running.

Do you have any idea how long it's been since I tried to debug somebody else's code? In a language I'm rusty with, and using libraries I've only read about? Makes me feel like a teenager again.

Anyway, I just wanted to count coup here on the blog.

Update: Indeed, here's a StackOverflow thread describing substantially the same problem under OSX. There, too, the code seemed fine under Linux, and no events fired on OSX. Moral of the story seems to be: don't put Pygame in a thread.

Update 2: I put all the commented-out code back and sure enough, the window gets its messages - and then if I enable Plover I see the same behavior. So it's going to be off into Ploverland to see what's going on there. Weirdness on all sides.

No comments:

Post a Comment