Panda3D
|
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before we create a GSG. More...
#include "frameBufferProperties.h"
Public Member Functions | |
FrameBufferProperties (const FrameBufferProperties ©) | |
void | add_properties (const FrameBufferProperties &other) |
Sets any properties that are explicitly specified in other on this object. | |
void | clear () |
Unsets all properties that have been specified so far, and resets the FrameBufferProperties structure to its initial empty state. | |
int | get_accum_bits () const |
int | get_alpha_bits () const |
int | get_aux_float () const |
int | get_aux_hrgba () const |
int | get_aux_mask () const |
Converts the aux bitplanes of the framebuffer into a RenderBuffer::Type. | |
int | get_aux_rgba () const |
int | get_back_buffers () const |
int | get_buffer_mask () const |
Converts the non-aux bitplanes of the framebuffer into a RenderBuffer::Type. | |
int | get_color_bits () const |
int | get_coverage_samples () const |
If coverage samples are specified, and there is hardware support, we use coverage multisampling. | |
int | get_depth_bits () const |
int | get_force_hardware () const |
int | get_force_software () const |
int | get_indexed_color () const |
int | get_multisamples () const |
int | get_quality (const FrameBufferProperties &reqs) const |
Assumes that these properties are a description of a window. | |
int | get_rgb_color () const |
int | get_stencil_bits () const |
int | get_stereo () const |
bool | is_any_specified () const |
Returns true if any properties have been specified, false otherwise. | |
bool | is_basic () const |
Returns true if the properties are extremely basic. | |
bool | is_single_buffered () const |
bool | is_stereo () const |
bool | operator!= (const FrameBufferProperties &other) const |
void | operator= (const FrameBufferProperties ©) |
bool | operator== (const FrameBufferProperties &other) const |
void | output (ostream &out) const |
Sets any properties that are explicitly specified in other on this object. | |
void | set_accum_bits (int n) |
void | set_all_specified () |
sets all the specified bits. | |
void | set_alpha_bits (int n) |
void | set_aux_float (int n) |
void | set_aux_hrgba (int n) |
void | set_aux_rgba (int n) |
void | set_back_buffers (int n) |
void | set_color_bits (int n) |
void | set_coverage_samples (int n) |
If coverage samples are specified, and there is hardware support, we use coverage multisampling. | |
void | set_depth_bits (int n) |
void | set_force_hardware (int n) |
void | set_force_software (int n) |
void | set_indexed_color (int n) |
void | set_multisamples (int n) |
void | set_one_bit_per_channel () |
If any of the depth, color, alpha, accum, or stencil properties is set to more than one, then they are reduced to one. | |
void | set_rgb_color (int n) |
void | set_stencil_bits (int n) |
void | set_stereo (int n) |
bool | subsumes (const FrameBufferProperties &other) const |
Returns true if this set of properties makes strictly greater or equal demands of the framebuffer than the other set of framebuffer properties. | |
bool | verify_hardware_software (const FrameBufferProperties &props, const string &renderer) const |
Validates that the properties represent the desired kind of renderer (hardware or software). | |
Static Public Member Functions | |
static const FrameBufferProperties & | get_default () |
Returns a FrameBufferProperties structure with all of the default values filled in according to the user's config file. |
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before we create a GSG.
Definition at line 27 of file frameBufferProperties.h.
void FrameBufferProperties::add_properties | ( | const FrameBufferProperties & | other | ) |
Sets any properties that are explicitly specified in other on this object.
Leaves other properties unchanged.
Definition at line 194 of file frameBufferProperties.cxx.
void FrameBufferProperties::clear | ( | ) |
Unsets all properties that have been specified so far, and resets the FrameBufferProperties structure to its initial empty state.
Definition at line 179 of file frameBufferProperties.cxx.
Referenced by glxGraphicsStateGuardian::choose_pixel_format(), eglGraphicsStateGuardian::choose_pixel_format(), wglGraphicsStateGuardian::get_properties(), glxGraphicsStateGuardian::get_properties(), eglGraphicsStateGuardian::get_properties(), wglGraphicsStateGuardian::get_properties_advanced(), glxGraphicsStateGuardian::get_properties_advanced(), and OsMesaGraphicsBuffer::open_buffer().
int FrameBufferProperties::get_aux_mask | ( | ) | const |
Converts the aux bitplanes of the framebuffer into a RenderBuffer::Type.
Definition at line 263 of file frameBufferProperties.cxx.
int FrameBufferProperties::get_buffer_mask | ( | ) | const |
Converts the non-aux bitplanes of the framebuffer into a RenderBuffer::Type.
Definition at line 284 of file frameBufferProperties.cxx.
Referenced by GraphicsStateGuardian::get_render_buffer().
int FrameBufferProperties::get_coverage_samples | ( | ) | const [inline] |
If coverage samples are specified, and there is hardware support, we use coverage multisampling.
Definition at line 173 of file frameBufferProperties.I.
const FrameBufferProperties & FrameBufferProperties::get_default | ( | ) | [static] |
Returns a FrameBufferProperties structure with all of the default values filled in according to the user's config file.
Definition at line 68 of file frameBufferProperties.cxx.
References ConfigVariable::get_num_words().
Referenced by GraphicsEngine::make_buffer().
int FrameBufferProperties::get_quality | ( | const FrameBufferProperties & | reqs | ) | const |
Assumes that these properties are a description of a window.
Measures how well this window satisfies a specified set of requirements. A higher quality number means that more requirements were satisfied. A quality of zero means that the window is unsuitable.
The routine deducts a lot if the window fails to provide a requested feature. It deducts less if the window provides a feature, but at a degraded level of functionality (ie, the user asks for rgba8, color, but the window only provides rgba4). The routine also deducts a small amount for unnecessary features. For example, if the window has an accumulation buffer when one is not requested will reduce quality slightly. Maximum quality is obtained when the window exactly matches the request.
If you want to know whether the window satisfies all of the requirements, use the "subsumes" function.
Definition at line 420 of file frameBufferProperties.cxx.
Referenced by wglGraphicsStateGuardian::choose_pixel_format(), glxGraphicsStateGuardian::choose_pixel_format(), and eglGraphicsStateGuardian::choose_pixel_format().
bool FrameBufferProperties::is_any_specified | ( | ) | const |
Returns true if any properties have been specified, false otherwise.
Definition at line 308 of file frameBufferProperties.cxx.
bool FrameBufferProperties::is_basic | ( | ) | const |
Returns true if the properties are extremely basic.
The following count as basic: rgb or rgba, depth. If anything else is specified, the properties are non-basic.
Definition at line 338 of file frameBufferProperties.cxx.
void FrameBufferProperties::output | ( | ostream & | out | ) | const |
Sets any properties that are explicitly specified in other on this object.
Leaves other properties unchanged.
Definition at line 211 of file frameBufferProperties.cxx.
void FrameBufferProperties::set_all_specified | ( | ) |
sets all the specified bits.
Definition at line 323 of file frameBufferProperties.cxx.
Referenced by wglGraphicsStateGuardian::get_properties(), and wglGraphicsStateGuardian::get_properties_advanced().
void FrameBufferProperties::set_coverage_samples | ( | int | n | ) | [inline] |
If coverage samples are specified, and there is hardware support, we use coverage multisampling.
Definition at line 346 of file frameBufferProperties.I.
void FrameBufferProperties::set_one_bit_per_channel | ( | ) |
If any of the depth, color, alpha, accum, or stencil properties is set to more than one, then they are reduced to one.
Definition at line 386 of file frameBufferProperties.cxx.
bool FrameBufferProperties::subsumes | ( | const FrameBufferProperties & | other | ) | const |
Returns true if this set of properties makes strictly greater or equal demands of the framebuffer than the other set of framebuffer properties.
Definition at line 51 of file frameBufferProperties.cxx.
Referenced by GraphicsEngine::make_output(), wglGraphicsBuffer::open_buffer(), glxGraphicsPixmap::open_buffer(), glxGraphicsBuffer::open_buffer(), eglGraphicsPixmap::open_buffer(), eglGraphicsBuffer::open_buffer(), wglGraphicsWindow::open_window(), glxGraphicsWindow::open_window(), and eglGraphicsWindow::open_window().
bool FrameBufferProperties::verify_hardware_software | ( | const FrameBufferProperties & | props, |
const string & | renderer | ||
) | const |
Validates that the properties represent the desired kind of renderer (hardware or software).
If not, prints out an error message and returns false.
Definition at line 557 of file frameBufferProperties.cxx.
Referenced by wglGraphicsBuffer::open_buffer(), glxGraphicsPixmap::open_buffer(), glxGraphicsBuffer::open_buffer(), eglGraphicsPixmap::open_buffer(), eglGraphicsBuffer::open_buffer(), wglGraphicsWindow::open_window(), glxGraphicsWindow::open_window(), and eglGraphicsWindow::open_window().