Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Sometimes it's better to find a used wheel

Sometimes it's better to find a used wheel

Mike Bossy
Mike Bossy
I am a duck · · 3 min read
1,491 2
I'm a big proponent of not recreating the wheel. There's so much great open source code out there now a days that you can get working code for almost any problem. The biggest problem with open source code is usually deciding which option to use as there are usually plenty of them. The major things that I look for in an open source library are:


  • Cross platform support. I would say 90% of projects support the Windows/OSX/Linux trio so this usually isn't a big deal.
  • Easy to build from source without having to use any fancy tools. I like to integrate any open source libraries into my build process even if they come with pre-built libs. The safety of knowing that I can get the code building in any environment is comforting to me.
  • Community support. If I can't find any forum posts/tuts/etc. on the tech then most likely the code isn't being used by a bunch of people and might not be stable.
  • Developer support. I know this is usually #1 on most people's list but often times an older library looks stale just because it has fully solved a problem and is good to go.
    So when do I decide to roll my own solution instead of using something already out there? Usually only if I want to learn how something is done or if I enjoy writing that kind of code. I've come to the realization that projects shouldn't just be about getting to the finish line as quickly as possible. We also need to stop and have fun along the way. Some would call us nerds for getting so much fun out of writing code but it's gotten to be almost a zen like thing for me. If I'm not coding on a regular basis then I don't feel centered

    Onto the open source libraries I'm currently using in my project. I'm sure I'll add more as my project grows but this is what I have up to this point:

    1. SFML (http://www.sfml-dev.org/) - My main development platform is Linux so when I started coding I started with bare bones X Windows. I haven't done any X Windows coding in almost 15 years and I was quickly ready to claw my eyeballs out. SFML to the rescue and I don't need to worry about any boring windowing stuff.
    2. AssImp (http://sourceforge.net/projects/assimp/) - If you need to import 3D meshes there is no better solution than this that I could find. It just simply works and supports so many file formats it's sick. You can compile it down to just support the formats you decide on to keep the lib small.
    3. SOIL (http://lonesock.net/soil.html) - I once wrote a whole bunch of graphic file importers for a steganography project I worked on years ago. It's not fun. It's not even remotely fun. Using SOIL is way more fun.
    4. GLM (http://glm.g-truc.net/) - I once wrote a whole bunch of matrix and vertex handling classes for a graphics course back at school. It was not fun. I don't have that cursed code lying around anymore. Using GLM is way more fun.
    5. Lua (http://www.lua.org/) - I once wrote a scripting language from scratch for one of my jobs. That was a LOT of fun. Way cool figuring out how to make an interpreter and byte code compiler. I don't have the rights to that code nor does it do half of what Lua does. As much fun as it would be to create a new scripting system that's an entire project or two in itself.
    6. ToLua++ (http://www.codenix.com/~tolua/) - Yes it probably puts some overhead into my system and requires separate headers to get the binding all setup but it's easy as cake to get working and maintain. If I find any perf issues in the future I can always rip it out. No optimizations before their time!
    7. pugixml (http://pugixml.org/) - Neat little XML parser that just works. Code examples show how to get everything working in 5 minutes. Sold!


Discussion

Loading comments...