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 | |
void | add_properties (const FrameBufferProperties &other) |
Sets any properties that are explicitly specified in other on this object. More... | |
void | clear () |
Unsets all properties that have been specified so far, and resets the FrameBufferProperties structure to its initial empty state. More... | |
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. More... | |
int | get_aux_rgba () const |
int | get_back_buffers () const |
int | get_blue_bits () const |
int | get_buffer_mask () const |
Converts the non-aux bitplanes of the framebuffer into a RenderBuffer::Type. More... | |
int | get_color_bits () const |
int | get_coverage_samples () const |
int | get_depth_bits () const |
bool | get_float_color () const |
bool | get_float_depth () const |
bool | get_force_hardware () const |
bool | get_force_software () const |
int | get_green_bits () const |
bool | 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. More... | |
int | get_red_bits () const |
bool | get_rgb_color () const |
bool | get_srgb_color () const |
int | get_stencil_bits () const |
bool | get_stereo () const |
bool | is_any_specified () const |
Returns true if any properties have been specified, false otherwise. More... | |
bool | is_basic () const |
Returns true if the properties are extremely basic. More... | |
bool | is_single_buffered () const |
bool | is_stereo () const |
bool | operator != (const FrameBufferProperties &other) const |
bool | operator== (const FrameBufferProperties &other) const |
void | output (std::ostream &out) const |
Generates a string representation. More... | |
void | set_accum_bits (int n) |
void | set_all_specified () |
Marks all bits as having been specified. More... | |
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_blue_bits (int n) |
void | set_color_bits (int n) |
void | set_coverage_samples (int n) |
void | set_depth_bits (int n) |
void | set_float_color (bool n) |
void | set_float_depth (bool n) |
void | set_force_hardware (bool n) |
void | set_force_software (bool n) |
void | set_green_bits (int n) |
void | set_indexed_color (bool 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. More... | |
void | set_red_bits (int n) |
void | set_rgb_color (bool n) |
void | set_rgba_bits (int r, int g, int b, int a) |
Convenience method for setting the red, green, blue and alpha bits in one go. More... | |
void | set_srgb_color (bool n) |
void | set_stencil_bits (int n) |
void | set_stereo (bool n) |
bool | setup_color_texture (Texture *tex) const |
Sets the texture up for render-to-texture matching these framebuffer properties. More... | |
bool | setup_depth_texture (Texture *tex) const |
Sets the texture up for render-to-texture matching these framebuffer properties. More... | |
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. More... | |
bool | verify_hardware_software (const FrameBufferProperties &props, const std::string &renderer) const |
Validates that the properties represent the desired kind of renderer (hardware or software). More... | |
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. More... | |
Public Attributes | |
get_accum_bits | |
get_alpha_bits | |
get_aux_float | |
get_aux_hrgba | |
get_aux_rgba | |
get_back_buffers | |
get_blue_bits | |
get_color_bits | |
get_coverage_samples | |
If coverage samples are specified, and there is hardware support, we use coverage multisampling. More... | |
get_depth_bits | |
get_float_color | |
get_float_depth | |
get_force_hardware | |
get_force_software | |
get_green_bits | |
get_indexed_color | |
get_multisamples | |
get_red_bits | |
get_rgb_color | |
get_srgb_color | |
get_stencil_bits | |
get_stereo | |
set_accum_bits | |
set_alpha_bits | |
set_aux_float | |
set_aux_hrgba | |
set_aux_rgba | |
set_back_buffers | |
set_blue_bits | |
set_color_bits | |
Sets the number of requested color bits as a single number that represents the sum of the individual numbers of red, green and blue bits. More... | |
set_coverage_samples | |
If coverage samples are specified, and there is hardware support, we use coverage multisampling. More... | |
set_depth_bits | |
set_float_color | |
set_float_depth | |
set_force_hardware | |
set_force_software | |
set_green_bits | |
set_indexed_color | |
set_multisamples | |
set_red_bits | |
set_rgb_color | |
set_srgb_color | |
set_stencil_bits | |
set_stereo | |
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 26 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 200 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 185 of file frameBufferProperties.cxx.
Referenced by eglGraphicsStateGuardian::choose_pixel_format(), glxGraphicsStateGuardian::choose_pixel_format(), AndroidGraphicsStateGuardian::get_properties(), eglGraphicsStateGuardian::get_properties(), wglGraphicsStateGuardian::get_properties(), glxGraphicsStateGuardian::get_properties(), and glxGraphicsStateGuardian::get_properties_advanced().
int FrameBufferProperties::get_aux_mask | ( | ) | const |
Converts the aux bitplanes of the framebuffer into a RenderBuffer::Type.
Definition at line 286 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 305 of file frameBufferProperties.cxx.
Referenced by GraphicsStateGuardian::get_render_buffer().
|
static |
Returns a FrameBufferProperties structure with all of the default values filled in according to the user's config file.
Definition at line 45 of file frameBufferProperties.cxx.
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 438 of file frameBufferProperties.cxx.
bool FrameBufferProperties::is_any_specified | ( | ) | const |
Returns true if any properties have been specified, false otherwise.
Definition at line 326 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 345 of file frameBufferProperties.cxx.
void FrameBufferProperties::output | ( | std::ostream & | out | ) | const |
Generates a string representation.
Definition at line 216 of file frameBufferProperties.cxx.
void FrameBufferProperties::set_all_specified | ( | ) |
Marks all bits as having been specified.
Definition at line 334 of file frameBufferProperties.cxx.
Referenced by wglGraphicsStateGuardian::get_properties().
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 411 of file frameBufferProperties.cxx.
|
inline |
Convenience method for setting the red, green, blue and alpha bits in one go.
Definition at line 255 of file frameBufferProperties.I.
Referenced by DXGraphicsStateGuardian9::calc_fb_properties(), AndroidGraphicsStateGuardian::get_properties(), eglGraphicsStateGuardian::get_properties(), wglGraphicsStateGuardian::get_properties(), glxGraphicsStateGuardian::get_properties(), and glxGraphicsStateGuardian::get_properties_advanced().
bool FrameBufferProperties::setup_color_texture | ( | Texture * | tex | ) | const |
Sets the texture up for render-to-texture matching these framebuffer properties.
Returns true if there was a format that had enough bits, false otherwise. Of course, this is no guarantee that a particular graphics back-end supports rendering to textures of that format.
Definition at line 644 of file frameBufferProperties.cxx.
Referenced by GraphicsOutput::add_render_texture().
bool FrameBufferProperties::setup_depth_texture | ( | Texture * | tex | ) | const |
Sets the texture up for render-to-texture matching these framebuffer properties.
Returns true if there was a format that had enough bits, false otherwise. Of course, this is no guarantee that a particular graphics back-end supports rendering to textures of that format.
Definition at line 723 of file frameBufferProperties.cxx.
References Texture::set_component_type, and Texture::set_format.
Referenced by GraphicsOutput::add_render_texture().
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 25 of file frameBufferProperties.cxx.
bool FrameBufferProperties::verify_hardware_software | ( | const FrameBufferProperties & | props, |
const std::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 604 of file frameBufferProperties.cxx.
|
inline |
If coverage samples are specified, and there is hardware support, we use coverage multisampling.
Definition at line 135 of file frameBufferProperties.h.
|
inline |
Sets the number of requested color bits as a single number that represents the sum of the individual numbers of red, green and blue bits.
Panda won't care how the individual bits are divided up.
See also set_rgba_bits, which allows you to specify requirements for the individual components.
Definition at line 124 of file frameBufferProperties.h.
Referenced by DXGraphicsStateGuardian9::calc_fb_properties(), and wglGraphicsStateGuardian::get_properties().
|
inline |
If coverage samples are specified, and there is hardware support, we use coverage multisampling.
Definition at line 135 of file frameBufferProperties.h.