X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=init.cpp;h=1d7c46a50a63fb0cb1138f885efae4526eaaef0b;hb=ba1339c311f67fa4718e6995d8bc446ac45e3244;hp=b7604e4333979bcd2faa3b06f9bb46864bee8db6;hpb=d398770154ecc4bc95282dc45656789dd5686309;p=movit diff --git a/init.cpp b/init.cpp index b7604e4..1d7c46a 100644 --- a/init.cpp +++ b/init.cpp @@ -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); @@ -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);