diff --git a/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp b/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp index 57ccdaad1b..af2f3cf069 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp @@ -129,21 +129,24 @@ const u8 rasters[char_count][char_height] = { }; static const char *s_vertexShaderSrc = - "attribute vec2 vertexPosition;\n" - "attribute vec2 texturePosition;\n" - "varying vec2 tpos;\n" + "#version 130\n" + "uniform vec2 charSize;\n" + "in vec2 vertexPosition;\n" + "in vec2 texturePosition;\n" + "out vec2 tpos;\n" "void main(void) {\n" " gl_Position = vec4(vertexPosition,0,1);\n" - " tpos = texturePosition;\n" + " tpos = texturePosition * charSize;\n" "}\n"; static const char *s_fragmentShaderSrc = - "#extension GL_ARB_texture_rectangle : enable\n" - "uniform sampler2DRect textureSampler;\n" + "#version 130\n" + "uniform sampler2D samp0;\n" "uniform vec4 color;\n" - "varying vec2 tpos;\n" + "in vec2 tpos;\n" + "out vec4 ocol0;\n" "void main(void) {\n" - " gl_FragColor = texture2DRect(textureSampler,tpos) * color;\n" + " ocol0 = texture2D(samp0,tpos) * color;\n" "}\n"; @@ -154,7 +157,7 @@ RasterFont::RasterFont() { // generate the texture glGenTextures(1, &texture); - glBindTexture(GL_TEXTURE_RECTANGLE, texture); + glBindTexture(GL_TEXTURE_2D, texture); u32* texture_data = new u32[char_width*char_count*char_height]; for(u32 y=0; y>16)&0xff)/255.f,((color>>8)&0xff)/255.f,((color>>0)&0xff)/255.f,((color>>24)&0xff)/255.f); + glUniform4f(uniform_color_id, GLfloat((color>>16)&0xff)/255.f,GLfloat((color>>8)&0xff)/255.f,GLfloat((color>>0)&0xff)/255.f,GLfloat((color>>24)&0xff)/255.f); cached_color = color; } glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_RECTANGLE, texture); + glBindTexture(GL_TEXTURE_2D, texture); glDrawArrays(GL_TRIANGLES, 0, usage/4); // TODO: this after merging with graphic_update