Streaming textures with SDL 1.3

I put up a streaming texture tutorial on my blog:

Enjoy!–
-Sam Lantinga, Founder and CEO, Galaxy Gameworks

There’s something badly broken on your blog. Scrolling continuously up and down
the page (in Firefox 3.6) is extremely slow and jerky, which I don’t usually see
unless there’s some obnoxious “active content” on the page that constantly moves
itself around when you scroll to stay visible. You don’t have anything like
that, so I’m not sure what’s causing it.________________________________
From: slouken@libsdl.org (slouken)
To: SDL ; sheenas at galaxygameworks.com
Sent: Fri, February 11, 2011 1:03:12 PM
Subject: [SDL] Streaming textures with SDL 1.3

I put up a streaming texture tutorial on my blog:

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Also happens here using Firefox 3.6.13, but doesn’t happen using Konqueror.

JeffOn Friday 11 February 2011 13:24, Mason Wheeler wrote:

There’s something badly broken on your blog. Scrolling continuously up and
down the page (in Firefox 3.6) is extremely slow and jerky, which I don’t
usually see unless there’s some obnoxious “active content” on the page that
constantly moves itself around when you scroll to stay visible. You don’t
have anything like that, so I’m not sure what’s causing it.

Hello !

There’s something badly broken on your blog. Scrolling continuously up and
down the page (in Firefox 3.6) is extremely slow and jerky, which I don’t
usually see unless there’s some obnoxious “active content” on the page that
constantly moves itself around when you scroll to stay visible. You don’t
have anything like that, so I’m not sure what’s causing it.

Also happens here using Firefox 3.6.13, but doesn’t happen using Konqueror.

With Netscape / Firefox scrolling a layer over a fixed background is always jerky.

CU

Try it now?On Fri, Feb 11, 2011 at 1:24 PM, Mason Wheeler wrote:

There’s something badly broken on your blog. Scrolling continuously up and
down the page (in Firefox 3.6) is extremely slow and jerky, which I don’t
usually see unless there’s some obnoxious “active content” on the page that
constantly moves itself around when you scroll to stay visible. You don’t
have anything like that, so I’m not sure what’s causing it.


From: Sam Lantinga <@slouken>
To: SDL ; sheenas at galaxygameworks.com
Sent: Fri, February 11, 2011 1:03:12 PM
Subject: [SDL] Streaming textures with SDL 1.3

I put up a streaming texture tutorial on my blog:
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Much better. Looks like the background is part of it, though I don’t think
that’s the whole thing because (for example) Twitter pages don’t tend to be that
choppy for me. Hard to say for sure, though. I’m not a web designer.________________________________
From: slouken@libsdl.org (slouken)
To: SDL Development List
Sent: Fri, February 11, 2011 3:06:31 PM
Subject: Re: [SDL] Streaming textures with SDL 1.3

Try it now?

On Fri, Feb 11, 2011 at 1:24 PM, Mason Wheeler <@Mason_Wheeler> wrote:

There’s something badly broken on your blog. Scrolling continuously up and down
the page (in Firefox 3.6) is extremely slow and jerky, which I don’t usually see
unless there’s some obnoxious “active content” on the page that constantly moves
itself around when you scroll to stay visible. You don’t have anything like
that, so I’m not sure what’s causing it.


From: slouken@libsdl.org (slouken)

To: SDL ; sheenas at galaxygameworks.com
Sent: Fri, February 11, 2011 1:03:12 PM
Subject: [SDL] Streaming textures with SDL 1.3

I put up a streaming texture tutorial on my blog:
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Hello !

Much better. Looks like the background is part of it, though I don’t think
that’s the whole thing because (for example) Twitter pages don’t tend to be that
choppy for me. Hard to say for sure, though. I’m not a web designer.

You are right. The background was only part of it and it is not
a generall xyxy.blogspot.com problem.

CU

hello Sam,
this is very interesting and useful at the same time! I was really
hoping that there was some more perfomant way to modify the texture
rather than SDL_UpdateTexture
just a note, you forgot NULL as second parameter of SDL_LockTexture
thanks for the happy moose tutorial

