Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
Gamp GL Data Managment

OpenGL rendering data management. More...

Classes

class  gamp::render::gl::data::GLArrayData
 Interface for a generic data buffer to be used for OpenGL arrays. More...
 
class  gamp::render::gl::data::GLArrayDataClient< Value_type >
 Client data buffer for non VBO GLArrayData usage of given template-type Value_type. More...
 
class  gamp::render::gl::data::GLArrayDataProxy< Value_type >
 Proxying a data buffer for GLArrayData usage of given template-type Value_type. More...
 
class  gamp::render::gl::data::GLArrayDataServer< Value_type >
 Server data buffer for VBO GLArrayData usage of given template-type Value_type. More...
 
class  gamp::render::gl::data::GLBuffers
 OpenGL buffer related routines. More...
 
class  gamp::render::gl::data::GLMappedBuffer
 OpenGL mapped buffer storage object reflecting it's. More...
 
class  gamp::render::gl::data::GLUniformData
 GLSL uniform data wrapper encapsulating data to be uploaded to the GPU as a uniform. More...
 
class  gamp::render::gl::data::GLUniformSyncMatrices4f
 
class  gamp::render::gl::data::GLUniformVec3f
 
class  gamp::render::gl::data::GLUniformVec4f
 

Typedefs

template<typename Value_type>
using gamp::render::gl::data::GLArrayDataClientRef = std::shared_ptr<GLArrayDataClient<Value_type>>
 
template<typename Value_type>
using gamp::render::gl::data::GLArrayDataProxyRef = std::shared_ptr<GLArrayDataProxy<Value_type>>
 
typedef std::shared_ptr< GLArrayDatagamp::render::gl::data::GLArrayDataRef
 
template<typename Value_type>
using gamp::render::gl::data::GLArrayDataServerRef = std::shared_ptr<GLArrayDataServer<Value_type>>
 
typedef GLArrayDataClient< float > gamp::render::gl::data::GLFloatArrayDataClient
 
typedef GLArrayDataClientRef< float > gamp::render::gl::data::GLFloatArrayDataClientRef
 
typedef GLArrayDataServer< float > gamp::render::gl::data::GLFloatArrayDataServer
 
typedef GLArrayDataServerRef< float > gamp::render::gl::data::GLFloatArrayDataServerRef
 
typedef std::unique_ptr< GLMappedBuffergamp::render::gl::data::GLMappedBufferPtr
 
typedef GLsizeiptr gamp::render::gl::data::glmemsize_t
 Compatible with ssize_t.
 
typedef GLArrayDataServer< uint32_t > gamp::render::gl::data::GLUIntArrayDataServer
 
typedef GLArrayDataServerRef< uint32_t > gamp::render::gl::data::GLUIntArrayDataServerRef
 
typedef std::shared_ptr< GLUniformDatagamp::render::gl::data::GLUniformDataRef
 
typedef std::shared_ptr< GLUniformSyncMatrices4fgamp::render::gl::data::GLUniformSyncMatrices4fRef
 
typedef std::shared_ptr< GLUniformVec3fgamp::render::gl::data::GLUniformVec3fRef
 
typedef std::shared_ptr< GLUniformVec4fgamp::render::gl::data::GLUniformVec4fRef
 

Functions

static size_t gamp::render::gl::data::GLBuffers::byteSize (const GL &gl, GLenum format, GLenum type, GLsizei width, GLsizei height, GLsizei depth, bool pack)
 Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pixel storage state and the given parameters.
 
static glmemsize_t gamp::render::gl::data::GLBuffers::byteSize (const GL &gl, GLsizei bytesPerPixel, GLsizei width, GLsizei height, GLsizei depth, bool pack)
 Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pixel storage state and the given parameters.
 
static GLsizei gamp::render::gl::data::GLBuffers::bytesPerPixel (GLenum format, GLenum type)
 Returns the number of bytes required for one pixel with the the given OpenGL format and type.
 
static GLsizei gamp::render::gl::data::GLBuffers::componentCount (GLenum format)
 Returns the number of components required for the given OpenGL format.
 
static GLint gamp::render::gl::data::GLBuffers::glGetInteger (GLenum pname)
 
static constexpr bool gamp::render::gl::data::GLBuffers::isGLTypeFixedPoint (GLenum glType)
 
static constexpr bool gamp::render::gl::data::GLBuffers::isSignedGLType (GLenum glType)
 
