[Win] More robust pixel format selection
authorStefanos A. <stapostol@gmail.com>
Fri, 10 Jan 2014 14:41:57 +0000 (15:41 +0100)
committerStefanos A. <stapostol@gmail.com>
Fri, 10 Jan 2014 14:41:57 +0000 (15:41 +0100)
commitbdfcf43e0b6b18d6bf21b371f5b5c6618c3b757a
treef89286684b3698d6a902acc0ba95ed623d09c8d7
parentef5aedba6f751874e90c7a16de9ff2ec2efe0243
[Win] More robust pixel format selection

This patch adds more robust checks for WGL_ARB_pixel_format and
WGL_ARB_multisample before using the relevant extensions, and adds
checks whether Wgl.Arb.ChoosePixelFormat() returns a valid pixel format
before trying to use it (thanks to Repetier for catching this edge
case.)

Additionally, the ChoosePixelFormatPFD code-path now heavily penalizes
single-buffered modes when the user requests a double-buffered mode.

Affects issues #42 and #45
Source/OpenTK/Platform/Windows/WinGraphicsMode.cs