diff options
| author | Manolo Gouy <Manolo> | 2015-12-02 09:59:37 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2015-12-02 09:59:37 +0000 |
| commit | 22af09dae7a2e17f0b1253030fd3cb7c6ce92799 (patch) | |
| tree | 9e715f50811df7a6d9a6647a61e289b06371a936 /src/Fl_Gl_Window.cxx | |
| parent | 30e572985b24eb685e3d9eb0112017c4fc318b4d (diff) | |
Mac OS: support for high resolution OpenGL windows.
Methods Fl::event_x_pixel() and Fl::event_y_pixel() committed at r.10941
are removed. Instead method Fl_Gl_Window::pixels_per_unit() is added.
The documentation explains in more detail how to write cross-platform
FLTK code supporting high resolution OpenGL windows on retina displays.
The examples/OpenGL3test.cxx app exercises Fl_Gl_Window::pixels_per_unit().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10945 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Window.cxx')
| -rw-r--r-- | src/Fl_Gl_Window.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 7fa0a4004..46e7ebbb7 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -96,14 +96,9 @@ void Fl_Gl_Window::show() { #if defined(__APPLE__) -int Fl_Gl_Window::pixel_w() +int Fl_Gl_Window::pixels_per_unit() { - return Fl_X::resolution_scaling_factor(this) * w(); -} - -int Fl_Gl_Window::pixel_h() -{ - return Fl_X::resolution_scaling_factor(this) * h(); + return (fl_mac_os_version >= 100700 && Fl::use_high_res_GL() && Fl_X::i(this) && Fl_X::i(this)->mapped_to_retina()) ? 2 : 1; } #endif // __APPLE__ |
