The future of SDL/directx

Now that SDL is using windib by default, and a bug of mine was closed
because it’s fixed in windib, what are the plans for support of the
directx 5 driver?

I almost get the impression it’s being phased out, which wouldn’t be a
good thing. Windib doesn’t offer any hardware acceleration, and some
things we take advantage of don’t work (like SDL_SetGammaRamp). The
difference is striking on my Pentium II between when I get a hardware
surface (where the game runs at the cap of 30 fps), and a software surface
(around 12 fps).

Unfortunately the directx driver has some issues of its own still going
from fullscreen no-OpenGL to fullscreen OpenGL (although I have yet to try
the most recent CVS, but I think our next release may come before SDL
1.2.10), so at the moment when the user switches between the OpenGL
renderer and the software renderer, we make him restart so we can switch
SDL’s drivers.

Is glSDL and windib the way to get hardware accelerated 2D going forward?
This is a questionable choice given we don’t know what will happen with
OpenGL in Vista, and many older machines (who need hardware accelerated 2D
the most) don’t support OpenGL well.

Or am I just paranoid and directx isn’t going to be ignored :slight_smile:

Gregory

Gregory Smith wrote:

Now that SDL is using windib by default, and a bug of mine was closed
because it’s fixed in windib, what are the plans for support of the
directx 5 driver?

I almost get the impression it’s being phased out, which wouldn’t be a
good thing. Windib doesn’t offer any hardware acceleration, and some
things we take advantage of don’t work (like SDL_SetGammaRamp). The
difference is striking on my Pentium II between when I get a hardware
surface (where the game runs at the cap of 30 fps), and a software surface
(around 12 fps).

Unfortunately the directx driver has some issues of its own still going
from fullscreen no-OpenGL to fullscreen OpenGL (although I have yet to try
the most recent CVS, but I think our next release may come before SDL
1.2.10), so at the moment when the user switches between the OpenGL
renderer and the software renderer, we make him restart so we can switch
SDL’s drivers.

Is glSDL and windib the way to get hardware accelerated 2D going forward?
This is a questionable choice given we don’t know what will happen with
OpenGL in Vista, and many older machines (who need hardware accelerated 2D
the most) don’t support OpenGL well.

Or am I just paranoid and directx isn’t going to be ignored :slight_smile:

Frankly, the directx 5 backend is not a future proof backend,
considering support for directx 5 will be lacking in future windows
releases, and driver support is already falling apart. For windows,
someone should probably write a directx 9 backend for SDL, plus this
would also allow hardware accelerated alpha blits (no, I didn’t
volunteer here, but I think people on this list would gladly help anyone
undertaking this task).

Stephane

Frankly, the directx 5 backend is not a future proof backend,
considering support for directx 5 will be lacking in future windows
releases, and driver support is already falling apart. For windows,
someone should probably write a directx 9 backend for SDL, plus this
would also allow hardware accelerated alpha blits (no, I didn’t
volunteer here, but I think people on this list would gladly help anyone
undertaking this task).

I agree with Stephane: especially now that glSDL is definitely going in,
it only makes sense to add a d3dSDL. There is no DirectDraw anymore, so
matching what glSDL does with Direct3D is both the fastpath and most
future-proof way to handle 2D rendering on Windows.

Granted, this will start a long thread of emails asking us to add a
SDL_DIRECT3D flag to SDL_SetVideoMode to match SDL_OPENGL…

–ryan.

I agree with Stephane: especially now that glSDL is definitely going in,
it only makes sense to add a d3dSDL. There is no DirectDraw anymore, so
matching what glSDL does with Direct3D is both the fastpath and most
future-proof way to handle 2D rendering on Windows.

Unfortunately, neither is suitable for an (optionally) software-rendered
FPS like Aleph One. The ability to touch all the pixels on the screen
directly 30 times a second is something I guess will just be lost when
DirectDraw goes away?

