
Issues with XP and GDI Renderer
Posted Thursday, 5 August, 2010 - 00:19 by jdomnitz inI'm having an issue with some of my users on XP systems. They were experiencing high CPU usage and on further investigation we found out that they were defaulting to Microsoft's GDI renderer. I had them update to the latest official drivers (nvidia) which I knew supported openGL 3.3.
Unfortunately, thats not fixing the problem. Using the OpenGL extension viewer (http://www.realtech-vr.com/glview/) it shows two renderers installed, GDI Renderer and the hardware accelerated Nvidia one. Why does OpenTK default to using the GDI renderer (i'm assuming its not an openTK flaw since all it does is call opengl32.dll) and what steps can we tell users who have this problem?
Thanks,
Justin


Comments
Re: Issues with XP and GDI Renderer
OpenTK always requests an accelerated context from the OS - the rest is up to the OS. Off the top of my head, fallback to software rendering might happen:
Are you using GLControl or GameWindow? Is this reproducible with a simple test case (create window, print GL.GetString(StringName.Renderer), exit)?
Re: Issues with XP and GDI Renderer
Using the GameWindow... I'm working on a test case to produce it reliably-will post that later today
Re: Issues with XP and GDI Renderer
Alright I found the issue.... It was caused by one of the changes I made. I added an opacity property to INativeWindow and implemented it for windows and linux. with the windows implementation I had to change the extended window style to EX_LAYERED so that opacity could be changed. In doing so on vista and win7 everything works perfectly. On XP this forces the renderer to be the GDI renderer.
Is this due to XPs lack of a DWM (and direct to the card openGL rendering)? or is there a bug in openTK thats causing this?
I figured this info would be good to post either way just in case other users have similar issues.
Re: Issues with XP and GDI Renderer
Interesting. A quick search reveals people using pbuffers, glReadPixels and gdi blits to draw to WS_EX_LAYERED windows on Win2K/XP. Hardware acceleration on such windows is probably not possible before Vista and the DWM.
Out of curiosity, what happens if you disable Aero? Do you also lose hardware acceleration on WS_EX_LAYERED windows?
Edit: See also this.
From: Greg Binkerd [MS] (GregB@online.microsoft.com)
Subject: RE: WS_EX_LAYERED and OpenGL together?
View: Complete Thread (3 articles)
Original Format
Newsgroups: microsoft.public.win32.programmer.gdi
Date: 2002-06-05 10:18:55 PST
Hi, Craig.
Unfortunately, OpenGL (and DirectX) can not be used in a layered window. The hardware performs all rendering and will not incorporate the semitransparency effect displayed by a layered window. In fact, if you create a layered window and you move it over an OpenGL application or windowed DirectX application, you will see "flashing" of the layered window, since the hardware will draw the 3D primitives directly on the primary surface, drawing over the layered window and the layered window will immediately redraw itself in a semitransparent state. Note, this will only occur with hardware accelerated OpenGL and DirectX applications.
Thanks,
-Greg
Microsoft Developer Support
Re: Issues with XP and GDI Renderer
Graphical Issues I would expect....it was the falling back to GDI Renderer that I couldn't find any mention of anywhere.
Tested on win7 with aero disabled and found no issues. Although dragging windows around does produce some artifacts-which would be expected.