Cleaner access to Fl_Gl_Window_Driver objects.
This commit is contained in:
parent
f9e8ef0b7a
commit
9df287b415
@ -50,13 +50,8 @@ class Fl_Gl_Window_Driver;
|
||||
*/
|
||||
class FL_EXPORT Fl_Gl_Window : public Fl_Window {
|
||||
friend class Fl_Gl_Window_Driver;
|
||||
friend class _Fl_Gl_Overlay;
|
||||
friend class Fl_OpenGL_Display_Device;
|
||||
Fl_Gl_Window_Driver *pGlWindowDriver;
|
||||
|
||||
/** Returns a pointer to the window's Fl_Gl_Window_Driver object */
|
||||
Fl_Gl_Window_Driver *gl_driver() {return pGlWindowDriver;}
|
||||
|
||||
int mode_;
|
||||
const int *alist;
|
||||
Fl_Gl_Choice *g;
|
||||
|
||||
@ -100,6 +100,7 @@ public:
|
||||
virtual int genlistsize() { return 0; } // support for gl_draw()
|
||||
virtual Fl_Font_Descriptor** fontnum_to_fontdescriptor(int fnum);
|
||||
virtual Fl_RGB_Image* capture_gl_rectangle(int x, int y, int w, int h);
|
||||
static inline Fl_Gl_Window_Driver* driver(const Fl_Gl_Window *win) {return win->pGlWindowDriver;}
|
||||
};
|
||||
|
||||
#endif /* Fl_Gl_Window_Driver_H */
|
||||
|
||||
@ -40,7 +40,7 @@ Fl_OpenGL_Display_Device::Fl_OpenGL_Display_Device(Fl_OpenGL_Graphics_Driver *gr
|
||||
|
||||
Fl_RGB_Image* Fl_OpenGL_Display_Device::capture_gl_rectangle(Fl_Gl_Window* glw, int x, int y, int w, int h)
|
||||
{
|
||||
return glw->gl_driver()->capture_gl_rectangle(x, y, w, h);
|
||||
return Fl_Gl_Window_Driver::driver(glw)->capture_gl_rectangle(x, y, w, h);
|
||||
}
|
||||
|
||||
/* Captures a rectangle of a Fl_Gl_Window and returns it as a RGB image.
|
||||
|
||||
@ -430,7 +430,7 @@ void _Fl_Gl_Overlay::draw() {
|
||||
uchar save_valid = w->valid();
|
||||
w->valid(valid());
|
||||
Fl_Xlib_Graphics_Driver::fl_overlay = 1;
|
||||
w->gl_driver()->draw_overlay();
|
||||
Fl_Gl_Window_Driver::driver(w)->draw_overlay();
|
||||
Fl_Xlib_Graphics_Driver::fl_overlay = 0;
|
||||
valid(w->valid());
|
||||
w->valid(save_valid);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user