unsigned levels = static_cast<const Texture1D *>(this)->levels;
if(!id)
- generate_id();
+ create();
GLenum gl_fmt = get_gl_pixelformat(storage_fmt);
if(ARB_texture_storage)
unsigned levels = static_cast<const Texture2D *>(this)->levels;
if(!id)
- generate_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();
unsigned samples = static_cast<const Texture2DMultisample *>(this)->samples;
if(!id)
- generate_id();
+ create();
GLenum gl_fmt = get_gl_pixelformat(storage_fmt);
if(ARB_texture_storage_multisample)
unsigned levels = static_cast<const Texture3D *>(this)->levels;
if(!id)
- generate_id();
+ create();
GLenum gl_fmt = get_gl_pixelformat(storage_fmt);
if(ARB_texture_storage)
glDeleteTextures(1, &id);
}
-void OpenGLTexture::generate_id()
+void OpenGLTexture::create()
{
if(id)
- throw invalid_operation("OpenGLTexture::generate_id");
+ throw invalid_operation("OpenGLTexture::create");
if(ARB_direct_state_access)
glCreateTextures(target, 1, &id);
else
OpenGLTexture(unsigned);
~OpenGLTexture();
- void generate_id();
+ void create();
void require_swizzle();
void apply_swizzle();
void set_parameter_i(unsigned, int) const;
unsigned levels = static_cast<const TextureCube *>(this)->levels;
if(!id)
- generate_id();
+ create();
GLenum gl_fmt = get_gl_pixelformat(storage_fmt);
if(ARB_texture_storage)