Fixed a few more gsg==NULL bugs

This commit is contained in:
Josh Yelon 2006-06-07 21:16:37 +00:00
parent 2408212aac
commit c1f03b3650
3 changed files with 6 additions and 4 deletions

View File

@ -36,8 +36,6 @@ GraphicsBuffer(GraphicsPipe *pipe,
GraphicsOutput *host) :
GraphicsOutput(pipe, name, properties, x_size, y_size, flags, gsg, host)
{
nassertv(gsg != (GraphicsStateGuardian *)NULL);
#ifdef DO_MEMORY_USAGE
MemoryUsage::update_type(this, this);
#endif
@ -49,8 +47,6 @@ GraphicsBuffer(GraphicsPipe *pipe,
_default_display_region->compute_pixels(_x_size, _y_size);
_open_request = OR_none;
set_inverted(gsg->get_copy_texture_inverted());
}
////////////////////////////////////////////////////////////////////
@ -124,6 +120,7 @@ process_events() {
case OR_open:
open_buffer();
set_inverted(_gsg->get_copy_texture_inverted());
break;
case OR_close:

View File

@ -554,6 +554,7 @@ set_properties_now(WindowProperties &properties) {
// When the window is first opened, force its size to be
// broadcast to its display regions.
_is_valid = true;
set_inverted(_gsg->get_copy_texture_inverted());
set_size_and_recalc(_properties.get_x_size(),
_properties.get_y_size());
} else {

View File

@ -352,6 +352,10 @@ open_buffer() {
////////////////////////////////////////////////////////////////////
void wglGraphicsBuffer::
release_pbuffer() {
if (_gsg == 0) {
return;
}
wglGraphicsStateGuardian *wglgsg;
DCAST_INTO_V(wglgsg, _gsg);