3

My application have OpenGL Engine in a WPF hosted Window. I created half-transparent widget (as Window object) that should display content above OpenGL window. Sometimes when application processing data, widgets backgrounds becomes black (see attached image). Does anybody know what it is. How can I resolve this problem.enter image description here

Adam D
  • 191
  • 1
  • 8

2 Answers2

3

Since Vista Windows supports a new PIXELFORMATDESCRIPTOR flag: PFD_SUPPORT_COMPOSITION. If this flag is set, the OpenGL context creates will integrate into the desktop composition system:

http://msdn.microsoft.com/en-us/library/cc231189(v=prot.10).aspx

datenwolf
  • 159,371
  • 13
  • 185
  • 298
0

It's not guaranteed to work at all. OpenGL windows are not composited with WPF transparency, either below or above. It may work sometimes, but it doesn't have to.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
  • Compositing can be enabled for compositing. This is done through a new PIXELFORMATDESCRIPTOR flag. – datenwolf Feb 28 '12 at 17:27
  • First, that only composites with things behind it, not on top of it. Second, I don't see the equivalent in [wglChoosePixelFormatARB](http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt), which is where most people get their pixel formats from. Otherwise, you couldn't use sRGB framebuffers or multisampling. – Nicol Bolas Feb 28 '12 at 17:30
  • @datenwolf: And third, there's no guarantee that PFD_SUPPORT_COMPOSITION will not turn off hardware acceleration or force use of the Microsoft GL driver. There's no guarantee it will do that either, but I'd want more info before trying to make such a change. – Nicol Bolas Feb 28 '12 at 18:12