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

Public Member Functions

 __init__ ()
 
 __init__ (const FrameBufferProperties)
 
 addProperties (const FrameBufferProperties other)
 Sets any properties that are explicitly specified in other on this object. More...
 
 clear ()
 Unsets all properties that have been specified so far, and resets the FrameBufferProperties structure to its initial empty state. More...
 
int getAccumBits ()
 
int getAlphaBits ()
 
int getAuxFloat ()
 
int getAuxHrgba ()
 
int getAuxMask ()
 Converts the aux bitplanes of the framebuffer into a RenderBuffer::Type. More...
 
int getAuxRgba ()
 
int getBackBuffers ()
 
int getBlueBits ()
 
int getBufferMask ()
 Converts the non-aux bitplanes of the framebuffer into a RenderBuffer::Type. More...
 
int getColorBits ()
 
int getCoverageSamples ()
 If coverage samples are specified, and there is hardware support, we use coverage multisampling. More...
 
int getDepthBits ()
 
bool getFloatColor ()
 
bool getFloatDepth ()
 
bool getForceHardware ()
 
bool getForceSoftware ()
 
int getGreenBits ()
 
bool getIndexedColor ()
 
int getMultisamples ()
 
int getQuality (const FrameBufferProperties reqs)
 Assumes that these properties are a description of a window. More...
 
int getRedBits ()
 
bool getRgbColor ()
 
bool getSrgbColor ()
 
int getStencilBits ()
 
bool getStereo ()
 
bool isAnySpecified ()
 Returns true if any properties have been specified, false otherwise. More...
 
bool isBasic ()
 Returns true if the properties are extremely basic. More...
 
bool isSingleBuffered ()
 
bool isStereo ()
 
bool operator != (const FrameBufferProperties other)
 
bool operator== (const FrameBufferProperties other)
 
 output (Ostream out)
 Generates a string representation. More...
 
 setAccumBits (int n)
 
 setAllSpecified ()
 Marks all bits as having been specified. More...
 
 setAlphaBits (int n)
 
 setAuxFloat (int n)
 
 setAuxHrgba (int n)
 
 setAuxRgba (int n)
 
 setBackBuffers (int n)
 
 setBlueBits (int n)
 
 setColorBits (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. More...
 
 setCoverageSamples (int n)
 If coverage samples are specified, and there is hardware support, we use coverage multisampling. More...
 
 setDepthBits (int n)
 
 setFloatColor (bool n)
 
 setFloatDepth (bool n)
 
 setForceHardware (bool n)
 
 setForceSoftware (bool n)
 
 setGreenBits (int n)
 
 setIndexedColor (bool n)
 
 setMultisamples (int n)
 
 setOneBitPerChannel ()
 If any of the depth, color, alpha, accum, or stencil properties is set to more than one, then they are reduced to one. More...
 
 setRedBits (int n)
 
 setRgbaBits (int r, int g, int b, int a)
 Convenience method for setting the red, green, blue and alpha bits in one go. More...
 
 setRgbColor (bool n)
 
 setSrgbColor (bool n)
 
 setStencilBits (int n)
 
 setStereo (bool n)
 
bool setupColorTexture (Texture tex)
 Sets the texture up for render-to-texture matching these framebuffer properties. More...
 
bool setupDepthTexture (Texture tex)
 Sets the texture up for render-to-texture matching these framebuffer properties. More...
 
bool subsumes (const FrameBufferProperties other)
 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 verifyHardwareSoftware (const FrameBufferProperties props, str renderer)
 Validates that the properties represent the desired kind of renderer (hardware or software). More...
 

Static Public Member Functions

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

Public Attributes

int accum_bits
 
int alpha_bits
 
int aux_float
 
int aux_hrgba
 
int aux_rgba
 
int back_buffers
 
int blue_bits
 
int color_bits
 
int coverage_samples
 If coverage samples are specified, and there is hardware support, we use coverage multisampling. More...
 
int depth_bits
 Individual queries. More...
 
bool float_color
 
bool float_depth
 
bool force_hardware
 
bool force_software
 
int green_bits
 
bool indexed_color
 
int multisamples
 
int red_bits
 
bool rgb_color
 
bool srgb_color
 
int stencil_bits
 
bool 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.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const  FrameBufferProperties)

◆ addProperties()

addProperties ( const FrameBufferProperties  other)

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

Leaves other properties unchanged.

◆ clear()

clear ( )

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

◆ getAccumBits()

int getAccumBits ( )

◆ getAlphaBits()

int getAlphaBits ( )

◆ getAuxFloat()

int getAuxFloat ( )

◆ getAuxHrgba()

int getAuxHrgba ( )

◆ getAuxMask()

int getAuxMask ( )

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

◆ getAuxRgba()

int getAuxRgba ( )

◆ getBackBuffers()

int getBackBuffers ( )

◆ getBlueBits()

int getBlueBits ( )

◆ getBufferMask()

int getBufferMask ( )

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

◆ getColorBits()

int getColorBits ( )

◆ getCoverageSamples()

int getCoverageSamples ( )

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

◆ getDefault()

static const FrameBufferProperties getDefault ( )
static

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

◆ getDepthBits()

int getDepthBits ( )

◆ getFloatColor()

bool getFloatColor ( )

◆ getFloatDepth()

bool getFloatDepth ( )

◆ getForceHardware()

bool getForceHardware ( )

◆ getForceSoftware()

bool getForceSoftware ( )

◆ getGreenBits()

int getGreenBits ( )

◆ getIndexedColor()

bool getIndexedColor ( )

◆ getMultisamples()

int getMultisamples ( )

◆ getQuality()

int getQuality ( const FrameBufferProperties  reqs)

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.

◆ getRedBits()

int getRedBits ( )

◆ getRgbColor()

bool getRgbColor ( )

◆ getSrgbColor()

bool getSrgbColor ( )

◆ getStencilBits()

int getStencilBits ( )

◆ getStereo()

bool getStereo ( )

◆ isAnySpecified()

bool isAnySpecified ( )

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

◆ isBasic()

bool isBasic ( )

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.

◆ isSingleBuffered()

bool isSingleBuffered ( )

◆ isStereo()

bool isStereo ( )

◆ operator !=()

bool operator != ( const FrameBufferProperties  other)

◆ operator==()

bool operator== ( const FrameBufferProperties  other)

◆ output()

output ( Ostream  out)

Generates a string representation.

◆ setAccumBits()

setAccumBits ( int  n)

◆ setAllSpecified()

setAllSpecified ( )

Marks all bits as having been specified.

◆ setAlphaBits()

setAlphaBits ( int  n)

◆ setAuxFloat()

setAuxFloat ( int  n)

◆ setAuxHrgba()

setAuxHrgba ( int  n)

◆ setAuxRgba()

setAuxRgba ( int  n)

◆ setBackBuffers()

setBackBuffers ( int  n)

◆ setBlueBits()

setBlueBits ( int  n)

◆ setColorBits()

setColorBits ( 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.

◆ setCoverageSamples()

setCoverageSamples ( int  n)

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

◆ setDepthBits()

setDepthBits ( int  n)

◆ setFloatColor()

setFloatColor ( bool  n)

◆ setFloatDepth()

setFloatDepth ( bool  n)

◆ setForceHardware()

setForceHardware ( bool  n)

◆ setForceSoftware()

setForceSoftware ( bool  n)

◆ setGreenBits()

setGreenBits ( int  n)

◆ setIndexedColor()

setIndexedColor ( bool  n)

◆ setMultisamples()

setMultisamples ( int  n)

◆ setOneBitPerChannel()

setOneBitPerChannel ( )

If any of the depth, color, alpha, accum, or stencil properties is set to more than one, then they are reduced to one.

◆ setRedBits()

setRedBits ( int  n)

◆ setRgbaBits()

setRgbaBits ( int  r,
int  g,
int  b,
int  a 
)

Convenience method for setting the red, green, blue and alpha bits in one go.

◆ setRgbColor()

setRgbColor ( bool  n)

◆ setSrgbColor()

setSrgbColor ( bool  n)

◆ setStencilBits()

setStencilBits ( int  n)

◆ setStereo()

setStereo ( bool  n)

◆ setupColorTexture()

bool setupColorTexture ( Texture  tex)

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.

◆ setupDepthTexture()

bool setupDepthTexture ( Texture  tex)

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.

◆ subsumes()

bool subsumes ( const FrameBufferProperties  other)

Returns true if this set of properties makes strictly greater or equal demands of the framebuffer than the other set of framebuffer properties.

◆ verifyHardwareSoftware()

bool verifyHardwareSoftware ( const FrameBufferProperties  props,
str  renderer 
)

Validates that the properties represent the desired kind of renderer (hardware or software).

If not, prints out an error message and returns false.

Member Data Documentation

◆ accum_bits

int accum_bits

◆ alpha_bits

int alpha_bits

◆ aux_float

int aux_float

◆ aux_hrgba

int aux_hrgba

◆ aux_rgba

int aux_rgba

◆ back_buffers

int back_buffers

◆ blue_bits

int blue_bits

◆ color_bits

int color_bits

◆ coverage_samples

int coverage_samples

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

◆ depth_bits

int depth_bits

Individual queries.

◆ float_color

bool float_color

◆ float_depth

bool float_depth

◆ force_hardware

bool force_hardware

◆ force_software

bool force_software

◆ green_bits

int green_bits

◆ indexed_color

bool indexed_color

◆ multisamples

int multisamples

◆ red_bits

int red_bits

◆ rgb_color

bool rgb_color

◆ srgb_color

bool srgb_color

◆ stencil_bits

int stencil_bits

◆ stereo

bool stereo