Remove GL_LUMINANCE in more places.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 8 Mar 2014 23:41:38 +0000 (00:41 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 8 Mar 2014 23:42:00 +0000 (00:42 +0100)
Causes problems with GL 3.2+ core contexts. Found by testing on ATI.

dither_effect.cpp
init.cpp

index e9ea19f..72a38de 100644 (file)
@@ -84,7 +84,7 @@ void DitherEffect::update_texture(GLuint glsl_program_num, const string &prefix,
        check_error();
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
        check_error();
-       glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE16F_ARB, texture_width, texture_height, 0, GL_LUMINANCE, GL_FLOAT, dither_noise);
+       glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, texture_width, texture_height, 0, GL_RED, GL_FLOAT, dither_noise);
        check_error();
 
        delete[] dither_noise;
index 1d7c46a..0957a11 100644 (file)
--- a/init.cpp
+++ b/init.cpp
@@ -64,7 +64,7 @@ void measure_texel_subpixel_precision()
        check_error();
        glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
        check_error();
-       glTexImage1D(GL_TEXTURE_1D, 0, GL_LUMINANCE16F_ARB, 2, 0, GL_LUMINANCE, GL_FLOAT, texdata);
+       glTexImage1D(GL_TEXTURE_1D, 0, GL_R16F, 2, 0, GL_RED, GL_FLOAT, texdata);
        check_error();
 
        // Basic state.
@@ -195,7 +195,7 @@ void measure_roundoff_problems()
        check_error();
        glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
        check_error();
-       glTexImage1D(GL_TEXTURE_1D, 0, GL_LUMINANCE32F_ARB, 512, 0, GL_LUMINANCE, GL_FLOAT, texdata);
+       glTexImage1D(GL_TEXTURE_1D, 0, GL_R32F, 512, 0, GL_RED, GL_FLOAT, texdata);
        check_error();
 
        // Basic state.