1 #ifndef VVGL_GLTexToCPUCopier_hpp 2 #define VVGL_GLTexToCPUCopier_hpp 4 #include "VVGL_Defines.hpp" 5 #include "GLBufferPool.hpp" 14 #if !defined(VVGL_TARGETENV_GLES) && !defined(VVGL_TARGETENV_GLES3) 38 recursive_mutex _queueLock;
39 GLContextRef _queueCtx =
nullptr;
41 queue<GLBufferRef> _cpuQueue;
42 queue<GLBufferRef> _pboQueue;
43 queue<GLBufferRef> _texQueue;
44 queue<GLBufferRef> _fboQueue;
46 GLBufferPoolRef _privatePool =
nullptr;
50 void _beginProcessing(
const GLBufferRef & inCPUBuffer,
const GLBufferRef & inPBOBuffer,
const GLBufferRef & inTexBuffer,
const GLBufferRef & inFBOBuffer);
51 void _finishProcessing(
const GLBufferRef & inCPUBuffer,
const GLBufferRef & inPBOBuffer,
const GLBufferRef & inTexBuffer,
const GLBufferRef & inFBOBuffer);
62 void setQueueSize(
const int & inNewQueueSize);
64 inline int queueSize() { lock_guard<recursive_mutex> lock(_queueLock);
return _queueSize; };
72 GLBufferRef downloadTexToCPU(
const GLBufferRef & inTexBuffer,
const GLBufferRef & inCPUBuffer=
nullptr,
const bool & createInCurrentContext=
false);
80 GLBufferRef streamTexToCPU(
const GLBufferRef & inTexBuffer,
const GLBufferRef & inCPUBuffer=
nullptr,
const bool & createInCurrentContext=
false);
110 #endif // !defined(VVGL_TARGETENV_GLES) && !defined(VVGL_TARGETENV_GLES3) Definition: GLBuffer.hpp:13
int queueSize()
Returns the size of the queue used for streaming.
Definition: GLTexToCPUCopier.hpp:64
Downloads texture-based GLBuffers (Type_Tex) to CPU memory.
Definition: GLTexToCPUCopier.hpp:36
GLTexToCPUCopierRef CreateGLTexToCPUCopierRef()
Creates and returns a GLTexToCPUCopier. The scene makes a new GL context which shares the context of ...
Definition: GLTexToCPUCopier.hpp:95
shared_ptr< GLTexToCPUCopier > GLTexToCPUCopierRef
A GLTexToCPUCopierRef is a shared pointer around a GLTexToCPUCopier.
Definition: VVGL_Base.hpp:80
GLTexToCPUCopierRef CreateGLTexToCPUCopierRefUsing(const GLContextRef &inCtx)
Creates and returns a GLTexToCPUCopier. The downloader uses the passed GL context to perform its GL o...
Definition: GLTexToCPUCopier.hpp:100
GLBufferPoolRef privatePool()
Gets the receiver's private buffer pool- null by default, only non-null if something called setPrivat...
Definition: GLTexToCPUCopier.hpp:85
void setPrivatePool(const GLBufferPoolRef &n)
Sets the receiver's private buffer pool (which should default to null). If non-null, this buffer pool will be used to generate any GL resources required by this scene. Handy if you have a variety of GL contexts that aren't shared and you have to switch between them rapidly on a per-frame basis.
Definition: GLTexToCPUCopier.hpp:83