24 int AntialiasAttrib::_attrib_slot;
54 make(
unsigned short mode) {
56 return return_new(attrib);
71 void AntialiasAttrib::
72 output(std::ostream &out)
const {
73 out << get_type() <<
":";
81 }
else if (type == M_auto) {
85 if ((_mode & M_point) != 0) {
86 out << sep <<
"point";
89 if ((_mode & M_line) != 0) {
93 if ((_mode & M_polygon) != 0) {
94 out << sep <<
"polygon";
97 if ((_mode & M_auto) != 0) {
103 if ((_mode & M_faster) != 0) {
104 out << sep <<
"faster";
107 if ((_mode & M_better) != 0) {
108 out << sep <<
"better";
125 int AntialiasAttrib::
129 if (_mode != ta->_mode) {
130 return (
int)_mode - (int)ta->_mode;
141 size_t AntialiasAttrib::
142 get_hash_impl()
const {
163 unsigned short mode_type;
164 unsigned short mode_quality;
186 return make(mode_type | mode_quality);
192 void AntialiasAttrib::
193 register_with_read_factory() {
220 attrib->fillin(scan, manager);
229 void AntialiasAttrib::
231 RenderAttrib::fillin(scan, manager);
239 void AntialiasAttrib::
241 RenderAttrib::init_type();
243 RenderAttrib::get_class_type());
249 (
"default-antialias-enable",
false,
250 PRC_DESC(
"Set this true to enable the M_auto antialiasing mode for all " 251 "nodes by default."));
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Specifies whether or how to enable antialiasing, if supported by the backend renderer.
This is a convenience class to specialize ConfigVariable as a boolean type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
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.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
get_mode_type
Returns the specified antialias mode, with the quality bits masked out.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 size_t add_hash(size_t start, const Key &key)
Adds the indicated key into a running hash.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
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_quality
Returns the specified antialias mode, with the type bits masked out.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
const RenderAttrib * get_slot_default(int slot) const
Returns the default RenderAttrib object associated with slot n.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
CPT(RenderAttrib) AntialiasAttrib
Constructs a new AntialiasAttrib object.
static RenderAttribRegistry * quick_get_global_ptr()
Returns the global_ptr without first ensuring it has been initialized.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.