14#ifndef ALPHATESTATTRIB_H
15#define ALPHATESTATTRIB_H
26class EXPCL_PANDA_PGRAPH AlphaTestAttrib :
public RenderAttrib {
28 INLINE AlphaTestAttrib(PandaCompareFunc mode = M_always,
29 PN_stdfloat reference_alpha = 1.0f);
32 static CPT(RenderAttrib)
make(PandaCompareFunc mode,
33 PN_stdfloat reference_alpha);
37 INLINE PandaCompareFunc
get_mode()
const;
44 virtual void output(std::ostream &out)
const;
47 virtual int compare_to_impl(
const RenderAttrib *other)
const;
48 virtual size_t get_hash_impl()
const;
51 PandaCompareFunc _mode;
52 PN_stdfloat _reference_alpha;
55 static int get_class_slot() {
58 virtual int get_slot()
const {
59 return get_class_slot();
61 MAKE_PROPERTY(class_slot, get_class_slot);
64 static void register_with_read_factory();
68 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
69 void fillin(DatagramIterator &scan, BamReader *manager);
72 static TypeHandle get_class_type() {
75 static void init_type() {
76 RenderAttrib::init_type();
78 RenderAttrib::get_class_type());
79 _attrib_slot =
register_slot(_type_handle, 100,
new AlphaTestAttrib);
81 virtual TypeHandle get_type()
const {
82 return get_class_type();
84 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
87 static TypeHandle _type_handle;
88 static int _attrib_slot;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_reference_alpha
Returns the alpha reference value.
static ConstPointerTo< RenderAttrib > make(PandaCompareFunc mode, PN_stdfloat reference_alpha)
Constructs a new AlphaTestAttrib object.
get_mode
Returns the alpha write mode.
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
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.
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.