2D API evolution (SDL 1.3/2.0)

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;

* OpenGL is not the safest bet for 3D acceleration
  on all systems. Some operating systems favor other
  APIs, and there are 3D accelerators for which there
  are no OpenGL drivers. Implementing OpenGL over
  other 3D APIs has proven to be far from trivial, and
  AFAIK, there are no seriously usable Free/Open
  Source, or even free-as-in-beer solutions at this
  point. (Any progress here lately?)

* OpenGL is not available at all on some platforms -
  even some that provide some, but not all features
  that are more or less required for accelerated
  OpenGL. (Consoles and handheld devices, mostly.)

* OpenGL is overkill if you basically just need a
  supercharger on the rendering backend of the SDL
  1.2 2D API.

* Software OpenGL implementations are usually
  (always?) too slow for real time applications -
  especially on the low end systems that tend to be
  the ones lacking hardware accelerated OpenGL! The
  OpenGL API is not designed to support the shortcuts
  that custom software rasterizers for games need to
  take to achieve playable frame rates. Meanwhile,
  most of these shortcuts aren't even relevant to
  "mostly 2D" applications in the first place.

* Implementing a "mostly 2D" application directly
  over OpenGL can result in an application that is
  hard to adapt to software rendering, or less
  advanced (than OpenGL) accelerated rendering APIs.
  (Of course, any porting job is complicated when
  hard to implement features are missing on the
  target platform...)

What I’m thinking is basically something like a subset of OpenGL,
aimed at 2D rendering with basic transforms and blending. Like the
current SDL API, it should be easy to understand and use, and
(relatively speaking) easy to implement in software as well as over
various 2D and 3D rendering APIs.

An alternative to building higher level features into the SDL API to
allow the backends to accelerate them, is to provide a generic
"Backend Extension Interface", so that add-on libraries can plug into
explicitly supported backends to cooperate with them more intimately.

However, I’m worried that such a solution would do more harm than
good;
“I’m using SDL_PrimitivesA which works great with
OpenGL and software - but I need to use the API
incompatible SDL_PrimitivesB instead to get
acceleration with Direct3D!”

Maybe it’s better to just agree on a feature set, implement software
fallbacks for it, and then keep any accelerated implementations
inside SDL. Full acceleration could actually still be provided by
plugins, to keep the main SDL lib lean and mean, but I have a feeling
it’s not worth the effort.

I was inspired to write this part because I’ve found various extended
versions of glSDL/wrapper with rotation, scaling, accelerated drawing
primitives and whatnot. Stuff that isn’t too hard to implement in
software, and that is trivial to implement over OpenGL, Direct3D and
probably some 2D APIs. Stuff that is pretty much mandatory these
days, when most 2D games are implemented directly over Direct3D, and
even casual gamers expect the kind of look and feel that fully
accelerated 2D can provide.

