summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sdl-freetype-opengles.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/sdl-freetype-opengles.c b/src/sdl-freetype-opengles.c
index dd6e98e..3ed9ef1 100644
--- a/src/sdl-freetype-opengles.c
+++ b/src/sdl-freetype-opengles.c
@@ -329,17 +329,6 @@ sdl_freetype_opengles_glyphs_render (sdl_freetype_font_t * font,
if (!cached)
return SDL_FREETYPE_ERR_OUT_OF_MEMORY;
- blend_enabled = glIsEnabled (GL_BLEND);
- color_array_enabled = glIsEnabled (GL_COLOR_ARRAY);
- vertex_array_enabled = glIsEnabled (GL_VERTEX_ARRAY);
- texcoord_array_enabled = glIsEnabled (GL_TEXTURE_COORD_ARRAY);
- normal_array_enabled = glIsEnabled (GL_NORMAL_ARRAY);
- tex2d_enabled = glIsEnabled (GL_TEXTURE_2D);
- lighting_enabled = glIsEnabled (GL_LIGHTING);
- glGetFloatv (GL_CURRENT_COLOR, color);
- glGetIntegerv (GL_BLEND_SRC, &blendsrc);
- glGetIntegerv (GL_BLEND_DST, &blenddst);
-
start = 0;
while (start < num_glyphs) {
int end;
@@ -372,11 +361,19 @@ sdl_freetype_opengles_glyphs_render (sdl_freetype_font_t * font,
int left = num_cached;
if (!dirty) {
- GLint max_tex_units = 2;
+ GLint max_tex_units = 2;
int tex;
dirty = SDL_FREETYPE_TRUE;
+ blend_enabled = glIsEnabled (GL_BLEND);
+ glGetIntegerv (GL_BLEND_SRC, &blendsrc);
+ glGetIntegerv (GL_BLEND_DST, &blenddst);
+
+ tex2d_enabled = glIsEnabled (GL_TEXTURE_2D);
+ lighting_enabled = glIsEnabled (GL_LIGHTING);
+ glGetFloatv (GL_CURRENT_COLOR, color);
+
glMatrixMode (GL_TEXTURE);
glGetFloatv(GL_TEXTURE_MATRIX, tmat);
glLoadIdentity ();
@@ -389,7 +386,7 @@ sdl_freetype_opengles_glyphs_render (sdl_freetype_font_t * font,
glDisable (GL_LIGHTING);
- glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_tex_units);
+ glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_tex_units);
for (tex = 1; tex < max_tex_units; tex++) {
glActiveTexture (GL_TEXTURE0 + tex);
glBindTexture (GL_TEXTURE_2D, 0);
@@ -397,6 +394,11 @@ sdl_freetype_opengles_glyphs_render (sdl_freetype_font_t * font,
}
glActiveTexture (GL_TEXTURE0);
glClientActiveTexture (GL_TEXTURE0);
+ color_array_enabled = glIsEnabled (GL_COLOR_ARRAY);
+ vertex_array_enabled = glIsEnabled (GL_VERTEX_ARRAY);
+ texcoord_array_enabled = glIsEnabled (GL_TEXTURE_COORD_ARRAY);
+ normal_array_enabled = glIsEnabled (GL_NORMAL_ARRAY);
+
glEnable (GL_TEXTURE_2D);
glBindTexture (GL_TEXTURE_2D, render->texture);