14#ifndef TRANSPARENCYATTRIB_H
15#define TRANSPARENCYATTRIB_H
31class EXPCL_PANDA_PGRAPH TransparencyAttrib :
public RenderAttrib {
39 M_premultiplied_alpha,
47 INLINE TransparencyAttrib(Mode mode = M_none);
50 static CPT(RenderAttrib)
make(Mode mode);
57 virtual void output(std::ostream &out)
const;
60 virtual int compare_to_impl(
const RenderAttrib *other)
const;
61 virtual size_t get_hash_impl()
const;
67 static int get_class_slot() {
70 virtual int get_slot()
const {
71 return get_class_slot();
73 MAKE_PROPERTY(class_slot, get_class_slot);
76 static void register_with_read_factory();
80 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
81 void fillin(DatagramIterator &scan, BamReader *manager);
84 static TypeHandle get_class_type() {
87 static void init_type() {
88 RenderAttrib::init_type();
90 RenderAttrib::get_class_type());
91 _attrib_slot =
register_slot(_type_handle, 100,
new TransparencyAttrib);
93 virtual TypeHandle get_type()
const {
94 return get_class_type();
96 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
99 static TypeHandle _type_handle;
100 static int _attrib_slot;
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 ...
get_mode
Returns the transparency mode.
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
static ConstPointerTo< RenderAttrib > make(Mode mode)
Constructs a new TransparencyAttrib object.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.