Intro to SDL #0: Setup - Procedurally Generated

Intro to SDL #0: Setup

This series of tutorials deals with the Simple DirectMedia Layer library, which can be found here. SDL is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, 2D video framebuffer, and is my favorite graphics library for a number of reasons, chief among them that it lives up to its name. It gives you a simple, powerful set of tools and then gets out of your way. If you have ever used libraries you have likely encountered how frustrating it can be to try and color outside the lines the developers envisioned or to get them to play nice with others.

We will be using SDL 1.2. There is a SDL 2.0 under development, and I expect them to formally release before I get halfway through this series to mess with me, but for the moment 1.2 is king because it is stable and well documented.

The low level nature of SDL does mean that you do have to build a lot of stuff yourself (which is just how I like it, you learn ten times as much rolling your own instead of using someone else’s). Over the years I’ve built up a nice little set of tools and this series is for those of you who have to know how everything works or want to roll your own. For those of you who just want to skip straight to the cool stuff, my SDL Gamedev tutorials are for you. I give you the toolbox we build in the ‘Intro to SDL’ series and we move onto actual game development from there.

A couple additional caveats before we begin. I’m doing this with C++ on Windows 7, so my tutorials are going to work with those(hopefully). Due to SDL’s multi-platform nature and multiple language wrappers it should be possible(in theory) to adapt these with minimal fuss, however I make no promises. If you’re doing development on other OS’s or with other languages you’re going to know better than me what needs to be done to get it working, so you’re on your own. I’m also assuming you have a good grasp on your basics, and you know how your compiler works.

Step One: Acquire library files. For the official SDL stuff you want the development libraries.

  • SDL– Main library
  • SDL gfx – rotating/scaling/primitives/other cool stuff, not an official library. Yes, you could write all this stuff yourself, and we do write some of it later in the series, but I’m willing to bet that this rotation and scaling code is going to be far better than anything I could write myself.

Step Two: Read the license terms. For these specific libraries it essentially boils down to: feel free to use, don’t claim you wrote, giving credit is always nice. This is not universal, if you use additional libraries be sure to check the terms to make sure you don’t sink a large amount of time into something that you’ll end up not being able to use because of license terms.

Step Three: Stick the appropriate files in the appropriate places (ignore most of the stuff in sdl_gfx and just grab the .c and .h files) . DLL’s go with your compiled .EXEs and everything else goes into the appropriate folder in your compiler install.

With all that done we should be ready to get down to the actual coding, which we will get to in the next installment.

Post a Comment

Your email is kept private. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Home of two pushpin murals, an X-COM lets-play, some C++/SDL programming, and some discussion of procedural generation. Wordpress Theme: Procgen, a hulking monstrosity that was originally BlankSlate. © 2017 Procedurally Generated. All Rights Reserved.