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
texture: what renderer? what conditions on size?
albert


Joined: 22 Oct 2009
Posts: 29
Hi,

SDL_CreateTexture creates a texture which is associated to a specific renderer, as I understand (and can also only used with this renderer, I guess). For a given texture, can I somehow query which renderer that is?

On the size, I remember that some OpenGL backends require the size to be a multiple of 2. But I don't see any such requirements in the doc. So it automatically handles that internally, i.e. it uses the next bigger size which is a multiple of 2?

I understand that there is a maximum texture size. So if I need something bigger, I need to handle that manually, i.e. create multiple textures?

Is there some guaranteed minimum texture size which is always supported?

Maybe the docs should be updated to answer these questions.

Thanks,
Albert
texture: what renderer? what conditions on size?
Daniel Holth
Guest

Historically each dimension of a texture should be a power of 2
(2,4,8,..,128...,512) but you probably do not need to worry about that
on current platforms: according to Wikipedia non-power-of-two textures
are allowed as of OpenGL 2.0 (released in 2004), or OpenGL ES 2.0
(released in 2007).

OpenGL implementations are guaranteed to support at least 64x64 pixel
textures. Yours probably supports larger textures.

I didn't see a way to query texture -> renderer associations either.


On Wed, Sep 10, 2014 at 11:38 AM, albert wrote:
Quote:
Hi,

SDL_CreateTexture creates a texture which is associated to a specific
renderer, as I understand (and can also only used with this renderer, I
guess). For a given texture, can I somehow query which renderer that is?

On the size, I remember that some OpenGL backends require the size to be a
multiple of 2. But I don't see any such requirements in the doc. So it
automatically handles that internally, i.e. it uses the next bigger size
which is a multiple of 2?

I understand that there is a maximum texture size. So if I need something
bigger, I need to handle that manually, i.e. create multiple textures?

Is there some guaranteed minimum texture size which is always supported?

Maybe the docs should be updated to answer these questions.

Thanks,
Albert

_______________________________________________
SDL mailing list

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

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
texture: what renderer? what conditions on size?
Alex Szpakowski
Guest

Realistically you can pretty much rely on at least 2048x2048-sized textures being supported (or 8192x8192 if you only target GL3/DX10+ era hardware.)


Here are some stats:
http://feedback.wildfiregames.com/report/opengl/feature/GL_MAX_TEXTURE_SIZE
https://developer.apple.com/opengl/capabilities/GLInfo_1075.html


The SDL_GetRendererInfo function will fill in a struct which contains ‘max_texture_width’ and ‘max_texture_height’ members, if you want to know the values at runtime.

On Sep 10, 2014, at 1:48 PM, Daniel Holth wrote:

Quote:
OpenGL implementations are guaranteed to support at least 64x64 pixel
textures. Yours probably supports larger textures.

I didn't see a way to query texture -> renderer associations either.

_______________________________________________
SDL mailing list

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