mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 23:06:54 +08:00
Cleaner access to Fl_Gl_Window_Driver objects.
This commit is contained in:
@@ -50,13 +50,8 @@ class Fl_Gl_Window_Driver;
|
|||||||
*/
|
*/
|
||||||
class FL_EXPORT Fl_Gl_Window : public Fl_Window {
|
class FL_EXPORT Fl_Gl_Window : public Fl_Window {
|
||||||
friend class Fl_Gl_Window_Driver;
|
friend class Fl_Gl_Window_Driver;
|
||||||
friend class _Fl_Gl_Overlay;
|
|
||||||
friend class Fl_OpenGL_Display_Device;
|
|
||||||
Fl_Gl_Window_Driver *pGlWindowDriver;
|
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_;
|
int mode_;
|
||||||
const int *alist;
|
const int *alist;
|
||||||
Fl_Gl_Choice *g;
|
Fl_Gl_Choice *g;
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ public:
|
|||||||
virtual int genlistsize() { return 0; } // support for gl_draw()
|
virtual int genlistsize() { return 0; } // support for gl_draw()
|
||||||
virtual Fl_Font_Descriptor** fontnum_to_fontdescriptor(int fnum);
|
virtual Fl_Font_Descriptor** fontnum_to_fontdescriptor(int fnum);
|
||||||
virtual Fl_RGB_Image* capture_gl_rectangle(int x, int y, int w, int h);
|
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 */
|
#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)
|
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.
|
/* 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();
|
uchar save_valid = w->valid();
|
||||||
w->valid(valid());
|
w->valid(valid());
|
||||||
Fl_Xlib_Graphics_Driver::fl_overlay = 1;
|
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;
|
Fl_Xlib_Graphics_Driver::fl_overlay = 0;
|
||||||
valid(w->valid());
|
valid(w->valid());
|
||||||
w->valid(save_valid);
|
w->valid(save_valid);
|
||||||
|
|||||||
Reference in New Issue
Block a user