]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/glcanvas.cpp
added wxGLCanvas::IsDisplaySupported() (patch 1879906)
[wxWidgets.git] / src / msw / glcanvas.cpp
index 2c5406e2fda528c42daf3e15da63f49626543884..edf2264d60c2707d2ba10daf46a2104de82eeee4 100644 (file)
@@ -450,6 +450,14 @@ wxGLCanvas::ChooseMatchingPixelFormat(HDC hdc,
     return ::ChoosePixelFormat(hdc, ppfd);
 }
 
     return ::ChoosePixelFormat(hdc, ppfd);
 }
 
+/* static */
+bool wxGLCanvasBase::IsDisplaySupported(const int *attribList)
+{
+    // We need a device context to test the pixel format, so get one
+    // for the root window.
+    return wxGLCanvas::ChooseMatchingPixelFormat(ScreenHDC(), attribList) > 0;
+}
+
 bool wxGLCanvas::DoSetup(const int *attribList)
 {
     PIXELFORMATDESCRIPTOR pfd;
 bool wxGLCanvas::DoSetup(const int *attribList)
 {
     PIXELFORMATDESCRIPTOR pfd;