std::ostream & gamp::render::gl::data::operator<< (std::ostream &out, const GLArrayData &v)
 
static constexpr GLsizei gamp::render::gl::data::GLBuffers::sizeOfGLType (GLenum glType)
 

Detailed Description

OpenGL rendering data management.

Typedef Documentation

◆ GLArrayDataRef

Definition at line 39 of file GLArrayData.hpp.

◆ GLArrayDataClientRef

Definition at line 40 of file GLArrayDataClient.hpp.

◆ GLFloatArrayDataClient

◆ GLFloatArrayDataClientRef

◆ GLArrayDataProxyRef

Definition at line 34 of file GLArrayDataProxy.hpp.

◆ GLArrayDataServerRef

Definition at line 44 of file GLArrayDataServer.hpp.

◆ GLFloatArrayDataServer

◆ GLFloatArrayDataServerRef

◆ GLUIntArrayDataServer

◆ GLUIntArrayDataServerRef

◆ glmemsize_t

Compatible with ssize_t.

Examples
GraphShapes01.cpp.

Definition at line 26 of file GLBuffers.hpp.

◆ GLMappedBufferPtr

Definition at line 170 of file GLMappedBuffer.hpp.

◆ GLUniformDataRef

◆ GLUniformSyncMatrices4fRef

◆ GLUniformVec4fRef

◆ GLUniformVec3fRef

Function Documentation

◆ operator<<()

std::ostream & gamp::render::gl::data::operator<< ( std::ostream & out,
const GLArrayData & v )
inline

Definition at line 504 of file GLArrayData.hpp.

◆ isSignedGLType()

static constexpr bool gamp::render::gl::data::GLBuffers::isSignedGLType ( GLenum glType)
inlinestaticconstexpr
Parameters
glTypeGL primitive type
Returns
false if one of GL primitive unsigned types, otherwise true GL_UNSIGNED_BYTE,
GL_UNSIGNED_SHORT,
GL_UNSIGNED_INT,
GL_HILO16_NV

Definition at line 41 of file GLBuffers.hpp.

◆ isGLTypeFixedPoint()

static constexpr bool gamp::render::gl::data::GLBuffers::isGLTypeFixedPoint ( GLenum glType)
inlinestaticconstexpr
Parameters
glTypeGL primitive type
Returns
false if one of GL primitive floating point types, otherwise true GL_FLOAT,
GL_HALF_FLOAT,
GL_HALF_FLOAT_OES,
GL_DOUBLE

Definition at line 61 of file GLBuffers.hpp.

Here is the caller graph for this function:

◆ sizeOfGLType()

static constexpr GLsizei gamp::render::gl::data::GLBuffers::sizeOfGLType ( GLenum glType)
inlinestaticconstexpr
Parameters
glTypeshall be one of (31)
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL.GL_HALF_FLOAT, GLES2.GL_HALF_FLOAT_OES:

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE
Returns
0 if glType is unhandled, otherwise the actual value > 0

Definition at line 99 of file GLBuffers.hpp.

Here is the caller graph for this function:

◆ glGetInteger()

static GLint gamp::render::gl::data::GLBuffers::glGetInteger ( GLenum pname)
inlinestatic

Definition at line 310 of file GLBuffers.hpp.

Here is the caller graph for this function:

◆ byteSize() [1/2]

static glmemsize_t gamp::render::gl::data::GLBuffers::byteSize ( const GL & gl,
GLsizei bytesPerPixel,
GLsizei width,
GLsizei height,
GLsizei depth,
bool pack )
inlinestatic

Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pixel storage state and the given parameters.

This method is security critical, hence it throws an exception (fail-fast) in case of an invalid alignment. In case we forgot to handle proper values, please contact the maintainer.

Parameters
glpthe current GLProfile
bytesPerPixelbytes per pixel, i.e. via bytesPerPixel(int, int).
widthin pixels
heightin pixels
depthin pixels
packtrue for read mode GPU -> CPU (pack), otherwise false for write mode CPU -> GPU (unpack)
Returns
required minimum size of the buffer in bytes
Exceptions
GLExceptionif alignment is invalid. Please contact the maintainer if this is our bug.

Definition at line 333 of file GLBuffers.hpp.

Here is the caller graph for this function:

◆ byteSize() [2/2]

