Texture::Texture(GLenum t, ResourceManager *m):
id(0),
target(t),
+ ifmt(RGB),
min_filter(NEAREST_MIPMAP_LINEAR),
mag_filter(LINEAR),
wrap_s(REPEAT),
return (get_base_pixelformat(fmt)==DEPTH_COMPONENT ? UNSIGNED_SHORT : UNSIGNED_BYTE);
}
+void Texture::set_internal_format(PixelFormat fmt)
+{
+ if(!get_component_size(fmt) && MSP_sized_internal_formats)
+ {
+ unsigned size = (fmt==DEPTH_COMPONENT ? get_gl_api()==OPENGL_ES2 ? 2 : 4 : 1);
+ fmt = get_sized_pixelformat(fmt, size);
+ }
+
+ require_pixelformat(fmt);
+ ifmt = fmt;
+}
+
void Texture::update_parameter(int mask) const
{
if(!ARB_direct_state_access && TexUnit::current().get_texture()!=this)