diff options
author | Johannes Schickel | 2015-12-21 05:05:37 +0100 |
---|---|---|
committer | Johannes Schickel | 2016-03-16 20:29:25 +0100 |
commit | c7c870bf7f269229d069d47c22b61c237737cdae (patch) | |
tree | 000a7365799a2ed99d044e4169d6916314c34145 /backends/graphics/opengl/texture.cpp | |
parent | 5752f125e1a0d334c3a5bfcea314c4ffceede640 (diff) | |
download | scummvm-rg350-c7c870bf7f269229d069d47c22b61c237737cdae.tar.gz scummvm-rg350-c7c870bf7f269229d069d47c22b61c237737cdae.tar.bz2 scummvm-rg350-c7c870bf7f269229d069d47c22b61c237737cdae.zip |
OPENGL: (Partly) move context specific handling to Context.
This does not include (most) shader setup, and projection matrices yet.
Diffstat (limited to 'backends/graphics/opengl/texture.cpp')
-rw-r--r-- | backends/graphics/opengl/texture.cpp | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp index e394f760f9..08f5e69f03 100644 --- a/backends/graphics/opengl/texture.cpp +++ b/backends/graphics/opengl/texture.cpp @@ -195,32 +195,8 @@ void Texture::draw(GLfloat x, GLfloat y, GLfloat w, GLfloat h) { x + w, y + h }; -#if !USE_FORCED_GL && !USE_FORCED_GLES && !USE_FORCED_GLES2 - if (g_context.type == kContextGLES2) { -#endif -#if !USE_FORCED_GL && !USE_FORCED_GLES - GL_CALL(glVertexAttribPointer(kTexCoordAttribLocation, 2, GL_FLOAT, GL_FALSE, 0, texcoords)); - GL_CALL(glVertexAttribPointer(kPositionAttribLocation, 2, GL_FLOAT, GL_FALSE, 0, vertices)); -#endif -#if !USE_FORCED_GL && !USE_FORCED_GLES && !USE_FORCED_GLES2 - } else { -#endif -#if !USE_FORCED_GLES2 -#if !USE_FORCED_GLES - if (g_context.shadersSupported) { - GL_CALL(glVertexAttribPointerARB(kTexCoordAttribLocation, 2, GL_FLOAT, GL_FALSE, 0, texcoords)); - GL_CALL(glVertexAttribPointerARB(kPositionAttribLocation, 2, GL_FLOAT, GL_FALSE, 0, vertices)); - } else { -#endif - GL_CALL(glTexCoordPointer(2, GL_FLOAT, 0, texcoords)); - GL_CALL(glVertexPointer(2, GL_FLOAT, 0, vertices)); -#if !USE_FORCED_GLES - } -#endif -#endif -#if !USE_FORCED_GL && !USE_FORCED_GLES && !USE_FORCED_GLES2 - } -#endif + // Setup coordinates for drawing. + g_context.setDrawCoordinates(vertices, texcoords); // Draw the texture to the screen buffer. GL_CALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4)); |