(The vast majority of these games are developed using various RAD
tools with integrated support for Direct3D, and in some cases, Linux
and/or Mac versions that transparently use OpenGL instead. However,
these tools are not Free/Open Source, and many developers don’t care
much for the language most of these tools use: BASIC. Also, it can’t
be right when the Free/Open Source community is missing something
that is considered standard in the rest of the world. :wink:

That is, now there are applications that either rely on OpenGL to run
at all, or have separate backends for “plain” SDL, but still use a
slightly extended version of the SDL 2D API when rendering through
OpenGL.

Technically, this could be classified as abuse of glSDL/wrapper, as in
"They should be writing their own, proper OpenGL wrapper instead!"
However, I believe it is more useful to take this as a hint as to
what programmers expect from a 2D API today.

The current situation with the new SDL 1.3 backends, various versions
of glSDL/wrapper, people writing their own 2D layers over OpenGL
and/or Direct3D etc is causing confusion, duplication of effort and
portability issues. Now I’m headed there myself, trying to decide
whether to rely entirely on OpenGL, implement support for both OpenGL
and Direct3D and perhaps a software fallback, or maybe investing that
time in SDL 1.3/2.0 instead, or…?

What are the plans for the 2D API of SDL 1.3 and/or 2.0?

//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 --’

Hello !

I do not know about the other things,
but SDL 1.2 will be always an option for
anybody that just wants to use 2D.
It has also support for more systems and backends
than SDL 1.3. It is some things lacking like
MultiWindow Support, but you it should be always possible
to get over these things.

SDL 1.3/2.0 is for me a footstep into a future API.

SDL’s great thing was always to be used
in commercial productions. An important thing that
made SDL public and proved how stable it is.
The new features are
also a question of living or dieing for SDL.

CU

David,

how is the current status of glSDL backend? is there any links to download
the latest SDL 1.2.11 with it embedded?

also, Im interested on glSDL branches that you have named…again…any
link?

btw, Im following the SDL 1.3 development to see how we can use opengl or
d3d to render our 2D stuff.

For the time being…this is an amazing time! soo many news! :slight_smile:

Cheers!> ----- Original Message -----

From: david@olofson.net (David Olofson)
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Monday, August 14, 2006 11:56 PM
Subject: [SDL] 2D API evolution (SDL 1.3/2.0)

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;

  • OpenGL is not the safest bet for 3D acceleration
    on all systems. Some operating systems favor other
    APIs, and there are 3D accelerators for which there
    are no OpenGL drivers. Implementing OpenGL over
    other 3D APIs has proven to be far from trivial, and
    AFAIK, there are no seriously usable Free/Open
    Source, or even free-as-in-beer solutions at this
    point. (Any progress here lately?)

  • OpenGL is not available at all on some platforms -
    even some that provide some, but not all features
    that are more or less required for accelerated
    OpenGL. (Consoles and handheld devices, mostly.)

  • OpenGL is overkill if you basically just need a
    supercharger on the rendering backend of the SDL
    1.2 2D API.

  • Software OpenGL implementations are usually
    (always?) too slow for real time applications -
    especially on the low end systems that tend to be
    the ones lacking hardware accelerated OpenGL! The
    OpenGL API is not designed to support the shortcuts
    that custom software rasterizers for games need to
    take to achieve playable frame rates. Meanwhile,
    most of these shortcuts aren’t even relevant to
    "mostly 2D" applications in the first place.

  • Implementing a “mostly 2D” application directly
    over OpenGL can result in an application that is
    hard to adapt to software rendering, or less
    advanced (than OpenGL) accelerated rendering APIs.
    (Of course, any porting job is complicated when
    hard to implement features are missing on the
    target platform…)

What I’m thinking is basically something like a subset of OpenGL,
aimed at 2D rendering with basic transforms and blending. Like the
current SDL API, it should be easy to understand and use, and
(relatively speaking) easy to implement in software as well as over
various 2D and 3D rendering APIs.

An alternative to building higher level features into the SDL API to
allow the backends to accelerate them, is to provide a generic
"Backend Extension Interface", so that add-on libraries can plug into
explicitly supported backends to cooperate with them more intimately.

However, I’m worried that such a solution would do more harm than
good;
“I’m using SDL_PrimitivesA which works great with
OpenGL and software - but I need to use the API
incompatible SDL_PrimitivesB instead to get
acceleration with Direct3D!”

Maybe it’s better to just agree on a feature set, implement software
fallbacks for it, and then keep any accelerated implementations
inside SDL. Full acceleration could actually still be provided by
plugins, to keep the main SDL lib lean and mean, but I have a feeling
it’s not worth the effort.

I was inspired to write this part because I’ve found various extended
versions of glSDL/wrapper with rotation, scaling, accelerated drawing
primitives and whatnot. Stuff that isn’t too hard to implement in
software, and that is trivial to implement over OpenGL, Direct3D and
probably some 2D APIs. Stuff that is pretty much mandatory these
days, when most 2D games are implemented directly over Direct3D, and
even casual gamers expect the kind of look and feel that fully
accelerated 2D can provide.

(The vast majority of these games are developed using various RAD
tools with integrated support for Direct3D, and in some cases, Linux
and/or Mac versions that transparently use OpenGL instead. However,
these tools are not Free/Open Source, and many developers don’t care
much for the language most of these tools use: BASIC. Also, it can’t
be right when the Free/Open Source community is missing something
that is considered standard in the rest of the world. :wink:

That is, now there are applications that either rely on OpenGL to run
at all, or have separate backends for “plain” SDL, but still use a
slightly extended version of the SDL 2D API when rendering through
OpenGL.

Technically, this could be classified as abuse of glSDL/wrapper, as in
"They should be writing their own, proper OpenGL wrapper instead!"
However, I believe it is more useful to take this as a hint as to
what programmers expect from a 2D API today.

The current situation with the new SDL 1.3 backends, various versions
of glSDL/wrapper, people writing their own 2D layers over OpenGL
and/or Direct3D etc is causing confusion, duplication of effort and
portability issues. Now I’m headed there myself, trying to decide
whether to rely entirely on OpenGL, implement support for both OpenGL
and Direct3D and perhaps a software fallback, or maybe investing that
time in SDL 1.3/2.0 instead, or…?

What are the plans for the 2D API of SDL 1.3 and/or 2.0?

//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 --’


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

__________ Informaci?n de NOD32, revisi?n 1.1706 (20060814) __________

Este mensaje ha sido analizado con NOD32 antivirus system
http://www.nod32.com

My thoughts exactly!

SDL 1.2 is very useful and very portable, and should remain the first
choice for those who need extreme portability. Meanwhile, 1.3/2.0 has
to deal with the shift in the way computer graphics is handled, or
I’m not quite sure what the point is.

Personally, I’d love to stick with software rendering with minimal
hardware support (unlimited control and flexibility, and reliable,
identical results on all platforms), but the hard fact is that the
current generation of computers just aren’t built to be used that
way. Even procedural textures are probably best done by the GPU these
days.

I’m not sure it’s as serious as life or death of SDL as we know it (I
don’t see SDL 1.2 going away any time soon, no matter what) - but
then again, it can’t be a good sign when even an SDL diehard like
myself starts considering alternatives for future projects…

Ok, maybe I’m just a coward for not daring to rely on OpenGL alone?
However, it seems like it’s a fact of life that proper OpenGL support
is only to be expected on the relatively small number of computers
owned by power users and hardcore gamers. This is a rather small user
base if you’re into anything but AAA titles.

So, Direct3D it is. …and OpenGL, because I totally refuse using
Windows as my primary development platform! :smiley:

Now, if/when it comes down to hacking the code anyway, I’d rather
contribute to SDL, or some related effort, than invent and maintain
Yet Another 2D Graphics Library that no one else will use.

//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 15 August 2006 01:40, Torsten Giebl wrote:

Hello !

I do not know about the other things,
but SDL 1.2 will be always an option for
anybody that just wants to use 2D.
It has also support for more systems and backends
than SDL 1.3. It is some things lacking like
MultiWindow Support, but you it should be always possible
to get over these things.

SDL 1.3/2.0 is for me a footstep into a future API.

SDL’s great thing was always to be used
in commercial productions. An important thing that
made SDL public and proved how stable it is.
The new features are
also a question of living or dieing for SDL.

David,

how is the current status of glSDL backend? is there any links to
download the latest SDL 1.2.11 with it embedded?

I’m pretty much out of the loop when it comes to the backend
version… My bet right now is that you’ll find the latest glSDL
backend here:
http://icps.u-strasbg.fr/~marchesin/sdl/

As far as I can tell, it has not yet been included in the official SDL
1.2 or 1.3 trees. According to Bugzilla, there is a glSDL patch for
1.3, but it has issues:
https://bugzilla.libsdl.org/show_bug.cgi?id=6

Last thing I heard on this list:

Hi all!

and what about OpenGL? and glSDL?

They’re coming. I went with D3D first, since I wanted to make sure
the 1.3 API worked smoothly with it, and to see how much performance
it has.
[…]

also, Im interested on glSDL branches that you have
named…again…any link?

The most advanced one seems to be part of the Globulation 2 project:
http://globulation2.org/wiki/Main_Page

…or more specifically:
http://www.koders.com/c/fidE0F18B8CB8CB9C51DE929CDA19655B7F0D08F742.aspx
http://www.koders.com/c/fid8065027F2B23862CD73D1D1370128358B91C9D77.aspx

This is apparently based on the 0.71 version with rotation and scaling
support that was posted on this list:
http://www.libsdl.org/pipermail/sdl/2004-June/062854.html

(The file appears to be gone now, but I have a copy if you want it.)

btw, Im following the SDL 1.3 development to see how we can use
opengl or d3d to render our 2D stuff.

D3D should already be working, it seems, and glSDL is coming when
someone (me or Stephane, maybe, if Sam doesn’t beat us to it) gets
around to look at it.

Some API extensions similar to what I had in mind already seem to be
in place in SDL 1.3, so I guess that answers some of the questions in
my original post… I have some code to read! :slight_smile:

For the time being…this is an amazing time! soo many news! :slight_smile:

Yes, this is most inspiring. I wish I could work full time on this
stuff, but that’s still not the case, unfortunately.

//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 15 August 2006 02:05, Roberto Prieto wrote:
On Saturday 15 July 2006 10:52, Sam Lantinga wrote:

Hello everybody!

first of all, sorry about my poor english.

Good, SDL is a 2D-only API. If you want 3D you have another very good API:
openGL.

I think, when you say “2D API evolution” you are thinking in a 2D+"semi 3D"
SDL API, ?is this?. If is this, I think may be a error. You can use openGL
(3D API) with SDL (2D API) and in the web exist some documentation about
this.

You talk about the new platforms (Consoles and handheld devices, you say), I
think this may be a good idea, but SDL for 2D.

Can be a good idea use the power of openGL for expand the features of SDL, I
dont know.

In all of cases, I think the best is SDL for 2D and, maybe, some extensions
for use openGL.

Is only my idea, I am very new in SDL, just some months :slight_smile:

Altair

Hello !

In all of cases, I think the best is SDL for 2D and, maybe, some
extensions for use openGL.

Is only my idea, I am very new in SDL, just some months :slight_smile:

That is what SDL 1.2 is for. But especially for the next
generation we need a SDL 1.3 that makes it easy to init
for example a Direct3D mode and then let the user use
this Mode. And the thing is even today a 3D card for example
the 2nd generation behind the actual standard is so cheap that
nearly everbody can buy one. For example the most oldskool games
that are sprite based benefit from the ultra fast blitting and the
alpha blending stuff as well. Vector games can use the OpenGL line
drawing functions.

CU

I was inspired to write this part because I’ve found various extended
versions of glSDL/wrapper with rotation, scaling, accelerated drawing
primitives and whatnot. Stuff that isn’t too hard to implement in
software, and that is trivial to implement over OpenGL, Direct3D and
probably some 2D APIs. Stuff that is pretty much mandatory these
days, when most 2D games are implemented directly over Direct3D, and
even casual gamers expect the kind of look and feel that fully
accelerated 2D can provide.

Have a look at www.libavg.de (if I do say so myself ;-). It currently
exposes a python api only, but the python interface is a thin layer over
a C++ api. All you’d need to do is build it so it exposes that :-).

Cheers,

Uli> From: “David Olofson”

Hello !

Ok, maybe I’m just a coward for not daring to rely on OpenGL alone?
However, it seems like it’s a fact of life that proper OpenGL support
is only to be expected on the relatively small number of computers owned by
power users and hardcore gamers. This is a rather small user base if
you’re into anything but AAA titles.

So, Direct3D it is. …and OpenGL, because I totally refuse using
Windows as my primary development platform! :smiley:

Why ? I mean today a 3D card is pretty cheap, okay not an actual
one but a generation or two behind still has good speed and is really
cheap. The cards that i used over the years all had good OpenGL
and DirectX drivers. NVIDIA was the only choice for Linux users
a long time, but now maybe AMD+ATI will make the driver open source.

Also the crap built in IBM 3D Chipsets will get OpenSource drivers,
which will make many Laptop Users happy.

CU

Hello !

Also the crap built in IBM 3D Chipsets will get OpenSource drivers,
which will make many Laptop Users happy.

Correction: I meant the Intel 3D Chipsets.

CU

The problem isn’t the cost or availability of video cards or drivers.

The problem is the combination of the average user who doesn’t even
know what a driver is, and Microsoft’s desire to eliminate OpenGL as
a mainstream technology on the Windows platform.

It doesn’t matter that a proper OpenGL + Direct3D driver practically
downloads and installs itself on Windows these days, or that some
serious PCs come preinstalled with the latest drivers for everything.
The average surfing + casual gaming PC is still running a clean
Windows install with nothing but the drivers included on the CD.
What’s worse, it’s your game that is blamed when it doesn’t Just
Work™ out of the box.

"All other games work on my PC, and this one
 doesn't, so this game is obviously crap!"

Of course, we can dream about the entire developer community just
boycotting Direct3D until Microsoft starts to include proper OpenGL
drivers on the Windows CDs - but I don’t see anything like that
happening, ever. (That said, if it weren’t because of John Carmack
and supporters, we’d probably not have accelerated OpenGL at all on
consumer hardware…)

Note that AAA titles and all Free/Open Source games are just a
fraction of the market, aimed at hardcore gamers and power users!
Whatever hardware and drivers this minority of gamers may be using is
pretty much irrelevant to the large volume casual games market.

Of course, there’s theoretically nothing wrong with focusing SDL
1.3/2.0 on power users and hardcore gamers, but it just doesn’t seem
to make sense to me. SDL 1.2 + OpenGL is pretty much all you’ll ever
need to support that user base, I think - so?why bother with 1.3/2.0
if that is the only target user base?

//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 15 August 2006 12:50, Torsten Giebl wrote:

Hello !

Ok, maybe I’m just a coward for not daring to rely on OpenGL
alone? However, it seems like it’s a fact of life that proper
OpenGL support is only to be expected on the relatively small
number of computers owned by power users and hardcore gamers. This
is a rather small user base if you’re into anything but AAA
titles.

So, Direct3D it is. …and OpenGL, because I totally refuse using
Windows as my primary development platform! :smiley:

Why ? I mean today a 3D card is pretty cheap, okay not an actual
one but a generation or two behind still has good speed and is
really
cheap. The cards that i used over the years all had good OpenGL
and DirectX drivers. NVIDIA was the only choice for Linux users
a long time, but now maybe AMD+ATI will make the driver open source.

Also the crap built in IBM 3D Chipsets will get OpenSource drivers,
which will make many Laptop Users happy.

Hi again David,

well, you have given me a lot of stuff :), I have downloaded all but as you
said, that special version 0.71 is not available, so please,
could you send me a copy of it? Im looking for to compare all trees to see
what is the most stable.

Thanks you very much in advance!!!

Roberto> ----- Original Message -----

From: david@olofson.net (David Olofson)
To: "A list for developers using the SDL library. (includes SDL-announce)"

Sent: Tuesday, August 15, 2006 5:24 AM
Subject: Re: [SDL] 2D API evolution (SDL 1.3/2.0)

On Tuesday 15 August 2006 02:05, Roberto Prieto wrote:

David,

how is the current status of glSDL backend? is there any links to
download the latest SDL 1.2.11 with it embedded?

I’m pretty much out of the loop when it comes to the backend
version… My bet right now is that you’ll find the latest glSDL
backend here:
http://icps.u-strasbg.fr/~marchesin/sdl/

As far as I can tell, it has not yet been included in the official SDL
1.2 or 1.3 trees. According to Bugzilla, there is a glSDL patch for
1.3, but it has issues:
https://bugzilla.libsdl.org/show_bug.cgi?id=6

Last thing I heard on this list:

On Saturday 15 July 2006 10:52, Sam Lantinga wrote:

Hi all!

and what about OpenGL? and glSDL?

They’re coming. I went with D3D first, since I wanted to make sure
the 1.3 API worked smoothly with it, and to see how much performance
it has.
[…]

also, Im interested on glSDL branches that you have
named…again…any link?

