SDL2 and Opengl textures

Can someone tell what is the bast way of setting up a texture for opengl. Do it all in Opengl? Does anyone know of a good C programming example (prefer very basic)?

Perhaps these would be helpful:
http://immersedcode.org/2011/4/7/stb-image/
http://immersedcode.org/2011/4/7/sdl-surface-to-texture/~
Doug.

On Tue, Sep 25, 2012 at 11:21 AM, dosh wrote:

Can someone tell what is the bast way of setting up a texture for opengl. Do
it all in Opengl? Does anyone know of a good C programming example (prefer
very basic)?


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

Thanks Doug
I think this
"If you read the SDL documentation you will find out that it supports textures. Unfortunately or fortunately, depending on how you look at it, this texture support is however not available in a way that it would work with arbitrary OpenGL applications. But for the purpose of using SDL with OpenGL you can just ignore that a thing called SDL_Texture exists."
sought of answers a lot of my questions.

I now just need to change the example over to the C programming I like (I’m a little strange in that way).

Thanks again

Doug wrote:> Perhaps these would be helpful:

http://immersedcode.org/2011/4/7/stb-image/
http://immersedcode.org/2011/4/7/sdl-surface-to-texture/

~
Doug.

On Tue, Sep 25, 2012 at 11:21 AM, dosh <@dosh> wrote:

Can someone tell what is the bast way of setting up a texture for opengl. Do
it all in Opengl? Does anyone know of a good C programming example (prefer
very basic)?


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

2012/9/25 dosh

**
Thanks Doug
I think this
"If you read the SDL documentation you will find out that it supports
textures. Unfortunately or fortunately, depending on how you look at it,
this texture support is however not available in a way that it would work
with arbitrary OpenGL applications. But for the purpose of using SDL with
OpenGL you can just ignore that a thing called SDL_Texture exists."
sought of answers a lot of my questions.

I now just need to change the example over to the C programming I like
(I’m a little strange in that way).

Thanks again

If you restrict yourself to OpenGL and its variantes (ES/ES2), you can use
SDL_GL_BindTexture to bind SDL Textures to the current OpenGL context and
use it as you would any other texture. I put up an example on the wiki on
how to use it.–
Gabriel.

Another piece of handy code:
https://github.com/mrozbarry/bitfighter-experiments/blob/master/bitfighter1.0/sdlutil.cpp#L349On Tue, Sep 25, 2012 at 6:26 AM, Gabriel Jacobo wrote:

2012/9/25 dosh

**
Thanks Doug
I think this
"If you read the SDL documentation you will find out that it supports
textures. Unfortunately or fortunately, depending on how you look at it,
this texture support is however not available in a way that it would work
with arbitrary OpenGL applications. But for the purpose of using SDL with
OpenGL you can just ignore that a thing called SDL_Texture exists."
sought of answers a lot of my questions.

I now just need to change the example over to the C programming I like
(I’m a little strange in that way).

Thanks again

If you restrict yourself to OpenGL and its variantes (ES/ES2), you can use
SDL_GL_BindTexture to bind SDL Textures to the current OpenGL context and
use it as you would any other texture. I put up an example on the wiki on
how to use it.


Gabriel.


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