SDL 1.3 texture handling

Hi

Sorry for all the threads - I am getting busy developing a new game on 1.3 so the problems are starting to raise their heads…

This one is a general question about textures, specifically, why when you create a texture, does it only do so for the current
renderer that is selected?

Assuming you’re running more than 1 window, then it’s not possible to “share” textures across the different windows which
sounds a bit crazy to me.

I need a cache of textures which I can display on any screen. They’re just memory, after all? The only way around now
(please tell me if I’m wrong) is to make 2 textures, one for each window, which seems very wasteful of memory.

Thanks
Ed

That’s correct. Each texture is specific to the renderer it’s created for.
They’re not “just memory,” they’re internal objects bound to the texture memory
of their renderer, created in system-specific ways to work with that renderer.________________________________
From: e_byard@yahoo.co.uk (Edward Byard)
Subject: [SDL] SDL 1.3 texture handling

Hi

Sorry for all the threads - I am getting busy developing a new game on 1.3 so
the problems are starting to raise their heads…

This one is a general question about textures, specifically, why when you create
a texture, does it only do so for the current
renderer that is selected?

Assuming you’re running more than 1 window, then it’s not possible to "share"
textures across the different windows which
sounds a bit crazy to me.

I need a cache of textures which I can display on any screen. They’re just
memory, after all? The only way around now
(please tell me if I’m wrong) is to make 2 textures, one for each window, which
seems very wasteful of memory.

Thanks
Ed

Oh no! Disaster. Oh well.

Can you tell me, are textures limited to the size of the window?

Thanks

No. You can make a very large texture and then specify what part of it you want
to blit to the screen when you call SDL_RenderCopy.________________________________
From: e_byard@yahoo.co.uk (Edward Byard)
Subject: Re: [SDL] SDL 1.3 texture handling

Oh no! Disaster. Oh well.

Can you tell me, are textures limited to the size of the window?

Thanks

Yeah, got it working, thanks. I’m so ingrained with SDL surfaces that changing to textures and not having a “screen” to render to is a big difference, which means changing a lot of code. I’m getting the hang of it - slowly. I can see the benefits of doing it this way.