]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/glcanvas.cpp
make it clear which GL(U) library we can't find in error messages, otherwise the...
[wxWidgets.git] / src / msw / glcanvas.cpp
index 65a39574a5ada87af18a9856c1baa128c07fd029..3b635873d7f1a4ab491b02932f8dedb2491308cf 100644 (file)
@@ -39,6 +39,12 @@ WX_CHECK_BUILD_OPTIONS("wxGL")
 
 #include "wx/glcanvas.h"
 
 
 #include "wx/glcanvas.h"
 
+#if GL_EXT_vertex_array
+    #define WXUNUSED_WITHOUT_GL_EXT_vertex_array(name) name
+#else
+    #define WXUNUSED_WITHOUT_GL_EXT_vertex_array(name) WXUNUSED(name)
+#endif
+
 /*
   The following two compiler directives are specific to the Microsoft Visual
   C++ family of compilers
 /*
   The following two compiler directives are specific to the Microsoft Visual
   C++ family of compilers
@@ -401,7 +407,7 @@ static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
           pfd.iPixelType = PFD_TYPE_RGBA;
           break;
         case WX_GL_BUFFER_SIZE:
           pfd.iPixelType = PFD_TYPE_RGBA;
           break;
         case WX_GL_BUFFER_SIZE:
-          pfd.cColorBits = attribList[arg++];
+          pfd.cColorBits = (BYTE)attribList[arg++];
           break;
         case WX_GL_LEVEL:
           // this member looks like it may be obsolete
           break;
         case WX_GL_LEVEL:
           // this member looks like it may be obsolete
@@ -421,38 +427,38 @@ static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
           pfd.dwFlags |= PFD_STEREO;
           break;
         case WX_GL_AUX_BUFFERS:
           pfd.dwFlags |= PFD_STEREO;
           break;
         case WX_GL_AUX_BUFFERS:
-          pfd.cAuxBuffers = attribList[arg++];
+          pfd.cAuxBuffers = (BYTE)attribList[arg++];
           break;
         case WX_GL_MIN_RED:
           break;
         case WX_GL_MIN_RED:
-          pfd.cColorBits += (pfd.cRedBits = attribList[arg++]);
+          pfd.cColorBits = (BYTE)(pfd.cColorBits + (pfd.cRedBits = (BYTE)attribList[arg++]));
           break;
         case WX_GL_MIN_GREEN:
           break;
         case WX_GL_MIN_GREEN:
-          pfd.cColorBits += (pfd.cGreenBits = attribList[arg++]);
+          pfd.cColorBits = (BYTE)(pfd.cColorBits + (pfd.cGreenBits = (BYTE)attribList[arg++]));
           break;
         case WX_GL_MIN_BLUE:
           break;
         case WX_GL_MIN_BLUE:
-          pfd.cColorBits += (pfd.cBlueBits = attribList[arg++]);
+          pfd.cColorBits = (BYTE)(pfd.cColorBits + (pfd.cBlueBits = (BYTE)attribList[arg++]));
           break;
         case WX_GL_MIN_ALPHA:
           // doesn't count in cColorBits
           break;
         case WX_GL_MIN_ALPHA:
           // doesn't count in cColorBits
-          pfd.cAlphaBits = attribList[arg++];
+          pfd.cAlphaBits = (BYTE)attribList[arg++];
           break;
         case WX_GL_DEPTH_SIZE:
           break;
         case WX_GL_DEPTH_SIZE:
-          pfd.cDepthBits = attribList[arg++];
+          pfd.cDepthBits = (BYTE)attribList[arg++];
           break;
         case WX_GL_STENCIL_SIZE:
           break;
         case WX_GL_STENCIL_SIZE:
-          pfd.cStencilBits = attribList[arg++];
+          pfd.cStencilBits = (BYTE)attribList[arg++];
           break;
         case WX_GL_MIN_ACCUM_RED:
           break;
         case WX_GL_MIN_ACCUM_RED:
-          pfd.cAccumBits += (pfd.cAccumRedBits = attribList[arg++]);
+          pfd.cAccumBits = (BYTE)(pfd.cAccumBits + (pfd.cAccumRedBits = (BYTE)attribList[arg++]));
           break;
         case WX_GL_MIN_ACCUM_GREEN:
           break;
         case WX_GL_MIN_ACCUM_GREEN:
-          pfd.cAccumBits += (pfd.cAccumGreenBits = attribList[arg++]);
+          pfd.cAccumBits = (BYTE)(pfd.cAccumBits + (pfd.cAccumGreenBits = (BYTE)attribList[arg++]));
           break;
         case WX_GL_MIN_ACCUM_BLUE:
           break;
         case WX_GL_MIN_ACCUM_BLUE:
-          pfd.cAccumBits += (pfd.cAccumBlueBits = attribList[arg++]);
+          pfd.cAccumBits = (BYTE)(pfd.cAccumBits + (pfd.cAccumBlueBits = (BYTE)attribList[arg++]));
           break;
         case WX_GL_MIN_ACCUM_ALPHA:
           break;
         case WX_GL_MIN_ACCUM_ALPHA:
-          pfd.cAccumBits += (pfd.cAccumAlphaBits = attribList[arg++]);
+          pfd.cAccumBits = (BYTE)(pfd.cAccumBits + (pfd.cAccumAlphaBits = (BYTE)attribList[arg++]));
           break;
         default:
           break;
           break;
         default:
           break;
@@ -539,7 +545,7 @@ wxPalette wxGLCanvas::CreateDefaultPalette()
     LOGPALETTE* pPal =
      (LOGPALETTE*) malloc(sizeof(LOGPALETTE) + paletteSize * sizeof(PALETTEENTRY));
     pPal->palVersion = 0x300;
     LOGPALETTE* pPal =
      (LOGPALETTE*) malloc(sizeof(LOGPALETTE) + paletteSize * sizeof(PALETTEENTRY));
     pPal->palVersion = 0x300;
-    pPal->palNumEntries = paletteSize;
+    pPal->palNumEntries = (WORD)paletteSize;
 
     /* build a simple RGB color palette */
     {
 
     /* build a simple RGB color palette */
     {
@@ -550,11 +556,11 @@ wxPalette wxGLCanvas::CreateDefaultPalette()
 
     for (i=0; i<paletteSize; ++i) {
         pPal->palPalEntry[i].peRed =
 
     for (i=0; i<paletteSize; ++i) {
         pPal->palPalEntry[i].peRed =
-            (((i >> pfd.cRedShift) & redMask) * 255) / redMask;
+            (BYTE)((((i >> pfd.cRedShift) & redMask) * 255) / redMask);
         pPal->palPalEntry[i].peGreen =
         pPal->palPalEntry[i].peGreen =
-            (((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask;
+            (BYTE)((((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask);
         pPal->palPalEntry[i].peBlue =
         pPal->palPalEntry[i].peBlue =
-            (((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask;
+            (BYTE)((((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask);
         pPal->palPalEntry[i].peFlags = 0;
     }
     }
         pPal->palPalEntry[i].peFlags = 0;
     }
     }
@@ -633,7 +639,9 @@ void glColorPointerEXT(GLint WXUNUSED(size), GLenum WXUNUSED(type), GLsizei WXUN
 {
 }
 
 {
 }
 
-void glDrawArraysEXT(GLenum mode, GLint first, GLsizei count)
+void glDrawArraysEXT(GLenum  WXUNUSED_WITHOUT_GL_EXT_vertex_array(mode),
+                     GLint   WXUNUSED_WITHOUT_GL_EXT_vertex_array(first),
+                     GLsizei WXUNUSED_WITHOUT_GL_EXT_vertex_array(count))
 {
 #ifdef GL_EXT_vertex_array
     static PFNGLDRAWARRAYSEXTPROC proc = 0;
 {
 #ifdef GL_EXT_vertex_array
     static PFNGLDRAWARRAYSEXTPROC proc = 0;
@@ -660,7 +668,10 @@ void glIndexPointerEXT(GLenum WXUNUSED(type), GLsizei WXUNUSED(stride), GLsizei
 {
 }
 
 {
 }
 
-void glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
+void glNormalPointerEXT(GLenum        WXUNUSED_WITHOUT_GL_EXT_vertex_array(type),
+                        GLsizei       WXUNUSED_WITHOUT_GL_EXT_vertex_array(stride),
+                        GLsizei       WXUNUSED_WITHOUT_GL_EXT_vertex_array(count),
+                        const GLvoid *WXUNUSED_WITHOUT_GL_EXT_vertex_array(pointer))
 {
 #ifdef GL_EXT_vertex_array
   static PFNGLNORMALPOINTEREXTPROC proc = 0;
 {
 #ifdef GL_EXT_vertex_array
   static PFNGLNORMALPOINTEREXTPROC proc = 0;
@@ -679,7 +690,11 @@ void glTexCoordPointerEXT(GLint WXUNUSED(size), GLenum WXUNUSED(type), GLsizei W
 {
 }
 
 {
 }
 
-void glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
+void glVertexPointerEXT(GLint         WXUNUSED_WITHOUT_GL_EXT_vertex_array(size),
+                        GLenum        WXUNUSED_WITHOUT_GL_EXT_vertex_array(type),
+                        GLsizei       WXUNUSED_WITHOUT_GL_EXT_vertex_array(stride),
+                        GLsizei       WXUNUSED_WITHOUT_GL_EXT_vertex_array(count),
+                        const GLvoid *WXUNUSED_WITHOUT_GL_EXT_vertex_array(pointer))
 {
 #ifdef GL_EXT_vertex_array
   static PFNGLVERTEXPOINTEREXTPROC proc = 0;
 {
 #ifdef GL_EXT_vertex_array
   static PFNGLVERTEXPOINTEREXTPROC proc = 0;