21 INLINE VertexDataBuffer::
34 INLINE VertexDataBuffer::
35 VertexDataBuffer(
size_t size) :
40 do_unclean_realloc(size);
49 INLINE VertexDataBuffer::
63 INLINE VertexDataBuffer::
84 if (_resident_data != (
unsigned char *)NULL || _size == 0) {
85 return _resident_data;
89 nassertr(_reserved_size >= _size, NULL);
94 return _block->get_pointer(force);
106 if (_resident_data == (
unsigned char *)NULL && _reserved_size != 0) {
109 nassertr(_reserved_size >= _size, NULL);
110 return _resident_data;
136 return _reserved_size;
150 nassertv(size <= _reserved_size);
153 if (_resident_data == (
unsigned char *)NULL && _reserved_size != 0) {
175 do_clean_realloc(reserved_size);
191 do_unclean_realloc(reserved_size);
203 do_unclean_realloc(0);
unsigned char * get_write_pointer()
Returns a writable pointer to the raw data.
void clear()
Empties the buffer and sets its size to 0.
size_t get_reserved_size() const
Returns the total number of bytes "reserved" in the buffer.
A block of bytes that stores the actual raw vertex data referenced by a GeomVertexArrayData object...
void clean_realloc(size_t reserved_size)
Changes the "reserved" size of the buffer, preserving its data (except for any data beyond the new en...
Similar to MutexHolder, but for a light mutex.
A block of bytes that stores the actual raw vertex data referenced by a GeomVertexArrayData object...
void set_size(size_t size)
Changes the size of the buffer.
A collection of VertexDataPages, which can be used to allocate new VertexDataBlock objects...
void unclean_realloc(size_t reserved_size)
Changes the size of the buffer, without regard to preserving its data.
size_t get_size() const
Returns the number of bytes in the buffer.
const unsigned char * get_read_pointer(bool force) const
Returns a read-only pointer to the raw data, or NULL if the data is not currently resident...
void page_out(VertexDataBook &book)
Moves the buffer out of independent memory and puts it on a page in the indicated book...