[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] SDL 1.3 adds support for render targets

From: Kai Sterker
Subject: [Adonthell-devel] SDL 1.3 adds support for render targets
Date: Sun, 22 Jan 2012 12:36:55 +0100

Here's another task that springs to mind, now that SDL 1.3 is getting
render targets.

Right now, in the SDL 1.3 backend, all textures are created as
streaming textures, which means that SDL keeps a copy of the texture
data in main memory. Whenever we need to blit something from one
surface to another, we use and update that data and after unlocking
the surface, the version in video memory is updated. Altogether, this
is just a workaround and slows down rendering quite a bit. But with
support for render targets in SDL 1.3, it should be possible to blit
directly from one texture to another, meaning we can get rid of
streaming textures and the costly software blitting.

Here's the commit that adds render targets to SDL:

And here's the code that needs changing:

In there you'll find a lot of those checks:

    if (!target || target == display)
        // draw on screen
        // draw on surface

I assume that all the else branches could be rewritten to use render
targets instead.

Textures would no longer have to be created with

Haven't looked in depth at all the required changes and ramifications,
but if somebody wants to give that a go, please do so!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]