[SDL] Surface vs Texture - optimal usage

Jonas Kulla nyocurio at gmail.com
Sat Oct 26 19:35:47 PDT 2013


2013/10/27 mattbentley <mattreecebentley at gmail.com>

> **
>
>
>
>  Jonas Kulla wrote:
>
>
>
> What? Please don't tell me you create a texture for each animation frame.
> You are supposed to leave all animation frames of a character/whatever
> in one bitmap/texture and then just use a different source rectangle when
> drawing each frame.
>
>
>
> There's no 'supposed' to about it. That's the way you in particular want
> to do it, that's absolutely fine. There are many reasons why you could
> choose not to do that. And by the sounds of it there's no performance
> difference in either case with SDL, as what you're talking about is
> small-scale texture-atlasing for your sprites.
> At any rate, I was using 'texture' in the generic sense here, as in,
> 'different pictures', with no reference as to how those pictures would be
> stored...
>

> There's no 'supposed' to about it. That's the way you in particular want
to do it, that's absolutely fine.

Yeah but then don't ask "how do I make this faster".

> There are many reasons why you could choose not to do that.

Such as?

> And by the sounds of it there's no performance difference in either case
with SDL, as what you're talking about is small-scale texture-atlasing for
your sprites.

It's not even about performance. Why would you want to deal with multiple
textures if you can have just one.

> At any rate, I was using 'texture' in the generic sense here, as in,
'different pictures', with no reference as to how those pictures would be
stored...

You said "ie. different textures". There is no ambiguity in the word
"texture",
no "general sense".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20131027/8dfe93a0/attachment-0009.htm>


More information about the SDL mailing list