Re: GDI over OpenGL in Vista
Quote:
I’ve got problem with using GDI on top of OpenGL in Windows Vista. I’ve found that if GDI graphic would be drawn before any drawing operation of OpenGL than everything what was drawn by GDI would be cleared and would be drawn everything what was drawn by OpenGL before and after. It looks like OpenGL is drawn in separate buffer which after each calling of glFlush function drawn on a screen while clearing what was drawn by GDI.
Is there a reason to mix GDI and OpenGL?
Re: GDI over OpenGL in Vista
Quote:
Originally Posted by
ckweius
Is there a reason to mix GDI and OpenGL?
It is bad idea to do that. But big part of code is already implemented. And to rewrite everything to OpenGL will take huge amount of time. So, I am looking for easest way to solve the problem
Re: GDI over OpenGL in Vista
I don't think there is an easy way out from what you are trying to achieve, because GDI has no way to target the OpenGL backbuffer directly.
Making GDI calls after buffer flips is not correct either because that will introduce flickering.
I think it's doable to draw GDI objects to memory and let OpenGL does the final rendering.
Re: GDI over OpenGL in Vista
Are you drawing in 2D?
Draw GDI to memory DC with attached bitmap, then load bitmap into OpenGL texture (32-bit RGBA).
Enable OpenGL alpha-blending, then draw texture transparently to backbuffer.