[…]
Well, you can go a long way with the old SDL 2D API, and it has the
advantage of being well known and very portable. Some minor
extensions (more blending modes etc) won’t hurt, and won’t break 1.2
compatibility much, if at all.
(Speaking of extensions; I added some stuff like that to glSDL 0.8;
color modulation, scaling and rotation, more specifically. I designed
it like an OpenGL style state machine that affects (gl)SDL
operations, so no extra arguments need to be added to existing calls,
and the default state is set up so that SDL 1.2 compatibility is
maintained as long as you don’t mess with the new state stuff.)
OTOH, it seems like most developers these days (at least those doing
shareware games and similar stuff on a more or less professional
level) expect and require a “2D” API similar to what varius BASIC
derivates and other RAD tools on the Windows platform have to offer -
and that’s probably more like option 1.
It seems that if SDL is to keep up with the current state of "2D"
rendering, 1 is the way to go - but that might take a great part of
the “S” out of SDL, as well as breaking compatibility with existing
code, documentation, tutorials etc.
So, it seems like the usual case of “you can’t have it all”… Or
maybe not?
What I’m thinking about is this “SDL Advanced2D” stuff I was planning,
either as an evolution of glSDL (more of those glSDL 0.8 style
extensions, basically), and/or as some sort of plugin for SDL
1.3/2.0. I think the latter could come out pretty nice if SDL 1.3
provides some sort of plugin/backend API; some “raw” access to video
backend resources and stuff like that.
Of course, one could just implement it as a separate add-on library
(or a compile time wrapper like glSDL; the difference is just a bunch
of ugly #defines) that essentially replaces all SDL video calls and
backends, but to some extent, that defeats the point of using SDL in
the first place. It would be nicer if one could stick with the good
old SDL surfaces in application code as well as add-on libs, and have
it all Just Work™ together out of the box most of the time.
That is, my vote is something like “2), but allow for add-on libs and
applications to hook into the backends as needed to implement 1)”.
As to the "you’re better off using OpenGL for advanced rendering"
argument, well yes, I agree - but Microsoft does not, unfortunately.
SDL can’t realistically fix this for every case (that would require a
brand new 3D API that can replace OpenGL and Direct3D entirely), but
providing the (relatively speaking) rudimentary rendering features
that most modern “2D” games require should go a long way. The real
life alternative seems to be that applications needing such features
either run on Windows only (Direct3D), or does not run properly on
the majority of Windows systems as a result of relying on OpenGL. We
can blame this situations on Microsoft, Windows user, lazy developers
or whatever all we want, but that doesn’t make the problem go away.
//David Olofson - Programmer, Composer, Open Source Advocate
.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Tuesday 31 July 2007, Sam Lantinga wrote:
So I’m reviewing the feature list for SDL 1.3, and looking at the
video API.
Given the state of hardware and 3D today, which would people find
more useful:
- A brand new texture API with the following features:
- color modulation, alpha blending, linear/bilinear scaling
- Acceleration of the existing SDL_Surface API, similar to glSDL