Esempio n. 1
0
void _Fl_Overlay::flush()
{
    fl_window = fl_xid(this);
    if (!gc) gc = XCreateGC(fl_display, fl_xid(this), 0, 0);
    fl_gc = gc;
    fl_overlay = 1;
    Fl_Overlay_Window *w = (Fl_Overlay_Window *)parent();
    current_ = w;
    Fl_X *i = Fl_X::i(this);
    if (damage() == FL_DAMAGE_EXPOSE)
    {
        fl_clip_region(i->region); i->region = 0;
        w->draw_overlay();
        fl_clip_region(0);
    }
    else
    {
        XClearWindow(fl_display, fl_xid(this));
        w->draw_overlay();
    }
    fl_overlay = 0;
}
Esempio n. 2
0
void Fl_Overlay_Window::flush()
{
    #if BOXX_OVERLAY_BUGS
    if (overlay_ && overlay_ != this && overlay_->shown())
    {
        // all drawing to windows hidden by overlay windows is ignored, fix this
        XUnmapWindow(fl_display, fl_xid(overlay_));
        Fl_Double_Window::flush(0);
        XMapWindow(fl_display, fl_xid(overlay_));
        return;
    }
    #endif
    bool erase_overlay = (damage()&FL_DAMAGE_OVERLAY) != 0;
    set_damage(damage()&~FL_DAMAGE_OVERLAY);
    Fl_Double_Window::flush(erase_overlay);
    if (overlay_ == this) draw_overlay();
    fl_clip_region(0);           // turn off any clip it left on
}
Esempio n. 3
0
void gl_start()
{
    if (!context)
    {
#ifdef _WIN32
        if (!gl_choice) fl_gl_visual(0);
        context = fl_create_gl_context(Fl_Window::current(), gl_choice);
#else
        context = fl_create_gl_context(fl_visual);
#endif
    }
    fl_set_gl_context(Fl_Window::current(), context);
#ifndef _WIN32
    glXWaitX();
#endif
    if (pw != Fl_Window::current()->w() || ph != Fl_Window::current()->h())
    {
        pw = Fl_Window::current()->w();
        ph = Fl_Window::current()->h();
        glLoadIdentity();
        glViewport(0, 0, pw, ph);
        glOrtho(0, pw, 0, ph, -1, 1);
        glDrawBuffer(GL_FRONT);
    }
    //  if (clip_state_number != fl_clip_state_number) {
    //    clip_state_number = fl_clip_state_number;
    int x, y, w, h;
    if (fl_clip_box(0, 0, Fl_Window::current()->w(), Fl_Window::current()->h(),
        x, y, w, h))
    {
        fl_clip_region(XRectangleRegion(x,y,w,h));
        glScissor(x, Fl_Window::current()->h()-(y+h), w, h);
        glEnable(GL_SCISSOR_TEST);
    }
    else
    {
        glDisable(GL_SCISSOR_TEST);
    }
    //  }
}
Esempio n. 4
0
 FL_EXPORT_C(fl_Region,flc_clip_region)( ){
   return (fl_Region)fl_clip_region();
 }
Esempio n. 5
0
 FL_EXPORT_C(void,flc_set_clip_region)(fl_Region r){
   fl_clip_region((static_cast<Fl_Region>(r)));
 }