1 #ifndef VVGL_GLBufferPool_hpp 2 #define VVGL_GLBufferPool_hpp 4 #include "VVGL_Defines.hpp" 8 #include "GLBuffer.hpp" 10 #if defined(VVGL_SDK_MAC) 11 #import <CoreGraphics/CoreGraphics.h> 12 #import <TargetConditionals.h> 13 #import <CoreMedia/CoreMedia.h> 14 #import <CoreVideo/CoreVideo.h> 15 #elif defined(VVGL_SDK_IOS) 16 #import <CoreGraphics/CoreGraphics.h> 17 #import <CoreVideo/CoreVideo.h> 18 #elif defined(VVGL_SDK_QT) 19 #include <QVideoFrame> 48 bool _deleted =
false;
49 mutex _freeBuffersLock;
50 vector<GLBufferRef> _freeBuffers;
52 recursive_mutex _contextLock;
53 GLContextRef _context =
nullptr;
57 #if defined(VVGL_SDK_MAC) || defined(VVGL_SDK_IOS) 58 CGColorSpaceRef _colorSpace =
nullptr;
67 inline void prepareToBeDeleted() { _deleted=
true; purge(); }
70 GLBufferRef createBufferRef(
const GLBuffer::Descriptor & desc,
const Size & size={640,480},
const void * backingPtr=
nullptr,
const Size & backingSize={640,480},
const bool & createInCurrentContext=
false);
78 inline Timestamp
getTimestamp()
const {
return Timestamp()-_baseTime; }
80 inline void timestampThisBuffer(
const GLBufferRef & n)
const {
if (n ==
nullptr)
return; n->contentTimestamp=getTimestamp(); }
82 inline GLContextRef &
context() {
return _context; }
83 inline recursive_mutex & getContextLock() {
return _contextLock; }
84 #if defined(VVGL_SDK_MAC) || defined(VVGL_SDK_IOS) 85 inline CGColorSpaceRef colorSpace()
const {
return _colorSpace; }
88 friend ostream & operator<<(ostream & os,
const GLBufferPool & n);
93 void returnBufferToPool(GLBuffer * inBuffer);
95 void releaseBufferResources(GLBuffer * inBuffer);
97 friend GLBuffer::~GLBuffer();
108 VVGL_EXPORT GLBufferPoolRef CreateGlobalBufferPool(
const GLContextRef & inPoolCtx=
nullptr);
113 VVGL_EXPORT
const GLBufferPoolRef & GetGlobalBufferPool();
118 VVGL_EXPORT
void SetGlobalBufferPool(
const GLBufferPoolRef & inPoolRef=
nullptr);
135 VVGL_EXPORT GLBufferRef
CreateFBO(
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
145 VVGL_EXPORT GLBufferRef
CreateVBO(
const void * inBytes,
const size_t & inByteSize,
const int32_t & inUsage,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
155 VVGL_EXPORT GLBufferRef
CreateEBO(
const void * inBytes,
const size_t & inByteSize,
const int32_t & inUsage,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
162 VVGL_EXPORT GLBufferRef
CreateVAO(
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
182 VVGL_EXPORT GLBufferRef
CreateRB(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
201 VVGL_EXPORT GLBufferRef
CreateRGBACPUBuffer(
const Size & size,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
208 VVGL_EXPORT GLBufferRef
CreateRGBAFloatCPUBuffer(
const Size & size,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
215 VVGL_EXPORT GLBufferRef
CreateBGRACPUBuffer(
const Size & size,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
222 VVGL_EXPORT GLBufferRef
CreateBGRAFloatCPUBuffer(
const Size & size,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
234 VVGL_EXPORT GLBufferRef
CreateRGBACPUBufferUsing(
const Size & inCPUBufferSizeInPixels,
const void * inCPUBackingPtr,
const Size & inImageSizeInPixels,
const void * inReleaseCallbackContext,
const GLBuffer::BackingReleaseCallback & inReleaseCallback,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
245 VVGL_EXPORT GLBufferRef
CreateRGBAFloatCPUBufferUsing(
const Size & inCPUBufferSizeInPixels,
const void * inCPUBackingPtr,
const Size & inImageSizeInPixels,
const void * inReleaseCallbackContext,
const GLBuffer::BackingReleaseCallback & inReleaseCallback,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
256 VVGL_EXPORT GLBufferRef
CreateBGRACPUBufferUsing(
const Size & inCPUBufferSizeInPixels,
const void * inCPUBackingPtr,
const Size & inImageSizeInPixels,
const void * inReleaseCallbackContext,
const GLBuffer::BackingReleaseCallback & inReleaseCallback,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
267 VVGL_EXPORT GLBufferRef
CreateBGRAFloatCPUBufferUsing(
const Size & inCPUBufferSizeInPixels,
const void * inCPUBackingPtr,
const Size & inImageSizeInPixels,
const void * inReleaseCallbackContext,
const GLBuffer::BackingReleaseCallback & inReleaseCallback,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
269 #if !defined(VVGL_TARGETENV_GLES) && !defined(VVGL_TARGETENV_GLES3) 280 VVGL_EXPORT GLBufferRef
CreateYCbCrCPUBufferUsing(
const Size & inCPUBufferSizeInPixels,
const void * inCPUBackingPtr,
const Size & inImageSizeInPixels,
const void * inReleaseCallbackContext,
const GLBuffer::BackingReleaseCallback & inReleaseCallback,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
281 #endif // !defined(VVGL_TARGETENV_GLES) && !defined(VVGL_TARGETENV_GLES3) 301 VVGL_EXPORT GLBufferRef
CreateRGBATex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
309 VVGL_EXPORT GLBufferRef
CreateRGBAFloatTex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
311 #if !defined(VVGL_TARGETENV_GLES) && !defined(VVGL_TARGETENV_GLES3) 319 VVGL_EXPORT GLBufferRef
CreateYCbCrTex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
320 #endif // !defined(VVGL_TARGETENV_GLES) && !defined(VVGL_TARGETENV_GLES3) 329 VVGL_EXPORT GLBufferRef
CreateDepthBuffer(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
345 VVGL_EXPORT GLBufferRef
CreateFromExistingGLTexture(
const int32_t & inTexName,
const GLBuffer::Target & inTexTarget,
const GLBuffer::InternalFormat & inTexIntFmt,
const GLBuffer::PixelFormat & inTexPxlFmt,
const GLBuffer::PixelType & inTexPxlType,
const Size & inTexSize,
const bool & inTexFlipped,
const Rect & inImgRectInTex,
const void * inReleaseCallbackContext,
const GLBuffer::BackingReleaseCallback & inReleaseCallback,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
347 #if !defined(VVGL_SDK_IOS) 355 VVGL_EXPORT GLBufferRef
CreateBGRATex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
363 VVGL_EXPORT GLBufferRef
CreateBGRAFloatTex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
365 #if defined(VVGL_SDK_MAC) 379 VVGL_EXPORT GLBufferRef
CreateRGBACPUBackedTex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
387 VVGL_EXPORT GLBufferRef
CreateRGBAFloatCPUBackedTex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
395 VVGL_EXPORT GLBufferRef
CreateBGRACPUBackedTex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
403 VVGL_EXPORT GLBufferRef
CreateBGRAFloatCPUBackedTex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
407 #endif // VVGL_SDK_MAC 408 #endif // !VVGL_SDK_IOS 428 VVGL_EXPORT GLBufferRef
CreateTexFromImage(
const string & inPath,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
436 VVGL_EXPORT GLBufferRef
CreateCubeTexFromImagePaths(
const vector<string> & inPaths,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
444 #if !defined(VVGL_TARGETENV_GLES) && !defined(VVGL_TARGETENV_GLES3) 475 VVGL_EXPORT GLBufferRef
CreateRGBAPBO(
const GLBuffer::Target & inTarget,
const int32_t & inUsage,
const Size & inSize,
const void * inData=
nullptr,
const bool & inCreateInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
480 VVGL_EXPORT GLBufferRef
CreateBGRAPBO(
const int32_t & inTarget,
const int32_t & inUsage,
const Size & inSize,
const void * inData=
nullptr,
const bool & inCreateInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
485 VVGL_EXPORT GLBufferRef
CreateRGBAFloatPBO(
const int32_t & inTarget,
const int32_t & inUsage,
const Size & inSize,
const void * inData=
nullptr,
const bool & inCreateInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
490 VVGL_EXPORT GLBufferRef
CreateBGRAFloatPBO(
const int32_t & inTarget,
const int32_t & inUsage,
const Size & inSize,
const void * inData=
nullptr,
const bool & inCreateInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
495 VVGL_EXPORT GLBufferRef
CreateYCbCrPBO(
const int32_t & inTarget,
const int32_t & inUsage,
const Size & inSize,
const void * inData=
nullptr,
const bool & inCreateInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
499 #endif // !defined(VVGL_TARGETENV_GLES) && !defined(VVGL_TARGETENV_GLES3) 504 #if defined(VVGL_SDK_QT) 518 VVGL_EXPORT GLBufferRef CreateBufferForQImage(QImage * inImg,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
525 VVGL_EXPORT GLBufferRef CreateCPUBufferForQImage(QImage * inImg,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
532 VVGL_EXPORT GLBufferRef CreateCPUBufferForQVideoFrame(QVideoFrame * inFrame,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
541 #if defined(VVGL_SDK_MAC) 562 VVGL_EXPORT GLBufferRef
CreateRGBATexIOSurface(
const Size & inSize,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
570 VVGL_EXPORT GLBufferRef
CreateRGBAFloatTexIOSurface(
const Size & inSize,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
578 VVGL_EXPORT GLBufferRef
CreateRGBATexFromIOSurfaceID(
const IOSurfaceID & inID,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
588 VVGL_EXPORT GLBufferRef
CreateBufferForCVPixelBuffer(CVPixelBufferRef & inCVPB,
const bool & inTexRange,
const bool & inIOSurface,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
596 VVGL_EXPORT GLBufferRef
CreateTexRangeFromCMSampleBuffer(CMSampleBufferRef & n,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
604 VVGL_EXPORT GLBufferRef
CreateRGBARectTex(
const Size & size,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
612 #if defined(VVGL_SDK_MAC) || defined(VVGL_SDK_IOS) 626 VVGL_EXPORT GLBufferRef
CreateTexFromCGImageRef(
const CGImageRef & n,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
634 VVGL_EXPORT GLBufferRef
CreateCubeTexFromImages(
const vector<CGImageRef> & inImgs,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
652 #if defined(VVGL_SDK_MAC) 661 VVGL_EXPORT GLBufferRef
CreateBufferForCVGLTex(CVOpenGLTextureRef & inTexRef,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
662 #elif defined(VVGL_SDK_IOS) 670 VVGL_EXPORT GLBufferRef
CreateBufferForCVGLTex(CVOpenGLESTextureRef & inTexRef,
const bool & createInCurrentContext=
false,
const GLBufferPoolRef & inPoolRef=GetGlobalBufferPool());
Buffer pools create and manage GL resources which, on deletion, are either destroyed or returned to t...
Definition: GLBufferPool.hpp:44
GLBufferRef CreateVBO(const void *inBytes, const size_t &inByteSize, const int32_t &inUsage, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a vertex buffer object (VBO).
GLBufferRef CreateRB(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL renderbuffer.
void CGBitmapContextUnpremultiply(CGContextRef ctx)
Unpremultiplies the contents of the bitmap in the passed CGContextRef.
GLBufferRef CreateBufferForCVPixelBuffer(CVPixelBufferRef &inCVPB, const bool &inTexRange, const bool &inIOSurface, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that is populated with the contents of the passed CVPixelBuffer...
Definition: GLBuffer.hpp:13
GLBufferRef CreateRGBACPUBufferUsing(const Size &inCPUBufferSizeInPixels, const void *inCPUBackingPtr, const Size &inImageSizeInPixels, const void *inReleaseCallbackContext, const GLBuffer::BackingReleaseCallback &inReleaseCallback, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that describes a non-planar RGBA image (32 bits per pixel) in CPU memo...
GLBufferRef CreateTexRangeFromCMSampleBuffer(CMSampleBufferRef &n, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that is populated with the contents of the passed CMSampleBuffe...
GLBufferRef CreateVAO(const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a vertex attribte object (VAO).
GLBufferRef CreateRGBATexIOSurface(const Size &inSize, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates an 8 bit per channel RGBA OpenGL texture backed by an IOSurface that also gets created- the c...
GLBufferRef CreateRGBAFloatCPUBuffer(const Size &size, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that uses a 128 bit per pixel non-planar RGBA CPU buffer as its backin...
GLBufferRef CreateYCbCrPBO(const int32_t &inTarget, const int32_t &inUsage, const Size &inSize, const void *inData=nullptr, const bool &inCreateInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates a GLBufferRef that represents a PBO. See the documentation of CreateRGBAPBO() for more inform...
GLBufferRef CreateRGBAFloatTexIOSurface(const Size &inSize, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates a 32 bit per channel RGBA OpenGL texture backed by an IOSurface that also gets created- the c...
GLBufferRef CreateBGRAFloatPBO(const int32_t &inTarget, const int32_t &inUsage, const Size &inSize, const void *inData=nullptr, const bool &inCreateInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates a GLBufferRef that represents a PBO. See the documentation of CreateRGBAPBO() for more inform...
Basic struct for 2D size.
Definition: VVGL_Geom.hpp:46
GLContextRef & context()
Returns the GLContextRef used by the buffer pool to create and destroy its GL resources.
Definition: GLBufferPool.hpp:82
void timestampThisBuffer(const GLBufferRef &n) const
Timestamps the passed buffer with the current time.
Definition: GLBufferPool.hpp:80
GLBufferRef CreateCubeTexFromImagePaths(const vector< string > &inPaths, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL cube texture from the images at the passed paths.
GLBufferRef CreateRGBAPBO(const GLBuffer::Target &inTarget, const int32_t &inUsage, const Size &inSize, const void *inData=nullptr, const bool &inCreateInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates a GLBufferRef that represents a PBO (pixel buffer object). These functions are used by GLTexT...
GLBufferRef CreateEBO(const void *inBytes, const size_t &inByteSize, const int32_t &inUsage, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an element buffer object (EBO).
GLBufferRef CreateYCbCrCPUBufferUsing(const Size &inCPUBufferSizeInPixels, const void *inCPUBackingPtr, const Size &inImageSizeInPixels, const void *inReleaseCallbackContext, const GLBuffer::BackingReleaseCallback &inReleaseCallback, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that describes a non-planar YCbCr image (16 bits per pixel) in CPU mem...
The Descriptor struct describes the hardware attributes of the GLBuffer.
Definition: GLBuffer.hpp:115
GLBufferRef CreateRGBACPUBuffer(const Size &size, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that uses a 32 bit per pixel non-planar RGBA CPU buffer as its backing...
GLBufferRef CreateFromExistingGLTexture(const int32_t &inTexName, const GLBuffer::Target &inTexTarget, const GLBuffer::InternalFormat &inTexIntFmt, const GLBuffer::PixelFormat &inTexPxlFmt, const GLBuffer::PixelType &inTexPxlType, const Size &inTexSize, const bool &inTexFlipped, const Rect &inImgRectInTex, const void *inReleaseCallbackContext, const GLBuffer::BackingReleaseCallback &inReleaseCallback, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that wraps an existing OpenGL texture that was created by another SDK...
GLBufferRef CreateRGBARectTex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL RECT-target texture.
GLBufferRef CreateBGRAFloatCPUBackedTex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that has an internal BGRA format, is 32 bits per component...
function< void(GLBuffer &, void *)> BackingReleaseCallback
This defines a callback that is used to release the backing of a GLBuffer, where appropriate. The GLBuffer being released is the first var, and the GLBuffer's backingContext is the second var. The backingContext is probably a pointer to an object from another SDK that has been retained, and needs to be released/freed using the appropriate means.
Definition: GLBuffer.hpp:35
GLBufferRef CreateBGRAPBO(const int32_t &inTarget, const int32_t &inUsage, const Size &inSize, const void *inData=nullptr, const bool &inCreateInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates a GLBufferRef that represents a PBO. See the documentation of CreateRGBAPBO() for more inform...
GLBufferRef CreateBGRAFloatCPUBuffer(const Size &size, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that uses a 128 bit per pixel non-planar BGRA CPU buffer as its backin...
GLBufferRef CreateRGBAFloatCPUBackedTex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that has an internal RGBA format, is 32 bits per component...
void PushTexRangeBufferRAMtoVRAM(const GLBufferRef &inBufferRef, const GLContextRef &inContextRef)
Some GLBuffers are GL textures with a CPU backing- this function pushes the contents of the CPU backi...
GLBufferRef CreateBGRACPUBufferUsing(const Size &inCPUBufferSizeInPixels, const void *inCPUBackingPtr, const Size &inImageSizeInPixels, const void *inReleaseCallbackContext, const GLBuffer::BackingReleaseCallback &inReleaseCallback, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that describes a non-planar BGRA image (32 bits per pixel) in CPU memo...
GLBufferRef CreateRGBATexFromIOSurfaceID(const IOSurfaceID &inID, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer representing a texture that is backed by an IOSurface that was created...
GLBufferRef CreateCubeTexFromImages(const vector< CGImageRef > &inImgs, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a cube-type OpenGL texture populated with the passed vector of CGImageRefs...
GLBufferRef CreateYCbCrTex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that has an internal RGB (no alhpa!) format and is 32 bits per ...
GLBufferRef CreateBGRAFloatCPUBufferUsing(const Size &inCPUBufferSizeInPixels, const void *inCPUBackingPtr, const Size &inImageSizeInPixels, const void *inReleaseCallbackContext, const GLBuffer::BackingReleaseCallback &inReleaseCallback, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that describes a non-planar BGRA image (128 bits per pixel...
GLBufferRef CreateRGBAFloatTex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that has an internal RGBA format and is 32 bits per component (...
GLBufferRef CreateRGBAFloatPBO(const int32_t &inTarget, const int32_t &inUsage, const Size &inSize, const void *inData=nullptr, const bool &inCreateInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates a GLBufferRef that represents a PBO. See the documentation of CreateRGBAPBO() for more inform...
InternalFormat
Definition: GLBuffer.hpp:12
GLBufferRef CreateRGBATex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that has an internal RGBA format and is 8 bits per component (3...
GLBufferRef CreateRGBAFloatCPUBufferUsing(const Size &inCPUBufferSizeInPixels, const void *inCPUBackingPtr, const Size &inImageSizeInPixels, const void *inReleaseCallbackContext, const GLBuffer::BackingReleaseCallback &inReleaseCallback, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that describes a non-planar RGBA image (128 bits per pixel...
GLBufferRef CreateTexFromCGImageRef(const CGImageRef &n, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture populated with the contents of the passed CGImageRef.
GLBufferRef CreateBufferForCVGLTex(CVOpenGLTextureRef &inTexRef, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that represents the texture in the passed CVOpenGLTextureRef. VVGL won't actually create any GL resources here- it's basically just using GLBuffer as a wrapper around the GL resource owned by the CVOpenGLTextureRef.
GLBufferRef CreateFBO(const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a framebuffer object (FBO).
GLBufferRef CreateBGRATex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that has an internal BGRA format (BGRA is optimized on most pla...
GLBufferRef CreateBGRACPUBackedTex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that has an internal BGRA format, is 8 bits per component...
GLBufferRef CreateRGBACPUBackedTex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that has an internal RGBA format, is 8 bits per component...
GLBufferRef CreateTexFromImage(const string &inPath, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture from the image at the passed path.
GLBufferRef CreateBGRACPUBuffer(const Size &size, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns a GLBuffer that uses a 32 bit per pixel non-planar BGRA CPU buffer as its backing...
GLBufferRef CreateDepthBuffer(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture configured to be a 16 bit per pixel depth buffer.
Timestamp getTimestamp() const
Returns a timestamp generated for the current time.
Definition: GLBufferPool.hpp:78
GLBufferRef CreateBGRAFloatTex(const Size &size, const bool &createInCurrentContext=false, const GLBufferPoolRef &inPoolRef=GetGlobalBufferPool())
Creates and returns an OpenGL texture that has an internal BGRA format and is 32 bits per component...