VittorioOn Fri, Feb 11, 2011 at 10:03 PM, Sam Lantinga wrote:

I put up a streaming texture tutorial on my blog:
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

? ? -Sam Lantinga, Founder and CEO, Galaxy Gameworks


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

Oh, good catch, thanks!On Sat, Feb 12, 2011 at 6:20 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hello Sam,
this is very interesting and useful at the same time! I was really
hoping that there was some more perfomant way to modify the texture
rather than SDL_UpdateTexture
just a note, you forgot NULL as second parameter of SDL_LockTexture
thanks for the happy moose tutorial

Vittorio

On Fri, Feb 11, 2011 at 10:03 PM, Sam Lantinga <@slouken> wrote:

I put up a streaming texture tutorial on my blog:
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Hi,

just a question since I’m using SDL_UpdateTexture quite heavily… well I didn’t check the source code for streaming textures but is this supposed to be faster then SDL_UpdateTexture? And if yes, how? :slight_smile:

regards,–
Pavel Kanzelsberger
Sent with Sparrow
On Sobota, 12. febru?r 2011 at 17:00, Sam Lantinga wrote:

Oh, good catch, thanks!

On Sat, Feb 12, 2011 at 6:20 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hello Sam,
this is very interesting and useful at the same time! I was really
hoping that there was some more perfomant way to modify the texture
rather than SDL_UpdateTexture
just a note, you forgot NULL as second parameter of SDL_LockTexture
thanks for the happy moose tutorial

Vittorio

On Fri, Feb 11, 2011 at 10:03 PM, Sam Lantinga wrote:

I put up a streaming texture tutorial on my blog:
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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

It usually doesn’t matter, but if the driver is doing something smart like
pinning the texture memory and doing async GPU controlled DMA, you can avoid
a copy by locking the texture directly instead of keeping a separate copy of
the image data in your application.On Sat, Feb 12, 2011 at 12:23 PM, Pavel Kanzelsberger wrote:

Hi,

just a question since I’m using SDL_UpdateTexture quite heavily… well I
didn’t check the source code for streaming textures but is this supposed to
be faster then SDL_UpdateTexture? And if yes, how? :slight_smile:

regards,

Pavel Kanzelsberger
Sent with Sparrow http://www.sparrowmailapp.com

On Sobota, 12. febru?r 2011 at 17:00, Sam Lantinga wrote:

Oh, good catch, thanks!

On Sat, Feb 12, 2011 at 6:20 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hello Sam,
this is very interesting and useful at the same time! I was really
hoping that there was some more perfomant way to modify the texture
rather than SDL_UpdateTexture
just a note, you forgot NULL as second parameter of SDL_LockTexture
thanks for the happy moose tutorial

Vittorio

On Fri, Feb 11, 2011 at 10:03 PM, Sam Lantinga <@slouken> wrote:

I put up a streaming texture tutorial on my blog:
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Hmm interesting, I have to checkout the underlying OpenGL code to see how
locking works…

Thanks for the information,

have a nice day,
Pavel Kanzelsberger—


e-mail: pavel at kanzelsberger.com
icq: 20990633, gtalk: @Pavel_Kanzelsberger

On 13.2.2011, at 2:42, Sam Lantinga wrote:

It usually doesn’t matter, but if the driver is doing something smart like
pinning the texture memory and doing async GPU controlled DMA, you can avoid
a copy by locking the texture directly instead of keeping a separate copy of
the image data in your application.

On Sat, Feb 12, 2011 at 12:23 PM, Pavel Kanzelsberger <@Pavel_Kanzelsberger>wrote:

Hi,

just a question since I’m using SDL_UpdateTexture quite heavily… well I
didn’t check the source code for streaming textures but is this supposed to
be faster then SDL_UpdateTexture? And if yes, how? :slight_smile:

regards,

Pavel Kanzelsberger
Sent with Sparrow http://www.sparrowmailapp.com

On Sobota, 12. febru?r 2011 at 17:00, Sam Lantinga wrote:

Oh, good catch, thanks!

