FrameBufferProperties

class FrameBufferProperties

A container for the various kinds of properties we might ask to have on a graphics frameBuffer before we create a GSG.

Inheritance diagram

Inheritance diagram of FrameBufferProperties

constexpr FrameBufferProperties(void) = default
FrameBufferProperties(FrameBufferProperties const&) = default
void add_properties(FrameBufferProperties const &other)

Sets any properties that are explicitly specified in other on this object. Leaves other properties unchanged.

void clear(void)

Unsets all properties that have been specified so far, and resets the FrameBufferProperties structure to its initial empty state.

int get_accum_bits(void) const
int get_alpha_bits(void) const
int get_aux_float(void) const
int get_aux_hrgba(void) const
int get_aux_mask(void) const

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

int get_aux_rgba(void) const
int get_back_buffers(void) const
int get_blue_bits(void) const
int get_buffer_mask(void) const

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

int get_color_bits(void) const
int get_coverage_samples(void) const

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

static FrameBufferProperties const &get_default(void)

Returns a FrameBufferProperties structure with all of the default values filled in according to the user’s config file.

int get_depth_bits(void) const

Individual queries.

Individual queries.

bool get_float_color(void) const
bool get_float_depth(void) const
bool get_force_hardware(void) const
bool get_force_software(void) const
int get_green_bits(void) const
bool get_indexed_color(void) const
int get_multisamples(void) const
int get_quality(FrameBufferProperties const &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.

int get_red_bits(void) const
bool get_rgb_color(void) const
bool get_srgb_color(void) const
int get_stencil_bits(void) const
bool get_stereo(void) const
bool is_any_specified(void) const

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

bool is_basic(void) 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.

bool is_single_buffered(void) const
bool is_stereo(void) const
void output(std::ostream &out) const

Generates a string representation.

void set_accum_bits(int n)
void set_all_specified(void)

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)

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.

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)

Individual assigners.

Individual assigners.

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(void)

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.

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.

bool 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.

bool subsumes(FrameBufferProperties const &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(FrameBufferProperties const &props, std::string const &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.