开发者

Frame skipping with OpenGL and WinAPI?

开发者 https://www.devze.com 2023-01-02 22:26 出处:网络
Here is my situation. I\'m creating a d开发者_JS百科rawing application using OpenGL and WinAPI. My OpenGL frame has scrollbars which renders the screen and modifies GlTranslatef when it gets a scroll

Here is my situation. I'm creating a d开发者_JS百科rawing 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


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消