On Sat, Feb 12, 2011 at 6:20 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hello Sam,
this is very interesting and useful at the same time! I was really
hoping that there was some more perfomant way to modify the texture
rather than SDL_UpdateTexture
just a note, you forgot NULL as second parameter of SDL_LockTexture
thanks for the happy moose tutorial

Vittorio

On Fri, Feb 11, 2011 at 10:03 PM, Sam Lantinga wrote:

I put up a streaming texture tutorial on my blog:
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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

Ok, I did a quick check in SDL_renderer_gl.c and SDL_renderer_gles.c, but texture locking and unlocking doesn’t seem to do anything except marking dirty rectangles of a texture and then updating them with SDL_UpdateTexture right before SDL_RenderCopy happens… anyway I’ll check with the OpenGL to see if there’s something like this available in some implementations, that could be used by SDL.

regards,–
Pavel Kanzelsberger
Sent with Sparrow
On Nede?a, 13. febru?r 2011 at 13:44, Pavel Kanzelsberger wrote:

Hmm interesting, I have to checkout the underlying OpenGL code to see how locking works…

Thanks for the information,

have a nice day,
Pavel Kanzelsberger

http://www.kanzelsberger.com
e-mail: pavel at kanzelsberger.com
icq: 20990633, gtalk: @Pavel_Kanzelsberger

On 13.2.2011, at 2:42, Sam Lantinga wrote:

It usually doesn’t matter, but if the driver is doing something smart like pinning the texture memory and doing async GPU controlled DMA, you can avoid a copy by locking the texture directly instead of keeping a separate copy of the image data in your application.

On Sat, Feb 12, 2011 at 12:23 PM, Pavel Kanzelsberger <@Pavel_Kanzelsberger> wrote:

Hi,

just a question since I’m using SDL_UpdateTexture quite heavily… well I didn’t check the source code for streaming textures but is this supposed to be faster then SDL_UpdateTexture? And if yes, how? :slight_smile:

regards,

Pavel Kanzelsberger
Sent with Sparrow
On Sobota, 12. febru?r 2011 at 17:00, Sam Lantinga wrote:

Oh, good catch, thanks!

On Sat, Feb 12, 2011 at 6:20 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hello Sam,
this is very interesting and useful at the same time! I was really
hoping that there was some more perfomant way to modify the texture
rather than SDL_UpdateTexture
just a note, you forgot NULL as second parameter of SDL_LockTexture
thanks for the happy moose tutorial

Vittorio

On Fri, Feb 11, 2011 at 10:03 PM, Sam Lantinga wrote:

I put up a streaming texture tutorial on my blog:
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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

If you look in the latest version you’ll see that the apple extensions are
used to pin the texture memory for async DMA, on Mac OS X. It also may have
some performance benefits on Direct3D, depending on their implementation.On Sun, Feb 13, 2011 at 1:50 PM, Pavel Kanzelsberger wrote:

Ok, I did a quick check in SDL_renderer_gl.c and SDL_renderer_gles.c, but
texture locking and unlocking doesn’t seem to do anything except marking
dirty rectangles of a texture and then updating them with SDL_UpdateTexture
right before SDL_RenderCopy happens… anyway I’ll check with the OpenGL to
see if there’s something like this available in some implementations, that
could be used by SDL.

regards,

Pavel Kanzelsberger
Sent with Sparrow http://www.sparrowmailapp.com

On Nede?a, 13. febru?r 2011 at 13:44, Pavel Kanzelsberger wrote:

Hmm interesting, I have to checkout the underlying OpenGL code to see how
locking works…

Thanks for the information,

have a nice day,
Pavel Kanzelsberger

http://www.kanzelsberger.com
e-mail: pavel at kanzelsberger.com
icq: 20990633, gtalk: kanzels at gmail.com

On 13.2.2011, at 2:42, Sam Lantinga <@slouken> wrote:

It usually doesn’t matter, but if the driver is doing something smart like
pinning the texture memory and doing async GPU controlled DMA, you can avoid
a copy by locking the texture directly instead of keeping a separate copy of
the image data in your application.

On Sat, Feb 12, 2011 at 12:23 PM, Pavel Kanzelsberger < kanzels at gmail.com> wrote:

