Skip to content

Commit

Permalink
SDL_GL_BindTexture and SDL_GL_UnbindTexture
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmfb committed Apr 20, 2018
1 parent 811ea48 commit 5c0db42
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/texture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ class Texture {
return SDL_GetTextureBlendMode(texture_.get(), blendMode) >= 0;
}

// "You need a renderer to create a SDL_Texture, therefore you can only
// use this function with an implicit OpenGL context from
// SDL_CreateRenderer(), not with your own OpenGL context.
// If you need control over your OpenGL context, you need to write your
// own texture-loading methods."
// <wiki.libsdl.org/SDL_GL_BindTexture>
//
bool bind(float *w = NULL, float *h = NULL)
{
return SDL_GL_BindTexture(texture_.get(), w, h);
}
bool unbind(float *w = NULL, float *h = NULL)
{
return SDL_GL_UnbindTexture(texture_.get(), w, h);
}

Texture(const Texture &that) = delete;
Texture(Texture &&that) = default;
~Texture() = default;
Expand Down

0 comments on commit 5c0db42

Please sign in to comment.