14#ifndef COLORWRITEATTRIB_H
15#define COLORWRITEATTRIB_H
28class EXPCL_PANDA_PGRAPH ColorWriteAttrib :
public RenderAttrib {
43 INLINE ColorWriteAttrib(
unsigned int channels = C_all);
46 static CPT(RenderAttrib)
make(
unsigned int channels);
55 virtual void output(std::ostream &out)
const;
58 virtual int compare_to_impl(
const RenderAttrib *other)
const;
59 virtual size_t get_hash_impl()
const;
69 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
73 static int get_class_slot() {
76 virtual int get_slot()
const {
77 return get_class_slot();
79 MAKE_PROPERTY(class_slot, get_class_slot);
82 static TypeHandle get_class_type() {
85 static void init_type() {
86 RenderAttrib::init_type();
88 RenderAttrib::get_class_type());
89 _attrib_slot =
register_slot(_type_handle, 100,
new ColorWriteAttrib);
91 virtual TypeHandle get_type()
const {
92 return get_class_type();
94 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
97 static TypeHandle _type_handle;
98 static int _attrib_slot;
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
get_channels
Returns the mask of color channels that are enabled by this attrib.
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
static void register_with_read_factory()
Tells the BamReader how to create objects of type ColorWriteAttrib.
static ConstPointerTo< RenderAttrib > make(unsigned int channels)
Constructs a new ColorWriteAttrib object.
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
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 int register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.