In an article I've read that Microsoft signed GDI/GDI+ as deprecated. I was a bit frightened, I won't be able to use OpenGL in future versions of Windows. Since you need GDI ( more likely the Device Context you get through GDI's GetDC( HWND ) ) to initialize OpenGL.

I got frightened because, when MS marks something as deprecated, it's likely to be removed from the Platform SDK and later from the kernel. This means OpenGL can't be used through GDI.

The only other ways to get the Device Context would be trough WPF or DXGI. But both have their problems:

WPF -> slowly

DXGI -> Device Context shows sometimes creepy graphic bugs

So my question is: Is Microsoft killing OpenGL ? I'm asking because MS seems to make the use of OGL pretty difficult.

Thank's for reading.

  • \$\begingroup\$ How about using SDL with OpenGL? I know you can use SDL with OpenGL though I am not sure how SDL works in-depth... \$\endgroup\$
    – olevegard
    Commented May 26, 2013 at 17:34
  • \$\begingroup\$ Initialize OpenGL on in Windows you've to use Functions from wgl. These will need a DC, that you can only get from a GDI/WPF or DXGI context. :'/ \$\endgroup\$
    – LaVolpe
    Commented May 26, 2013 at 17:36
  • 7
    \$\begingroup\$ Use the available tools, there will always be a fast 3D renderer in the near future on windows. Stop complaining and choose the proper tools (or engines that do it for you). Having said that, this is a hypothetical question, we can hardly forsee the future here, hence voting to close as this is not an answerable question. \$\endgroup\$ Commented May 26, 2013 at 17:46
  • \$\begingroup\$ Ok, my question goes down like a lead balloon. Of course I didn't want to complain about MS. I think I 've incorrectly formulated my thoughts / question. \$\endgroup\$
    – LaVolpe
    Commented May 26, 2013 at 17:50

1 Answer 1


Two things:

  1. GDI and GDI+ are not going anywhere. Deprecated and Obsolete have two very different meanings, and GDI/GDI+ are just Deprecated. This means that there are better ways to do the same things you used to do with GDI/GDI+, namely DirectX, DirectComposition and WIC, but I don't foresee Microsoft actually removing GDI/GDI+ from the kernel anywhere in the future, as there is way too much software written with these libraries, and Microsoft prides itself on its backwards compatibility (unlike a certain fruit-named company, which seems to enjoy breaking software with each update).

    To give you some perspective, OpenFile has been deprecated for almost 20 years, but you can still call it, and it still works, and it will still work for a long time. It is of course deprecated, and there are few reasons (if any) to use it instead of the newer CreateFile.

    So feel free to use GDI/GDI+ if that's what's best for your application. However, you are strongly encouraged to use the newer APIs, and hopefully in the future, there will be no reasons to use GDI/GDI+, just like today there's no reason for anybody to use OpenFile.

  2. Regarding OpenGL, I haven't done WGL recently, but you only require an hDC to create an OpenGL content, but that's all there is to it. OpenGL is not built on top of GDI, and OpenGL's relationship with GDI is so inconsequential, that even in the extremely bizarre case that GDI is actually removed from the kernel, there will be other ways to create your GL context, probably with the hWnd directly, like in DirectX.

    Microsoft certainly has lots of reasons for deprecating GDI/GDI+, but I can assure you that deprecating it with the single interest of cutting OpenGL is not one of them. If they just wanted to kill OpenGL, they would have done it long ago. And honestly, OpenGL doesn't need any help to kill themselves. They did it a long time ago.

  • 1
    \$\begingroup\$ unlike a certain fruit-named company Hahaha :P +1 \$\endgroup\$
    – Doorknob
    Commented May 27, 2013 at 13:19

Not the answer you're looking for? Browse other questions tagged .