Discussion:
Porting SDL2 to a new platform, detailed docs?
(too old to reply)
Arne Schwettmann
2017-02-19 21:41:13 UTC
Permalink
Hello SDL developers,
I want to help in porting SDL2 to a new platform. I am new to this, and I would greatly appreciate help from somebody who has done this before (porting to Android or other platforms where SDL2 now exists).

I have the following question:
- Is there a standard reference document that includes all the functions with implementation details*? I need something telling me which system level functions (drivers) I have to implement, detailing their desired behaviour (input/output etc.)?

*ideally this should be a long, indexed, pdf and not a bunch of disjointed comments in source or a bunch of disjointed comments/readme’s on GitHub :)

What I have found:

So far I have found this
https://forums.libsdl.org/viewtopic.php?p=3591&sid=ca6328caf29e567ac498a6d32ae4399a <https://forums.libsdl.org/viewtopic.php?p=3591&sid=ca6328caf29e567ac498a6d32ae4399a>

, and some comments in the driver source for SDL2 for other platforms. But surely that can’t be all the documentation for a decade old project?

To clarify: None of the content at https://wiki.libsdl.org <https://wiki.libsdl.org/> is of use to me, since it is at the user level. I need docs at the driver/internal level of the API. I am looking at documentation at the developer level for porting the SDL2 library itself, not documentation at the user level for using an existing SDL2 port for a project.

Thank you very much for any help in advance,
Arne
Jonathan Dearborn
2017-02-19 22:58:16 UTC
Permalink
Sounds like you should look at this file:
http://hg.libsdl.org/SDL/file/5fcc998013ed/docs/README-porting.md

Jonny D
Post by Arne Schwettmann
Hello SDL developers,
I want to help in porting SDL2 to a new platform. I am new to this, and I
would greatly appreciate help from somebody who has done this before
(porting to Android or other platforms where SDL2 now exists).
- Is there a standard reference document that includes all the functions
with implementation details*? I need something telling me which system
level functions (drivers) I have to implement, detailing their desired
behaviour (input/output etc.)?
*ideally this should be a long, indexed, pdf and not a bunch of disjointed
comments in source or a bunch of disjointed comments/readme’s on GitHub :)
So far I have found this
https://forums.libsdl.org/viewtopic.php?p=3591&sid=
ca6328caf29e567ac498a6d32ae4399a
, and some comments in the driver source for SDL2 for other platforms. But
surely that can’t be all the documentation for a decade old project?
To clarify: None of the content at https://wiki.libsdl.org is of use to
me, since it is at the user level. I need docs at the driver/internal level
of the API. I am looking at documentation at the developer level for
porting the SDL2 library itself, not documentation at the user level for
using an existing SDL2 port for a project.
Thank you very much for any help in advance,
Arne
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Jonathan Dearborn
2017-02-19 23:05:23 UTC
Permalink
Ah, yep, I followed that forum link now and that's the intro file for
porting to a new platform. My best advice is to do what it says and start
from either a similar platform's implementation or use the dummy driver as
a starting point. There are several people who will have more to add.

Jonny D
Post by Jonathan Dearborn
http://hg.libsdl.org/SDL/file/5fcc998013ed/docs/README-porting.md
Jonny D
On Sun, Feb 19, 2017 at 4:41 PM, Arne Schwettmann <
Post by Arne Schwettmann
Hello SDL developers,
I want to help in porting SDL2 to a new platform. I am new to this, and I
would greatly appreciate help from somebody who has done this before
(porting to Android or other platforms where SDL2 now exists).
- Is there a standard reference document that includes all the functions
with implementation details*? I need something telling me which system
level functions (drivers) I have to implement, detailing their desired
behaviour (input/output etc.)?
*ideally this should be a long, indexed, pdf and not a bunch of
disjointed comments in source or a bunch of disjointed comments/readme’s on
GitHub :)
So far I have found this
https://forums.libsdl.org/viewtopic.php?p=3591&sid=ca6328caf
29e567ac498a6d32ae4399a
, and some comments in the driver source for SDL2 for other platforms.
But surely that can’t be all the documentation for a decade old project?
To clarify: None of the content at https://wiki.libsdl.org is of use to
me, since it is at the user level. I need docs at the driver/internal level
of the API. I am looking at documentation at the developer level for
porting the SDL2 library itself, not documentation at the user level for
using an existing SDL2 port for a project.
Thank you very much for any help in advance,
Arne
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
David Ludwig
2017-02-21 21:03:38 UTC
Permalink
This ended up being what I did, when porting SDL2 to WinRT/UWP: I spent
-lots- of time reading through SDL source code. The hardest parts usually
ended up being platform-specific bits, although, SDL2's window vs.
full-screen management code was difficult to work with, at times.

I'm happy to try answering questions about, or during this process, as well.

Cheers,
-- David L.

​
Ryan C. Gordon
2017-03-06 22:05:51 UTC
Permalink
Post by David Ludwig
This ended up being what I did, when porting SDL2 to WinRT/UWP: I spent
-lots- of time reading through SDL source code. The hardest parts
usually ended up being platform-specific bits, although, SDL2's window
vs. full-screen management code was difficult to work with, at times.
Having just done this for a new platform, it's basically "get it to
compile with the platform's build system, then go through each subdir in
"src" to see if there needs to be a platform-specific piece added."

This gets more complicated in that a few things (SDL_atomic.c) expect
you to add an #ifdef, and others expect you to add a new implementation
and plug it into a list of available implementations to try at runtime
(audio, video), and others expect you to add a new implementation that's
the _only_ thing that works on that platform (thread, etc).

And then joystick expects you to have one implementation for the
platform, but both Linux and Windows then built their own
multi-implementation thing on top of that.

Also, almost universally, starting from the "dummy" driver is the wrong
move.

We should fix some of these details.

--ryan.

Continue reading on narkive:
Loading...