Tag Archives: news

New Version of SDL2-for-Pascal Units Released

Version 2.2 of the SDL2-for-Pascal Units got released! It took nearly two and a half years to update the SDL2-for-Pascal Units to be quite up-to-date with the latest version of SDL2. We got a quite updated package now. For you this means, there is no good reason not to start using SDL2 in Pascal to realize your (game) projects, be it with Free Pascal or Delphi, on Linux, Windows or MacOS. – Other compilers and OS’es work too, probably.

I’d like to thank all contributors for their efforts. I’d also like to thank suve, the co-maintainer, for the great cooperation, without which some large improvements would be missing in this release and some serious mistakes wouldn’t have been caught before merging the code :-)!

Happy New Year and Happy Coding!

Here are the offical release notes:

  • SDL2 unit is up-to-date with at least version 2.0.14 of the SDL2 library (exception sdlthread.inc)
  • many aliases got replaced by typed enums
  • add single and double pointers for all types (thanks furious-programming)
  • update SDL_ttf.pas to latest version 2.21.0
  • replace data types by c data types (see PR #29)
  • add folder structure (see PR #27)
  • many bugfixes
title image fairtris

Fairtris and an “Error Chapter” :-)

Added a new great project by Jarosław Baran, Fairtris! – It is purely done in the Lazarus IDE with Free Pascal and uses the SDL2-For-Pascal units to make use of graphic hardware acceleration. The full source code is available and poses a great opportunity to learn how to craft a SDL2 game with Free Pascal!

A brand new chapter about error handling in SDL2 and its combination with Pascal’s exception handling is released now and added to the SDL2 tutorial.

Updated the widgets (replaced legacy widgets) and added new links. Some tags got updated to reflect my new “naming policy” to use SDL2 instead of SDL 2.0.

The work on SDL3 has begun on the official development branch of the SDL project. I’m curious to see what comes from this.

Edit: Fairtris’ author’s name got corrected. (03/06/2023)

sdl2 news title image

SDL2 documentation

Thanks to suve a new documentation resource is available for the PGD SDL2 units at https://pascalgamedevelopment.github.io/SDL2-for-Pascal. The docs are generated directly from the source if new pull requests are merged into the master branch of the repository. Talking of the SDL2 units: They made good progress in 2022 and are still making good progress and soon the first official release will be available.

FFPlay4Laz2 has been added to the projects. It is a Free Pascal/Lazarus Media Player powered by the FFmpeg frame work and SDL2.

In the future I will not refer to SDL version 2 as “SDL 2.0” anymore as SDL’s version numbering scheme has changed with version 2.0.23 (now actually being 2.23.1). That means the minor version is not zero anymore and SDL 2.0 is misleading in that regard. I will update any reference by “SDL2”.

Updated Chapter 4 to reflect changes in the new PGD SDL2 units.

sdl2repo-music-sound

Many updates, everywhere

The news title says nothing and everything :-).

After an PHP update the syntax plugin doesn’t work anymore. I added a better plugin and updated all chapters to display code in a reader friendly way. I also removed the description how to copy source code using the old plugin in the introductory chapter. I adapted code snippet length in some chapters (Chapter 4, Chapter 15). Updated Chapter 18 about music and sound.

I added a new SDL2 powered Free Pascal project: SuperSakura. It’s a nice visual novel engine to run retro-style Japanese games by Kirinn.

I updated some chapters (Introduction, Windows Installation, Linux Installation), mainly because of the repository change to the PGD Community SDL2 units. The units got a lot of updates lately, and help is needed to improve them even further. While this news post was waiting to be published, it appears Tim is back. Now, we have the unfortunate situation that there are two active repositories for the SDL2 headers and the situation has not been resolved, yet.

Also, I changed some stylings.

Download SDL2 units on GitHub

Important: New SDL2 Repo!

IMPORTANT: The repository to get the newest, up to date, SDL2 units has changed. It is found here: https://github.com/PascalGameDevelopment/SDL2-for-Pascal. It is now hosted by our Partner site Pascal Game Development, where you can find many resources if you are interested in game development with Delphi or Free Pascal.

Background: The old repository by Tim Blume has been an up to date source for these units for many years since its establishment (Thanks Tim!), but lately no more pull requests were integrated and so a new repository maintainer had to be found. Long time contributor to the units, Super Vegeta (suve), came up with the great idea to integrate it to the PGD repository, which is now reality (Thanks AthenaOfDelphi!).

What now: Please, if you are a Pascal SDL2 developer, pull from, commit to, fork and star the new repository over at https://github.com/PascalGameDevelopment/SDL2-for-Pascal and update your links accordingly. 🙂

