On 7 Jan 2008, at 17:07, Jens Grunert wrote: > thanks for the tips, I did a quick modification doing the redrawing > of all rectangle within one container in the draw() function but > it's even slower. > > I did also play with the return values from the handler in the > original program but could not notice any differenze. > > Are there any other ways to make it faster (I can't use opengl > since the graphic card does not support it).
A couple of things come to mind: - Any timings you make of code that has print output is quite possibly meaningless, since the i/o stream will mess up your timings. You need to time your code with the cout's removed. File or terminal i/o is generally slow compared to graphics i/o. - Rendering a scene this complex on a graphics card that can't even do OpenGL seems like a difficult place to be. Pretty much all "reasonably powerful" graphics cards have some accelerated OpenGL driver these days I thought? - rendering a scene this complex directly with a widget per item is not the way to do it. When you are zoomed out, each widget could be less than a single pixel, yet you still need the full widget rendering overhead. That simply makes no sense. Similarly, when you are zoomed right in, you have a great many widgets to process that are dimply not visible on the screen, yet you still need to process their positions so you can tell whether they need to be rendered or not. Rather, what you need is an abstract representation of the objects in your scene which you can easily search to determine which are visible or not - then you decide what to draw... If you are very zoomed out, you need some way of determining which pixels to fill, simply rendering all the widgets and hoping that will somehow dither to produce the correct scene is unlikely to work satisfactorily. In effect, when zoomed out, you need a mechanism for determining what a standard eye could discern on a standard monitor, and render only that... - It would probably help if you could tell us what you are actually trying to achieve, rather than what you have done or how you have gone about doing it. Then perhaps someone here could suggest how best to do it. There are folk here from many different backgrounds, there's a good chance someone will have worked on something similar in the past. _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