The most advanced one seems to be part of the Globulation 2 project:
http://globulation2.org/wiki/Main_Page

…or more specifically:
http://www.koders.com/c/fidE0F18B8CB8CB9C51DE929CDA19655B7F0D08F742.aspx
http://www.koders.com/c/fid8065027F2B23862CD73D1D1370128358B91C9D77.aspx

This is apparently based on the 0.71 version with rotation and scaling
support that was posted on this list:
http://www.libsdl.org/pipermail/sdl/2004-June/062854.html

(The file appears to be gone now, but I have a copy if you want it.)

btw, Im following the SDL 1.3 development to see how we can use
opengl or d3d to render our 2D stuff.

D3D should already be working, it seems, and glSDL is coming when
someone (me or Stephane, maybe, if Sam doesn’t beat us to it) gets
around to look at it.

Some API extensions similar to what I had in mind already seem to be
in place in SDL 1.3, so I guess that answers some of the questions in
my original post… I have some code to read! :slight_smile:

For the time being…this is an amazing time! soo many news! :slight_smile:

Yes, this is most inspiring. I wish I could work full time on this
stuff, but that’s still not the case, unfortunately.

//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 --’


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

__________ Informaci?n de NOD32, revisi?n 1.1707 (20060815) __________

Este mensaje ha sido analizado con NOD32 antivirus system
http://www.nod32.com

