From b84a8fbd5b7713be94a408dd5ae98120fdd5844f Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Sat, 27 Oct 2018 18:00:15 -0500 Subject: [PATCH] glsl: Use core-compatible OpenGL calls. * Remove glTexCoordPointer because it wasn't affecting anything anyway. * Use GL_TRIANGLE_STRIP instead of deprecated GL_QUADS. --- shaders/glsl.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/shaders/glsl.cpp b/shaders/glsl.cpp index 2e870219..9bf5fad0 100644 --- a/shaders/glsl.cpp +++ b/shaders/glsl.cpp @@ -3,8 +3,8 @@ #include "shader_helpers.h" #include "shader_platform.h" -static const GLfloat tex_coords[16] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, - 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f }; +static const GLfloat tex_coords[16] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, + 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f }; static const GLfloat mvp_ortho[16] = { 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, @@ -685,14 +685,12 @@ void GLSLShader::render(GLuint &orig, GL_TEXTURE_WRAP_T, pass[i].wrap_mode); - glTexCoordPointer(2, GL_FLOAT, 0, tex_coords + (lastpass ? 8 : 0)); - glUseProgram (pass[i].program); set_shader_vars(i); glClearColor(0.0f, 0.0f, 0.0f, 0.5f); glClear(GL_COLOR_BUFFER_BIT); - glDrawArrays(GL_QUADS, 0, 4); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); // reset vertex attribs set in set_shader_vars clear_shader_vars(); @@ -738,7 +736,6 @@ void GLSLShader::render(GLuint &orig, glBindTexture(GL_TEXTURE_2D, orig); glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint)pass.back().width); - glTexCoordPointer(2, GL_FLOAT, 0, tex_coords + 8); } void GLSLShader::register_uniforms ()