Panda3D
|
Enables or disables writing to the color buffer. More...
#include "colorWriteAttrib.h"
Public Types | |
enum | Channels { C_off = 0x000, C_red = 0x001, C_green = 0x002, C_blue = 0x004, C_rgb = 0x007, C_alpha = 0x008, C_all = 0x00f } |
Public Member Functions | |
virtual TypeHandle | force_init_type () |
unsigned int | get_channels () const |
Returns the mask of color channels that are enabled by this attrib. | |
virtual int | get_slot () const |
virtual TypeHandle | get_type () const |
virtual void | output (ostream &out) const |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
Static Public Member Functions | |
static | CPT (RenderAttrib) make(unsigned int channels) |
static | CPT (RenderAttrib) make_default() |
static int | get_class_slot () |
static TypeHandle | get_class_type () |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type ColorWriteAttrib. | |
Protected Member Functions | |
virtual int | compare_to_impl (const RenderAttrib *other) const |
Intended to be overridden by derived ColorWriteAttrib types to return a unique number indicating whether this ColorWriteAttrib is equivalent to the other one. | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new ColorWriteAttrib. | |
virtual size_t | get_hash_impl () const |
Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties. | |
Static Protected Member Functions | |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type ColorWriteAttrib is encountered in the Bam file. |
Enables or disables writing to the color buffer.
This is primarily useful for certain special effects in which it is important to write to the depth buffer without affecting the color buffer.
Definition at line 31 of file colorWriteAttrib.h.
int ColorWriteAttrib::compare_to_impl | ( | const RenderAttrib * | other | ) | const [protected, virtual] |
Intended to be overridden by derived ColorWriteAttrib types to return a unique number indicating whether this ColorWriteAttrib is equivalent to the other one.
This should return 0 if the two ColorWriteAttrib objects are equivalent, a number less than zero if this one should be sorted before the other one, and a number greater than zero otherwise.
This will only be called with two ColorWriteAttrib objects whose get_type() functions return the same.
Reimplemented from RenderAttrib.
Definition at line 91 of file colorWriteAttrib.cxx.
void ColorWriteAttrib::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new ColorWriteAttrib.
Reimplemented from RenderAttrib.
Definition at line 166 of file colorWriteAttrib.cxx.
References DatagramIterator::get_uint8().
Referenced by make_from_bam().
unsigned int ColorWriteAttrib::get_channels | ( | ) | const [inline] |
Returns the mask of color channels that are enabled by this attrib.
Definition at line 35 of file colorWriteAttrib.I.
Referenced by TinyGraphicsStateGuardian::begin_draw_primitives(), DXGraphicsStateGuardian8::do_issue_blending(), and DXGraphicsStateGuardian9::do_issue_blending().
size_t ColorWriteAttrib::get_hash_impl | ( | ) | const [protected, virtual] |
Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties.
RenderAttribs that compare the same with compare_to_impl(), above, should return the same hash; RenderAttribs that compare differently should return a different hash.
Reimplemented from RenderAttrib.
Definition at line 108 of file colorWriteAttrib.cxx.
References integer_hash< Key, Compare >::add_hash().
TypedWritable * ColorWriteAttrib::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type ColorWriteAttrib is encountered in the Bam file.
It should create the ColorWriteAttrib and extract its information from the file.
Definition at line 147 of file colorWriteAttrib.cxx.
References fillin().
Referenced by register_with_read_factory().
void ColorWriteAttrib::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type ColorWriteAttrib.
Definition at line 121 of file colorWriteAttrib.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
void ColorWriteAttrib::write_datagram | ( | BamWriter * | manager, |
Datagram & | dg | ||
) | [virtual] |
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from RenderAttrib.
Definition at line 132 of file colorWriteAttrib.cxx.
References Datagram::add_uint8().