Răsfoiți Sursa

need to test nformats

David Rose 21 ani în urmă
părinte
comite
943f213dbb

+ 2 - 1
panda/src/wgldisplay/wglGraphicsBuffer.cxx

@@ -377,7 +377,8 @@ make_pbuffer(HDC twindow_dc) {
     memset(pformat, 0, sizeof(pformat));
     unsigned int nformats = 0;
     if (!wglgsg->_wglChoosePixelFormatARB(twindow_dc, iattrib_list, fattrib_list,
-                                          max_pformats, pformat, &nformats)) {
+                                          max_pformats, pformat, &nformats)
+        || nformats == 0) {
       wgldisplay_cat.info()
         << "Couldn't find a suitable pixel format for creating a pbuffer.\n";
       return false;

+ 2 - 1
panda/src/wgldisplay/wglGraphicsPipe.cxx

@@ -370,7 +370,8 @@ choose_pfnum_advanced(const FrameBufferProperties &properties,
   memset(pformat, 0, sizeof(pformat));
   unsigned int nformats = 0;
   if (!wglgsg->_wglChoosePixelFormatARB(window_dc, iattrib_list, fattrib_list,
-                                        max_pformats, pformat, &nformats)) {
+                                        max_pformats, pformat, &nformats) ||
+      nformats == 0) {
     wgldisplay_cat.info()
       << "Couldn't find a suitable advanced pixel format.\n";
     return orig_pfnum;