From 762d02fb6207c40e3c0e2ff8a9d41a510094f9c0 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 16 Mar 2010 22:51:31 +0000 Subject: Using Fl_Plugin feature to automatically draw OpenGL (sub)windows. No extra coding needs to be done. Just call Fl_Printer::print_widget(...). The Fl_Gl_Printer device can (and should) be removed or at least made inaccessible. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7280 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Device.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Fl_Device.cxx') diff --git a/src/Fl_Device.cxx b/src/Fl_Device.cxx index 03e8367ac..642ddd22b 100644 --- a/src/Fl_Device.cxx +++ b/src/Fl_Device.cxx @@ -52,7 +52,16 @@ void Fl_Virtual_Printer::print_widget(Fl_Widget* widget, int delta_x, int delta_ #else _XGC *save_gc = fl_gc; // FIXME #endif - widget->draw(); + // we do some trickery to recognize OpenGL windows and draw them via a plugin + int drawn_by_plugin = 0; + if (widget->as_gl_window()) { + Fl_Plugin_Manager pm("fltk:device"); + Fl_Device_Plugin *pi = (Fl_Device_Plugin*)pm.plugin("opengl.device.fltk.org"); + if (pi) drawn_by_plugin = pi->print(this, widget, 0, 0); + } + if (!drawn_by_plugin) + widget->draw(); + fl_gc = save_gc; if (is_window) fl_pop_clip(); // find subwindows of widget and print them -- cgit v1.2.3