00001 // Filename: frameBufferProperties.I 00002 // Created by: drose (27Jan03) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: FrameBufferProperties::Copy Constructor 00018 // Access: Published 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE FrameBufferProperties:: 00022 FrameBufferProperties(const FrameBufferProperties ©) { 00023 (*this) = copy; 00024 } 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Function: FrameBufferProperties::Destructor 00028 // Access: Published 00029 // Description: 00030 //////////////////////////////////////////////////////////////////// 00031 INLINE FrameBufferProperties:: 00032 ~FrameBufferProperties() { 00033 } 00034 00035 //////////////////////////////////////////////////////////////////// 00036 // Function: FrameBufferProperties::operator != 00037 // Access: Published 00038 // Description: 00039 //////////////////////////////////////////////////////////////////// 00040 INLINE bool FrameBufferProperties:: 00041 operator != (const FrameBufferProperties &other) const { 00042 return !operator == (other); 00043 } 00044 00045 //////////////////////////////////////////////////////////////////// 00046 // Function: FrameBufferProperties::is_single_buffered 00047 // Access: Published 00048 // Description: 00049 //////////////////////////////////////////////////////////////////// 00050 INLINE bool FrameBufferProperties:: 00051 is_single_buffered() const { 00052 return (_property[FBP_back_buffers] == 0); 00053 } 00054 00055 //////////////////////////////////////////////////////////////////// 00056 // Function: FrameBufferProperties::is_stereo 00057 // Access: Published 00058 // Description: 00059 //////////////////////////////////////////////////////////////////// 00060 INLINE bool FrameBufferProperties:: 00061 is_stereo() const { 00062 return (_property[FBP_stereo] != 0); 00063 } 00064 00065 //////////////////////////////////////////////////////////////////// 00066 // Function: FrameBufferProperties::operator << 00067 // Access: Public 00068 // Description: 00069 //////////////////////////////////////////////////////////////////// 00070 INLINE ostream & 00071 operator << (ostream &out, const FrameBufferProperties &properties) { 00072 properties.output(out); 00073 return out; 00074 } 00075 00076 //////////////////////////////////////////////////////////////////// 00077 // Function: FrameBufferProperties::get_depth_bits 00078 // Access: Published 00079 // Description: 00080 //////////////////////////////////////////////////////////////////// 00081 INLINE int FrameBufferProperties:: 00082 get_depth_bits() const { 00083 return _property[FBP_depth_bits]; 00084 } 00085 00086 //////////////////////////////////////////////////////////////////// 00087 // Function: FrameBufferProperties::get_color_bits 00088 // Access: Published 00089 // Description: 00090 //////////////////////////////////////////////////////////////////// 00091 INLINE int FrameBufferProperties:: 00092 get_color_bits() const { 00093 return _property[FBP_color_bits]; 00094 } 00095 00096 //////////////////////////////////////////////////////////////////// 00097 // Function: FrameBufferProperties::get_alpha_bits 00098 // Access: Published 00099 // Description: 00100 //////////////////////////////////////////////////////////////////// 00101 INLINE int FrameBufferProperties:: 00102 get_alpha_bits() const { 00103 return _property[FBP_alpha_bits]; 00104 } 00105 00106 //////////////////////////////////////////////////////////////////// 00107 // Function: FrameBufferProperties::get_stencil_bits 00108 // Access: Published 00109 // Description: 00110 //////////////////////////////////////////////////////////////////// 00111 INLINE int FrameBufferProperties:: 00112 get_stencil_bits() const { 00113 return _property[FBP_stencil_bits]; 00114 } 00115 00116 //////////////////////////////////////////////////////////////////// 00117 // Function: FrameBufferProperties::get_accum_bits 00118 // Access: Published 00119 // Description: 00120 //////////////////////////////////////////////////////////////////// 00121 INLINE int FrameBufferProperties:: 00122 get_accum_bits() const { 00123 return _property[FBP_accum_bits]; 00124 } 00125 00126 //////////////////////////////////////////////////////////////////// 00127 // Function: FrameBufferProperties::get_aux_rgba 00128 // Access: Published 00129 // Description: 00130 //////////////////////////////////////////////////////////////////// 00131 INLINE int FrameBufferProperties:: 00132 get_aux_rgba() const { 00133 return _property[FBP_aux_rgba]; 00134 } 00135 00136 //////////////////////////////////////////////////////////////////// 00137 // Function: FrameBufferProperties::get_aux_hrgba 00138 // Access: Published 00139 // Description: 00140 //////////////////////////////////////////////////////////////////// 00141 INLINE int FrameBufferProperties:: 00142 get_aux_hrgba() const { 00143 return _property[FBP_aux_hrgba]; 00144 } 00145 00146 //////////////////////////////////////////////////////////////////// 00147 // Function: FrameBufferProperties::get_aux_float 00148 // Access: Published 00149 // Description: 00150 //////////////////////////////////////////////////////////////////// 00151 INLINE int FrameBufferProperties:: 00152 get_aux_float() const { 00153 return _property[FBP_aux_float]; 00154 } 00155 00156 //////////////////////////////////////////////////////////////////// 00157 // Function: FrameBufferProperties::get_multisamples 00158 // Access: Published 00159 // Description: 00160 //////////////////////////////////////////////////////////////////// 00161 INLINE int FrameBufferProperties:: 00162 get_multisamples() const { 00163 return _property[FBP_multisamples]; 00164 } 00165 00166 //////////////////////////////////////////////////////////////////// 00167 // Function: FrameBufferProperties::get_coverage_samples 00168 // Access: Published 00169 // Description: If coverage samples are specified, and there is 00170 // hardware support, we use coverage multisampling. 00171 //////////////////////////////////////////////////////////////////// 00172 INLINE int FrameBufferProperties:: 00173 get_coverage_samples() const { 00174 return _property[FBP_coverage_samples]; 00175 } 00176 00177 //////////////////////////////////////////////////////////////////// 00178 // Function: FrameBufferProperties::get_back_buffers 00179 // Access: Published 00180 // Description: 00181 //////////////////////////////////////////////////////////////////// 00182 INLINE int FrameBufferProperties:: 00183 get_back_buffers() const { 00184 return _property[FBP_back_buffers]; 00185 } 00186 00187 //////////////////////////////////////////////////////////////////// 00188 // Function: FrameBufferProperties::get_indexed_color 00189 // Access: Published 00190 // Description: 00191 //////////////////////////////////////////////////////////////////// 00192 INLINE int FrameBufferProperties:: 00193 get_indexed_color() const { 00194 return _property[FBP_indexed_color]; 00195 } 00196 00197 //////////////////////////////////////////////////////////////////// 00198 // Function: FrameBufferProperties::get_rgb_color 00199 // Access: Published 00200 // Description: 00201 //////////////////////////////////////////////////////////////////// 00202 INLINE int FrameBufferProperties:: 00203 get_rgb_color() const { 00204 return _property[FBP_rgb_color]; 00205 } 00206 00207 //////////////////////////////////////////////////////////////////// 00208 // Function: FrameBufferProperties::get_stereo 00209 // Access: Published 00210 // Description: 00211 //////////////////////////////////////////////////////////////////// 00212 INLINE int FrameBufferProperties:: 00213 get_stereo() const { 00214 return _property[FBP_stereo]; 00215 } 00216 00217 //////////////////////////////////////////////////////////////////// 00218 // Function: FrameBufferProperties::get_force_hardware 00219 // Access: Published 00220 // Description: 00221 //////////////////////////////////////////////////////////////////// 00222 INLINE int FrameBufferProperties:: 00223 get_force_hardware() const { 00224 return _property[FBP_force_hardware]; 00225 } 00226 00227 //////////////////////////////////////////////////////////////////// 00228 // Function: FrameBufferProperties::get_force_software 00229 // Access: Published 00230 // Description: 00231 //////////////////////////////////////////////////////////////////// 00232 INLINE int FrameBufferProperties:: 00233 get_force_software() const { 00234 return _property[FBP_force_software]; 00235 } 00236 00237 //////////////////////////////////////////////////////////////////// 00238 // Function: FrameBufferProperties::set_depth_bits 00239 // Access: Published 00240 // Description: 00241 //////////////////////////////////////////////////////////////////// 00242 INLINE void FrameBufferProperties:: 00243 set_depth_bits(int n) { 00244 _property[FBP_depth_bits] = n; 00245 _specified[FBP_depth_bits] = true; 00246 } 00247 00248 //////////////////////////////////////////////////////////////////// 00249 // Function: FrameBufferProperties::set_color_bits 00250 // Access: Published 00251 // Description: 00252 //////////////////////////////////////////////////////////////////// 00253 INLINE void FrameBufferProperties:: 00254 set_color_bits(int n) { 00255 _property[FBP_color_bits] = n; 00256 _specified[FBP_color_bits] = true; 00257 } 00258 00259 //////////////////////////////////////////////////////////////////// 00260 // Function: FrameBufferProperties::set_alpha_bits 00261 // Access: Published 00262 // Description: 00263 //////////////////////////////////////////////////////////////////// 00264 INLINE void FrameBufferProperties:: 00265 set_alpha_bits(int n) { 00266 _property[FBP_alpha_bits] = n; 00267 _specified[FBP_alpha_bits] = true; 00268 } 00269 00270 //////////////////////////////////////////////////////////////////// 00271 // Function: FrameBufferProperties::set_stencil_bits 00272 // Access: Published 00273 // Description: 00274 //////////////////////////////////////////////////////////////////// 00275 INLINE void FrameBufferProperties:: 00276 set_stencil_bits(int n) { 00277 _property[FBP_stencil_bits] = n; 00278 _specified[FBP_stencil_bits] = true; 00279 } 00280 00281 //////////////////////////////////////////////////////////////////// 00282 // Function: FrameBufferProperties::set_accum_bits 00283 // Access: Published 00284 // Description: 00285 //////////////////////////////////////////////////////////////////// 00286 INLINE void FrameBufferProperties:: 00287 set_accum_bits(int n) { 00288 _property[FBP_accum_bits] = n; 00289 _specified[FBP_accum_bits] = true; 00290 } 00291 00292 //////////////////////////////////////////////////////////////////// 00293 // Function: FrameBufferProperties::set_aux_rgba 00294 // Access: Published 00295 // Description: 00296 //////////////////////////////////////////////////////////////////// 00297 INLINE void FrameBufferProperties:: 00298 set_aux_rgba(int n) { 00299 nassertv(n < 4); 00300 _property[FBP_aux_rgba] = n; 00301 _specified[FBP_aux_rgba] = true; 00302 } 00303 00304 //////////////////////////////////////////////////////////////////// 00305 // Function: FrameBufferProperties::set_aux_hrgba 00306 // Access: Published 00307 // Description: 00308 //////////////////////////////////////////////////////////////////// 00309 INLINE void FrameBufferProperties:: 00310 set_aux_hrgba(int n) { 00311 nassertv(n < 4); 00312 _property[FBP_aux_hrgba] = n; 00313 _specified[FBP_aux_hrgba] = true; 00314 } 00315 00316 //////////////////////////////////////////////////////////////////// 00317 // Function: FrameBufferProperties::set_aux_float 00318 // Access: Published 00319 // Description: 00320 //////////////////////////////////////////////////////////////////// 00321 INLINE void FrameBufferProperties:: 00322 set_aux_float(int n) { 00323 nassertv(n < 4); 00324 _property[FBP_aux_float] = n; 00325 _specified[FBP_aux_float] = true; 00326 } 00327 00328 //////////////////////////////////////////////////////////////////// 00329 // Function: FrameBufferProperties::set_multisamples 00330 // Access: Published 00331 // Description: 00332 //////////////////////////////////////////////////////////////////// 00333 INLINE void FrameBufferProperties:: 00334 set_multisamples(int n) { 00335 _property[FBP_multisamples] = n; 00336 _specified[FBP_multisamples] = true; 00337 } 00338 00339 //////////////////////////////////////////////////////////////////// 00340 // Function: FrameBufferProperties::set_coverage_samples 00341 // Access: Published 00342 // Description: If coverage samples are specified, and there is 00343 // hardware support, we use coverage multisampling 00344 //////////////////////////////////////////////////////////////////// 00345 INLINE void FrameBufferProperties:: 00346 set_coverage_samples(int n) { 00347 _property[FBP_coverage_samples] = n; 00348 _specified[FBP_coverage_samples] = true; 00349 } 00350 00351 //////////////////////////////////////////////////////////////////// 00352 // Function: FrameBufferProperties::set_back_buffers 00353 // Access: Published 00354 // Description: 00355 //////////////////////////////////////////////////////////////////// 00356 INLINE void FrameBufferProperties:: 00357 set_back_buffers(int n) { 00358 _property[FBP_back_buffers] = n; 00359 _specified[FBP_back_buffers] = true; 00360 } 00361 00362 //////////////////////////////////////////////////////////////////// 00363 // Function: FrameBufferProperties::set_indexed_color 00364 // Access: Published 00365 // Description: 00366 //////////////////////////////////////////////////////////////////// 00367 INLINE void FrameBufferProperties:: 00368 set_indexed_color(int n) { 00369 _property[FBP_indexed_color] = n; 00370 _specified[FBP_indexed_color] = true; 00371 } 00372 00373 //////////////////////////////////////////////////////////////////// 00374 // Function: FrameBufferProperties::set_rgb_color 00375 // Access: Published 00376 // Description: 00377 //////////////////////////////////////////////////////////////////// 00378 INLINE void FrameBufferProperties:: 00379 set_rgb_color(int n) { 00380 _property[FBP_rgb_color] = n; 00381 _specified[FBP_rgb_color] = true; 00382 } 00383 00384 //////////////////////////////////////////////////////////////////// 00385 // Function: FrameBufferProperties::set_stereo 00386 // Access: Published 00387 // Description: 00388 //////////////////////////////////////////////////////////////////// 00389 INLINE void FrameBufferProperties:: 00390 set_stereo(int n) { 00391 _property[FBP_stereo] = n; 00392 _specified[FBP_stereo] = true; 00393 } 00394 00395 //////////////////////////////////////////////////////////////////// 00396 // Function: FrameBufferProperties::set_force_hardware 00397 // Access: Published 00398 // Description: 00399 //////////////////////////////////////////////////////////////////// 00400 INLINE void FrameBufferProperties:: 00401 set_force_hardware(int n) { 00402 _property[FBP_force_hardware] = n; 00403 _specified[FBP_force_hardware] = true; 00404 } 00405 00406 //////////////////////////////////////////////////////////////////// 00407 // Function: FrameBufferProperties::set_force_software 00408 // Access: Published 00409 // Description: 00410 //////////////////////////////////////////////////////////////////// 00411 INLINE void FrameBufferProperties:: 00412 set_force_software(int n) { 00413 _property[FBP_force_software] = n; 00414 _specified[FBP_force_software] = true; 00415 }