summaryrefslogtreecommitdiff
path: root/src/gl_draw.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-05-08 16:20:24 +0000
committerManolo Gouy <Manolo>2016-05-08 16:20:24 +0000
commit8813f93ac105e2ae58282f1d4fc5552591423712 (patch)
tree5a1a5cf2400d31cf460c89284ce527743e7a4529 /src/gl_draw.cxx
parent8fcccb05d4ba3620871f8fdbe87decd50a9b444b (diff)
Fix gl_draw() used in simple window under Mac OS X.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11719 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/gl_draw.cxx')
-rw-r--r--src/gl_draw.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx
index 2a4722fe3..b33844dbd 100644
--- a/src/gl_draw.cxx
+++ b/src/gl_draw.cxx
@@ -369,7 +369,8 @@ static int has_texture_rectangle = 0; // true means GL_EXT_texture_rectangle is
#include <FL/glu.h> // for gluUnProject() and gluCheckExtension()
#include <FL/glut.H> // for glutStrokeString() and glutStrokeLength()
-#include <src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h>
+#include <src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H>
+#include <src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H>
// manages a fifo pile of pre-computed string textures
class gl_texture_fifo {
@@ -554,7 +555,13 @@ static gl_texture_fifo *gl_fifo = NULL; // points to the texture pile class inst
// draws a utf8 string using pre-computed texture if available
void Fl_Cocoa_Gl_Window_Driver::draw_string(const char* str, int n)
{
- gl_scale = Fl_Window::current()->as_gl_window()->pixels_per_unit();
+ Fl_Window *win = Fl_Window::current();
+ if (win->as_gl_window())
+ gl_scale = win->as_gl_window()->pixels_per_unit();
+ else
+ gl_scale = (fl_mac_os_version >= 100700 && win->shown() &&
+ Fl_Cocoa_Window_Driver::driver(win)->mapped_to_retina()) ? 2 : 1;
+
//fprintf(stderr,"gl_scale=%d\n",gl_scale);
if (! gl_fifo) gl_fifo = new gl_texture_fifo();
if (!gl_fifo->textures_generated) {