Tutorial on transitioning a medium-sized project to SDL 1.3/2.0

First a little info. I’m planning to convert Stella (the multi-platform
Atari 2600 emulator) to SDL 1.3/2.0 (whenever the latter may be
released). The codebase is approx 50000 lines of C++ code with about
170 classes. About 10 of the classes are specific to SDL; the rest is
completely separated. I make use of software and OpenGL features, sound
and joystick stuff, and Unicode input (no threading, music or CD usage).

Currently, the code has derived classes for software rendering and
OpenGL rendering. I hope to move to a unified rendering class where I
let SDL worry about whether it’s using software or OpenGL behind the
scenes. I’ve modeled the current code on upcoming SDL features, hoping
to get ahead of the process a little. For example, I create FBSurface
objects which encapsulate an SDL_Surface, are drawn into, and then
rendered to the screen. I assume (hope) that these same classes can be
used with an SDL_Texture instead.

Stella is cross-platform, with Windows XP/Vista/7, MacOSX 10.4+ and
Linux supported in the main codebase. It uses Visual Studio 2005/2010,
Xcode 3.2 and configure/make, respectively.

My main questions are:

  1. How should I begin? Are there any documents that outline moving a
    large-ish project to SDL 1.3?

  2. When will SDL 1.3/2.0 be officially released? And unofficially, are
    there builds for each of the systems listed above?

  3. What build systems are supported, or more importantly, are the build
    systems I mention above supported?

  4. Based on my short description of the project, do you foresee any
    gotcha’s that I may run into?

Thanks in advance for any info you can provide.

Steve A.
Stella maintainer

  1. There is an introductory migration guide here:
    http://wiki.libsdl.org/moin.cgi/MigrationGuide
    There isn’t anything step by step from the perspective of actually
    doing it, but that would be really nice to have. Maybe you can take notes
    about your process and what you ran into and we can link it from there?

2,3. There isn’t an official timeline, but one of the things I’m doing over
the next few weeks is getting the final countdown list of things that need
to be done for release. Unofficially there is build support for the
systems you mentioned, though I haven’t tried the VC 2005 project in a
while, so it’s probably out of date, and you may need to upgrade to XCode 4
for the latest Mac build. YMMV, please send feedback!

  1. Not that I can think of offhand. Please report any issues you have to
    the mailing list and to http://bugzilla.libsdl.org, and be patient since
    this is a community supported project now. :slight_smile:

Cheers!On Wed, Dec 28, 2011 at 9:43 PM, Stephen Anthony wrote:

First a little info. I’m planning to convert Stella (the multi-platform
Atari 2600 emulator) to SDL 1.3/2.0 (whenever the latter may be released).
The codebase is approx 50000 lines of C++ code with about 170 classes.
About 10 of the classes are specific to SDL; the rest is completely
separated. I make use of software and OpenGL features, sound and joystick
stuff, and Unicode input (no threading, music or CD usage).

Currently, the code has derived classes for software rendering and OpenGL
rendering. I hope to move to a unified rendering class where I let SDL
worry about whether it’s using software or OpenGL behind the scenes. I’ve
modeled the current code on upcoming SDL features, hoping to get ahead of
the process a little. For example, I create FBSurface objects which
encapsulate an SDL_Surface, are drawn into, and then rendered to the
screen. I assume (hope) that these same classes can be used with an
SDL_Texture instead.

Stella is cross-platform, with Windows XP/Vista/7, MacOSX 10.4+ and Linux
supported in the main codebase. It uses Visual Studio 2005/2010, Xcode 3.2
and configure/make, respectively.

My main questions are:

  1. How should I begin? Are there any documents that outline moving a
    large-ish project to SDL 1.3?

  2. When will SDL 1.3/2.0 be officially released? And unofficially, are
    there builds for each of the systems listed above?

  3. What build systems are supported, or more importantly, are the build
    systems I mention above supported?

  4. Based on my short description of the project, do you foresee any
    gotcha’s that I may run into?

Thanks in advance for any info you can provide.

Steve A.
Stella maintainer

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks for the feedback. After looking over the documentation, ironically
enough it seems that the keyboard stuff is going to be hardest to convert!
The video stuff seems fairly straightforward, and audio isn’t an issue at
all.

I can make notes of the process I use, but I don’t know how end-user-
friendly it will be. Obviously whatever I provide will be specific to
Stella, but I guess it’s better to have some documentation than none at
all.

Thanks,
Steve A.
Stella maintainerOn December 29, 2011 5:39:47 AM Sam Lantinga wrote:

  1. There is an introductory migration guide here:
    http://wiki.libsdl.org/moin.cgi/MigrationGuide
    There isn’t anything step by step from the perspective of actually
    doing it, but that would be really nice to have. Maybe you can take
    notes about your process and what you ran into and we can link it from
    there?

2,3. There isn’t an official timeline, but one of the things I’m doing
over the next few weeks is getting the final countdown list of things
that need to be done for release. Unofficially there is build support
for the systems you mentioned, though I haven’t tried the VC 2005
project in a while, so it’s probably out of date, and you may need to
upgrade to XCode 4 for the latest Mac build. YMMV, please send
feedback!

  1. Not that I can think of offhand. Please report any issues you have
    to the mailing list and to http://bugzilla.libsdl.org, and be patient
    since this is a community supported project now. :slight_smile:

Cheers!