00001 // Filename: glxGraphicsStateGuardian.cxx 00002 // Created by: drose (27Jan03) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include "glxGraphicsStateGuardian.h" 00020 00021 00022 TypeHandle glxGraphicsStateGuardian::_type_handle; 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Function: glxGraphicsStateGuardian::Constructor 00026 // Access: Public 00027 // Description: 00028 //////////////////////////////////////////////////////////////////// 00029 glxGraphicsStateGuardian:: 00030 glxGraphicsStateGuardian(const FrameBufferProperties &properties) : 00031 GLGraphicsStateGuardian(properties) 00032 { 00033 _context = (GLXContext)NULL; 00034 _visual = (XVisualInfo *)NULL; 00035 _display = NULL; 00036 } 00037 00038 //////////////////////////////////////////////////////////////////// 00039 // Function: glxGraphicsStateGuardian::Destructor 00040 // Access: Public 00041 // Description: 00042 //////////////////////////////////////////////////////////////////// 00043 glxGraphicsStateGuardian:: 00044 ~glxGraphicsStateGuardian() { 00045 if (_visual != (XVisualInfo *)NULL) { 00046 XFree(_visual); 00047 _visual = (XVisualInfo *)NULL; 00048 } 00049 00050 if (_context != (GLXContext)NULL) { 00051 glXDestroyContext(_display, _context); 00052 _context = (GLXContext)NULL; 00053 } 00054 }