It should work fine the way you are doing it, but the ugly flickering shouldn't be there. Somewhere between the first draw and the second draw, the first draw is showing up on-screen.
It should go something like:
MyDrawFunction()
{
if(...time-to-pick...)
{
DrawPickingBackground();
DrawPickingColors();
ProcessPick();
}
DrawNormalBackground();
DrawNormal();
FlipBuffers(); //Only flipped after a normal draw.
}
I see you have a functon called SwapBuffer(), but are you sure your code is double buffered? Have you tested it to make sure it doesn't just look like it's working?
If you're using the Win32 SwapBuffers() function (which I'm not personally familiar with), did you actually enable double buffering?
The function documentation says:
"[color=#000000]Specifies a device context. [color=#ff0000]*If*[color=#000000] the current pixel format for the window referenced by this device context includes a back buffer, the function exchanges the front and back buffers."
[color=#000000]...
[color=#000000]"If the current pixel format for the window referenced by the device context does not include a back buffer, this call has no effect and the content of the back buffer is undefined when the function returns."