There are no guides as to how to port SDL. Here are a few tips.
Start with 1.3, that is where the real work is being done now days.
Try to borrow as much of the low level code as you can for your new OS.
If you find your self tempted to change any of the system independent parts
of SDL you are probably wrong and most likely very wrong. Go back and
rethink the problem and then ask Sam about it.
You are going to have to dig in and learn the structure of SDL. You’ll need
to learn the file structure first. Notice where you find files named for
operating systems and windowing systems, those a directories where you are
going to spend a lot of time. You’ll add directories for YourOS in all those
You’ll need to learn the fine structure of the code. The overall structure
of the code is a simple two layer system. The top layer is machine
independent. The bottom layer is OS and hardware specific.
In between the two layers is the context. The context is a big structure
that contains pointers to all the system dependent parts of SDL. If you look
around you’ll find it. Put in stubs for all the system dependent parts and
get it all to compile, then start filling in the stubs.
Expect to spend some serious time getting the build system to work, your new
additions need to fit with the SDL build system. SDL has a million #ifdefs
and you need to get all the right things defined. Much easier to do it if
you use the existing build system.
SDL is built just like every other portable system I’ve ever seen, so if you
don’t understand the two layer structure of portable systems then SDL is a
good place to learn it.
But, seriously, you’re going to have to spend a lot of time reading source
code to figure it all out. SDL is well documented, but documentation is over
rated. Documentation lies, code does not lie.
Use the Source Luke.
2009/3/21 Dirk Coetsee <dirk.coetsee at gmail.com>> Hi, sorry but based on the replies I think perhaps I was misunderstood. I
want to port SDL onto a new embedded OS. I just wonder if there are any
guides anywhere as to how to go about this? I am sure I will need to wrap or
rewrite some low-level functions, but I have no idea where to start.
SDL mailing list
SDL at lists.libsdl.org