Or have video subsystems become fast enough to draw to a high resolution
texture at 30 fps?

The ultimate overkill solution may be to write a D3D renderer to
complement our OpenGL renderer–how distasteful–which brings up the
question:

Granted, this will start a long thread of emails asking us to add a
SDL_DIRECT3D flag to SDL_SetVideoMode to match SDL_OPENGL…

–ryan.

Hehe.

GregoryOn Mon, 20 Mar 2006, Ryan C. Gordon wrote:

Le Mon, 20 Mar 2006 16:48:23 -0500 (EST)
Gregory Smith a ?crit:> On Mon, 20 Mar 2006, Ryan C. Gordon wrote:

Granted, this will start a long thread of emails asking us to add a
SDL_DIRECT3D flag to SDL_SetVideoMode to match SDL_OPENGL…

Hehe.

I wonder why SDL developpers would bother with SDL_DIRECT3D applications
you could only run on 1 platform ;-). At last, OpenGL has more platforms
that support it through SDL. Writing cross-platform apps is one of the
main advantage of SDL (and a very big one from my point of view).


Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

nodding vigorously

-bill!On Mon, Mar 20, 2006 at 10:59:38PM +0100, Patrice Mandin wrote:

I wonder why SDL developpers would bother with SDL_DIRECT3D applications
you could only run on 1 platform ;-). At last, OpenGL has more platforms
that support it through SDL. Writing cross-platform apps is one of the
main advantage of SDL (and a very big one from my point of view).

Direct3D depends a lot on low-level Win32 API functionality, so it
wouldn’t make sense anyway. If you’re doing a Direct3D app (that
directly uses Direct3D calls), you’re better off doing it the proper
way, all the way.On 3/20/06, Patrice Mandin <mandin.patrice at wanadoo.fr> wrote:

I wonder why SDL developpers would bother with SDL_DIRECT3D applications
you could only run on 1 platform ;-). At last, OpenGL has more platforms
that support it through SDL. Writing cross-platform apps is one of the
main advantage of SDL (and a very big one from my point of view).

  • SR

Gregory Smith wrote:

Unfortunately, neither is suitable for an (optionally) software-rendered
FPS like Aleph One. The ability to touch all the pixels on the screen
directly 30 times a second is something I guess will just be lost when
DirectDraw goes away?

I think the fastest way to do what you are willing to achieve is :

  • create a surface in software memory
  • render everything to that surface
  • blit this surface to the video surface at the end of each frame

If the backend is smart enough to avoid conversions (and if the format
is suitable), the blit is just a texture upload, which is implemented
with a DMA, and rendering a quad. So it’s fast and asynchronous. This
should be even faster than your current approach of locking the video
surface (which downloads the video contents while it’s not needed),
software surface manipulation, and upload to screen again (probably done
using a DMA too).

Stephane

Hello !

OpenGL is okay for most systems.
But Evil MS tries to kickout OpenGL
in future Windows versions like Windows
Vista, so there really is a need for
a D3D backend in the future, if SDL
wants to stay on top. The same for
Multi Window support and so on.

CU

Don’t think it’s too off topic so I’ll ask

What countermeasures are being used against gl in windows vista?> ----- Original Message -----

From: sdl-bounces+atrix2=cox.net@libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Torsten Giebl
Sent: Monday, March 20, 2006 3:23 PM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] the future of SDL/directx

Hello !

OpenGL is okay for most systems.
But Evil MS tries to kickout OpenGL
in future Windows versions like Windows
Vista, so there really is a need for
a D3D backend in the future, if SDL
wants to stay on top. The same for
Multi Window support and so on.

CU


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

Alan Wolfe escreveu:

Don’t think it’s too off topic so I’ll ask

What countermeasures are being used against gl in windows vista?

From what I can remember, it’ll be the same as ever: you’ll depend on
ICDs provided by video card vendors. Low-end cards always had crappy
support for OpenGL, and I doubt this will be any different with Vista.
Check the “The Windows Vista Issue” at

