};
-OpenGLTexture2D::OpenGLTexture2D(ResourceManager *m):
- Texture(GL_TEXTURE_2D, m)
+OpenGLTexture2D::OpenGLTexture2D():
+ Texture(GL_TEXTURE_2D)
{ }
void OpenGLTexture2D::allocate()
unsigned height = static_cast<const Texture2D *>(this)->height;
unsigned levels = static_cast<const Texture2D *>(this)->levels;
+ if(!id)
+ create();
+
GLenum gl_fmt = get_gl_pixelformat(storage_fmt);
if(ARB_texture_storage)
{
}
if(!texture.id)
- texture.generate_id();
+ texture.create();
unsigned w = image.get_width();
unsigned h = image.get_height();