24 int AlphaTestAttrib::_attrib_slot;
30 make(PandaCompareFunc mode, PN_stdfloat reference_value) {
31 assert((reference_value >=0.0f) && (reference_value <=1.0f));
33 return return_new(attrib);
48 void AlphaTestAttrib::
49 output(std::ostream &out)
const {
50 out << get_type() <<
":";
51 output_comparefunc(out,_mode);
52 out <<
"," << _reference_alpha;
71 int compare_result = ((int)_mode - (
int)ta->_mode) ;
72 if (compare_result != 0) {
73 return compare_result;
76 if (_reference_alpha != ta->_reference_alpha) {
77 return _reference_alpha < ta->_reference_alpha ? -1 : 1;
89 size_t AlphaTestAttrib::
90 get_hash_impl()
const {
129 attrib->fillin(scan, manager);
138 void AlphaTestAttrib::
140 RenderAttrib::fillin(scan, manager);
142 _mode = (PandaCompareFunc)scan.
get_int8();
CPT(RenderAttrib) AlphaTestAttrib
Constructs a new AlphaTestAttrib object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Enables or disables writing of pixel to framebuffer based on its alpha value relative to a reference ...
static void register_with_read_factory()
Tells the BamReader how to create objects of type AlphaTestAttrib.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
A class to retrieve the individual data elements previously stored in a Datagram.
PN_stdfloat get_stdfloat()
Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_doubl...
int8_t get_int8()
Extracts a signed 8-bit integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
void add_int8(int8_t value)
Adds a signed 8-bit integer to the datagram.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
This hash_compare class hashes a float or a double.
size_t add_hash(size_t start, const Key &key) const
Adds the indicated key into a running hash.
static size_t add_hash(size_t start, const Key &key)
Adds the indicated key into a running hash.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.