Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
FrameBufferProperties Class Reference

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.
 
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_blue_bits () 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
 
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.
 
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.
 
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
 
bool operator== (const FrameBufferProperties &other) const
 
void output (std::ostream &out) const
 Generates a string representation.
 
void set_accum_bits (int n)
 
void set_all_specified ()
 Marks all bits as having been specified.
 
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.
 
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.
 
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.
 
bool setup_depth_texture (Texture *tex) const
 Sets the texture up for render-to-texture matching these framebuffer properties.
 
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 std::string &renderer) const
 Validates that the properties represent the desired kind of renderer (hardware or software).
 

Static Public Member Functions

static const FrameBufferPropertiesget_default ()
 Returns a FrameBufferProperties structure with all of the default values filled in according to the user's config file.
 

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.
 
 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.
 
 set_coverage_samples
 If coverage samples are specified, and there is hardware support, we use coverage multisampling.
 
 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
 

Detailed Description

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.

Member Function Documentation

◆ add_properties()

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 199 of file frameBufferProperties.cxx.

◆ clear()

void FrameBufferProperties::clear ( )

◆ get_aux_mask()

int FrameBufferProperties::get_aux_mask ( ) const

Converts the aux bitplanes of the framebuffer into a RenderBuffer::Type.

Definition at line 285 of file frameBufferProperties.cxx.

◆ get_buffer_mask()

int FrameBufferProperties::get_buffer_mask ( ) const

Converts the non-aux bitplanes of the framebuffer into a RenderBuffer::Type.

Definition at line 304 of file frameBufferProperties.cxx.

Referenced by GraphicsStateGuardian::get_render_buffer().

◆ get_default()

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 44 of file frameBufferProperties.cxx.

References ConfigVariable::get_num_words(), set_color_bits, and ConfigVariableInt::size().

Referenced by GraphicsEngine::make_buffer().

◆ get_quality()

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 437 of file frameBufferProperties.cxx.

Referenced by wglGraphicsStateGuardian::choose_pixel_format(), AndroidGraphicsStateGuardian::choose_pixel_format(), eglGraphicsStateGuardian::choose_pixel_format(), and glxGraphicsStateGuardian::choose_pixel_format().

◆ is_any_specified()

bool FrameBufferProperties::is_any_specified ( ) const

Returns true if any properties have been specified, false otherwise.

Definition at line 325 of file frameBufferProperties.cxx.

◆ is_basic()

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 344 of file frameBufferProperties.cxx.

Referenced by PT(), and PT().

◆ is_single_buffered()

bool FrameBufferProperties::is_single_buffered ( ) const
inline

Definition at line 25 of file frameBufferProperties.I.

◆ is_stereo()

bool FrameBufferProperties::is_stereo ( ) const
inline

Definition at line 33 of file frameBufferProperties.I.

◆ operator!=()

bool FrameBufferProperties::operator!= ( const FrameBufferProperties & other) const
inline

Definition at line 17 of file frameBufferProperties.I.

◆ operator==()

bool FrameBufferProperties::operator== ( const FrameBufferProperties & other) const

Definition at line 161 of file frameBufferProperties.cxx.

◆ output()

void FrameBufferProperties::output ( std::ostream & out) const

Generates a string representation.

Definition at line 215 of file frameBufferProperties.cxx.

◆ set_all_specified()

void FrameBufferProperties::set_all_specified ( )

Marks all bits as having been specified.

Definition at line 333 of file frameBufferProperties.cxx.

Referenced by wglGraphicsStateGuardian::get_properties(), and wglGraphicsStateGuardian::get_properties_advanced().

◆ set_one_bit_per_channel()

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 410 of file frameBufferProperties.cxx.

◆ set_rgba_bits()

void FrameBufferProperties::set_rgba_bits ( int r,
int g,
int b,
int a )
inline

◆ setup_color_texture()

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 643 of file frameBufferProperties.cxx.

References Texture::set_component_type, and Texture::set_format.

Referenced by GraphicsOutput::add_render_texture().

◆ setup_depth_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 722 of file frameBufferProperties.cxx.

References Texture::set_component_type, and Texture::set_format.

Referenced by GraphicsOutput::add_render_texture().

◆ subsumes()

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 24 of file frameBufferProperties.cxx.

Referenced by GraphicsEngine::make_output(), and PT().

◆ verify_hardware_software()

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 603 of file frameBufferProperties.cxx.

Member Data Documentation

◆ get_accum_bits

int FrameBufferProperties::get_accum_bits
inline

Definition at line 130 of file frameBufferProperties.h.

◆ get_alpha_bits

int FrameBufferProperties::get_alpha_bits
inline

Definition at line 128 of file frameBufferProperties.h.

◆ get_aux_float

int FrameBufferProperties::get_aux_float
inline

Definition at line 133 of file frameBufferProperties.h.

◆ get_aux_hrgba

int FrameBufferProperties::get_aux_hrgba
inline

Definition at line 132 of file frameBufferProperties.h.

◆ get_aux_rgba

int FrameBufferProperties::get_aux_rgba
inline

Definition at line 131 of file frameBufferProperties.h.

◆ get_back_buffers

int FrameBufferProperties::get_back_buffers
inline

Definition at line 136 of file frameBufferProperties.h.

◆ get_blue_bits

int FrameBufferProperties::get_blue_bits
inline