I’m sending it off-list.

I’d be interested in your conclusions. Please report! :slight_smile:

//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 15 August 2006 14:04, Roberto Prieto wrote:

Hi again David,

well, you have given me a lot of stuff :), I have downloaded all but
as you said, that special version 0.71 is not available, so please,
could you send me a copy of it? Im looking for to compare all trees
to see what is the most stable.

Thanks you very much in advance!!!

I have to agree here.

Even though I don’t work on the games industry,
I know a few people that do. And I also attended
a few GDC already.

And the reality is:

a) You as a developer get a lot of support when
using DX by comparison with what you get from
OpenGL. I know sometimes this is just marketing,
but it works.

b) When developing games on Windows many developers
are already using the other DX subsystems so they
just go with D3D as well for the graphics part.

c) As David says, many users just use a vanilla
Windows installation with drivers that only provide
DX drivers. Even if the card is using a NVidia or
ATI chipset, you might not be able to use their
drivers without some hacking. Just remeber the
laptop users.

d) The latest announcement from Microsoft to provide
a cheap XBox 360 dev kit will make DX even more prevalent
as a games development library.

So I agree that a D3D backend should also be required
for SDL in the future.

Actually that might even be a requirement on Windows
when (if ever) we get Vista. Remeber that DirectDraw
is no longer part of the API.

Just my .02 ?,
Paulo

Quoting David Olofson :> On Tuesday 15 August 2006 12:50, Torsten Giebl wrote:

Hello !

Ok, maybe I’m just a coward for not daring to rely on OpenGL
alone? However, it seems like it’s a fact of life that proper
OpenGL support is only to be expected on the relatively small
number of computers owned by power users and hardcore gamers. This
is a rather small user base if you’re into anything but AAA
titles.

So, Direct3D it is. …and OpenGL, because I totally refuse using
Windows as my primary development platform! :smiley:

Why ? I mean today a 3D card is pretty cheap, okay not an actual
one but a generation or two behind still has good speed and is
really
cheap. The cards that i used over the years all had good OpenGL
and DirectX drivers. NVIDIA was the only choice for Linux users
a long time, but now maybe AMD+ATI will make the driver open source.

Also the crap built in IBM 3D Chipsets will get OpenSource drivers,
which will make many Laptop Users happy.

The problem isn’t the cost or availability of video cards or drivers.

The problem is the combination of the average user who doesn’t even
know what a driver is, and Microsoft’s desire to eliminate OpenGL as
a mainstream technology on the Windows platform.

It doesn’t matter that a proper OpenGL + Direct3D driver practically
downloads and installs itself on Windows these days, or that some
serious PCs come preinstalled with the latest drivers for everything.
The average surfing + casual gaming PC is still running a clean
Windows install with nothing but the drivers included on the CD.
What’s worse, it’s your game that is blamed when it doesn’t Just
Work™ out of the box.

“All other games work on my PC, and this one
doesn’t, so this game is obviously crap!”

Of course, we can dream about the entire developer community just
boycotting Direct3D until Microsoft starts to include proper OpenGL
drivers on the Windows CDs - but I don’t see anything like that
happening, ever. (That said, if it weren’t because of John Carmack
and supporters, we’d probably not have accelerated OpenGL at all on
consumer hardware…)

Note that AAA titles and all Free/Open Source games are just a
fraction of the market, aimed at hardcore gamers and power users!
Whatever hardware and drivers this minority of gamers may be using is
pretty much irrelevant to the large volume casual games market.

