rendering to DC colour problem

Hi, I guess this is advanced…

I’m rendering my scene to a DC and displaying the bitmap elsewhere in my application as a thumbnail.

The problem I have is that if the clear colour is black I don’t see anything, just black. If I set it to white, I see my rendered objects just fine.

I was wondering if someone could explain to me what might be happening so that I can try and sort it out.

Many thanks

matthew

maybe the 4th parameter of glClearColour, the alpha value …

Thanks for the tip, although it has not helped.

I now set glClearColor(R,G,B,0.0);

It’s the same symptom. If the BG colour is black, then the bitmap I render to the DC is black. If it is a lighter colour then the bitmap in the DC is exactly what I see on the rendered view.

It’s all very odd.

Matthew

This sounds like some strange blend function is on. Perhaps you are modulating source color by destination color or destination color by source color. try glDisable(GL_BLEND) prior to drawing the bitmap.

If this works you need to fix your overall OpenGL state management.