> It's not clear how to actually *use* a different graphics driver, I'm
> simply swapping my driver into fltk3::graphics_driver when drawing the
> window, but this seems unlikely to be the correct way...suggestions? I
> use the existing FLTK font stuff.

Assuming you just have to change the way you draw into windows,
do this:
- create a Fl_Graphics_Driver derived class, say, Fl_OpenGL_Driver,
and implement all its virtual member functions
- create an Fl_OpenGL_Driver object:
  Fl_OpenGL_Driver *ogl_driver = new Fl_OpenGL_Driver();
- replace the default graphics driver (X11/Quartz/GDI) by yours:
  Fl_Graphics_Driver *old_driver =
     Fl_Display_Device::display_device()->driver();
  Fl_Display_Device::display_device()->driver(ogl_driver);
- activate the new driver:
  Fl_Display_Device::display_device()->set_current();

At that point, all graphics primitives will use OpenGL.
You can return to default with:
  Fl_Display_Device::display_device()->driver(old_driver);
  Fl_Display_Device::display_device()->set_current();


But all of that do little more than :
  fl_graphics_driver = ogl_driver;
as you do already

>
> Is there an easy way to render a "standard" window to an image? It'd
> greatly streamline testing if I could do comparisons in the app itself.

fl_read_image() as you already discovered

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to