Of course, there’s theoretically nothing wrong with focusing SDL
1.3/2.0 on power users and hardcore gamers, but it just doesn’t seem
to make sense to me. SDL 1.2 + OpenGL is pretty much all you’ll ever
need to support that user base, I think - so why bother with 1.3/2.0
if that is the only target user base?

//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 --’


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


This message was sent using IMP, the Internet Messaging Program.

Hello !

Actually that might even be a requirement on Windows
when (if ever) we get Vista. Remeber that DirectDraw is no longer part of
the API.

There is already a DirectX Part in SDL 1.3.

CU

Hello !

The problem is the combination of the average user who doesn’t even
know what a driver is, and Microsoft’s desire to eliminate OpenGL as a
mainstream technology on the Windows platform.

It doesn’t matter that a proper OpenGL + Direct3D driver practically
downloads and installs itself on Windows these days, or that some serious
PCs come preinstalled with the latest drivers for everything.
The average surfing + casual gaming PC is still running a clean
Windows install with nothing but the drivers included on the CD.
What’s worse, it’s your game that is blamed when it doesn’t Just
Work™ out of the box.

“All other games work on my PC, and this one
doesn’t, so this game is obviously crap!”

Of course, we can dream about the entire developer community just
boycotting Direct3D until Microsoft starts to include proper OpenGL drivers
on the Windows CDs - but I don’t see anything like that happening, ever.
(That said, if it weren’t because of John Carmack
and supporters, we’d probably not have accelerated OpenGL at all on
consumer hardware…)

Note that AAA titles and all Free/Open Source games are just a
fraction of the market, aimed at hardcore gamers and power users! Whatever
hardware and drivers this minority of gamers may be using is pretty much
irrelevant to the large volume casual games market.

Of course, there’s theoretically nothing wrong with focusing SDL
1.3/2.0 on power users and hardcore gamers, but it just doesn’t seem
to make sense to me. SDL 1.2 + OpenGL is pretty much all you’ll ever need
to support that user base, I think - so why bother with 1.3/2.0 if that is
the only target user base?

Sorry i still don’t understand the problem.

A few simple cases :

  1. You are writing a 2D application, like an oldschool
    JumpNrun for example. SDL 1.2 is the perfect choice
    for you, it supports a lot of backends and is well and long tested.

  2. You are writing a 2D application, but need for using
    a lot of Alpha Blending stuff hardware acceleration. SDL 1.3
    is your best choice it supports OpenGL, DirectX, X11 and the
    user can choice whatever is the fastest on his system.
    A way to make it easier is to include a little benchmark into your game
    just testing the different backends and printing out the max. FPS.

  3. You are writing a 3D game. You are already bitten today even without
    SDL. You have to choice what System you use. Is your game only
    for Windows and XBOXes. DirectX is perfect. Do you want to get it also
    running on Mac OS X and Linux you have to write it with OpenGL. If you
    now write two backends and be safe or just write the OpenGL backend
    and people may yell about the bad performance is not a problem
    that could be solved by SDL. Linux users most of the time
    are pretty advanced in the knowledge of the system. Even the … Windows
    User today install the NVIDIA or ATI driver on his system and both
    provide good OpenGL drivers.

CU

Hello !
Sorry i still don’t understand the problem.

A few simple cases :

  1. You are writing a 2D application, like an oldschool
    JumpNrun for example. SDL 1.2 is the perfect choice
    for you, it supports a lot of backends and is well and long tested.

  2. You are writing a 2D application, but need for using
    a lot of Alpha Blending stuff hardware acceleration. SDL 1.3
    is your best choice it supports OpenGL, DirectX, X11 and the
    user can choice whatever is the fastest on his system.
    A way to make it easier is to include a little benchmark into your game
    just testing the different backends and printing out the max. FPS.

  3. You are writing a 3D game. You are already bitten today even without
    SDL. You have to choice what System you use. Is your game only
    for Windows and XBOXes. DirectX is perfect. Do you want to get it also
    running on Mac OS X and Linux you have to write it with OpenGL. If you
    now write two backends and be safe or just write the OpenGL backend
    and people may yell about the bad performance is not a problem
    that could be solved by SDL. Linux users most of the time
    are pretty advanced in the knowledge of the system. Even the … Windows
    User today install the NVIDIA or ATI driver on his system and both
    provide good OpenGL drivers.

CU

Well, not all games fit into those molds perfectly. Aleph One for example:

  • is a 3D game, but has a software renderer, which needs to update more
    than half of a 640x480 buffer 30 times a second. On old machines that
    don’t have OpenGL (or even direct3D support), this means directfb or
    directx or drawsprocket (which I can’t get working, btw) is essential.
    And it seems like SDL 1.2 is the way to go for this kind of stuff on old
    machines.

  • Uses the directx backend for software rendering on windows right now,
    which is buggy. Could use D3D backend on newer machines that have 3D
    hardware but don’t have enough oomph (or video driver functionality) to
    use the OpenGL renderer (laptops with integrated video, etc.) which I
    suspect will be supported better than the old directx driver, but that
    would leave out lots of old machines that don’t have any 3D hardware.

  • Doesn’t use alpha blending for its 2D rendering; it just needs a fast
    way to dump a lot of pixels to the screen

  • has an OpenGL renderer as well, but no plans for Direct3D as far as I’m
    aware

  • works (sort of; for some reason I don’t get accelerated blits, or gamma
    faders) in Classic Mac OS, and I still get requests all the time to get
    networking working there. Lots of old macs out there I guess?

  • would benefit from the audio capture support going into 1.3

