VVISF & VVGL
|
Buffer pools create and manage GL resources which, on deletion, are either destroyed or returned to the pool for re-use. More...
#include <GLBufferPool.hpp>
Public Member Functions | |
GLBufferRef | createBufferRef (const GLBuffer::Descriptor &desc, const Size &size={640, 480}, const void *backingPtr=nullptr, const Size &backingSize={640, 480}, const bool &createInCurrentContext=false) |
This member function is how the pool creates buffers. You probably shouldn't call this function directly- instead use one of the functions in (VVGL- GLBuffer create functions) directly or as a prototype. They're in GLBufferPool.hpp/GLBufferPool.cpp. | |
void | housekeeping () |
You must call this periodically (once per render loop after you finish drawing is usually a good time to call this). This function frees any buffers that have been sitting unused in the pool for "too long". | |
void | purge () |
If needed you can call this to release all inactive buffers in the pool. | |
Timestamp | getTimestamp () const |
Returns a timestamp generated for the current time. | |
void | timestampThisBuffer (const GLBufferRef &n) const |
Timestamps the passed buffer with the current time. | |
GLContextRef & | context () |
Returns the GLContextRef used by the buffer pool to create and destroy its GL resources. | |
Related Functions | |
(Note that these are not member functions.) | |
using | GLBufferPoolRef = shared_ptr< GLBufferPool > |
A GLBufferPoolRef is a shared pointer around a GLBufferPool. | |
GLBufferPoolRef | CreateGlobalBufferPool (const GLContextRef &inPoolCtx=nullptr) |
This is how you create the global buffer pool. More... | |
const GLBufferPoolRef & | GetGlobalBufferPool () |
This is how you retrieve the global buffer pool. | |
void | SetGlobalBufferPool (const GLBufferPoolRef &inPoolRef=nullptr) |
This is another way to set a global buffer pool, but I mostly use it for deleting the global buffer pool. | |
Buffer pools create and manage GL resources which, on deletion, are either destroyed or returned to the pool for re-use.
Notes on use:
|
related |
This is how you create the global buffer pool.
inPoolCtx | The buffer pool that is created will share this context (textures and buffers created by the buffer pool will be compatible with all other GL contexts in the same sharegroup). |