[SDL] 2D API evolution (SDL 1.3/2.0)

Bob Pendleton bob at pendleton.com
Tue Aug 15 08:41:47 PDT 2006


On Mon, 2006-08-14 at 23:56 +0200, David Olofson wrote:
> I've been thinking about 2D rendering APIs every now and then, and I 
> usually come to the conclusion that if you want more than the SDL 1.2 
> 2D API, you're better of using OpenGL. (If you're into massive 
> blending and transformation effects, and don't care much about non 
> hardcore gamers running MS Windows, I still maintain this position.)
> 
> However, using OpenGL as the rendering API for a "mostly 2D" 
> application has several issues;

[Big Snip]

I agree with your concerns, but I think I come to it from a different
point of view. First off, I think a large part of the value of SDL 1.2
is the 2D API. It is hardly complete, but it does let you do a lot
without having to learn very much, and it has pretty good performance. I
believe it could be made complete and made to provide excellent
performance an many/most platforms.

The key part of what I just said is that you don't have to learn very
much to use it. And, since it is portable and reasonably stable (almost
static) you can learn it once and use it for years. The value here is
that you spend most of your time using the API, not learning the API.
This is very important to those of us who want to spend out time writing
applications rather than spending our time reading yet another set of
documents.

I for one am tired of chasing the train. I first learn DirectX when it
was called the GDK (and I learned WinG before that). Then had to relearn
a bunch of stuff for DirectX 1.0, 2.0, ... and 10.1 is coming out.
OpenGL isn't nearly as bad, but mostly because it's development has
moved so slowly. I would like to see an API the is a high level
abstraction for 2D and for 3D that can stay reasonably stable while
taking advantage of new versions of APIs to provide better performance.
The API should be extended when new hardware features are introduced,
but only after we have a chance to study at least a couple of early APIs
that support the hardware. In other words, the API I would be a follower
not a leader, but would always provide a highly abstracted highly
portable API.

The problem with what I want is that it might not keep up with the
latest hardware as fast as some programmers would like. The simple truth
is that people who want to use the bleeding edge stuff will have to use
proprietary non-portable APIs. Perhaps we can provide hooks to let them
use them comfortably from within a portable API, perhaps not. I
interpret a lot of the angst I see on the list as a conflict between
people wanting the performance of pure OpenGL/DirectX while wanting the
simplicity, ease of learning, and ease of coding, they find in SDL.

IMHO it would not be that hard to design and develop a 2D graphic API
that includes both pixel based operations as well as basic graphic
primitives and 2D scaling and rotation. Such an API could be layered on
top of DirectX/OpenGL, as well as providing a full software
implementation. My guess is that such an API probably already exists and
we can just use it. I say this based on having written all the parts of
such an API at different times in the last 30 years. I have detailed
personal experience of what goes into such a project. Something similar
could be done for 3D graphics.

If you want to see a pretty good attempt at building a 3D graphics API
that works well on top of both OpenGL and DirectX take a look at Java3D.
Yes, I too can spend a week listing what is wrong with it, but take a
look at what is right with it. No, I am not suggesting we adopt anything
like Java3D into SDL, I am just suggesting that taking a good look at
Java3D is good for you graphics education. (I should also point out that
one of the designers of Java3D is a fellow I used to work with at E&S
and so I am biased in his favor and I understand why Java3D looks so
much like the function networks used in the old E&S PS300 series.)

I think the release of the XBox development system can be a real
opportunity to make SDL even more widely used than it already is. A lot
of people are going to start trying to write games for the XBox. About
the second day after starting to work on their game they are going to go
running to the Internet looking for tools that will hide all the ugly
details of DirectX programming. SDL is bound to be ported to the XBox
shortly after that. The better the 2D/3D support is the more SDL will be
used on the XBox.

		Bob Pendleton

-- 
+--------------------------------------+
+ Bob Pendleton: writer and programmer +
+ email: Bob at Pendleton.com             +
+ web: www.GameProgrammer.com          +
+ www.Wise2Food.com                    +
+ nutrient info on 7,000+ common foods +
+--------------------------------------+






More information about the SDL mailing list