Viewports with different background colors

I’ve got 2 viewports in my openGL window. I want each to have a different background color. I’m using glClearColorfv( m_fvClearColor ) to set the background color for each. Problem is, whatever I set viewport #2 background color to, that becomes the background color for the entire window (both viewports).

Any ideas?

You need to use the scissor rectangle set around the second viewport to prevent the second clear from clearing entire window.

I will try that. Thank you.

Thanks Komat. Hope all is well in Prague. Sunny and warm here in Florida.