Mark Sachs (ksleet) wrote,
Mark Sachs
ksleet

  • Mood:
  • Music:

A violent argument erupts about whose day was more pleasant.

So I have been continuing to work on my game engine.

As expected, a sudden wave of boredom and general distraction passed over me and I switched over from Neon Galaxy to one of the other projects -- specifically, the sprite landscape. Though outwardly it hasn't changed much, I've been making miscellaneous internal improvements to the system to make it more flexible and efficient and allow it to support fractal maps of various types. Then I was all "hey you know what would be cool? If I implemented gamepad support so I could fly the plane like in Ace Combat! Neeeeeeowwwwwrrr!"

And, uh, yeah. That's a little tricky. Development on GLUT, the main OpenGL utility library and the one that ships with OSX, has been stone-dead since 2003; it got as far as supporting three axes on a controller before falling face forward into the dirt. Which would be great if this was 1993 and I was trying to get my super-mega-rad THRUSTMASTER FLIGHT CONTROL STICK WITH OPTIONAL THROTTLE working, but it is not 1993. It is the dystopian future year of 2010 and technology has moved on. Your standard two-stick gamepad with, one might notice, four axes, is just not supported under GLUT and I guess that's that. Though GLUT is lousy with weird functions for supporting things like spaceballs and dials and "button boxes," whatever those are, so in case you work in a computer museum you're super in luck!

So after some searching around and bouncing off more than one other widely advertised yet dead or near-dead OGL utility library, I finally came across SDL, and it looks like that's just what the doctor ordered. SDL has actually been used in commercial products and, more importantly, has been updated at some point in the last five years. It supports gamepads, hopefully such as the clunky old Logitech Dual Action I dug out of a box of cables yesterday, with all the axes you could ever ask for. It also does many other good things such as including the LoadWAV function some sadist had removed from GLUT. And SDL advertises itself to be as cross-platform as GLUT was, making ports to Windows and Linux at least conceivable in the future. In sum it seems like SDL is the way to go, and in fact what I should have been using all along.

Therefore I downloaded SDL this morning and I ported my engine over to it, taking the opportunity to reshuffle the source code in a slightly more sensible fashion and clean up a few other things. The result is... it worked! Holy cow! There was really very little trouble, or at least no more trouble than there always is. But to be fair, I was lucky enough to stumble across Mark Szymczyk's excellent and straightforward introduction to using SDL with XCode which made the process a lot smoother. There's a lot of other interesting XCode tips on that site, so I'd urge you to check it out.

And after all that, did I actually implement the gamepad support? Dude. I'll get to it. Sheesh.
Tags: neon galaxy
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments