Welcome to www.Freepascal-meets-SDL.net!

What is SDL? SDL is a set of units which provide a free, easy and platform-independent access to features needed for developing high performance games and applications. This includes easy access to graphic, sound and input handling (keyboard, mouse, joystick) for Freepascal. (Read more here.)

Who made SDL? Originally SDL was developed under C/C++ by S. Lantinga for Loki Games. Fortunately the C/C++ headers got translated to Pascal units by the JEDI-SDL project maintained by D. Louis so the SDL library is quite usable for Pascal developers as well. Both SDL and the JEDI-SDL project are under further development today.

What is this page about? This page is made to help you to start with the SDL (Simple Directmedia Layer) library under Freepascal (or other Pascal dialects) and to acquaint yourself with SDL's concepts and commands. Be aware though that my tutorial gives just a brief overview and introduction to the SDL library and is far from being all-embracing. The tutorial aims at Pascal programmers knowing the basic concepts (loops, functions, pointers) of Pascal and now like to progress to SDL.


If you find mistakes in language or content please let me know. If you have any suggestions or something contact me (Community).

Pascal Game Development Pascal Gamer Magazine

By the way, if you're interested in Pascal game development, don't forget to check out these two great partner sites. The left one providing a large Pascal game development community and the right one publishing a free of charge Pascal game magazine.

News

3rd July 2011I'm very happy to announce that more than 10,000 visitors hit my site by now! Eventually this hobby project can be counted as success. Thanks to all visitors, readers and especially participants who mentioned bugs and ideas in the forum! Last but not least to mention the fruitful partnership with the Pascal Game Development project and their magazine! Thanks to Jason and his team!

Since FPC ships SDL with pre-compiled units since a while I decided to remove the path setting steps in several chapters (3a, 5, 7, 8). They may confuse readers. Furthermore they are quite specific for the FP IDE, I doubt many people really use this nowadays for serious development. Otherwise beginners who might still use the FP IDE or a different IDE should get the idea when seeing how to set the unit paths in FP IDE. Therefore, for people who install the units manually I added these information at the end of the first chapter with a little explanation. I added a FAQ page for frequently asked questions, mainly from the forum. The first question added concerns the 64 bit compatibility of SDL (thanks to Cybermonkey for a a lot of contributions to solve this).

2nd January 2011New chapter 4a created dealing with SDL_GFX which is a valuable extension of SDL. It is demonstrated how to compile your own SDL_gfx.dll, how images are zoomed and rotated, a framerate manager is introduced and primitives are drawn. The author's page is added to the link list.

In 2005, when starting this page, one of the two main purposes was to show how to install/configure your Windows machine to work with Freepascal and SDL, nowadays FPC is shared with JEDI-SDL implemented as an auto-installer, also JEDI-SDL itself is installed by an auto-installer. So actually a manual installation isn't necessary anymore for recent versions of these software packages. For archiving reasons I will keep chapter 1 as is but it is kind of obsolete. I did minor changes to chapter 1 and 1a.

7th November 2010Recently issue #3 of the Pascal Gamer Magazine has been released. Please check this great stuff out!

22nd October 2010Two important news this time. Firstly, chapter 6 ist now completely updated. From now on ALL chapters show the complete source code of the example programs completely first and are then treating the source step by step. Secondly, PascalGameDevelopment.com and the Pascal Gamer Magazine are from now on official partner sites of Freepascal meets SDL. If you're interested in Pascal game development you should really check out these sites. Especially the forum of PascalGameDevelopment.com is a rich resource for programmers. There are currently two issues published of the Pascal Gamer Magazine which are available online for free, so don't hesitate to give this high quality magazine a try.

11th September 2010Just a small counter (page views) update. This was requested by the counter provider.

8th August 2010Updated chapter 5 completely.

9th June 2010Updated chapter 4 completely.

1st November 2009Updated chapter 2 and 3. Explanation of variable type UInt32 shifted from chapter 3 to 2. I decided to give the exact definition for any function provided in my tutorial according to the corresponding source code. So instead of general arguments like "components" or "parameters", the exact parameter list and their variable types are shown.

27th September 2009Took me longer than expected, but added now the new chapter 8 describing how to prepare Freepascal and SDL for OpenGL programming. Thanks to Roin who mentioned a now fixed major bug which let the source code snippets appear centered instead of left aligned in many browsers (Epiphany, Firefox, IE). Changes in main page. Reworked chapter 3. Moved information about SDL_DELAY function from chapter 4 to chapter 3. Added a result box at the end of any chapter describing what the program is going to do if working correctly.

8th July 2009Along with the new URL www.Freepascal-meets-SDL.net, a whole bunch of updates come up. I reworked and shortened chapter 1 now giving some information about the recently provided JEDI-SDL units of FPC since version 2.2.2. Renamed chapter 1b to 1a. More details on SDL_DELAY function in chapter 4. Reworked the table of chapter 5. Added new chapter 3a describing the usage of different image format (e.g. JPG, PNG, GIF...). I'm working and planning to release two new chapters in the next time, so stay tuned. Please don't forget to update your links or bookmarks to the new URL.

13th July 2008Reader Robvdl mentioned that Firefox users aren't able to view many images and to download some files. I fixed this now. Thanks Robvdl. I also added a new subforum now for questions related to programming.

26th April 2008New chapter 7 added! Now you learn how to introduce music and sound to your programs. I reworked chapter 3 and now explain not only how to display a picture but how to blit parts of pictures which is a quite important feature at all. Updated chapter 1 and link section a little.

13th January 2008Happy new year! I reworked the first chapter because the JEDI-SDL project now provides an auto-installer. The new chapter 1b describes the installation and configuration of Lazarus. This surely isn't directly related to SDL but the combination of SDL and Lazarus yields a quite powerful development kit. The links are updated and I started adding copyright information.

7th October 2007Read in a pascal development forum that someone had problems getting my tutorials to run because he didn't know about CRT unit which I used habbitually in any chapter. When I thought about it, it seemed really avoidable in most cases so I reworked all chapters and removed it if possible.

26th July 2007Reworked chapter 6 for JEDI-SDL and added mouse handling.

15th June 2007Reworked chapter 5 for JEDI-SDL.

6th May 2007Reworked chapter 4 for JEDI-SDL.

4th May 2007Major changes have been applied to this site. Since the SDL4FP project seems to be dead I will now rewrite all tutorials for JEDI-SDL project. This project is alive and in development and has much more translated headers. The first three chapters are finished and can be accessed by the menu. The old chapters for SDL4FP are available, too but you should really think about switching to JEDI-SDL.

3rd April 2006Added first part of chapter 6, which describes event handling. Furthermore I updated some chapters, added some links and a brand new tables page which contain two useful tables. I will add new tables if I think they could be useful.

15th October 2005 Added new chapter, added links and download area.

22nd July 2005 Made some updates to the site and added a new chapter.

20th July 2005 Today page got online with first three chapters describing how to configure a windows system to use Freepascal and SDL library. Furthermore there is a forum to keep contact if needed.

















to mainpage



Creation/Updates:
There is no guarantee that things will work! You do everything described here on your own risk! © M. Molski 2005-2011. All product and company names, brand names, trademarks and logos are the property of their respective owners.