matthiasm wrote:
> int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W,
> int &H)
>
> Intersect the rectangle x,y,w,h with the current clip region and
> returns the bounding box of the result in X,Y,W,H. Returns non-zero
> if the resulting rectangle is different than the original. This can
> be used to limit the necessary drawing to a rectangle. W and H are
> set to zero if the rectangle is completely outside the region.
I read this before, but I still dont know what are exactly X,Y,W,H and how to
use fl_clip_box.
In my app I have a widget wich invoke parent()->redraw() in order to be redrawn.
The pb is that each time the main window (parent) is entirely redrawn.
So I want to reduce the clipping area and redraw only what is necessary.
This is a pseudo code wich show the way I'm trying to make it works, but it
doesn't.
int xx, yy, ww, hh;
void draw() //draw function of the main window
{
if(widget->wdgRedraw) //flag indicates that widget must be redrawn
{
xx = xClipBox;
yy = yClipBox;
ww = wClipBox;
hh = hClipBox;
fl_clip_box(xClipBox, yClipBox, wClipBox, hClipBox, xx, yy, ww, hh);
fl_pop_clip();
widget->wdgRedraw = false;
return;
}
Fl_Double_Window::draw();
}
Can someone help me ?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk