please help!
I have compiled same program in FLTK2 (fltk-2.0.x-r6834) and FLTK1
(fltk-1.3.x-r6943) and the drawing performance is visibly worse in fltk2
version of the program. Both versions have been compiled on the same machine in
same Windows operating system.
The program is very simple. In FLTK2 version I inherited from Window widget and
overwritten the draw(). In FLTK1 version I inherited from Fl_Double_Window and
again overwritten the draw(). I also overwritten handle() but the code is
identical there.
The code in draw() renders the RGB image into the memory using AGG graphics
library. And for drawing the image I use:
//fltk1:
fl_draw_image(buf, 0, 0, w(), h()) ;
//fltk2:
drawimage(buf, RGB, Rectangle(0, 0, w(), h()));
In the main() of fltk2 version after window->show() I do:
window->set_double_buffer();
program main() starts with:
//fltk1:
if (!Fl::visual(FL_DOUBLE))
log_file.print("Xdbe not supported, faking double buffer with pixmaps.");
//fltk2:
if (!visual(DOUBLE_BUFFER))
log_file.print("Xdbe not supported, faking double buffer with pixmaps.");
when executing either of programs I find the above message written in my log
file(means that visual() returns false in both cases).
Apart from this there are no relevant differences between the two in the code.
The program just render two circles, ellipses and lines as you click and drag
the mouse across the window. The drawing is visibly not as smooth in FLTK2
version as in the FLTK1 version of the program. The CPU is around 80% busy in
both programs when drawing. Both fltk1 and fltk2 have been configured with
./configure --enable-xft --enable-xdbe
compiled and instaled in Windows MinGW enviroment.
I have big project written in the FLTK2 which is using drawing from the memory
(using drawimage()) and I don't want to rewrite everything to FLTK1 code. It
might not even be possible not speaking how time consuming it would be. I
wonder what is the cause for FLTK2 drawing not to be as smooth/quick as in
FLTK1.
Any help is much appreciated!
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk