Chapter 1: Introduction, installation and configuration
(JEDI-SDL, Windows OS)

Now this chapter concerns on the installation of all necessary software on your system for programming SDL applications with Freepascal on Windows XP (probably this will work for other Windows systems as well; please report if you tried out; what about Vista?).

First of all, we have to consider which software is needed. We need three different software packages. We need the Freepascal compiler of course. Furthermore we need the original SDL library files and finally we need something what translates our Pascal programs to the SDL library (written in C/C++). This will be done by a few units. These units come from the JEDI-SDL Project (Joint Endeavor of Delphi Innovators - Simple Direct Media Layer Project).

This table provides all information you need about the files you need to download with respect to installation steps 1) - 3).
SoftwareVersionSize, MBSourceDescription
fpc-2.2.4.i386-win32.exe2.2.4~35http://www.freepascal.orgDownload the latest stable Freepascal compiler.
JEDI-SDLFullSetup.exe
(Full Installer!)
1.0 Final RC2~5Main site:http://jedi-sdl.pascalgamedevelopment.com/
Downloads:http://sourceforge.net/forum/forum.php?forum_id=724777
Download the latest version of JEDI-SDL package.
SDL-1.2.13-win32.zip1.2.13~0.1http://www.libsdl.org (German readers may prefer: http://www.libsdl.de/)Download the latest stable runtime library of SDL.


1) Download the latest stable Freepascal compiler, version 2.2.4 or higher.
2) Download the latest version of JEDI-SDL, version 1.0 Final or higher. Be sure it is the full installer (not headers only or demos only).
3) Download the latest version of SDL runtime library, version 1.2.13 or higher.

Of course, if you have installed Freepascal already you haven't to download it again and you can skip step 4.

4) Execute "fpc-2.2.4.i386-win32.exe" to install Freepascal. Let the self-installer create a shortcut on your desktop. Don't modify any checked options during installation process. The default path is: 'C:\FPC\2.2.4\'.
5) Extract "SDL-1.2.13-win32.zip" to get the SDL runtime library. This leads to two extracted files. There is a text file and the very important SDL.dll.
6) Copy those files (especially the SDL.dll!) to your system32-folder! Usually you find it at "C:\WINDOWS\system32\". Don't confuse it with the similar system-folder. (This works for WinXP, probably for NT-series and Win2000 as well; if you use Win9x or WinME you should copy it to system-folder instead of system32-folder)

If it isn't possible for any reason to copy the files into this folder you later have to copy that file into the same folder where the application is. Now you have installed Freepascal and the SDL runtime library on your system. Finally JEDI-SDL has to be installed.

7) Execute the "JEDI-SDLFullSetup.exe" and follow the installer's instructions. Since you should avoid a folder name like "JEDI-SDL Full" which is suggested by the install program when asking for the install path, I suggest as full path: "C:\FPC\2.2.4\units\JEDI\". All later tutorials will assume you installed to this path.

Now the compiler has to be told about where to find the new units.

8) Open the Freepascal IDE (for example by clicking the shortcut on desktop).
9) In the menue choose the following item "Options". From "Options" choose "Directories...". Now a window should pop up.
10) The first tab whitin this new window is called "Units". Here you add the full path to your SDL-units (e.g. C:\FPC\2.2.0\units\JEDI\SDL\Pas) below the other pathes. Leave the last backslash out. Make sure the path leads to the folder, where the sdl.pas file is located! This file contains all the basic features of SDL.

dirs.PNG - Path to sdl.pas

The picture doesn't show the correct path! It is old. We use "C:\FPC\2.2.4\units\JEDI\SDL\Pas" instead. Confirm by clicking "OK".

Congratulations! You have configured your system for developing SDL applications with Freepascal! Now let's check if it really was that easy...

11) To check if you installed your system successfully download the file demo02.pp (right click and "save as") into demo-folder (C:\FPC\2.2.4\demo\) or anywhere else.
12) Open this file and run it.

If you see some cool colourful red and blue lines you have done everything as it has to be done :)! Have fun with your configured system!

For those of you who try running the demo and get an abortion together with a messege saying "exitcode = 309": You skipped step 6! Did you copy the SDL.dll to your system32- or system-folder respectively? If so and the error still occurs you should copy the SDL.dll into the folder where the demos are placed. Now it should work.

VERY IMPORTANT

