From 597ac17bda5711bb323a508105f29e43b9fb8381 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 1 Dec 2015 16:17:37 +0000 Subject: 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 --- examples/OpenGL3test.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/OpenGL3test.cxx b/examples/OpenGL3test.cxx index 0699d39cb..8c293f81f 100644 --- a/examples/OpenGL3test.cxx +++ b/examples/OpenGL3test.cxx @@ -149,7 +149,7 @@ public: data[0] *= factor; glBufferSubData(GL_ARRAY_BUFFER, 24*sizeof(GLfloat), 4*sizeof(GLfloat), data); redraw(); - add_output("push\n"); + add_output("push Fl::event_x_pixel()=%d Fl::event_y_pixel()=%d\n",Fl::event_x_pixel(), Fl::event_y_pixel()); return 1; } return Fl_Gl_Window::handle(event); @@ -189,7 +189,8 @@ void add_output(const char *format, ...) va_start(args, format); vsnprintf(line_buffer, sizeof(line_buffer)-1, format, args); va_end(args); - output->insert(line_buffer); + output->buffer()->append(line_buffer); + output->scroll(10000, 0); output->redraw(); } -- cgit v1.2.3