It looks to me like supporting both 1.2 (for directx, classic Mac OS, and
I think somebody did a dreamcast port?) and 1.3 (Vista, Mac OS X, X11) by
using #defines is going to be the way to go with Aleph One. The one
problem I see with this approach is I’ll need separate Windows builds for
directx (SDL 1.2) vs D3D backend/OpenGL (1.3).

C’est la vie.

GregoryOn Tue, 15 Aug 2006, Torsten Giebl wrote:

[…]

Sorry i still don’t understand the problem.

A few simple cases :

  1. You are writing a 2D application, like an oldschool
    JumpNrun for example. SDL 1.2 is the perfect choice
    for you, it supports a lot of backends and is well and long tested.

  2. You are writing a 2D application, but need for using
    a lot of Alpha Blending stuff hardware acceleration. SDL 1.3
    is your best choice it supports OpenGL, DirectX, X11 and the
    user can choice whatever is the fastest on his system.
    A way to make it easier is to include a little benchmark into your
    game just testing the different backends and printing out the max.
    FPS.

  3. You are writing a 3D game. You are already bitten today even
    without SDL. You have to choice what System you use. Is your game
    only for Windows and XBOXes. DirectX is perfect. Do you want to get
    it also running on Mac OS X and Linux you have to write it with
    OpenGL. If you now write two backends and be safe or just write the
    OpenGL backend and people may yell about the bad performance is not
    a problem that could be solved by SDL. Linux users most of the time
    are pretty advanced in the knowledge of the system. Even the …
    Windows User today install the NVIDIA or ATI driver on his system
    and both provide good OpenGL drivers.

I think there are a few simple cases missing between 2 and 3. What
defines 2D and what defines 3D? How much, beyond single pixel
plotting are you allowed to do before you’re forced to use OpenGL
and/or Direct3D? Rectangular blits? Colorkeying? Alpha blending?
Additive blending? Scaling? Rotation? Other 2D transforms?

As it is, if you want to make something that looks and feels serious
by current standards (and I’m talking casual games - not AAA 3D
titles), you have to support one or two 3D APIs pretty much no matter
what type of game you want to do. I would say a game that runs well
and looks nice without full acceleration is the exception rather than
the rule.

Rectangular blits, colorkey and alpha have been around for a good
while, although AFAIK, alpha wasn’t even accelerated by any 2D APIs
around when that feature was added. Seems like additional blend modes
are already in 1.3. (?) Accelerated scaling was mentioned long ago,
and IIRC, it’s in the TODO for 1.3.

How about rotation, or preferably, the superset of that; single plane
four point transform? (Like OpenGL quads with 2D coordinates only.)
Still rather basic rendering if you were to implement it in software,
and most trivial to implement over any 3D API, of course.

IMHO, it just doesn’t make sense to learn one or two 3D APIs as soon
as you need any of these fundamental 2D features, that have been
accelerated in mainstream hardware for at least ten years now. Nor
does it make sense to implement two or even three versions to ensure
portability without going for the (s)lowest common denominator.

Now, if you need much more than that, you probably do need a 3D API,
and as it is, there isn’t much we can do about the situation.
Direct3D for Windows-only, OpenGL for portability, both if you want
both portability and the casual gamer user base. Besides, when
developing an actual 3D engine, learning one or even two rendering
APIs is a relatively small part of the job, so not the end of the
world, really.

My point is that the more you can do - within reasonable limits -
before you’re forced into this OpenGL vs Direct3D situation, the
better.

//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 15 August 2006 15:21, Torsten Giebl wrote:

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;

  • OpenGL is not the safest bet for 3D acceleration
    on all systems. Some operating systems favor other
    APIs, and there are 3D accelerators for which there
    are no OpenGL drivers. Implementing OpenGL over
    other 3D APIs has proven to be far from trivial, and
    AFAIK, there are no seriously usable Free/Open
    Source, or even free-as-in-beer solutions at this
    point. (Any progress here lately?)

Microsoft will be shipping their highly criticized "opengl-over-directx"
in windows vista. I see this as some form of progress.

  • OpenGL is not available at all on some platforms -
    even some that provide some, but not all features
    that are more or less required for accelerated
    OpenGL. (Consoles and handheld devices, mostly.)