Since most users will not install FPC/SDL manually I removed the information about setting up the unit pathes in the compiler settings part of each individual chapter. However for you, without setting the unit pathes in your IDE you will get errors. Next is a list of the settings for each chapter where necessary IF you do the manual installation.




Chapter 3a
1) Make sure your compiler finds the new unit. (IDE: Options --> Directories... --> Units)

dirs3.png - Path to sdl_image.pas

2) Copy the file "jedi-sdl.inc" from the "../SDL/Pas"-folder into the "../SDL_image/Pas/"-folder. Both folders are located in the JEDI-SDL project folder (e.g. C:\FPC\2.2.4\units\JEDI\). If you forget this you will get an error on compiling saying SDL_IMAGE is not finding jedi-sdl.inc.

3) You need this .dll file:
SoftwareVersionSourceDescription
SDL_image-1.2.7-win32.zip1.2.7http://www.libsdl.org/projects/SDL_image/This is the corresponding dynamic link library file for unit and image formats.


Chapter 5
1) Make sure your compiler finds the new unit. (IDE: Options --> Directories... --> Units)

dirs2.png - Path to sdl_tff.pas

2) Copy the file "jedi-sdl.inc" from the "../SDL/Pas"-folder into the "../SDL_tff/Pas/"-folder. Both folders are located in the JEDI-SDL project folder (e.g. C:\FPC\2.0.4\units\JEDI\). If you forget this you will get an error on compiling saying SDL_TFF is not finding jedi-sdl.inc.

3) You need this .dll file:
SoftwareVersionSourceDescription
SDL_ttf-2.0.10-win32.zip2.0.10http://www.libsdl.org/projects/SDL_ttf/This is the corresponding dynamic link library file.


Chapter 7
1) Make sure your compiler finds the new units. (IDE: Options --> Directories... --> Units) For the usage of SDL_MIXER you have to include both, the SDL_MIXER itself and the SMPEG unit (which is used by SDL_MIXER unit). The SMPEG unit actually is only used for mp3 support but your programs will fail to run even if you don't use mp3 files.

dirs3.png - Path to sdl_mixer.pas

2) Copy the file "jedi-sdl.inc" from the "../SDL/Pas"-folder into the "../SDL_Mixer/Pas/"-folder and "../smpeg/Pas/"-folder. All folders are located in the JEDI-SDL project folder (e.g. C:\FPC\2.0.4\units\JEDI-SDLv1.0\). If you forget this you will get an error on compiling saying SDL_Mixer or smpeg is not finding jedi-sdl.inc.

3) You need this .dll file and a music and sound file:
SoftwareVersionSourceDescription
SDL_mixer-1.2.8-win32.zip1.2.8http://www.libsdl.org/projects/SDL_mixer/This is the corresponding dynamic link library file.
In my mind.ogg-hereA music file. "In my mind" by First. Of course you could also use any other music file you desire.
dial.wav-herePublic domain sounds: http://www.pdsounds.org. Of course you could also use any other sound file you desire.


Chapter 8
1) Make sure your compiler finds the new units. (IDE: Options --> Directories... --> Units) You will need to add the path to the OpenGL units GL and GLU. GL provides the whole basic OpenGL functionality and GLU (OpenGL Utilities) provides some additional functions which are very useful but not provided as basic functions of OpenGL (version 1.1).

dirs1.png - Path to OpenGL units

2) Copy the file "jedi-sdl.inc" from the "../SDL/Pas"-folder into the "../OpenGL/Pas/"-folder. All folders are located in the JEDI-SDL project folder (e.g. C:\FPC\2.2.4\units\JEDI\). If you forget this you will get an error on compiling saying GL or GLU is not finding jedi-sdl.inc.

3) You need this software:
SoftwareVersionSourceDescription
OpenGL driver--Usually your graphic card provides the corresponding OpenGL driver and you don't have to do anything. And if so it is very likely that version 1.1 is fully supported. However if you are one of the few poor people whose graphic card doesn't support OpenGL, check the graphic card's manufacturer's homepage for OpenGL drivers.

















to mainpage



Creation/Updates: 27/5/2011; 13/4/2009; 13/7/2008; 11/4/2008; 11/1/2008; 25/1/2007
There is no guarantee that things will work! You do everything described here on your own risk! © M. Molski 2005-2008. All product and company names, brand names, trademarks and logos are the property of their respective owners.