
-----------------------------------
CodeMonkey2000
Tue Apr 27, 2010 12:13 am

Graphics in C with SDL (part 0)
-----------------------------------
Introduction
So you wanna move on the C/C++ so you can make ?real? game eh? Well it's a lot of work. There are many starting points, and many ways to get confused and do things the wrong way. Hopefully I will be able to lead you the right way. I will only be using pure C, and be compiling with makefiles. This tutorial probably will (initially) share some similarities to  What is SDL?
SDL stands for Simple DirectMedia Layer. It is an API for C that provides many functionality like having a window and drawing stuff on that window, and polling events (ie for things like mouse movement and keyboard inputs). It is simple and easy to use.

Why SDL?
It's simple (as the name would suggest), cross-platform. One can also use SDL with openGL, and you get a nice environment for openGL. OpenGL is great since it is much faster at rendering than SDL, and openGL can do 3D rendering. There are a bunch of examples of this in the C++ submission section.

Installing gcc, make and SDL


With Windows
This will be a quick speed run of gandalf's excelent tutorial. First off grab the minGW installer from With Linux
If you are using arch linux just go in the terminal and do:
With Mac
I've never used a Mac, so you're on your own (or you could try lazyfoo's tutorial, but you'll have to research make files).

-----------------------------------
DtY
Tue Apr 27, 2010 5:58 pm

RE:Graphics in C with SDL (part 0)
-----------------------------------
About running on a Mac, it's a bit of a pain.

There are a few ways:

- Installing with macports
Macports includes a package for SDL, it acts like SDL on Linux

- Binary installer from the official website
The SDL website has a mac os download, but it acts weird. Instead of being a series of dynamic libraries, it uses a mac framework, which is just a way to group a bunch of dynamic libraries and their headers into one file (which is the preferred way to do it on Mac os). This is all well and good, but you need different linker flags to compile (which makes it harder to write cross platform software).

[edit] You can always build from source, or use Fink (I think)

-----------------------------------
Insectoid
Sat Nov 19, 2011 12:55 pm

RE:Graphics in C with SDL (part 0)
-----------------------------------
I used lazyfoo's tutorial to install SDL. It's rather a bitch, 'cause lazyfoo and SDL assume that you really want to use Xcode, which in my case is not true. I couldn't find any instruction on compiling an SDL-based program from the command line, anywhere.
