Skip to main content
GameDev.net gamedev.net
šŸ”’ Locked

render only when necessary

Started by Funkymunky Nov 25, 2008 at 5:23 PM 1 replies 550+ views
Original Post
Funkymunky
Funkymunky
i'm developing an editor programming. it uses opengl for the rendering, with multiple contexts for multiple windows. i don't need to render at 60fps, in fact i really only want to render when necessary. right now i just render on mouse movement, so i can easily run my mouse over it and see what it is, but what would be the best way to render only when the display needs updating?
_the_phantom_
_the_phantom_
you could render to a texture and, until the view needs to change, just rerender the image each frame instead.

This is about the lowest overhead you'll get I guess.
Codeka
Codeka
Why not just respond to WM_PAINT? That's the standard way of drawing in Windows. To "force" a repaint, just use InvalidateRect.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.