static size_t gamp::render::gl::data::GLBuffers::byteSize ( const GL & gl,
GLenum format,
GLenum type,
GLsizei width,
GLsizei height,
GLsizei depth,
bool pack )
inlinestatic

Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pixel storage state and the given parameters.

This method is security critical, hence it throws an exception (fail-fast) in case either the format, type or alignment is unhandled. In case we forgot to handle proper values, please contact the maintainer.

See bytesPerPixel(int, int).

Parameters
glthe current GL object
tmpa pass through integer array of size >= 1 used to store temp data (performance)
formatmust be one of (27)
GL_COLOR_INDEX GL_STENCIL_INDEX
GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
GL_RED GL_RED_INTEGER
GL_GREEN GL_GREEN_INTEGER
GL_BLUE GL_BLUE_INTEGER
GL_ALPHA GL_LUMINANCE (12)

GL_LUMINANCE_ALPHA GL_RG
GL_RG_INTEGER GL_HILO_NV
GL_SIGNED_HILO_NV (5)

GL_YCBCR_422_APPLE

GL_RGB GL_RGB_INTEGER
GL_BGR GL_BGR_INTEGER (4)

GL_RGBA GL_RGBA_INTEGER
GL_BGRA GL_BGRA_INTEGER
GL_ABGR_EXT (5)
typemust be one of (32)
GL_BITMAP,
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE
widthin pixels
heightin pixels
depthin pixels
packtrue for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU
Returns
required minimum size of the buffer in bytes
Exceptions
GLExceptionif format, type or alignment is not handled. Please contact the maintainer if this is our bug.

Definition at line 490 of file GLBuffers.hpp.

◆ bytesPerPixel()

static GLsizei gamp::render::gl::data::GLBuffers::bytesPerPixel ( GLenum format,
GLenum type )
inlinestatic

Returns the number of bytes required for one pixel with the the given OpenGL format and type.

This method is security critical, hence it throws an exception (fail-fast) in case either the format, type or alignment is unhandled. In case we forgot to handle proper values, please contact the maintainer.

See componentCount(int).

Parameters
formatmust be one of (27)
GL_COLOR_INDEX GL_STENCIL_INDEX
GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
GL_RED GL_RED_INTEGER
GL_GREEN GL_GREEN_INTEGER
GL_BLUE GL_BLUE_INTEGER
GL_ALPHA GL_LUMINANCE (12)

GL_LUMINANCE_ALPHA GL_RG
GL_RG_INTEGER GL_HILO_NV
GL_SIGNED_HILO_NV (5)

GL_YCBCR_422_APPLE

GL_RGB GL_RGB_INTEGER
GL_BGR GL_BGR_INTEGER (4)

GL_RGBA GL_RGBA_INTEGER
GL_BGRA GL_BGRA_INTEGER
GL_ABGR_EXT (5)
typemust be one of (32)
GL_BITMAP,
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE
Returns
required size of one pixel in bytes
Exceptions
GLExceptionif format or type alignment is not handled. Please contact the maintainer if this is our bug.

Definition at line 558 of file GLBuffers.hpp.

Here is the caller graph for this function:

◆ componentCount()

static GLsizei gamp::render::gl::data::GLBuffers::componentCount ( GLenum format)
inlinestatic

Returns the number of components required for the given OpenGL format.

This method is security critical, hence it throws an exception (fail-fast) in case either the format, type or alignment is unhandled. In case we forgot to handle proper values, please contact the maintainer.

Parameters
formatmust be one of (27)
GL_COLOR_INDEX GL_STENCIL_INDEX
GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
GL_RED GL_RED_INTEGER
GL_GREEN GL_GREEN_INTEGER
GL_BLUE GL_BLUE_INTEGER
GL_ALPHA GL_LUMINANCE (12)

GL_LUMINANCE_ALPHA GL_RG
GL_RG_INTEGER GL_HILO_NV
GL_SIGNED_HILO_NV (5)

GL_YCBCR_422_APPLE

GL_RGB GL_RGB_INTEGER
GL_BGR GL_BGR_INTEGER (4)

GL_RGBA GL_RGBA_INTEGER
GL_BGRA GL_BGRA_INTEGER
GL_ABGR_EXT (5)
Returns
number of components required for the given OpenGL format
Exceptions
GLExceptionif format is not handled. Please contact the maintainer if this is our bug.

Definition at line 664 of file GLBuffers.hpp.

Here is the caller graph for this function: