Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top