Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix software backend
ogl rasterfont sets vao and vbo, but both aren't used on software backend
  • Loading branch information
degasus committed Mar 17, 2013
1 parent 2312a8d commit 7597b8b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp
Expand Up @@ -20,6 +20,7 @@

#include "../../Plugin_VideoOGL/Src/GLUtil.h"
#include "../../Plugin_VideoOGL/Src/RasterFont.h"
#include "../../Plugin_VideoOGL/Src/ProgramShaderCache.h"
#include "SWRenderer.h"
#include "SWStatistics.h"

Expand All @@ -30,6 +31,7 @@ static GLint uni_tex = -1;
static GLuint program;

// Rasterfont isn't compatible with GLES
// degasus: I think it does, but I can't test it
#ifndef USE_GLES
OGL::RasterFont* s_pfont = NULL;
#endif
Expand All @@ -45,6 +47,7 @@ void SWRenderer::Shutdown()
#ifndef USE_GLES
delete s_pfont;
s_pfont = 0;
OGL::ProgramShaderCache::Shutdown();
#endif
}

Expand Down Expand Up @@ -87,6 +90,8 @@ void SWRenderer::Prepare()
CreateShaders();
// TODO: Enable for GLES once RasterFont supports GLES
#ifndef USE_GLES
// ogl rasterfont depends on ogl programshadercache
OGL::ProgramShaderCache::Init();
s_pfont = new OGL::RasterFont();
glEnable(GL_TEXTURE_2D);
#endif
Expand All @@ -103,6 +108,9 @@ void SWRenderer::RenderText(const char* pstr, int left, int top, u32 color)
left * 2.0f / (float)nBackbufferWidth - 1,
1 - top * 2.0f / (float)nBackbufferHeight,
0, nBackbufferWidth, nBackbufferHeight, color);

glBindVertexArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
#endif
}

Expand Down

0 comments on commit 7597b8b

Please sign in to comment.