Difference between revisions of "Using SDL with Code::Blocks"
(Building and using SDL with Code::Blocks and MinGW under Windows) |
|||
Line 6: | Line 6: | ||
==The Good, the Bad, and the Ugly - Setting up SDL== | ==The Good, the Bad, and the Ugly - Setting up SDL== | ||
− | There are many ways to set up [[SDL]] to be used with [[Code::Blocks]], each of them having its own advantages and disadvantages. | + | There are many ways to set up [[SDL]] to be used with [[CodeBlocks:About Code::Blocks]], each of them having its own advantages and disadvantages. |
First, you have to get the necessary libraries and include files. There are three ways of getting these. | First, you have to get the necessary libraries and include files. There are three ways of getting these. | ||
Revision as of 13:37, 22 August 2005
( --- article is in work --- )
This article deals with SDL using Code::Blocks with the MinGW compiler, however the same steps will likely work with a different compiler (such as MSVC2003 toolkit) or under Linux, too (Linux users will of course not worry about DirectX).
The Good, the Bad, and the Ugly - Setting up SDL
There are many ways to set up SDL to be used with CodeBlocks:About Code::Blocks, each of them having its own advantages and disadvantages. First, you have to get the necessary libraries and include files. There are three ways of getting these.
The uglier variants have the advantage of better configurability, but may take significant time to set up.
The Good
The easiest of all possibilities is to just download the SDL binary distribution directly from libsdl.org.
If you are only interested in writing a SDL application, then the pre-built libraries are probably good enough for all your needs, so there is little reason to waste your time compiling your own.
Pro/Con
- pro: need to download one file, setup time ~20 seconds
- pro: it works
- con: not configurable
Prerequisites
- Internet Connection
- Archiving program (tar, 7z, WinZip, PowerArchiver, ...)
The Process
Download SDL-devel-1.2.8-mingw32.tar.gz from http://www.libsdl.org/download-1.2.php. There
Alternative
Code::Blocks comes with support for reading .DevPak files of late. This allows for an even more comfortable setup. Recent DevPaks (1.2.8) for SDL, SDL-mixer, and SDL-ttf can be found at http://www.devpaks.org/category.php?category=SDL.
Important: Please do note that the packages at devpaks.org are not original packages created by the SDL team. Be aware that devpaks.org theoretically allows anyone to upload anything under the name SDL. Although I know of no case of malware being distributed over this channel, it is still possible.
The Bad
With a little more effort, you can build SDL from sources using Code::Blocks. While this may not be the desirable solution for Joe Everybody writing Hello World for his computer science class, it has certainly its advantages.
Prerequisites
The Code::Blocks IDE
A working Template:MinGW installation
Any archiving program that is capable of decompressing a .tar.gz file.
The Ugly
SDL can be built
The Grave of Arch Stanton - Using SDL
Now that we have the libraries and headers installed, we want to build a SDL application.