rubberbanding in opengl

Hi, I’m stuck with yet another problem in Opengl.
Here we go-
I need to use rubberbanding in my graphics package that is more or less similar to the Paint Brush app in Windows.
Right now, i’ve implemented it somewhat like this:
1)Enter XOR mode.
2)Draw the line to display it.
3)And redraw the old line(to erase it) and redraw it(to draw the new line) whenever the mouse motion callback function is invoked.
The code works just fine, but for the flicker when I move the mouse rapidly.

It gets worse for the rectangle, worser for the circle( and ellipse) and worst for the bezier curve (for the bezier I cant just see the curve at certain times.)

The code is similar to F.S. hill Jr’ code for rubberbanding.

Ya, I cant afford a SGI workstation until I get a solution for this prob!!

My comp has a TNT2 (AGP) as the graphics accelerator (decelerator!!).

are you using doublebuffering ?

Nope i’m not doing so at present coz i’m stuck trying to implement it- fullscreen mode activation occurs only after I send an event to the mouse.
That should not happen- Fullscreen mode should be activated without any stimuli.

Originally posted by princeoflightning:
Nope i’m not doing so at present coz i’m stuck trying to implement it…

But you have to use it, to avoid the flickering.
plaese go to the beginner forum, and ask for doublebuffering or just take a look at any code for openGL… its one of the most basic functions.(take a look at the codeexamples at this site…)

I agree that “beginners” is probably better.

double-buffering != full-screen. SWAP_COPY is used when not full-screen (and is usually quite fast).