Hi,

just a question since I’m using SDL_UpdateTexture quite heavily… well I
didn’t check the source code for streaming textures but is this supposed to
be faster then SDL_UpdateTexture? And if yes, how? :slight_smile:

regards,

Pavel Kanzelsberger
Sent with Sparrow http://www.sparrowmailapp.com

On Sobota, 12. febru?r 2011 at 17:00, Sam Lantinga wrote:

Oh, good catch, thanks!

On Sat, Feb 12, 2011 at 6:20 AM, Vittorio G. < <vitto.giova at yahoo.it> vitto.giova at yahoo.it> wrote:

hello Sam,
this is very interesting and useful at the same time! I was really
hoping that there was some more perfomant way to modify the texture
rather than SDL_UpdateTexture
just a note, you forgot NULL as second parameter of SDL_LockTexture
thanks for the happy moose tutorial

Vittorio

On Fri, Feb 11, 2011 at 10:03 PM, Sam Lantinga < <@slouken> @slouken> wrote:

I put up a streaming texture tutorial on my blog:

http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Ah ok, thanks for pointing this out, I’ll checkout the latest revision and have a look.

have a nice day,
PavelOn 13.2.2011, at 22:54, Sam Lantinga wrote:

If you look in the latest version you’ll see that the apple extensions are used to pin the texture memory for async DMA, on Mac OS X. It also may have some performance benefits on Direct3D, depending on their implementation.

On Sun, Feb 13, 2011 at 1:50 PM, Pavel Kanzelsberger <@Pavel_Kanzelsberger> wrote:
Ok, I did a quick check in SDL_renderer_gl.c and SDL_renderer_gles.c, but texture locking and unlocking doesn’t seem to do anything except marking dirty rectangles of a texture and then updating them with SDL_UpdateTexture right before SDL_RenderCopy happens… anyway I’ll check with the OpenGL to see if there’s something like this available in some implementations, that could be used by SDL.

regards,

Pavel Kanzelsberger
Sent with Sparrow
On Nede?a, 13. febru?r 2011 at 13:44, Pavel Kanzelsberger wrote:

Hmm interesting, I have to checkout the underlying OpenGL code to see how locking works…

Thanks for the information,

have a nice day,
Pavel Kanzelsberger

http://www.kanzelsberger.com
e-mail: pavel at kanzelsberger.com
icq: 20990633, gtalk: @Pavel_Kanzelsberger

On 13.2.2011, at 2:42, Sam Lantinga wrote:

It usually doesn’t matter, but if the driver is doing something smart like pinning the texture memory and doing async GPU controlled DMA, you can avoid a copy by locking the texture directly instead of keeping a separate copy of the image data in your application.

On Sat, Feb 12, 2011 at 12:23 PM, Pavel Kanzelsberger <@Pavel_Kanzelsberger> wrote:

Hi,

just a question since I’m using SDL_UpdateTexture quite heavily… well I didn’t check the source code for streaming textures but is this supposed to be faster then SDL_UpdateTexture? And if yes, how? :slight_smile:

regards,

Pavel Kanzelsberger
Sent with Sparrow
On Sobota, 12. febru?r 2011 at 17:00, Sam Lantinga wrote:

Oh, good catch, thanks!

On Sat, Feb 12, 2011 at 6:20 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hello Sam,
this is very interesting and useful at the same time! I was really
hoping that there was some more perfomant way to modify the texture
rather than SDL_UpdateTexture
just a note, you forgot NULL as second parameter of SDL_LockTexture
thanks for the happy moose tutorial

Vittorio

On Fri, Feb 11, 2011 at 10:03 PM, Sam Lantinga wrote:

I put up a streaming texture tutorial on my blog:
http://slouken.blogspot.com/2011/02/streaming-textures-with-sdl-13.html

Enjoy!

-Sam Lantinga, Founder and CEO, Galaxy Gameworks

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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


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


-Sam Lantinga, Founder and CEO, Galaxy Gameworks


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


Pavel Kanzelsberger


E-Mail: pavel at kanzelsberger.com
Jabber: kanzelsberger at jabber.org, ICQ: 20990633