diff --git a/panda/src/display/graphicsOutput.I b/panda/src/display/graphicsOutput.I index 5a07ca2519..62d5969d75 100644 --- a/panda/src/display/graphicsOutput.I +++ b/panda/src/display/graphicsOutput.I @@ -296,7 +296,19 @@ has_size() const { //////////////////////////////////////////////////////////////////// INLINE bool GraphicsOutput:: is_valid() const { - return _is_valid; + return _is_valid && _is_nonzero_size; +} + +//////////////////////////////////////////////////////////////////// +// Function: GraphicsOutput::is_nonzero_size +// Access: Published +// Description: Returns true if the output has a nonzero size in both +// X and Y, or false if it is zero (and therefore +// invalid). +//////////////////////////////////////////////////////////////////// +INLINE bool GraphicsOutput:: +is_nonzero_size() const { + return _is_nonzero_size; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index c0eaa95d6e..b70b788cbd 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -97,6 +97,7 @@ GraphicsOutput(GraphicsEngine *engine, GraphicsPipe *pipe, _y_size = win_prop.get_y_size(); } _is_valid = false; + _is_nonzero_size = false; _flip_ready = false; _cube_map_index = -1; _cube_map_dr = NULL; @@ -1207,6 +1208,8 @@ set_size_and_recalc(int x, int y) { _y_size = y; _has_size = true; + _is_nonzero_size = (_x_size > 0 && _y_size > 0); + int fb_x_size = get_fb_x_size(); int fb_y_size = get_fb_y_size(); diff --git a/panda/src/display/graphicsOutput.h b/panda/src/display/graphicsOutput.h index 524bc19af0..31120aaf54 100644 --- a/panda/src/display/graphicsOutput.h +++ b/panda/src/display/graphicsOutput.h @@ -123,6 +123,7 @@ PUBLISHED: INLINE int get_sbs_right_y_size() const; INLINE bool has_size() const; INLINE bool is_valid() const; + INLINE bool is_nonzero_size() const; void set_active(bool active); virtual bool is_active() const; @@ -356,6 +357,7 @@ protected: int _y_size; bool _has_size; bool _is_valid; + bool _is_nonzero_size; static PStatCollector _make_current_pcollector; static PStatCollector _copy_texture_pcollector; diff --git a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx index 6be708026a..b9c5fefb48 100755 --- a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx @@ -1168,7 +1168,6 @@ consider_device(wdxGraphicsPipe9 *dxpipe, DXDeviceInfo *device_info) { //////////////////////////////////////////////////////////////////// bool wdxGraphicsWindow9:: reset_device_resize_window(UINT new_xsize, UINT new_ysize) { - nassertr((new_xsize > 0) && (new_ysize > 0), false); bool retval = true; DXScreenData *screen = NULL;