14#ifndef VERTEXDATABUFFER_H
15#define VERTEXDATABUFFER_H
52class EXPCL_PANDA_GOBJ VertexDataBuffer {
54 INLINE VertexDataBuffer();
55 INLINE VertexDataBuffer(
size_t size);
56 INLINE VertexDataBuffer(
const VertexDataBuffer ©);
57 void operator = (
const VertexDataBuffer ©);
58 INLINE ~VertexDataBuffer();
60 INLINE
const unsigned char *
get_read_pointer(
bool force)
const RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT);
72 void swap(VertexDataBuffer &other);
75 void do_clean_realloc(
size_t size);
76 void do_unclean_realloc(
size_t size);
81 unsigned char *_resident_data;
83 size_t _reserved_size;
91 static void init_type() {
This is a standard, non-reentrant mutex, similar to the Mutex class.
TypeHandle is the identifier used to differentiate C++ class types.
A block of bytes that stores the actual raw vertex data referenced by a GeomVertexArrayData object.
A collection of VertexDataPages, which can be used to allocate new VertexDataBlock objects.
void set_size(size_t size)
Changes the size of the buffer.
unsigned char * get_write_pointer()
Returns a writable pointer to the raw data.
void page_out(VertexDataBook &book)
Moves the buffer out of independent memory and puts it on a page in the indicated book.
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 swap(VertexDataBuffer &other)
Swaps the data buffers between this one and the other one.
void unclean_realloc(size_t reserved_size)
Changes the size of the buffer, without regard to preserving its 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.
size_t get_size() const
Returns the number of bytes in the buffer.
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...
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.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.