summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2014-01-15 21:47:37 +0000
committerManolo Gouy <Manolo>2014-01-15 21:47:37 +0000
commit9c6eb8be290cf9a95f987be96677cdb45be27fd8 (patch)
tree3567e1f1cc3d37c1b83feb243634c09def0c9455
parentfe1793f13b9a70eea9177a43826ce320c1a477ad (diff)
Mac OS: when computing a texture, save/restore the global fl_gc variable.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10061 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/gl_draw.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx
index 7e22b02e2..62f0510fe 100644
--- a/src/gl_draw.cxx
+++ b/src/gl_draw.cxx
@@ -473,6 +473,7 @@ int gl_texture_fifo::compute_texture(const char* str, int n)
CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB();
void *base = calloc(4*fifo[current].width, fifo[current].height);
if (base == NULL) return -1;
+ CGContextRef save_gc = fl_gc;
fl_gc = CGBitmapContextCreate(base, fifo[current].width, fifo[current].height, 8, fifo[current].width*4, lut, kCGImageAlphaPremultipliedLast);
CGColorSpaceRelease(lut);
fl_graphics_driver->font_descriptor(gl_fontsize);
@@ -488,7 +489,7 @@ int gl_texture_fifo::compute_texture(const char* str, int n)
glTexImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, fifo[current].width, fifo[current].height, 0, GL_RGBA, GL_UNSIGNED_BYTE, base);
glPopAttrib();
CGContextRelease(fl_gc);
- fl_gc = NULL;
+ fl_gc = save_gc;
free(base);
fifo[current].fdesc = gl_fontsize;
return current;