[SDL] 2D API evolution (SDL 1.3/2.0)
Sam Lantinga
slouken at devolution.com
Tue Aug 15 10:43:04 PDT 2006
> I guess the real question is then "how many systems are there out there
> with hardware accelerated 2D rotation/scaling/whatever, but no
> OpenGL/Direct3D support ?".
Very few, unfortunately.
If any of you have been following the SDL 1.3 API redesign, you'll see
that I've been wrestling with these issues myself. As David mentioned,
the basic question comes down to:
What features are expected in today's 2D API, and at what point is it
easier to simply use use 3D instead?
My focus with SDL 1.3 has been to redesign the API to take advantage
of 3D hardware acceleration, while providing a feature set that is still
fast using existing 2D APIs.
Here are a set of useful features, and whether they're fast or slow
in different environments:
Feature: 3D hardware: 2D hardware: 2D software:
Pixel Upload Slow* Slow Fast
Copy Blit Fast Fast Fast
Alpha Blit Fast Impossible* Slow
Scale Blit Fast Impossible* Slow
Rotation Fast Impossible* Very Slow
* With some exceptions, depending on hardware and drivers
I've taken the approach of supporting the first four features, since
they can be implemented relatively fast on existing 2D drivers, and
are blazingly fast on today's 3D hardware.
The entire design is flexible, at this point, but the focus is to
keep things fast and simple.
Feel free to take a look at the API so far in SDL_video.h:
http://www.libsdl.org/tmp/SDL-1.3.tar.gz (and .zip)
Currently there are drivers for OpenGL, Direct3D, GDI, and software surfaces.
Also note that most of the existing SDL 1.2 API has been reimplemented on
top of the 1.3 API, and can be found in SDL_compat.h and SDL_compat.c.
BTW, nice to see you again, David. :)
See ya!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment
More information about the SDL
mailing list