Definition at line 127 of file frameBufferProperties.h.

◆ get_color_bits

int FrameBufferProperties::get_color_bits
inline

Definition at line 124 of file frameBufferProperties.h.

◆ get_coverage_samples

int FrameBufferProperties::get_coverage_samples
inline

If coverage samples are specified, and there is hardware support, we use coverage multisampling.

Definition at line 135 of file frameBufferProperties.h.

◆ get_depth_bits

int FrameBufferProperties::get_depth_bits
inline

Definition at line 123 of file frameBufferProperties.h.

◆ get_float_color

bool FrameBufferProperties::get_float_color
inline

Definition at line 143 of file frameBufferProperties.h.

◆ get_float_depth

bool FrameBufferProperties::get_float_depth
inline

Definition at line 144 of file frameBufferProperties.h.

◆ get_force_hardware

bool FrameBufferProperties::get_force_hardware
inline

Definition at line 140 of file frameBufferProperties.h.

◆ get_force_software

bool FrameBufferProperties::get_force_software
inline

Definition at line 141 of file frameBufferProperties.h.

◆ get_green_bits

int FrameBufferProperties::get_green_bits
inline

Definition at line 126 of file frameBufferProperties.h.

◆ get_indexed_color

bool FrameBufferProperties::get_indexed_color
inline

Definition at line 137 of file frameBufferProperties.h.

◆ get_multisamples

int FrameBufferProperties::get_multisamples
inline

Definition at line 134 of file frameBufferProperties.h.

◆ get_red_bits

int FrameBufferProperties::get_red_bits
inline

Definition at line 125 of file frameBufferProperties.h.

◆ get_rgb_color

bool FrameBufferProperties::get_rgb_color
inline

Definition at line 138 of file frameBufferProperties.h.

◆ get_srgb_color

bool FrameBufferProperties::get_srgb_color
inline

Definition at line 142 of file frameBufferProperties.h.

◆ get_stencil_bits

int FrameBufferProperties::get_stencil_bits
inline

Definition at line 129 of file frameBufferProperties.h.

◆ get_stereo

bool FrameBufferProperties::get_stereo
inline

Definition at line 139 of file frameBufferProperties.h.

◆ set_accum_bits

void FrameBufferProperties::set_accum_bits
inline

Definition at line 130 of file frameBufferProperties.h.

◆ set_alpha_bits

void FrameBufferProperties::set_alpha_bits
inline

Definition at line 128 of file frameBufferProperties.h.

◆ set_aux_float

void FrameBufferProperties::set_aux_float
inline

Definition at line 133 of file frameBufferProperties.h.

◆ set_aux_hrgba

void FrameBufferProperties::set_aux_hrgba
inline

Definition at line 132 of file frameBufferProperties.h.

◆ set_aux_rgba

void FrameBufferProperties::set_aux_rgba
inline

Definition at line 131 of file frameBufferProperties.h.

◆ set_back_buffers

void FrameBufferProperties::set_back_buffers
inline

Definition at line 136 of file frameBufferProperties.h.

◆ set_blue_bits

void FrameBufferProperties::set_blue_bits
inline

Definition at line 127 of file frameBufferProperties.h.

◆ set_color_bits

void FrameBufferProperties::set_color_bits
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(), get_default(), wglGraphicsStateGuardian::get_properties(), and wglGraphicsStateGuardian::get_properties_advanced().

◆ set_coverage_samples

void FrameBufferProperties::set_coverage_samples
inline

If coverage samples are specified, and there is hardware support, we use coverage multisampling.

Definition at line 135 of file frameBufferProperties.h.

◆ set_depth_bits

void FrameBufferProperties::set_depth_bits
inline

Definition at line 123 of file frameBufferProperties.h.

◆ set_float_color

void FrameBufferProperties::set_float_color
inline

Definition at line 143 of file frameBufferProperties.h.

◆ set_float_depth

void FrameBufferProperties::set_float_depth
inline

Definition at line 144 of file frameBufferProperties.h.

◆ set_force_hardware

void FrameBufferProperties::set_force_hardware
inline

Definition at line 140 of file frameBufferProperties.h.

◆ set_force_software

void FrameBufferProperties::set_force_software
inline

Definition at line 141 of file frameBufferProperties.h.

◆ set_green_bits

void FrameBufferProperties::set_green_bits
inline

Definition at line 126 of file frameBufferProperties.h.

◆ set_indexed_color

void FrameBufferProperties::set_indexed_color
inline

Definition at line 137 of file frameBufferProperties.h.

◆ set_multisamples

void FrameBufferProperties::set_multisamples
inline

Definition at line 134 of file frameBufferProperties.h.

◆ set_red_bits

void FrameBufferProperties::set_red_bits
inline

Definition at line 125 of file frameBufferProperties.h.

◆ set_rgb_color

void FrameBufferProperties::set_rgb_color
inline

Definition at line 138 of file frameBufferProperties.h.

◆ set_srgb_color

void FrameBufferProperties::set_srgb_color
inline

Definition at line 142 of file frameBufferProperties.h.

◆ set_stencil_bits

void FrameBufferProperties::set_stencil_bits
inline

Definition at line 129 of file frameBufferProperties.h.

◆ set_stereo

void FrameBufferProperties::set_stereo
inline

Definition at line 139 of file frameBufferProperties.h.


The documentation for this class was generated from the following files: