> > I'd look at rendering into an offscreen
> > buffer, which I could safely access at my leisure (and not 
> just inside
> > fltk's draw method.)
> > Then have the window draw method copy the offscreen into 
> the window as
> > required.
> 
> This seems like a reasonable approach.
> 
> Is it possible to copy just a portion from an offscreen 
> buffer to the screen?  I am concerned that a full blit may be 
> too slow for me and also wasteful, especially when I only 
> need to update small areas.

>From the docs:

"void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen osrc,
int srcx, int srcy)

Copy a rectangular area of the size w*h from srcx, srcy in the offscreen
buffer into the current buffer at x, y. "

So it looks like you can blit a sub-rectangle of your offscreen to your
target. That said, I always make the offscreen pretty much the same as
the target and blit the whole lot, so I've never really tried it.

How slow is slow? With current hardware, it's generally less work to
blit the whole lot than it is to work out what areas are damaged and
update them. YMMV, of course, but I'd start with the simple option and
optimize later if it is actually needed (nothing like a little premature
optimisation to really screw your code up, I always say!)

Hope that helps,
-- 
Ian



SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to