X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.cpp;h=21fc7a6ae9bb41711cf079795e752196c4a2e014;hb=cdf928f03f4d8383b8fa978abc4c255a850ec061;hp=581ec705690d556320bc412577a7ad8e5f4d0adb;hpb=08e19bc2b4eba572bc7699378cf55cd8772ac67e;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index 581ec705..21fc7a6a 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -52,6 +52,7 @@ void operator>>(const LexicalConverter &c, TextureWrap &tw) Texture::Texture(GLenum t, ResourceManager *m): id(0), target(t), + ifmt(RGB), min_filter(NEAREST_MIPMAP_LINEAR), mag_filter(LINEAR), wrap_s(REPEAT), @@ -84,6 +85,15 @@ DataType Texture::get_alloc_type(PixelFormat fmt) return (get_base_pixelformat(fmt)==DEPTH_COMPONENT ? UNSIGNED_SHORT : UNSIGNED_BYTE); } +void Texture::set_internal_format(PixelFormat fmt) +{ + if(MSP_sized_internal_formats) + fmt = get_sized_pixelformat(fmt); + + require_pixelformat(fmt); + ifmt = fmt; +} + void Texture::update_parameter(int mask) const { if(!ARB_direct_state_access && TexUnit::current().get_texture()!=this)