PDA

View Full Version : px.sdl.pas - quick start and light companion unit for SDL2 + Delphi.



piXelicidio
05-04-2018, 04:46 PM
Hi,

I'm just a beginner with SDL 2.0, and I dare to share my modest journey with Delphi and SDL 2.0. Since the activity on the web around this combination is very low maybe this could be useful for someone
like me, wanting to start working with SDL 2.0 as quick as easy as possible while at the same time keeping the interaction directly to the SDL 2 api.

Inspired by previous work with Lua and Love2D, I just wanted something that every time I want to start a new test or project, with minimal code I get an SDL2 application ready, but other good solutions around try to offer a full engine while I just wanted to work directly with SDL 2 that is actually easy.

So this is the minimal example of use of the unit:

http://www.pascalgamedevelopment.com/attachment.php?attachmentid=1521&d=1522946953


With your permission ;) I'll use this thread to share my journey, my findings, the problems, and solutions.

Github project: https://github.com/piXelicidio/px.sdl

JernejL
06-04-2018, 06:55 AM
Are there much benefits in sdl 2.0? i know the original sdl was actually quite terrible in my experience.

piXelicidio
06-04-2018, 02:01 PM
I was unsuccessful also with SDL 1.2, that I have to give up a few years ago, I couldn't even draw my first texture. But SDL 2 is a better modern conception. The main benefits are the easy low level cross-platform access to everything you need to make a game. But will not find extra features that usually comes with game engines, just the basic for a 2D game, if you need 3D, SDL2 can provide an OpenGL context.
Read more here: https://wiki.libsdl.org/MigrationGuide