diff options
| author | Manolo Gouy <Manolo> | 2015-12-01 16:17:37 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2015-12-01 16:17:37 +0000 |
| commit | 597ac17bda5711bb323a508105f29e43b9fb8381 (patch) | |
| tree | cf8f77365c75ca8b7bc5874635b1e8bcec082699 /FL | |
| parent | f91579545394c97bcc0bc2ea31c840f63eb1a420 (diff) | |
Mac OS: added Fl::event_x_pixel() and Fl::event_y_pixel() that return the mouse event position
in pixel units that differ from FLTK units for OpenGL windows mapped to a retina display.
On non Mac OS platforms, these are synonyms of Fl::event_x() and Fl::event_y().
The example/OpenGL3test demo program is modified to call these new functions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10941 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl.H | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -135,6 +135,9 @@ public: // should be private! static int e_y; static int e_x_root; static int e_y_root; +#ifdef __APPLE__ + static Fl_Window *e_window_; +#endif static int e_dx; static int e_dy; static int e_state; @@ -601,6 +604,29 @@ public: event_x(),event_y(). */ static int event_y_root() {return e_y_root;} +#ifdef __APPLE__ + static int event_x_pixel(); + static int event_y_pixel(); +#else + /** Horizontal position in pixels of the mouse event relative to the Fl_Window it was passed to. + Generally identical with Fl::event_x(), but for OpenGL windows of macintosh computers + with a 'retina' display, and if Fl::use_high_res_GL(bool) is set to true, + the returned position, measured in pixels, differs from Fl::event_x(), measured in FLTK units. + \version 1.3.4 + */ + static int event_x_pixel() { + return e_x; + } + /** Vertical position in pixels of the mouse event relative to the Fl_Window it was passed to. + Generally identical with Fl::event_y(), but for OpenGL windows of macintosh computers + with a 'retina' display, and if Fl::use_high_res_GL(bool) is set to true, + the returned position, measured in pixels, differs from Fl::event_y(), measured in FLTK units. + \version 1.3.4 + */ + static int event_y_pixel() { + return e_y; + } +#endif /** Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event. Right is positive. |
