Problem in Vista OpenGL GDI mixed mode & HD3200

Hi,

I am developing an application for XP, Vista that uses OpenGL GDI mixed mode in a maximized window. Allways I set up a maximized window GDI panels and toolbars don’t render, but when I try a non maximiced window it all works fine.

With Intel 4500 and Geforce 8600GTS it works fine in Vista. In XP it works fine with all hardware.

I read http://www.opengl.org/pipeline/article/vol003_7/. It says that in Vista fullscreen windows OpenGL works in a similar way as DirectX exclusive mode, so I supose that I have the next options:
A.- Deactivate “exclusive mode”. ¿¿¿ :confused: ???
B.- Contact ATI in a effective way and ask they to solve this issue. ¿¿¿ :confused: ???

Does anybody know any solution for this issue/problem?

Hello,

I made a new version only with basic features of our application in Visual Studio 2008. It weights 260Kb. Source code can be downloaded from:

http://www.filefactory.com/file/a0hf87h/n/MSB_zip

You can draw lines and other graphic primitives in both GDI+ and OpenGL. Application starts in GDI+ mode and you can swith to OpenGL mode later. As soon you execute it you will find a black screen. When you move the cursor to the upper corner a toolbar is displayed. This toolbar contains functions for switching to OpenGL mode, and drawing graphics primitives.Text in OpenGL is disabled.

To unselect a graphic primitive press right button. To close the app press Alt+F4.

This code contains a GDI+ Graphics wrapper in OpenGL without support for textures and text. With this you will be able to check if your graphics card doesn’t render GDI over OpenGL in a maximized-fullscreen window in Vista.

Hi,

I have been investigating and I have found that the problem is in SetPixelFormat function:

        int pixelFormatIndex = 0;
        pixelFormatIndex = WGL.ChoosePixelFormat(m_DC, ref pfd);
        if (pixelFormatIndex == 0) return false;
        if (WGL.SetPixelFormat(m_DC, pixelFormatIndex, ref pfd) == 0) return false;

It seems that in HD3200 ChoosePixelFormat doesn’t choose a PixelFormat compatible with GDI when I maximize the window.

When I set pixelFormatIndex to 1 and then call SetPixelFormat everything works fine in fullscreen mode. The problem is that this index is incompatible in other hardware.

I tried to use PFD_SUPPORT_GDI flag when I create PIXELFORMATDESCRIPTOR structure but it doesn’t work

Does anyone know how can I select a GDI compatible pixel format for HD3200 hardware?

You can reproduce this problem in Catalyst 9.7, 9.8, 9.9, 9.10

Please help.

Just wild guess… You can call SetPixelFormat only once per window DC.

I have traced SetPixelFormat function and it is called only one time when DC is created.

Thanks yooyo.

Today I have realized that the pixel format 1 I described before refers to a single buffered mode, but by strange it appears when I select it in HD3200 my software works in fullscreen with double buffer code???, but it doesn´t work in Intel how it could be expected (you canot call SwapBuffers in single buffered mode).

I’ve tested in Catalyst 9.7, 9.8, 9.9 and 9.10 and I’m starting to be convinced that this is a driver related issue :frowning:

If you call ChangeDisplayMode to switch to fullscreen, device is usually reset. In order to properly switch to FS, you must:

  1. destroy current opengl context and window
  2. switch to FS
  3. create window again and create context.

I tryed it but it doesn’t work. Thanks for your support.

I think this is a driver related issue. I think ATI is disabling GDI in fullscreen exclusive mode (a bug? Who knows…) for HD3200 and maybe others in vista. With NVIDIA and Intel cards it works fine. Really most of the people don’t mix GDI with OpenGL in a fullscreen window…

By the moment I solved this problem by adding an option in the program which lets the user to select a non fullscreen window, but in the future i think I will be forced to disable fullscreen with ATI cards and letting customers to decide.

After discovering what this issue was based in, I’m going to answer myself.

Windows specification tells clearly that GDI is not supported on OpenGL double buffered window:
http://msdn.microsoft.com/en-us/library/dd374250%28VS.85%29.aspx
and
http://support.microsoft.com/kb/131024/en-us/

So it is supported only if the driver implements it.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.