X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrfileman;a=blobdiff_plain;f=src%2Ftexture.cc;h=49f3aabe30f02a13b1819f7b528340dcb28577b7;hp=f332efaaf564bc1d98179fd3d20ece551deccdea;hb=05cc7dce02b656e633c880dcc55acdf370cb25c1;hpb=b7ea5b1ae3f0f0a5eba13b49e303b49876ee209e diff --git a/src/texture.cc b/src/texture.cc index f332efa..49f3aab 100644 --- a/src/texture.cc +++ b/src/texture.cc @@ -3,6 +3,7 @@ #include "image.h" #include "opengl.h" #include "imago2.h" +#include "opt.h" #if defined(GL_ES_VERSION_2_0) || defined(GL_VERSION_3_0) #define USE_GL_GENERATE_MIPMAP @@ -394,21 +395,23 @@ static int gltype_from_ifmt(unsigned int ifmt) static int glifmt_from_imgfmt(Image::Format fmt) { + bool use_srgb = GLEW_EXT_texture_sRGB && opt.srgb; + switch(fmt) { case Image::FMT_GREY: - return GLEW_EXT_texture_sRGB ? GL_SLUMINANCE : GL_LUMINANCE; + return use_srgb ? GL_SLUMINANCE : GL_LUMINANCE; case Image::FMT_GREY_FLOAT: return GL_LUMINANCE16F; case Image::FMT_RGB: - return GLEW_EXT_texture_sRGB ? GL_SRGB : GL_RGB; + return use_srgb ? GL_SRGB : GL_RGB; case Image::FMT_RGB_FLOAT: return GL_RGB16F; case Image::FMT_RGBA: - return GLEW_EXT_texture_sRGB ? GL_SRGB_ALPHA : GL_RGBA; + return use_srgb ? GL_SRGB_ALPHA : GL_RGBA; case Image::FMT_RGBA_FLOAT: return GL_RGBA16F;