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_cocoa.mm | |
| 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_cocoa.mm')
| -rw-r--r-- | src/Fl_cocoa.mm | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index ed9872f91..02b8e7ce1 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -972,7 +972,6 @@ static void update_e_xy_and_e_xy_root(NSWindow *nsw) { NSPoint pt; pt = [nsw mouseLocationOutsideOfEventStream]; - Fl::e_window_ = [(FLWindow*)nsw getFl_Window]; Fl::e_x = int(pt.x); Fl::e_y = int([[nsw contentView] frame].size.height - pt.y); pt = [NSEvent mouseLocation]; @@ -980,13 +979,6 @@ static void update_e_xy_and_e_xy_root(NSWindow *nsw) Fl::e_y_root = int(main_screen_height - pt.y); } -int Fl::event_x_pixel() { - return e_x * Fl_X::resolution_scaling_factor(Fl::e_window_); -} - -int Fl::event_y_pixel() { - return e_y * Fl_X::resolution_scaling_factor(Fl::e_window_); -} /* * Cocoa Mousewheel handler @@ -2740,13 +2732,6 @@ static FLTextInputContext* fltextinputcontext_instance = nil; @end -// For Fl_Gl_Window on retina display, returns 2, otherwise 1 -int Fl_X::resolution_scaling_factor(Fl_Window* win) -{ - return (fl_mac_os_version >= 100700 && win && win->as_gl_window() && Fl::use_high_res_GL() && win->i && win->i->mapped_to_retina()) ? 2 : 1; -} - - NSOpenGLPixelFormat* Fl_X::mode_to_NSOpenGLPixelFormat(int m, const int *alistp) { NSOpenGLPixelFormatAttribute attribs[32]; |
