SDL2 surfaces

Are surfaces hardware accelerated by default, or does it depend on setting ? I have a text display routine which converts surfaces to texture to which positions need to be calculated etc etc, and I was wondering if it would be more efficient (and just as fast) to just render the surface instead of the conversion.

Whether they’re hardware accelerated or not depends on the renderer.
That said, the renderer by default will use hardware acceleration
(unless something went seriously wrong), so in that sense it should be
OK.

2014-09-26 4:52 GMT-03:00, MrTAToad :> Are surfaces hardware accelerated by default, or does it depend on setting ?

I have a text display routine which converts surfaces to texture to which
positions need to be calculated etc etc, and I was wondering if it would be
more efficient (and just as fast) to just render the surface instead of the
conversion.

Sounds like converting to a texture would be superfluous to requirements then, which is fair enough.

IIUC you have to convert to a texture to draw, if you are using
hardware acceleration and the renderer. So you have the choice of
converting a bunch of smaller surfaces to textures and then laying
them out with a number of hardware accelerated render operations, or
doing your text layout with software blits to a larger surface, then
converting the big surface to a texture, and then rendering with a
single hardware accelerated operation.

No idea which would be faster.On Fri, Sep 26, 2014 at 8:50 AM, MrTAToad wrote:

Sounds like converting to a texture would be superfluous to requirements
then, which is fair enough.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Ah yes, forgot surfaces cant blit to a renderer… Ah well - good job I haven’t changed anything!

Message-ID: <1411758868.m2f.45428 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Ah yes, forgot surfaces cant blit to a renderer… Ah well - good job I haven’t changed anything!

I don’t remember SDL2 surfaces EVER being accelerated, either? Not
certain where that was coming from, since the point of textures was
basically to better represent some complications of graphics
accelerators.> Date: Fri, 26 Sep 2014 19:14:28 +0000

From: “MrTAToad”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL2 surfaces

2014-09-27 9:00 GMT+02:00 Jared Maddox :> > Date: Fri, 26 Sep 2014 19:14:28 +0000

From: “MrTAToad”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL2 surfaces
Message-ID: <1411758868.m2f.45428 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Ah yes, forgot surfaces cant blit to a renderer… Ah well - good job I
haven’t changed anything!

I don’t remember SDL2 surfaces EVER being accelerated, either? Not
certain where that was coming from, since the point of textures was
basically to better represent some complications of graphics
accelerators.

In SDL1 I think there was a way to make surfaces hardware accelerated (as
they were the only
pixel arrays available), so that’s probably where the confusion is coming
from. In SDL2 they
were rightfully demoted to pure RAM buffers.

2014-09-27 4:08 GMT-03:00, Jonas Kulla :

In SDL1 I think there was a way to make surfaces hardware accelerated (as
they were the only
pixel arrays available), so that’s probably where the confusion is coming
from. In SDL2 they
were rightfully demoted to pure RAM buffers.

No, they weren’t. The only hardware acceleration came from blitting
into the screen surface, which would be hardware accelerated…
sometimes (I don’t think that method works on newer hardware at all
anymore, but I could be wrong).

For the record, DirectDraw could do this acceleration as well.

2014-09-28 1:01 GMT+02:00 Sik the hedgehog <sik.the.hedgehog at gmail.com>:

2014-09-27 4:08 GMT-03:00, Jonas Kulla <@Jonas_Kulla>:

In SDL1 I think there was a way to make surfaces hardware accelerated (as
they were the only
pixel arrays available), so that’s probably where the confusion is coming
from. In SDL2 they
were rightfully demoted to pure RAM buffers.

No, they weren’t. The only hardware acceleration came from blitting
into the screen surface, which would be hardware accelerated…
sometimes (I don’t think that method works on newer hardware at all
anymore, but I could be wrong).

For the record, DirectDraw could do this acceleration as well.

I don’t remember the details of the implementation, only that it said
something
like “SDL will try to create the surface in VRAM if this flag is set”.