I personally don’t understand all the fuss over it; is a “Direct3D to
OpenGL 1.4” emulation any worse than the OpenGL 1.1 software renderer
Microsoft provided with the previous versions?—
Daniel K. O.

Gregory Smith <wolfy treellama.org> writes:

Is glSDL and windib the way to get hardware accelerated 2D going forward?
This is a questionable choice given we don’t know what will happen with
OpenGL in Vista, and many older machines (who need hardware accelerated 2D
the most) don’t support OpenGL well.

Or am I just paranoid and directx isn’t going to be ignored :slight_smile:

Gregory

Nothing’s wrong with OpenGL on vista:

and if you’re running a machine that doesn’t support OpenGL, you’re not a gamer.
Even ATI’s “quirky” OpenGL support should be good enough. Making a D3D backend
is IMO a waste of time.

[…]

and if you’re running a machine that doesn’t support OpenGL, you’re
not a gamer.

If you’re running a machine that doesn’t support OpenGL, you’re not a
hardcore gamer.

Gigantic difference!

The biggest market there is, is the casual games market - and the
average casual gamer is not the type of person who would install a
serious video card, or even know how to download and install third
party drivers for one.

But, do “casual games” need h/w acceleration? Well, as massive amounts
of eye candy has pretty much become the norm rather than an extra
bonus, even non-game applications pretty much require h/w
acceleration to feel smooth and responsive.

//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 21 March 2006 04:42, Lazy Foo’ wrote:

Hi,

I tried glSDL on a VERY old machines and it worked like a charm.
That is because Windows since Win98 contains its own default
implementation of OpenGL and it works OK with glSDL.
Window Vista is requiring fast 3d card, and all 3d cards manufacturers
support OpenGL in their drivers.

And of course DirectX will be supported in (I think all) future versions
of SDL.
So there is nothing to worry about :slight_smile:

p.s. I’m thinking about writing direct3d driver for SDL that will be
free of bugs of ddraw.

Best Regards,
Dmitry Yakimov

Hello !

Window Vista is
requiring fast 3d card, and all 3d cards manufacturers support OpenGL in
their drivers.

But on the net you can read, that
on Vista you have to disable GLASS
to get OpenGL support. I don’t call the Vista
OpenGL Wrapper real OpenGL support.

I hope for SDL and other libs, that
there is a dynamic way on Vista
to let the App switch off GLASS,
run the OpenGL App and when it ends,
switch on GLASS.

So that there is no need for the User
to switch it off by hand.

CU

Stephane Marchesin <stephane.marchesin wanadoo.fr> writes:

Frankly, the directx 5 backend is not a future proof backend,
considering support for directx 5 will be lacking in future windows
releases, and driver support is already falling apart. For windows,
someone should probably write a directx 9 backend for SDL, plus this
would also allow hardware accelerated alpha blits (no, I didn’t
volunteer here, but I think people on this list would gladly help anyone
undertaking this task).

Stephane

Or, rather than a directx 9 backend, maybe a directx 8 backend? The Xbox uses
Directx 8, for those wanting to attempt programming for that. And 8 is also
the last supported version for Win95. While not top of the line, it is newer
than ver 5.

As for why even have it… OpenGL rules, don’t get me wrong. I have some low
end machines I use to test to see just what kind of power my games need. With
pure directx, I get better fps than with opengl. Low end cards, terrible
opengl drivers, etc. As was brought out before, a good target is the casual
gamers which will be buying your low to mid range computers, most likely with
an intel graphics card, or something like that. In that case, software
rendering, or directx would be the best bet for special fx.

As for cross platform… Include a configuration file support, parse it for
what flags to send. example “DRIVER = OPENGL” so pass SDL_OPENGL.

But, obviously, if you are writing a 3d game, and you call for Directx, and you
even start calling directx functions, then you just made it only for windows.
If I’m not mistaken, that isn’t what they are talking about though.

