From 943f213dbb27f7dab1fa4ffc2e72f58db1cc3e12 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 30 Dec 2004 01:15:42 +0000 Subject: [PATCH] need to test nformats --- panda/src/wgldisplay/wglGraphicsBuffer.cxx | 3 ++- panda/src/wgldisplay/wglGraphicsPipe.cxx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/wgldisplay/wglGraphicsBuffer.cxx b/panda/src/wgldisplay/wglGraphicsBuffer.cxx index 593f04d755..0dd1fd9f2d 100644 --- a/panda/src/wgldisplay/wglGraphicsBuffer.cxx +++ b/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; diff --git a/panda/src/wgldisplay/wglGraphicsPipe.cxx b/panda/src/wgldisplay/wglGraphicsPipe.cxx index 046eae0bc9..064ad81d32 100644 --- a/panda/src/wgldisplay/wglGraphicsPipe.cxx +++ b/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;