Updated the Linux installation chapter. Now you can get the environment running rather quickly.

Added a new widget “Quality Pascal Articles” (right sidebar) where I add carefully chosen Pascal articles, I appreciate.

WASD title image

Keyboard and Key States Chapter added

Added a new chapter about the keyboard state and the key states for simple key input handling. Updated the Text and Font chapter.

It seems the author of p_daniel’s (or danpla’s) SDL 2.0 units has deleted his github account (EDIT, 06/10/2019: The user name got changed.), hence I updated the discussion page about which unit to choose. Also the official website of the Bare game project seems to be offline. Thanks for the hints Stéphane.

A new impressive, commercial SDL2 based Pascal project called Savage Vessels has been added to the project list. The project list itself got restructured for better readability and loading times.

SDL2 title image

SDL2 Tutorial Improvements

I did a major update to the whole SDL2 tutorial, added some new, restructed and split up many old chapters to have a better learning experience. Instead of ten big learning chunks, there are now 18 smaller chunks which are dedicated to clearly outlined topics. I’m looking forward to do a lot of fine tuning and extending the SDL2 tutorial. If you find errors, just drop me a line.

Every article now shows a date of the last update. This makes it easier to estimate how up to date the article’s information are.

I decided to change the basic font size from 18 to 24 points since the text appears too small on common high resolution displays. I adapted point sizes for other elements accordingly. Also, I made license information available for many images (CC-BY 4.0).

The drop-down menu is gone since it got too long and it has been hard to reach all entries on some devices.

Thanks to MattCash Chapter 6 got some necessary updates.

Android News Cover Image

About SDL2, Free Pascal and… Android

Since the rise of SmartPhones, many wonder if Free Pascal/SDL2 development  is possible for them, too. The good news is, yes it is possible! The bad news is, it is kind of toilsome to set up a development environment for Android (one of the two major operating systems of many SmartPhones).

Imants Gulbis informed me that he set up a Lazarus package (LazSDL2Design) which makes development of SDL2 applications with Free Pascal for Android fairly simple and integrates with the Lazarus IDE. Check out the instructions to make Lazarus/SDL2 ready for Android. The LazSDL2Design package relies on an own translation of SDL2 headers (LazSDL2) by him.

I put together some useful resources for Android development in the FAQ.

Thanks to reader Paul for letting me know about an unclear statement in Chapter 8 Part 1.

The website uses HTTPS now.

Linux Tutorial News Cover Image

New Linux Installation Chapter

A new Chapter 2 has been added. In contrast to the classical Chapter 2 which explains the installation of SDL2 and Free Pascal for the Windows operating system, the new Chapter 2 explains the installation and configuration of SDL2 and Free Pascal/Lazarus in Linux. Initially I was trying to check for some troubles which got mentioned. Finally I ended up with a short, new installation chapter. A few minor changes have been added to the other chapters which are basically hints for Linux users.

A few new great and interesting Free Pascal/SDL projects have been added to the project page. These are namely GearHead: Arena, GearHead 2, Dungeon Monkey Unlimited, Monsterland and DoomRL. The former three are open source by the way.

OpenGL Logo

SDL 2.0 meets modern OpenGL

Good news, Chapter 10 has been released right now! You ever wondered what to do if you would like to create 3d graphics for a game or application? – Well, you go for modern OpenGL. And SDL 2.0 is probably the best and most convenient way to go for modern OpenGL nowadays, even professionals typically use SDL as powerful assistant for their OpenGL applications.  Learn more about the strong relationship between SDL and OpenGL in Chapter 10. – And learn how it’s done, of course ;-).

Chapter 3 got a short explanation now on how to copy the source code of a chapter. In the SDL 1.2 chapters the source code  was shipped for each chapter as Pascal file. Nowadays it is much more convenient to grab the source code (or just the desired parts) by copying it directly from the chapter’s source code boxes (in the browser) and paste it whereever it is needed.

The transfer of the old website has been finished. Nearly the complete content is in some way or another transfered to the new page. For example, all tutorial pages (even the old ones) are still available. Some downloads are integrated at the corresponding tutorial pages now, so they are not lost. Some pages are gone, these are Downloads, Tables and Links. These pages are of no benefit anymore since their information are now provided at the corresponding place instead of separate pages. Nevertheless, links trying to access these pages are redirected to the main page to prevent broken links.

No One’s Space got greenlit. This means that this Free Pascal/SDL game will be available in Steam for purchase soon. It demonstrates the power of Free Pascal and SDL.

Small update of some subdomain settings. Subdomain links work again.