For a possible better performance on the windows platform, I say go for a newer
directx backend. Just because it is there doesn’t force everyone to use it.
But at least it is there for those that want it.

Since it doesn’t seem to be top priority to most that have posted on the
subject so far, I see no reason anyone should drop what they are doing to work
on it. But, if someone wants it that badly, I say write it, and lets try to
get it into 1.3.

But, I personally am working with Linux, so I won’t be writing it any time
soon :wink:

Torsten Giebl escreveu:

But on the net you can read, that
on Vista you have to disable GLASS
to get OpenGL support. I don’t call the Vista
OpenGL Wrapper real OpenGL support.

FUD.
See http://blogs.msdn.com/kamvedbrat/archive/2006/02/22/537624.aspx

According to this, there are 3 paths for OpenGL on Vista: emulated
through Direct3D (that doesn’t disable the desktop compositor, and it’s
certainly faster than a software implementation, as provided by all the
previous Windows versions), legacy (that will be faster and disable the
desktop compositor) and the new 3rd party ICD (compatible with the
desktop compositor, and no slower than any other).—
Daniel K. O.

But on the net you can read, that
on Vista you have to disable GLASS
to get OpenGL support. I don’t call the Vista
OpenGL Wrapper real OpenGL support.

This isn’t true as of a few days ago:

http://blogs.msdn.com/kamvedbrat/archive/2006/02/22/537624.aspx

Looks like you’ll be able to do OpenGL 2.0 in a window on Vista, pixel
shaders and hardware acceleration and all, assuming your vendor (Nvidia,
ATI, etc) supply an updated driver, which they certainly will.

It’s interesting how quickly that changed. Now Microsoft’s “legacy” GL
renderer that’s layered over Direct3D means everyone (even crappy
on-board chips) will get a decent GL implementation, hardware
accelerated so long as you don’t need more than GL 1.4. Compared to what
you might end up with as a GL implementation for an on-board video chip
otherwise, this might actually be faster, more stable, and more
feature-complete, and takes pressure off the low-end vendors to deliver
anything other that D3D drivers. It also, more or less, guarantees that
you won’t land in a GL software renderer on Vista.

And the hardcore will still have Nvidia and ATI drivers.

From here, it sounds like this just became a huge win for OpenGL.

–ryan.

Horay!> ----- Original Message -----

From: sdl-bounces+atrix2=cox.net@libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Ryan C. Gordon
Sent: Tuesday, March 21, 2006 2:07 PM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] the future of SDL/directx

But on the net you can read, that
on Vista you have to disable GLASS
to get OpenGL support. I don’t call the Vista
OpenGL Wrapper real OpenGL support.

This isn’t true as of a few days ago:

http://blogs.msdn.com/kamvedbrat/archive/2006/02/22/537624.aspx

Looks like you’ll be able to do OpenGL 2.0 in a window on Vista, pixel
shaders and hardware acceleration and all, assuming your vendor (Nvidia,
ATI, etc) supply an updated driver, which they certainly will.

It’s interesting how quickly that changed. Now Microsoft’s “legacy” GL
renderer that’s layered over Direct3D means everyone (even crappy
on-board chips) will get a decent GL implementation, hardware
accelerated so long as you don’t need more than GL 1.4. Compared to what
you might end up with as a GL implementation for an on-board video chip
otherwise, this might actually be faster, more stable, and more
feature-complete, and takes pressure off the low-end vendors to deliver
anything other that D3D drivers. It also, more or less, guarantees that
you won’t land in a GL software renderer on Vista.

And the hardcore will still have Nvidia and ATI drivers.

From here, it sounds like this just became a huge win for OpenGL.

–ryan.


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

David Olofson <david olofson.net> writes:

If you’re running a machine that doesn’t support OpenGL, you’re not a
hardcore gamer.

Even the non-hardcore gamers will have enough OpenGL support. It’s not like
they’ll need the latest version of GLSL for glSDL.