just curious to why you would want to convert an SDL_Texture to OpenGL texture? heres another thread with same question almost SDL :: View topic - shaders
I would suggest using SDL + OpenGL pretty sure GLSL shaders are only available on OpenGL 2.0 and up
After a quick search on the forum found this thread on how to use SDL + OpenGL GLSL shaders even includes an example SDL :: View topic - GLSL shader fun!
if you take this path then you don’t need to worry about SDL_Textures and what not hope this helps
twinklebear wrote:> The title is pretty much my question, it seems that the SDL_Texture is sort of an abstraction of an OpenGL texture, (correct me if I’m wrong), so I was wondering if it was possible to apply various shaders to an SDL_Texture. I did see the tutorial on using shaders with SDL but that still uses converting a SDL_Surface to a GLuint and going from there, I was wondering if conversion was still needed. If that’s not possible I was wondering if there was a way to convert from an SDL_Texture to an OpenGL texture? I could only find the guides for converting SDL_Surfaces, and was wondering if converting the texture would be possible.
Also sort of sounds like maybe he’s loading an SDL_Surface and converting
it to a texture? If so, you may find this piece of source code useful
(from a project that I’m working on)
Hope that helps, and if not, it’s just some handy code to have
-AlexOn Wed, Aug 8, 2012 at 12:34 PM, stevo5800 wrote:
**
just curious to why you would want to convert an SDL_Texture to OpenGL
texture? heres another thread with same question almost SDL :: View topic - shaders
I would suggest using SDL + OpenGL pretty sure GLSL shaders are only
available on OpenGL 2.0 and up
After a quick search on the forum found this thread on how to use SDL +
OpenGL GLSL shaders even includes an example SDL :: View topic - GLSL shader fun!
if you take this path then you don’t need to worry about SDL_Textures and
what not hope this helps
twinklebear wrote:
The title is pretty much my question, it seems that the SDL_Texture is
sort of an abstraction of an OpenGL texture, (correct me if I’m wrong), so
I was wondering if it was possible to apply various shaders to an
SDL_Texture. I did see the tutorial on using shaders with SDL but that
still uses converting a SDL_Surface to a GLuint and going from there, I was
wondering if conversion was still needed. If that’s not possible I was
wondering if there was a way to convert from an SDL_Texture to an OpenGL
texture? I could only find the guides for converting SDL_Surfaces, and was
wondering if converting the texture would be possible.
SDL_Textures aren’t meant to be used with OpenGL calls. They’re part of
SDL2’s rendering API.
However, that functionality is my aim with SDL_gpu. I haven’t ported it to
SDL2 yet, but it would be an add-on-style replacement for the SDL2 texture
rendering API (which I still think should be an add-on).