Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix Non-GLES run path in videosoftware for the previous commit.
  • Loading branch information
Sonicadvance1 committed Sep 2, 2013
1 parent 8319636 commit 679957d
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp
Expand Up @@ -129,26 +129,14 @@ void SWRenderer::DrawButton(int texID, float *coords)
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

//Texture rectangle uses pixel coordinates
#ifndef USE_GLES
GLfloat u_max = (GLfloat)width;
GLfloat v_max = (GLfloat)height;

static const GLfloat texverts[4][2] = {
{0, v_max},
{0, 0},
{u_max, 0},
{u_max, v_max}
};
#else
static const GLfloat texverts[4][2] = {
{0, 1},
{0, 0},
{1, 0},
{1, 1}
};
#endif
glBindTexture(TEX2D, texID);

glBindTexture(GL_TEXTURE_2D, texID);

glVertexAttribPointer(attr_pos, 2, GL_FLOAT, GL_FALSE, 0, coords);
glVertexAttribPointer(attr_tex, 2, GL_FLOAT, GL_FALSE, 0, texverts);
Expand All @@ -160,7 +148,7 @@ void SWRenderer::DrawButton(int texID, float *coords)
glDisableVertexAttribArray(attr_pos);
glDisableVertexAttribArray(attr_tex);

glBindTexture(TEX2D, 0);
glBindTexture(GL_TEXTURE_2D, 0);

glDisable(GL_BLEND);
}
Expand Down

0 comments on commit 679957d

Please sign in to comment.