
Approach for partial redrawing on 2D environment
Posted Wednesday, 18 July, 2012 - 11:49 by rounder8 inHi, I've got a trading program that uses 2D drawing only. I made my first implementation with GDI+ but ran into performance problems. This is a sample of the graphics (made with GDI+) during slow market activity. When market starts acting quickly GDI implementation gets too slow.
I started to implement the drawing with OpenGL in order to make it faster. How should I approach updating only parts of the screen that are actually changed instead of redrawing everything? How do I keep front and back buffers synched when using double buffering (default in OpenTK)? Right now I'm ending up with situation where one buffer is showing a part of the whole picture and the other buffer the another part of the picture which causes flickering and confusion.


Comments
Re: Approach for partial redrawing on 2D environment
Hmm I think the previous post must have been posted on a wrong thread. Anyway I figured out a solution that seems quick enough for now.
Every time something new is painted (after backbuffer is swapped to front) I just copy everything from current frontbuffer to backbuffer like this:
Updating the whole screen even hundreds of times a second with multiple instruments causes no problems at all with this method. Considering I can optimize the code by updating only the neccessary parts this will be extremely fast method.