Home arrow Multimedia arrow Game Programming using SDL: Getting Started

Game Programming using SDL: Getting Started

Game programmers using OpenGL have often been forced to make a choice between using a library that is platform independent but doesn't use all the available resources, or powerful but platform dependent. Simple Directmedia Layer (SML) offers a third way. This article will give you a taste of its capabilities.

  1. Game Programming using SDL: Getting Started
  2. SDL: The Services Provided
  3. Working with Video the SDL Way
  4. SDL in Real World: Loading Sprites
By: A.P.Rajshekhar
Rating: starstarstarstarstar / 12
December 27, 2006

print this article



Game programming has come a long way since early Linux and Windows days. The time is gone when games were limited to Windows or to an extended Mac. Today portability is in the forefront, even in the gaming segment. The birth of OpenGL was the first step in this regard. But OpenGL addressed only the rendering aspect of game programming. The major part, that is communicating with varied input devices, was left to the operating system. That is the reason for the existence of various extensions to OpenGL, including GLUT (platform independent), MESA (OpenGL extension for *nix systems) and WOGL (OpenGL extension for Windows).

Each of these has its own pros and cons. If a library is OS independent, then it is limited in utilization of all the available resources. If it is able to harness the power of the underlying system, then such a library is platform dependent. Apart from portability issues, all the existing libraries left the task of developing the gaming infrastructure on the shoulders of the developer. It was during such times of extreme choices that SDL came into picture.

SDL (Simple Directmedia Layer) is a library "by the game programmers for the game programmers." Hence it doesn't try to achieve the "unachievable" by starting from scratch. Instead it is built upon the existing libraries for each OS, i.e. it uses DirectX for Windows and XWindows APIs for *nix systems. Additionally, SDL provides for all the infrastructure needs of a varied range of games.

In this discussion, I will focus on setting up SDL and accessing one of its many infrastructure facilities -- loading a sprite. In the first section I will enumerate the infrastructure services. The second section will focus on the initializing the video to achieve the best resolution. In the third section, I will discuss how to load a bitmap using SDL APIs. The third section will also detail the real world implementation of using an SDL API for sprite loading.

>>> More Multimedia Articles          >>> More By A.P.Rajshekhar

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Basic Lighting in OpenGL and SDL Game Progra...
- Working with Colors in OpenGL for Game Progr...
- Animation in OpenGL for Game Programming usi...
- Game Programming with SDL: Getting Started w...
- Using OpenGL with SDL for Game Programming
- Learning Sound for Game Programming using SDL
- Game Programming using SDL: Raw Graphics and...
- Game Programming using SDL: Getting Started
- Network Radio With Icecast
- Learning To SMILe

Developer Shed Affiliates


Dev Shed Tutorial Topics: