Jens Grunert wrote:
> Thanks to all feedback to my previous questions wich helped me to get started
> with my little application. It has simple zoom and each rectangle is
> selectable. The little program below works good for up to 100.000 rectangles
> but trying to display about 1 Mio components it's by far too slow.
>
> I would be very glad if somebody could give me some hints on howto make the
> programm a lot faster when I want to display many rectangles.
>
> Here is the program (below is the output from the profiling).
>
If you are talking about just squares, use opengl. It will be
accelerated in hardware on most gfx cards of the past 10 years.
As the code goes:
a) Handle your selection of a square in a single handle() function in a
global container like a derived group that contains all squares and
always return 1. That will avoid fltk from having to dispatch 100000+
handle calls to each square. On a pick, that function should select and
set a redraw on the proper square directly.
b) Iterate through your std::vector using an iterator not an
at() loop.
c) precalculate 1/gzoom and use a multiply instead.
d) Remove all printing commands.
--
Gonzalo Garramuño
[EMAIL PROTECTED]
AMD4400 - ASUS48N-E
GeForce7300GT
Xubuntu Gutsy
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk