]> git.sesse.net Git - movit/blobdiff - init.cpp
Remove GL_LUMINANCE in more places.
[movit] / init.cpp
index b7604e4333979bcd2faa3b06f9bb46864bee8db6..0957a11fc2077386bff4cb9ea4320cad36c58709 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.
@@ -89,16 +89,16 @@ void measure_texel_subpixel_precision()
        // texture coordinates in order not to get long stretches of (1,1,1,...)
        // at the start and (...,0,0,0) at the end.
        float vertices[] = {
+               0.0f, 1.0f,
                0.0f, 0.0f,
-               1.0f, 0.0f,
                1.0f, 1.0f,
-               0.0f, 1.0f
+               1.0f, 0.0f
        };
        float texcoords[] = {
+               0.25f, 0.0f,
                0.25f, 0.0f,
                0.75f, 0.0f,
-               0.75f, 0.0f,
-               0.25f, 0.0f
+               0.75f, 0.0f
        };
 
        GLuint vao;
@@ -110,7 +110,7 @@ void measure_texel_subpixel_precision()
        GLuint position_vbo = fill_vertex_attribute(glsl_program_num, "position", 2, GL_FLOAT, sizeof(vertices), vertices);
        GLuint texcoord_vbo = fill_vertex_attribute(glsl_program_num, "texcoord", 2, GL_FLOAT, sizeof(texcoords), texcoords);
 
-       glDrawArrays(GL_QUADS, 0, 4);
+       glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
        check_error();
 
        cleanup_vertex_attribute(glsl_program_num, "position", position_vbo);
@@ -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.
@@ -216,16 +216,16 @@ void measure_roundoff_problems()
 
        // Draw the texture stretched over a long quad, interpolating it out.
        float vertices[] = {
+               0.0f, 1.0f,
                0.0f, 0.0f,
-               1.0f, 0.0f,
                1.0f, 1.0f,
-               0.0f, 1.0f
+               1.0f, 0.0f
        };
        float texcoords[] = {
+               0.25f, 0.0f,
                0.25f, 0.0f,
                0.75f, 0.0f,
-               0.75f, 0.0f,
-               0.25f, 0.0f
+               0.75f, 0.0f
        };
 
        GLuint vao;
@@ -237,7 +237,7 @@ void measure_roundoff_problems()
        GLuint position_vbo = fill_vertex_attribute(glsl_program_num, "position", 2, GL_FLOAT, sizeof(vertices), vertices);
        GLuint texcoord_vbo = fill_vertex_attribute(glsl_program_num, "texcoord", 2, GL_FLOAT, sizeof(texcoords), texcoords);
 
-       glDrawArrays(GL_QUADS, 0, 4);
+       glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
        check_error();
 
        cleanup_vertex_attribute(glsl_program_num, "position", position_vbo);