X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexture2d_backend.cpp;h=ed10f6c192739196cd56f9baa5bd2d54479aaebc;hb=c356a20547afae97b412da36e0b0a7d51e879401;hp=54c82280e5b1a0e3e30b0e51bc7a1da6abf28ff6;hpb=3b98e13c823d4cb7e4d2d4d14e8440b44bc71f91;p=libs%2Fgl.git diff --git a/source/backends/opengl/texture2d_backend.cpp b/source/backends/opengl/texture2d_backend.cpp index 54c82280..ed10f6c1 100644 --- a/source/backends/opengl/texture2d_backend.cpp +++ b/source/backends/opengl/texture2d_backend.cpp @@ -50,20 +50,20 @@ void OpenGLTexture2D::allocate() if(ARB_texture_storage) { if(ARB_direct_state_access) - glTextureStorage2D(id, self.levels, gl_fmt, self.width, self.height); + glTextureStorage2D(id, n_levels, gl_fmt, self.width, self.height); else { bind_scratch(); - glTexStorage2D(target, self.levels, gl_fmt, self.width, self.height); + glTexStorage2D(target, n_levels, gl_fmt, self.width, self.height); } } else { bind_scratch(); - glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, self.levels-1); + glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, n_levels-1); GLenum comp = get_gl_components(get_components(storage_fmt)); GLenum type = get_gl_type(get_component_type(storage_fmt)); - for(unsigned i=0; i>=2) + for(unsigned i=0; i>=2) total_size += level_size; return total_size; }