The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL2 surfaces
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
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.
SDL2 surfaces
Sik


Joined: 26 Nov 2011
Posts: 905
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:
Quote:
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.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
Sounds like converting to a texture would be superfluous to requirements then, which is fair enough.
SDL2 surfaces
Daniel Holth
Guest

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:
Quote:
Sounds like converting to a texture would be superfluous to requirements
then, which is fair enough.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
Ah yes, forgot surfaces cant blit to a renderer... Ah well - good job I haven't changed anything!
SDL2 surfaces
Jared Maddox
Guest

Quote:
Date: Fri, 26 Sep 2014 19:14:28 +0000
From: "MrTAToad"
To:
Subject: Re: [SDL] SDL2 surfaces
Message-ID:
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.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL2 surfaces
Jonas Kulla
Guest

2014-09-27 9:00 GMT+02:00 Jared Maddox:
Quote:
> Date: Fri, 26 Sep 2014 19:14:28 +0000
Quote:
From: "MrTAToad"
To:
Subject: Re: [SDL] SDL2 surfaces
Message-ID:
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.
SDL2 surfaces
Sik


Joined: 26 Nov 2011
Posts: 905
2014-09-27 4:08 GMT-03:00, Jonas Kulla:
Quote:
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.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL2 surfaces
Jonas Kulla
Guest

2014-09-28 1:01 GMT+02:00 Sik the hedgehog:
Quote:
2014-09-27 4:08 GMT-03:00, Jonas Kulla:
Quote:
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".