X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fopengl%2Ftexture-gl.cc;h=17ea926b571b20310e9dfd93b47d8488623d0fa1;hb=3bf3536271e4afa8a8a93c75e2ab1256c0bf718a;hp=0143a6e675cb0d1f8e1755626d7c3a85efc18e58;hpb=64e2adbbab48320b6cd792e515b44cea112a3be4;p=demo diff --git a/src/opengl/texture-gl.cc b/src/opengl/texture-gl.cc index 0143a6e..17ea926 100644 --- a/src/opengl/texture-gl.cc +++ b/src/opengl/texture-gl.cc @@ -29,6 +29,12 @@ void TextureGL::update() glBindTexture(GL_TEXTURE_2D, tex); } - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels); glGenerateMipmap(GL_TEXTURE_2D); +} + + +void TextureGL::bind() +{ + glBindTexture(GL_TEXTURE_2D, tex); } \ No newline at end of file