DrawReversibleLine() and double buffering

778 views Asked by At

I'm using a curstom double buffering and want to draw a rubber band line with DrawReversibleLine(). But how can this be done? This method draws directly to the screen, so I see no way how to draw on the background buffer. What would you do?

2

There are 2 answers

0
Daniel Mošmondor On BEST ANSWER

I would... have one manually managed back buffer with my image, and manually paint it then rubber band on the screen when something is changed i.e. one end of the rubberband line pulled.

XOR-ed lines (DrawReversibleLine()) were meant to die with ZX Spectrum or Hercules graphics.

1
Felice Pollano On

You should draw in the front buffer: DrawReversibleLine works without needing to redraw the buffers, you just have to redraw the line in the same place to make it disappear. This is a good optimization that allow you to just draw the rubber box whitout drawing the entire scene, so having DrawReversibleLine drawing onto the screen should not be an issue.