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

Gregory Smith wolfy at treellama.org
Tue Aug 15 07:02:16 PDT 2006


On Tue, 15 Aug 2006, Torsten Giebl wrote:

> 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.

Gregory







More information about the SDL mailing list