render only when necessary

Started by
1 comment, last by Codeka 15 years, 5 months ago
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?
Advertisement
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.
Why not just respond to WM_PAINT? That's the standard way of drawing in Windows. To "force" a repaint, just use InvalidateRect.

This topic is closed to new replies.

Advertisement