15 #include "paramTexture.h"
26 void ParamTextureSampler::
27 output(ostream &out)
const {
30 if (_texture != (
Texture *)NULL) {
31 out << _texture->get_name();
74 _texture = DCAST(
Texture, p_list[pi++]);
92 parse_params(params, scan, manager);
93 param->fillin(scan, manager);
105 void ParamTextureSampler::
117 void ParamTextureImage::
118 output(ostream &out)
const {
121 if (_texture != (
Texture *)NULL) {
122 out << _texture->get_name();
127 if (_access & A_read) {
128 if (_access & A_write) {
129 out <<
", read-write";
131 out <<
", read-only";
133 }
else if (_access & A_write) {
134 out <<
", write-only";
137 if (_access & A_layered) {
138 out <<
", all layers";
140 out <<
", layer " << _bind_layer;
143 out <<
", level " << _bind_level;
182 _texture = DCAST(
Texture, p_list[pi++]);
200 parse_params(params, scan, manager);
201 param->fillin(scan, manager);
213 void ParamTextureImage::
PN_int8 get_int8()
Extracts a signed 8-bit integer.
void add_uint8(PN_uint8 value)
Adds an unsigned 8-bit integer to the datagram.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
void add_int8(PN_int8 value)
Adds a signed 8-bit integer to the datagram.
static void register_with_read_factory()
Tells the BamReader how to create objects of type ParamValue.
void write_datagram(Datagram &destination) const
Encodes the sampler state into a datagram.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Base class for objects that can be written to and read from Bam files.
void read_datagram(DatagramIterator &source, BamReader *manager)
Reads the sampler state from the datagram that has been previously written using write_datagram.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PN_int32 get_int32()
Extracts a signed 32-bit integer.
PN_uint8 get_uint8()
Extracts an unsigned 8-bit integer.
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin()...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
A class object for storing a pointer to a Texture along with a set of properties that indicates which...
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin()...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
static void register_with_read_factory()
Tells the BamReader how to create objects of type ParamValue.
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A class object for storing a pointer to a Texture along with a sampler state that indicates how to to...
void add_int32(PN_int32 value)
Adds a signed 32-bit integer to the datagram.
A class to retrieve the individual data elements previously stored in a Datagram. ...
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin()...
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 ...
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
void read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.