00001 // Filename: frameBufferProperties.I 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 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: FrameBufferProperties::Copy Constructor 00022 // Access: Published 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE FrameBufferProperties:: 00026 FrameBufferProperties(const FrameBufferProperties ©) { 00027 (*this) = copy; 00028 } 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Function: FrameBufferProperties::Destructor 00032 // Access: Published 00033 // Description: 00034 //////////////////////////////////////////////////////////////////// 00035 INLINE FrameBufferProperties:: 00036 ~FrameBufferProperties() { 00037 } 00038 00039 //////////////////////////////////////////////////////////////////// 00040 // Function: FrameBufferProperties::operator != 00041 // Access: Published 00042 // Description: 00043 //////////////////////////////////////////////////////////////////// 00044 INLINE bool FrameBufferProperties:: 00045 operator != (const FrameBufferProperties &other) const { 00046 return !operator == (other); 00047 } 00048 00049 //////////////////////////////////////////////////////////////////// 00050 // Function: FrameBufferProperties::is_any_specified 00051 // Access: Published 00052 // Description: Returns true if any properties have been specified, 00053 // false otherwise. 00054 //////////////////////////////////////////////////////////////////// 00055 INLINE bool FrameBufferProperties:: 00056 is_any_specified() const { 00057 return (_specified != 0); 00058 } 00059 00060 //////////////////////////////////////////////////////////////////// 00061 // Function: FrameBufferProperties::set_frame_buffer_mode 00062 // Access: Published 00063 // Description: Specifies the set of graphics properties that are 00064 // required for the context associated with the window. 00065 // This should be the union of the appropriate bits 00066 // defined in FrameBufferMode. 00067 //////////////////////////////////////////////////////////////////// 00068 INLINE void FrameBufferProperties:: 00069 set_frame_buffer_mode(int frameBuffer_mode) { 00070 _frame_buffer_mode = frameBuffer_mode; 00071 _specified |= S_frame_buffer_mode; 00072 } 00073 00074 //////////////////////////////////////////////////////////////////// 00075 // Function: FrameBufferProperties::get_frame_buffer_mode 00076 // Access: Published 00077 // Description: Returns the set of graphics properties that are 00078 // in effect for the window. This will be the union of 00079 // the corresponding bits from FrameBufferMode. 00080 //////////////////////////////////////////////////////////////////// 00081 INLINE int FrameBufferProperties:: 00082 get_frame_buffer_mode() const { 00083 nassertr(has_frame_buffer_mode(), false); 00084 return _frame_buffer_mode; 00085 } 00086 00087 //////////////////////////////////////////////////////////////////// 00088 // Function: FrameBufferProperties::has_frame_buffer_mode 00089 // Access: Published 00090 // Description: Returns true if the frameBuffer mode has been 00091 // specified, false otherwise. 00092 //////////////////////////////////////////////////////////////////// 00093 INLINE bool FrameBufferProperties:: 00094 has_frame_buffer_mode() const { 00095 return ((_specified & S_frame_buffer_mode) != 0); 00096 } 00097 00098 //////////////////////////////////////////////////////////////////// 00099 // Function: FrameBufferProperties::clear_frame_buffer_mode 00100 // Access: Published 00101 // Description: Removes the frameBuffer_mode specification from the 00102 // properties. 00103 //////////////////////////////////////////////////////////////////// 00104 INLINE void FrameBufferProperties:: 00105 clear_frame_buffer_mode() { 00106 _specified &= ~S_frame_buffer_mode; 00107 _frame_buffer_mode = 0; 00108 } 00109 00110 //////////////////////////////////////////////////////////////////// 00111 // Function: FrameBufferProperties::set_depth_bits 00112 // Access: Published 00113 // Description: Specifies the minimum number of bits that are 00114 // required for the depth buffer. 00115 //////////////////////////////////////////////////////////////////// 00116 INLINE void FrameBufferProperties:: 00117 set_depth_bits(int depth_bits) { 00118 _depth_bits = depth_bits; 00119 _specified |= S_depth_bits; 00120 } 00121 00122 //////////////////////////////////////////////////////////////////// 00123 // Function: FrameBufferProperties::get_depth_bits 00124 // Access: Published 00125 // Description: Returns the number of bits specified for the depth 00126 // buffer. 00127 //////////////////////////////////////////////////////////////////// 00128 INLINE int FrameBufferProperties:: 00129 get_depth_bits() const { 00130 return _depth_bits; 00131 } 00132 00133 //////////////////////////////////////////////////////////////////// 00134 // Function: FrameBufferProperties::has_depth_bits 00135 // Access: Published 00136 // Description: Returns true if the number of bits for the depth 00137 // buffer has been specified, false otherwise. 00138 //////////////////////////////////////////////////////////////////// 00139 INLINE bool FrameBufferProperties:: 00140 has_depth_bits() const { 00141 return ((_specified & S_depth_bits) != 0); 00142 } 00143 00144 //////////////////////////////////////////////////////////////////// 00145 // Function: FrameBufferProperties::clear_depth_bits 00146 // Access: Published 00147 // Description: Removes the depth_bits specification from the 00148 // properties. 00149 //////////////////////////////////////////////////////////////////// 00150 INLINE void FrameBufferProperties:: 00151 clear_depth_bits() { 00152 _specified &= ~S_depth_bits; 00153 _depth_bits = 0; 00154 } 00155 00156 //////////////////////////////////////////////////////////////////// 00157 // Function: FrameBufferProperties::set_color_bits 00158 // Access: Published 00159 // Description: Specifies the minimum number of bits that are 00160 // required for all three channels of the color buffer. 00161 // That is, this is the per-channel color requirement 00162 // times three. 00163 //////////////////////////////////////////////////////////////////// 00164 INLINE void FrameBufferProperties:: 00165 set_color_bits(int color_bits) { 00166 _color_bits = color_bits; 00167 _specified |= S_color_bits; 00168 } 00169 00170 //////////////////////////////////////////////////////////////////// 00171 // Function: FrameBufferProperties::get_color_bits 00172 // Access: Published 00173 // Description: Returns the number of bits specified for the color 00174 // buffer. 00175 //////////////////////////////////////////////////////////////////// 00176 INLINE int FrameBufferProperties:: 00177 get_color_bits() const { 00178 return _color_bits; 00179 } 00180 00181 //////////////////////////////////////////////////////////////////// 00182 // Function: FrameBufferProperties::has_color_bits 00183 // Access: Published 00184 // Description: Returns true if the number of bits for the color 00185 // buffer has been specified, false otherwise. 00186 //////////////////////////////////////////////////////////////////// 00187 INLINE bool FrameBufferProperties:: 00188 has_color_bits() const { 00189 return ((_specified & S_color_bits) != 0); 00190 } 00191 00192 //////////////////////////////////////////////////////////////////// 00193 // Function: FrameBufferProperties::clear_color_bits 00194 // Access: Published 00195 // Description: Removes the color_bits specification from the 00196 // properties. 00197 //////////////////////////////////////////////////////////////////// 00198 INLINE void FrameBufferProperties:: 00199 clear_color_bits() { 00200 _specified &= ~S_color_bits; 00201 _color_bits = 0; 00202 } 00203 00204 INLINE ostream & 00205 operator << (ostream &out, const FrameBufferProperties &properties) { 00206 properties.output(out); 00207 return out; 00208 }