tags:

views:

55

answers:

1

Here is my situation. I'm creating a drawing application using OpenGL and WinAPI. My OpenGL frame has scrollbars which renders the screen and modifies GlTranslatef when it gets a scroll message. The problem is wen I get too many shapes the scrollbar is less responsive since it cannot rerender it each and every time it gets a scroll message. How could I make it so the scrollbar has priority. I want it to skip drawing if it would compromise the smoothness of the scrolling. I thought of doing rendering on a separate thread but I was told all UI things should stay on the same thread. Thanks

A: 

You can measure the runtime of your draw routine. When it is greater than a threshold you decide, you should either throttle the updates or draw less (if you can).

zenerino
The only problem I see with this is what if the user wants to move with precision, then if I only render 1/3 of the time it will seem strange
Milo
Agreed. But if you are running in the same thread of execution it's not physically possible to make the scrollbars following the user input, unless you speed up your drawing routine.Make the math: if it takes 0.05 msec to draw an object and you have 2000 objects that's 100 msec. Even if you have the drawing code on a different thread it'll be drawing at 10 FPS. And dramatically lagging.If you want your scrollbar to be fast and your content animation to be smooth you gotta draw faster. How does your drawing code look like?What's your environment/language?
zenerino
I'm drawing polygons with a GLUTesselator and OpenGL. Since the shapes are editable I can't use display lists...
Milo