[SDL] SDL 1.3 - SDL_Texture or SDL_Surface?

Torsten Giebl wizard at syntheticsw.com
Thu Aug 2 16:12:33 PDT 2007


Hello !


> Right about here is where I think we starting going off tangent.
>
> I have already said I am against bloating SDL's video API, but I am by no
> means
> against adding features to SDL's rendering.
>
> I just don't want SDL to become an over engineered mess like GTK. When
> coming up
> with improvements to SDL, let's remember not to take the "Simple" out of
> "Simple
> DirectMedia Layer". Trying to make the "2D API to rule them all" will just
> end
> in tears.

Right. The "Only 2D" and half baked "OpenGL 3D" support
is a limit of SDL 1.2

> Anything we can cook up won't be as flexible as OGL or D3D and
> won't be
> as easy to use as SDL's current easy to use rendering.

Why ?

SDL 1.3 has to provide two things :

1. When it uses D3D or OpenGL it has to
say, okay you as a coder are allowed for example
to modify the matrix stack or you have to set it again
before using SDL functions. So a clear situation
what you are allowed to do in D3D or OGL.

2. There need to be SDL_Surface and SDL_Texture
in the 1.3. You will still have the same SDL Blitting commands,
that you are so used to. The only difference is that SDL_Surface has
a flag that allows to attach a SDL_Surface to it + a flag if this
should be used when doing blits.

The actual driver then looks okay, i am a 2D driver like
GDI, X11, so simply blit the surface like in 1.2

If i am a 3D driver like D3D or OGL,
look if there is an SDL_Texture attached to the SDL_Surface
and if the user wants me to use it, blit this texture with a
quad for example to the screen. If there is no texture
or the user says no with the flag, simply use the writePixels
function.

Fancy stuff like rotating, zooming can be easily
integrated to an Addon Library. The 3D parts of this lib
will be short, it is easy to rotate and blit a texture
with OpenGL for example, 2D will need a lot more code.

> We (I do plan to contribute to the SDL project once I make it through
> prerequisite hell) really shouldn't be trying to make the API that has
> everything any programmer could need. We should be listening to what the
> SDL
> users want.
>
>>From the e-mails I get and posts on I've seen on the message boards that
>> refer
> to my site, there's 5 things SDL I see are the most wanted features in the
> videoAPI:
>
> 1) Hardware acceleration

The 2D driver will still have the same hardware acceleration
it has now. Even when only using 2D the user can choose
okay i use 2D only or use D3D or OGL and get best hw acceleration.

> 2) Rotation
> 3) Scaling
> 5) Primitives (squares, lines, points, triangles, etc )

All the upper things can be easily integrated into an
external library.

> 4) Viewport scaling ( 320 x 240 viewport on a 640 x 480 screen ).

When SDL supports to set the ViewPort before blitting also
this could be handled by an external library.


CU



More information about the SDL mailing list