summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-12-01 16:17:37 +0000
committerManolo Gouy <Manolo>2015-12-01 16:17:37 +0000
commit597ac17bda5711bb323a508105f29e43b9fb8381 (patch)
treecf8f77365c75ca8b7bc5874635b1e8bcec082699 /examples
parentf91579545394c97bcc0bc2ea31c840f63eb1a420 (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 'examples')
-rw-r--r--examples/OpenGL3test.cxx5
1 files changed, 3 insertions, 2 deletions
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();
}