From 673a29c71bb010f11ba3dce913da374740f35f6f Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 6 Feb 2004 19:55:09 +0000 Subject: [PATCH] prevent crash after failure to open; minor correction to output --- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 1 + panda/src/dxgsg8/wdxGraphicsWindow8.cxx | 5 ++--- panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 1 + panda/src/dxgsg9/wdxGraphicsWindow9.cxx | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 2d2d0ae95d..8c125c0292 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -406,6 +406,7 @@ DXGraphicsStateGuardian8(const FrameBufferProperties &properties) : reset_panda_gsg(); _pScrn = NULL; + _pD3DDevice = NULL; _bDXisReady = false; _overlay_windows_supported = false; diff --git a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx index 6dee35b31e..c5517cf871 100644 --- a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx @@ -977,8 +977,8 @@ choose_device(void) { good_device_count++; } - if(good_device_count==0) { - wdxdisplay8_cat.fatal() << "no usable display devices, exiting...\n"; + if (good_device_count==0) { + wdxdisplay8_cat.error() << "no usable display devices.\n"; return false; } @@ -1722,7 +1722,6 @@ reset_window(bool swapchain) { //////////////////////////////////////////////////////////////////// bool wdxGraphicsWindow8:: open_window(void) { - cerr << "open_window()\n"; PT(DXGraphicsDevice8) dxdev; DXGraphicsStateGuardian8 *dxgsg; DCAST_INTO_R(dxgsg,_gsg,false); diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index cf2b305e9c..1a277c4180 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -406,6 +406,7 @@ DXGraphicsStateGuardian9(const FrameBufferProperties &properties) : reset_panda_gsg(); _pScrn = NULL; + _pD3DDevice = NULL; _bDXisReady = false; _overlay_windows_supported = false; diff --git a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx index c2cff0e502..ddaa58940f 100755 --- a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx @@ -980,7 +980,7 @@ choose_device(void) { } if(good_device_count==0) { - wdxdisplay9_cat.fatal() << "no usable display devices, exiting...\n"; + wdxdisplay9_cat.error() << "no usable display devices.\n"; return false; }