]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/glcanvas.cpp
compilation fix for !MSVC
[wxWidgets.git] / src / msw / glcanvas.cpp
index 3d3fc51624b4445ca5985b4afd6501346e0f0800..5cbfd68cfb17ee727e7007599ec95de1cc4b2f45 100644 (file)
 #pragma hdrstop
 #endif
 
-#include <wx/setup.h>
-
 #if wxUSE_GLCANVAS
 
 #ifndef WX_PRECOMP
-#include <wx/frame.h>
+    #include "wx/frame.h"
+    #include "wx/settings.h"
+    #include "wx/intl.h"
+    #include "wx/log.h"
 #endif
 
-#include <wx/msw/private.h>
-#include <wx/settings.h>
-#include <wx/log.h>
+#include "wx/msw/private.h"
 
-#include <wx/glcanvas.h>
+#include "wx/glcanvas.h"
 
 static const wxChar *wxGLCanvasClassName = wxT("wxGLCanvasClass");
 static const wxChar *wxGLCanvasClassNameNoRedraw = wxT("wxGLCanvasClassNR");
@@ -400,7 +399,6 @@ static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
 
 void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
 {
-  int pixelFormat;
   PIXELFORMATDESCRIPTOR pfd = {
         sizeof(PIXELFORMATDESCRIPTOR),    /* size */
         1,                /* version */
@@ -424,13 +422,13 @@ void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
 
   AdjustPFDForAttributes(pfd, attribList);
 
-  pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
+  int pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
   if (pixelFormat == 0) {
-    wxLogWarning(_("ChoosePixelFormat failed."));
+    wxLogLastError(_T("ChoosePixelFormat"));
   }
   else {
-    if (SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) != TRUE) {
-      wxLogWarning(_("SetPixelFormat failed."));
+    if ( !::SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) ) {
+      wxLogLastError(_T("SetPixelFormat"));
     }
   }
 }