How long before all these devices feature OpenGL-ES ?

  • OpenGL is overkill if you basically just need a
    supercharger on the rendering backend of the SDL
    1.2 2D API.

  • Software OpenGL implementations are usually
    (always?) too slow for real time applications -
    especially on the low end systems that tend to be
    the ones lacking hardware accelerated OpenGL! The
    OpenGL API is not designed to support the shortcuts
    that custom software rasterizers for games need to
    take to achieve playable frame rates. Meanwhile,
    most of these shortcuts aren’t even relevant to
    "mostly 2D" applications in the first place.

  • Implementing a “mostly 2D” application directly
    over OpenGL can result in an application that is
    hard to adapt to software rendering, or less
    advanced (than OpenGL) accelerated rendering APIs.
    (Of course, any porting job is complicated when
    hard to implement features are missing on the
    target platform…)

There was the recent Xglx buzz, and the issue that some drivers had no
OpenGL acceleration at all (and sometimes the hardware is not able to
provide it) was raised. One possible solution that was proposed was
providing some “2D only” subset of OpenGL which only accelerates the
minimal requirements for 2D usage.

What I’m thinking is basically something like a subset of OpenGL,
aimed at 2D rendering with basic transforms and blending. Like the
current SDL API, it should be easy to understand and use, and
(relatively speaking) easy to implement in software as well as over
various 2D and 3D rendering APIs.

An alternative to building higher level features into the SDL API to
allow the backends to accelerate them, is to provide a generic
"Backend Extension Interface", so that add-on libraries can plug into
explicitly supported backends to cooperate with them more intimately.

However, I’m worried that such a solution would do more harm than
good;
“I’m using SDL_PrimitivesA which works great with
OpenGL and software - but I need to use the API
incompatible SDL_PrimitivesB instead to get
acceleration with Direct3D!”

Maybe it’s better to just agree on a feature set, implement software
fallbacks for it, and then keep any accelerated implementations
inside SDL. Full acceleration could actually still be provided by
plugins, to keep the main SDL lib lean and mean, but I have a feeling
it’s not worth the effort.

I was inspired to write this part because I’ve found various extended
versions of glSDL/wrapper with rotation, scaling, accelerated drawing
primitives and whatnot. Stuff that isn’t too hard to implement in
software, and that is trivial to implement over OpenGL, Direct3D and
probably some 2D APIs. Stuff that is pretty much mandatory these
days, when most 2D games are implemented directly over Direct3D, and
even casual gamers expect the kind of look and feel that fully
accelerated 2D can provide.

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 ?”.
If these end up being a fair amount, it might be worth designing an API
for that use. Otherwise, layering on top of these 2 APIs is sufficient…

Stephane

David Olofson wrote:

David,

how is the current status of glSDL backend? is there any links to
download the latest SDL 1.2.11 with it embedded?

I’m pretty much out of the loop when it comes to the backend
version… My bet right now is that you’ll find the latest glSDL
backend here:
http://icps.u-strasbg.fr/~marchesin/sdl/

As far as I can tell, it has not yet been included in the official SDL
1.2 or 1.3 trees. According to Bugzilla, there is a glSDL patch for
1.3, but it has issues:
https://bugzilla.libsdl.org/show_bug.cgi?id=6

FWIW, it works fine here on SDL 1.2. SDL 1.3 is a different story
altogether, having new internal interfaces which mandates a rewrite of
glSDL.

Last thing I heard on this list:

Hi all!

and what about OpenGL? and glSDL?

They’re coming. I went with D3D first, since I wanted to make sure
the 1.3 API worked smoothly with it, and to see how much performance
it has.

[…]

also, Im interested on glSDL branches that you have
named…again…any link?

The most advanced one seems to be part of the Globulation 2 project:
http://globulation2.org/wiki/Main_Page

…or more specifically:
http://www.koders.com/c/fidE0F18B8CB8CB9C51DE929CDA19655B7F0D08F742.aspx
http://www.koders.com/c/fid8065027F2B23862CD73D1D1370128358B91C9D77.aspx

This is apparently based on the 0.71 version with rotation and scaling
support that was posted on this list:
http://www.libsdl.org/pipermail/sdl/2004-June/062854.html

(The file appears to be gone now, but I have a copy if you want it.)

As a side note, they complained about lack of accelerated lines once.
Drawing software lines and uploading them to OpenGL is really too slow.
I think that’s the reason that pushed that project to integrate a
variant of glSDL and change it to suit their needs.

btw, Im following the SDL 1.3 development to see how we can use
opengl or d3d to render our 2D stuff.

D3D should already be working, it seems, and glSDL is coming when
someone (me or Stephane, maybe, if Sam doesn’t beat us to it) gets
around to look at it.

The internal SDL API has changed. I don’t really have time to invest
into learning it right now and porting glSDL, I’m already quite busy
with other projects and work. So I guess it’s up to you David :smiley:

Some API extensions similar to what I had in mind already seem to be
in place in SDL 1.3, so I guess that answers some of the questions in
my original post… I have some code to read! :slight_smile:

For the time being…this is an amazing time! soo many news! :slight_smile:

Yes, this is most inspiring. I wish I could work full time on this
stuff, but that’s still not the case, unfortunately.

Same here. Sadly.

Stephane> On Tuesday 15 August 2006 02:05, Roberto Prieto wrote:

On Saturday 15 July 2006 10:52, Sam Lantinga wrote: