Gamp v0.0.7-54-gccdc599
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
Gamp GL Rendering

OpenGL managed rendering support, data handling and GLSL functionality. More...

Classes

class  gamp::render::gl::pixel::DefaultGLPixelBufferProvider
 
class  gamp::render::gl::FBObject
 Core utility class simplifying usage of framebuffer objects (FBO) with all GLProfiles. More...
 
class  gamp::render::gl::GLCapabilities
 Specifies a set of OpenGL capabilities. More...
 
class  gamp::render::gl::GLContext
 OpenGL Rendering Context. More...
 
class  gamp::render::gl::texture::GLExtensions
 Class holding OpenGL extension strings, commonly used by Gamp's implementation. More...
 
class  gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes
 Pixel attributes. More...
 
class  gamp::render::gl::pixel::GLPixelBuffer
 OpenGL pixel data buffer, allowing user to provide buffers via their GLPixelBufferProvider implementation. More...
 
class  gamp::render::gl::pixel::GLPixelBufferProvider
 Allows user to interface with another toolkit to define GLPixelAttributes and memory buffer to produce TextureData. More...
 
class  gamp::render::gl::GLProfile
 Specifies the OpenGL profile. More...
 
class  gamp::render::gl::GLVersionNumber
 A class for storing and comparing OpenGL version numbers. More...
 
class  gamp::render::gl::texture::Texture
 Represents an OpenGL texture object. More...
 
class  gamp::render::gl::texture::TextureCoords
 Rectangular texture coordinates. More...
 
class  gamp::render::gl::texture::TextureData
 Represents the data for an OpenGL texture. More...
 
class  gamp::render::gl::texture::TextureSequence
 Protocol for texture sequences, like animations, movies, etc. More...
 

Typedefs

typedef GLContext gamp::render::gl::GL
 
typedef std::unique_ptr< GLCapabilitiesgamp::render::gl::GLCapabilitiesPtr
 
typedef std::shared_ptr< GLPixelBuffergamp::render::gl::pixel::GLPixelBufferRef
 

Enumerations

enum class  gamp::render::gl::GLProfileMask : uint32_t { gamp::render::gl::GLProfileMask::none = 0 , gamp::render::gl::GLProfileMask::compat = 1U << 0 , gamp::render::gl::GLProfileMask::core = 1U << 1 , gamp::render::gl::GLProfileMask::es = 1U << 2 }
 OpenGL profile-mask bits. More...
 

Functions

 gamp::render::gl::pixel::DefaultGLPixelBufferProvider::DefaultGLPixelBufferProvider (bool allowRowStride)
 
 gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::GLPixelAttributes (final GLProfile glp, final PixelFormat pixFmt, final boolean pack) throws GLException
 Create a new GLPixelAttributes instance based on GLProfile, PixelFormat and pack.
 
 gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::GLPixelAttributes (final int dataFormat, final int dataType) throws GLException
 Create a new GLPixelAttributes instance based on GL format and type.
 
 gamp::render::gl::pixel::GLPixelBuffer::GLPixelBuffer (final GLPixelAttributes pixelAttributes, final boolean pack, final int width, final int height, final int depth, final Buffer buffer, final boolean allowRowStride)
 
GLPixelBuffer gamp::render::gl::pixel::DefaultGLPixelBufferProvider::allocate (final GL gl, final PixelFormat.Composition hostPixComp, final GLPixelAttributes pixelAttributes, final boolean pack, final int width, final int height, final int depth, final int minByteSize)
 
int gamp::render::gl::pixel::GLPixelBuffer::capacity ()
 Returns the byte capacity of the buffer.
 
Buffer gamp::render::gl::pixel::GLPixelBuffer::clear ()
 See Buffer#clear().
 
static GLPixelAttributes gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::convert (final GL gl, final int componentCount, final boolean pack)
 Returns the matching GLPixelAttributes for the given byte sized RGBA componentCount and GL if exists, otherwise returns null.
 
static final GLPixelAttributes gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::convert (final GLProfile glp, final PixelFormat pixFmt, final boolean pack)
 Returns the matching GLPixelAttributes for the given GLProfile, PixelFormat and pack if exists, otherwise returns null.
 
void gamp::render::gl::pixel::GLPixelBuffer::dispose ()
 Dispose resources.
 
final boolean gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::equals (final Object obj)
 
Buffer gamp::render::gl::pixel::GLPixelBuffer::flip ()
 See Buffer#flip().
 
bool gamp::render::gl::pixel::DefaultGLPixelBufferProvider::getAllowRowStride () const noexcept override
 
final boolean gamp::render::gl::pixel::GLPixelBuffer::getAllowRowStride ()
 Allow GL2ES3#GL_PACK_ROW_LENGTH, or GL2ES2#GL_UNPACK_ROW_LENGTH.
 
GLPixelAttributes gamp::render::gl::pixel::DefaultGLPixelBufferProvider::getAttributes (final GL gl, final int componentCount, final boolean pack)
 
constexpr std::string_view gamp::render::gl::getGLArrayName (GLenum array) noexcept
 
constexpr jau::util::VersionNumber gamp::render::gl::getGLSLVersionNumber (const jau::util::VersionNumber &glVersion, GLProfileMask mask)
 
constexpr std::string_view gamp::render::gl::getGLTypeName (GLenum type) noexcept
 
PixelFormat Composition gamp::render::gl::pixel::DefaultGLPixelBufferProvider::getHostPixelComp (final GLProfile glp, final int componentCount)
 
static final PixelFormat gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::getPixelFormat (final int glFormat, final int glDataType)
 Returns the matching PixelFormat for the given GL format and type if exists, otherwise returns null.
 
std::string gamp::render::gl::getPredefinedArrayIndexName (GLenum glArrayIndex)
 
std::string gamp::render::gl::getPredefinedArrayIndexName (GLenum glArrayIndex, GLint multiTexCoordIndex)
 
template<typename T, std::enable_if_t< std::is_same_v< float, T >, bool > = true>
constexpr GLenum gamp::render::gl::glType () noexcept
 
GLenum gamp::render::gl::glType (const jau::type_info &t) noexcept
 Runtime GL type retrieval using compile-time-type-info (CTTI) jau::type_info.
 
final int gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::hashCode ()
 
boolean gamp::render::gl::pixel::GLPixelBuffer::isValid ()
 Is not disposed and has byteSize > 0.
 
constexpr bool gamp::render::gl::isValidShaderType (GLenum type) noexcept
 
 gamp::render::gl::JAU_MAKE_BITFIELD_ENUM_STRING (GLProfileMask, compat, core, es)
 
int gamp::render::gl::pixel::GLPixelBuffer::limit ()
 Returns the byte limit of the buffer.
 
int gamp::render::gl::pixel::GLPixelBuffer::position ()
 Returns the byte position of the buffer.
 
Buffer gamp::render::gl::pixel::GLPixelBuffer::position (final int bytePos)
 Sets the byte position of the buffer.
 
boolean gamp::render::gl::pixel::GLPixelBuffer::requiresNewBuffer (final GL gl, final int newWidth, final int newHeight, int newByteSize)
 Returns true, if invalid or implementation requires a new buffer based on the new size due to pixel alignment or byte size, otherwise false.
 
Buffer gamp::render::gl::pixel::GLPixelBuffer::rewind ()
 See Buffer#rewind().
 
constexpr std::string_view gamp::render::gl::shaderTypeString (GLenum type) noexcept
 
String gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::toString ()
 
String gamp::render::gl::pixel::GLPixelBuffer::toString ()
 
StringBuilder gamp::render::gl::pixel::GLPixelBuffer::toString (StringBuilder sb)
 

Variables

final boolean gamp::render::gl::pixel::GLPixelBuffer::allowRowStride
 Allow GL2ES3#GL_PACK_ROW_LENGTH, or GL2ES2#GL_UNPACK_ROW_LENGTH.
 
final Buffer gamp::render::gl::pixel::GLPixelBuffer::buffer
 Buffer holding the pixel data.
 
final int gamp::render::gl::pixel::GLPixelBuffer::bufferElemSize
 Buffer element size in bytes.
 
final int gamp::render::gl::pixel::GLPixelBuffer::byteSize
 Byte size of the buffer.
 
gamp::render::gl::pixel::DefaultGLPixelBufferProvider gamp::render::gl::pixel::defaultProviderNoRowStride = new DefaultGLPixelBufferProvider(false)
 Default GLPixelBufferProvider with GLPixelBufferProvider#getAllowRowStride() == false, utilizing best match for GLPixelAttributes and allocating a ByteBuffer.
 
static final GLPixelBufferProvider gamp::render::gl::pixel::defaultProviderWithRowStride = new DefaultGLPixelBufferProvider(true)
 Default GLPixelBufferProvider with GLPixelBufferProvider#getAllowRowStride() == true, utilizing best match for GLPixelAttributes and allocating a ByteBuffer.
 
final int gamp::render::gl::pixel::GLPixelBuffer::depth
 Depth in pixels.
 
final int gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::format
 The OpenGL pixel data format.
 
static constexpr GLenum gamp::render::gl::GL_NVIDIA_PLATFORM_BINARY_NV = 0x890B
 
final int gamp::render::gl::pixel::GLPixelBuffer::height
 Height in pixels, representing buffer's byteSize.
 
static constexpr std::string_view gamp::render::gl::mgl_Color = "mgl_Color"
 
static constexpr std::string_view gamp::render::gl::mgl_InterleaveArray = "mgl_InterleaveArray"
 
static constexpr std::string_view gamp::render::gl::mgl_MultiTexCoord = "mgl_MultiTexCoord"
 
static constexpr std::string_view gamp::render::gl::mgl_Normal = "mgl_Normal"
 
static constexpr std::string_view gamp::render::gl::mgl_Vertex = "mgl_Vertex"
 
final boolean gamp::render::gl::pixel::GLPixelBuffer::pack
 Data packing direction.
 
final PixelFormat gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::pfmt
 PixelFormat describing the component layout
 
static class gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes gamp::render::gl::pixel::GLPixelBuffer::pixelAttributes
 The GLPixelAttributes.
 
final int gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::type
 The OpenGL pixel data type.
 
static final GLPixelAttributes gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::UNDEF = new GLPixelAttributes(null, PixelFormat.LUMINANCE, 0, 0, true, false)
 Undefined instance of GLPixelAttributes, having componentCount:=0, format:=0 and type:= 0.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version0_0 = jau::util::VersionNumber(0, 0, 0)
 Version 0.00, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_0 = jau::util::VersionNumber(1, 0, 0)
 Version 1.00, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_1 = jau::util::VersionNumber(1, 1, 0)
 Version 1.1, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_10 = jau::util::VersionNumber(1, 10, 0)
 Version 1.10, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_2 = jau::util::VersionNumber(1, 2, 0)
 Version 1.2, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_20 = jau::util::VersionNumber(1, 20, 0)
 Version 1.20, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_30 = jau::util::VersionNumber(1, 30, 0)
 Version 1.30, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_4 = jau::util::VersionNumber(1, 4, 0)
 Version 1.4, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_40 = jau::util::VersionNumber(1, 40, 0)
 Version 1.40, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_5 = jau::util::VersionNumber(1, 5, 0)
 Version 1.5, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version1_50 = jau::util::VersionNumber(1, 50, 0)
 Version 1.50, i.e.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version2_0 = jau::util::VersionNumber(2, 0, 0)
 Version 2.0.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version3_0 = jau::util::VersionNumber(3, 0, 0)
 Version 3.0.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version3_1 = jau::util::VersionNumber(3, 1, 0)
 Version 3.1.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version3_2 = jau::util::VersionNumber(3, 2, 0)
 Version 3.2.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version4_0 = jau::util::VersionNumber(4, 0, 0)
 Version 4.0.
 
static constexpr jau::util::VersionNumber gamp::render::gl::Version4_3 = jau::util::VersionNumber(4, 3, 0)
 Version 4.3.
 
final int gamp::render::gl::pixel::GLPixelBuffer::width
 Width in pixels, representing buffer's byteSize.
 

Detailed Description

OpenGL managed rendering support, data handling and GLSL functionality.

Typedef Documentation

◆ GLCapabilitiesPtr

Definition at line 427 of file GLCapabilities.hpp.

◆ GL

◆ GLPixelBufferRef

Definition at line 31 of file GLPixelBuffer.hpp.

Enumeration Type Documentation

◆ GLProfileMask

enum class gamp::render::gl::GLProfileMask : uint32_t
strong

OpenGL profile-mask bits.

Enumerator
none 
compat 

Desktop compatibility profile.

core 

Desktop core profile.

es 

ES profile.

Definition at line 77 of file GLLiterals.hpp.

Function Documentation

◆ JAU_MAKE_BITFIELD_ENUM_STRING()

gamp::render::gl::JAU_MAKE_BITFIELD_ENUM_STRING ( GLProfileMask ,
compat ,
core ,
es  )

◆ getGLTypeName()

std::string_view gamp::render::gl::getGLTypeName ( GLenum type)
constexprnoexcept

Definition at line 88 of file GLLiterals.hpp.

◆ getGLArrayName()

std::string_view gamp::render::gl::getGLArrayName ( GLenum array)
constexprnoexcept

Definition at line 118 of file GLLiterals.hpp.

Here is the caller graph for this function:

◆ isValidShaderType()

bool gamp::render::gl::isValidShaderType ( GLenum type)
constexprnoexcept

Definition at line 132 of file GLLiterals.hpp.

Here is the caller graph for this function:

◆ shaderTypeString()

std::string_view gamp::render::gl::shaderTypeString ( GLenum type)
constexprnoexcept

Definition at line 146 of file GLLiterals.hpp.

Here is the caller graph for this function:

◆ getGLSLVersionNumber()

jau::util::VersionNumber gamp::render::gl::getGLSLVersionNumber ( const jau::util::VersionNumber & glVersion,
GLProfileMask mask )
constexpr

Definition at line 164 of file GLLiterals.hpp.

◆ getPredefinedArrayIndexName() [1/2]

std::string gamp::render::gl::getPredefinedArrayIndexName ( GLenum glArrayIndex,
GLint multiTexCoordIndex )
inline
Parameters
glArrayIndexthe fixed function array index
multiTexCoordIndexindex for multiTexCoordIndex
Returns
default fixed function array name

Definition at line 200 of file GLLiterals.hpp.

Here is the caller graph for this function:

◆ getPredefinedArrayIndexName() [2/2]

std::string gamp::render::gl::getPredefinedArrayIndexName ( GLenum glArrayIndex)
inline
Parameters
glArrayIndexthe fixed function array index
Returns
default fixed function array name

Definition at line 221 of file GLLiterals.hpp.

◆ glType() [1/2]

template<typename T, std::enable_if_t< std::is_same_v< float, T >, bool > = true>
GLenum gamp::render::gl::glType ( )
constexprnoexcept

Definition at line 46 of file GLTypes.hpp.

Here is the caller graph for this function:

◆ glType() [2/2]

GLenum gamp::render::gl::glType ( const jau::type_info & t)
inlinenoexcept

Runtime GL type retrieval using compile-time-type-info (CTTI) jau::type_info.

Returns GL_NONE if type is not supported.

Definition at line 74 of file GLTypes.hpp.

◆ getPixelFormat()

static final PixelFormat gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::getPixelFormat ( final int glFormat,
final int glDataType )
inlinestatic

Returns the matching PixelFormat for the given GL format and type if exists, otherwise returns null.

Definition at line 105 of file GLPixelBuffer.hpp.

Here is the caller graph for this function:

◆ convert() [1/2]

static GLPixelAttributes gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::convert ( final GL gl,
final int componentCount,
final boolean pack )
inlinestatic

Returns the matching GLPixelAttributes for the given byte sized RGBA componentCount and GL if exists, otherwise returns null.

Parameters
glthe corresponding current GL context object
componentCountRGBA component count, i.e. 1 (luminance, alpha or red), 3 (RGB) or 4 (RGBA)
packtrue for read mode GPU -> CPU, e.g. glReadPixels. false for write mode CPU -> GPU, e.g. glTexImage2D.

Definition at line 175 of file GLPixelBuffer.hpp.

Here is the caller graph for this function:

◆ convert() [2/2]

static final GLPixelAttributes gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::convert ( final GLProfile glp,
final PixelFormat pixFmt,
final boolean pack )
inlinestatic

Returns the matching GLPixelAttributes for the given GLProfile, PixelFormat and pack if exists, otherwise returns null.

Parameters
glpthe corresponding GLProfile
pixFmtthe to be matched pixel format
packtrue for read mode GPU -> CPU, e.g. glReadPixels. false for write mode CPU -> GPU, e.g. glTexImage2D.

Definition at line 226 of file GLPixelBuffer.hpp.

◆ hashCode()

final int gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::hashCode ( )
inline

Definition at line 317 of file GLPixelBuffer.hpp.

◆ equals()

final boolean gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::equals ( final Object obj)
inline

Definition at line 325 of file GLPixelBuffer.hpp.

◆ GLPixelAttributes() [1/2]

gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::GLPixelAttributes ( final int dataFormat,
final int dataType ) throws GLException
inline

Create a new GLPixelAttributes instance based on GL format and type.

Parameters
dataFormatGL data format
dataTypeGL data type
Exceptions
GLExceptionif PixelFormat could not be determined, see getPixelFormat(int, int).

Definition at line 343 of file GLPixelBuffer.hpp.

Here is the caller graph for this function:

◆ GLPixelAttributes() [2/2]

gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::GLPixelAttributes ( final GLProfile glp,
final PixelFormat pixFmt,
final boolean pack ) throws GLException
inline

Create a new GLPixelAttributes instance based on GLProfile, PixelFormat and pack.

Parameters
glpthe corresponding GLProfile
pixFmtthe to be matched pixel format
packtrue for read mode GPU -> CPU, e.g. glReadPixels. false for write mode CPU -> GPU, e.g. glTexImage2D.
Exceptions
GLExceptionif GL format or type could not be determined, see convert(GLProfile, PixelFormat, boolean).

Definition at line 355 of file GLPixelBuffer.hpp.

◆ toString() [1/3]

String gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::toString ( )
inline

Definition at line 390 of file GLPixelBuffer.hpp.

◆ toString() [2/3]

StringBuilder gamp::render::gl::pixel::GLPixelBuffer::toString ( StringBuilder sb)
inline

Definition at line 437 of file GLPixelBuffer.hpp.

◆ toString() [3/3]

String gamp::render::gl::pixel::GLPixelBuffer::toString ( )
inline

Definition at line 447 of file GLPixelBuffer.hpp.

Here is the caller graph for this function:

◆ GLPixelBuffer()

gamp::render::gl::pixel::GLPixelBuffer::GLPixelBuffer ( final GLPixelAttributes pixelAttributes,
final boolean pack,
final int width,
final int height,
final int depth,
final Buffer buffer,
final boolean allowRowStride )
inline
Parameters
pixelAttributesthe desired GLPixelAttributes
packtrue for read mode GPU -> CPU, e.g. glReadPixels. false for write mode CPU -> GPU, e.g. glTexImage2D.
widthin pixels
heightin pixels
depthin pixels
bufferthe backing array
allowRowStrideIf true, allow row-stride, otherwise not. See requiresNewBuffer(GL, int, int, int).
hostPixelCompthe host PixelFormat.Composition

Definition at line 462 of file GLPixelBuffer.hpp.

◆ getAllowRowStride() [1/2]

final boolean gamp::render::gl::pixel::GLPixelBuffer::getAllowRowStride ( )
inline

◆ isValid()

boolean gamp::render::gl::pixel::GLPixelBuffer::isValid ( )
inline

Is not disposed and has byteSize > 0.

Definition at line 478 of file GLPixelBuffer.hpp.

Here is the caller graph for this function:

◆ rewind()

Buffer gamp::render::gl::pixel::GLPixelBuffer::rewind ( )
inline

See Buffer#rewind().

Definition at line 483 of file GLPixelBuffer.hpp.

◆ position() [1/2]

int gamp::render::gl::pixel::GLPixelBuffer::position ( )
inline

Returns the byte position of the buffer.

Definition at line 488 of file GLPixelBuffer.hpp.

◆ position() [2/2]

Buffer gamp::render::gl::pixel::GLPixelBuffer::position ( final int bytePos)
inline

Sets the byte position of the buffer.

Definition at line 493 of file GLPixelBuffer.hpp.

◆ capacity()

int gamp::render::gl::pixel::GLPixelBuffer::capacity ( )
inline

Returns the byte capacity of the buffer.

Definition at line 498 of file GLPixelBuffer.hpp.

◆ limit()

int gamp::render::gl::pixel::GLPixelBuffer::limit ( )
inline

Returns the byte limit of the buffer.

Definition at line 503 of file GLPixelBuffer.hpp.

◆ flip()

Buffer gamp::render::gl::pixel::GLPixelBuffer::flip ( )
inline

See Buffer#flip().

Definition at line 508 of file GLPixelBuffer.hpp.

◆ clear()

Buffer gamp::render::gl::pixel::GLPixelBuffer::clear ( )
inline

See Buffer#clear().

Definition at line 513 of file GLPixelBuffer.hpp.

◆ requiresNewBuffer()

boolean gamp::render::gl::pixel::GLPixelBuffer::requiresNewBuffer ( final GL gl,
final int newWidth,
final int newHeight,
int newByteSize )
inline

Returns true, if invalid or implementation requires a new buffer based on the new size due to pixel alignment or byte size, otherwise false.

It is assumed that pixelAttributes, depth and pack stays the same!

The minimum required byte size equals to minByteSize, if > 0, otherwise GLBuffers.sizeof(..) is being used to calculate it. This value is referred to newByteSize.

If allowRowStride = false, method returns true if the newByteSize > currentByteSize or the newWidth != currentWidth.

If allowRowStride = true, see GLPixelBufferProvider#getAllowRowStride(), method returns true only if the newByteSize > currentByteSize. Assuming user utilizes the row-stride when dealing w/ the data, i.e. GL2ES3#GL_PACK_ROW_LENGTH.

Parameters
glthe corresponding current GL context object
newWidthnew width in pixels
newHeightnew height in pixels
newByteSizeif > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
See also
GLPixelBufferProvider::allocate(GL, PixelFormat.Composition, GLPixelAttributes, boolean, int, int, int, int)

Definition at line 544 of file GLPixelBuffer.hpp.

◆ dispose()

void gamp::render::gl::pixel::GLPixelBuffer::dispose ( )
inline

Dispose resources.

See isValid().

Definition at line 559 of file GLPixelBuffer.hpp.

◆ DefaultGLPixelBufferProvider()

gamp::render::gl::pixel::DefaultGLPixelBufferProvider::DefaultGLPixelBufferProvider ( bool allowRowStride)
inline
Parameters
allowRowStrideIf true, allow row-stride, otherwise not. See getAllowRowStride() and GLPixelBuffer#requiresNewBuffer(GL, int, int, int).

Definition at line 574 of file GLPixelBuffer.hpp.

◆ getAllowRowStride() [2/2]

bool gamp::render::gl::pixel::DefaultGLPixelBufferProvider::getAllowRowStride ( ) const
inlineoverridenoexcept

Definition at line 577 of file GLPixelBuffer.hpp.

Here is the caller graph for this function:

◆ getAttributes()

GLPixelAttributes gamp::render::gl::pixel::DefaultGLPixelBufferProvider::getAttributes ( final GL gl,
final int componentCount,
final boolean pack )
inline

Definition at line 580 of file GLPixelBuffer.hpp.

◆ getHostPixelComp()

PixelFormat Composition gamp::render::gl::pixel::DefaultGLPixelBufferProvider::getHostPixelComp ( final GLProfile glp,
final int componentCount )
inline

Returns null!

Definition at line 596 of file GLPixelBuffer.hpp.

◆ allocate()

GLPixelBuffer gamp::render::gl::pixel::DefaultGLPixelBufferProvider::allocate ( final GL gl,
final PixelFormat.Composition hostPixComp,
final GLPixelAttributes pixelAttributes,
final boolean pack,
final int width,
final int height,
final int depth,
final int minByteSize )
inline

Returns an NIO ByteBuffer.

Definition at line 607 of file GLPixelBuffer.hpp.

Variable Documentation

◆ GL_NVIDIA_PLATFORM_BINARY_NV

GLenum gamp::render::gl::GL_NVIDIA_PLATFORM_BINARY_NV = 0x890B
inlinestaticconstexpr

Definition at line 29 of file GLLiterals.hpp.

◆ Version0_0

jau::util::VersionNumber gamp::render::gl::Version0_0 = jau::util::VersionNumber(0, 0, 0)
inlinestaticconstexpr

Version 0.00, i.e.

invalid or undefined version.

Definition at line 32 of file GLLiterals.hpp.

◆ Version1_0

jau::util::VersionNumber gamp::render::gl::Version1_0 = jau::util::VersionNumber(1, 0, 0)
inlinestaticconstexpr

Version 1.00, i.e.

GLSL 1.00 for ES 2.0.

Definition at line 34 of file GLLiterals.hpp.

◆ Version1_10

jau::util::VersionNumber gamp::render::gl::Version1_10 = jau::util::VersionNumber(1, 10, 0)
inlinestaticconstexpr

Version 1.10, i.e.

GLSL 1.10 for GL 2.0.

Definition at line 36 of file GLLiterals.hpp.

◆ Version1_20

jau::util::VersionNumber gamp::render::gl::Version1_20 = jau::util::VersionNumber(1, 20, 0)
inlinestaticconstexpr

Version 1.20, i.e.

GLSL 1.20 for GL 2.1.

Definition at line 38 of file GLLiterals.hpp.

◆ Version1_30

jau::util::VersionNumber gamp::render::gl::Version1_30 = jau::util::VersionNumber(1, 30, 0)
inlinestaticconstexpr

Version 1.30, i.e.

GLSL 1.30 for GL 3.0.

Definition at line 40 of file GLLiterals.hpp.

◆ Version1_40

jau::util::VersionNumber gamp::render::gl::Version1_40 = jau::util::VersionNumber(1, 40, 0)
inlinestaticconstexpr

Version 1.40, i.e.

GLSL 1.40 for GL 3.1.

Definition at line 42 of file GLLiterals.hpp.

◆ Version1_50

jau::util::VersionNumber gamp::render::gl::Version1_50 = jau::util::VersionNumber(1, 50, 0)
inlinestaticconstexpr

Version 1.50, i.e.

GLSL 1.50 for GL 3.2.

Definition at line 44 of file GLLiterals.hpp.

◆ Version1_1

jau::util::VersionNumber gamp::render::gl::Version1_1 = jau::util::VersionNumber(1, 1, 0)
inlinestaticconstexpr

Version 1.1, i.e.

GL 1.1

Definition at line 47 of file GLLiterals.hpp.

◆ Version1_2

jau::util::VersionNumber gamp::render::gl::Version1_2 = jau::util::VersionNumber(1, 2, 0)
inlinestaticconstexpr

Version 1.2, i.e.

GL 1.2

Definition at line 50 of file GLLiterals.hpp.

◆ Version1_4

jau::util::VersionNumber gamp::render::gl::Version1_4 = jau::util::VersionNumber(1, 4, 0)
inlinestaticconstexpr

Version 1.4, i.e.

GL 1.4

Definition at line 53 of file GLLiterals.hpp.

◆ Version1_5

jau::util::VersionNumber gamp::render::gl::Version1_5 = jau::util::VersionNumber(1, 5, 0)
inlinestaticconstexpr

Version 1.5, i.e.

GL 1.5

Definition at line 56 of file GLLiterals.hpp.

◆ Version2_0

jau::util::VersionNumber gamp::render::gl::Version2_0 = jau::util::VersionNumber(2, 0, 0)
inlinestaticconstexpr

Version 2.0.

As an OpenGL version, it qualifies for desktop isGL2() only, or ES 2.0.

Definition at line 59 of file GLLiterals.hpp.

◆ Version3_0

jau::util::VersionNumber gamp::render::gl::Version3_0 = jau::util::VersionNumber(3, 0, 0)
inlinestaticconstexpr

Version 3.0.

As an OpenGL version, it qualifies for desktop isGL2() only, or ES 3.0. Or GLSL 3.00 for ES 3.0.

Definition at line 62 of file GLLiterals.hpp.

◆ Version3_1

jau::util::VersionNumber gamp::render::gl::Version3_1 = jau::util::VersionNumber(3, 1, 0)
inlinestaticconstexpr

Version 3.1.

As an OpenGL version, it qualifies for isGL3core(), isGL3bc() and isGL3()

Definition at line 65 of file GLLiterals.hpp.

◆ Version3_2

jau::util::VersionNumber gamp::render::gl::Version3_2 = jau::util::VersionNumber(3, 2, 0)
inlinestaticconstexpr

Version 3.2.

As an OpenGL version, it qualifies for geometry shader

Definition at line 68 of file GLLiterals.hpp.

◆ Version4_0

jau::util::VersionNumber gamp::render::gl::Version4_0 = jau::util::VersionNumber(4, 0, 0)
inlinestaticconstexpr

Version 4.0.

As an OpenGL version.

Definition at line 71 of file GLLiterals.hpp.

◆ Version4_3

jau::util::VersionNumber gamp::render::gl::Version4_3 = jau::util::VersionNumber(4, 3, 0)
inlinestaticconstexpr

Version 4.3.

As an OpenGL version, it qualifies for GL_ARB_ES3_compatibility

Definition at line 74 of file GLLiterals.hpp.

◆ mgl_Vertex

std::string_view gamp::render::gl::mgl_Vertex = "mgl_Vertex"
inlinestaticconstexpr

Definition at line 189 of file GLLiterals.hpp.

◆ mgl_Normal

std::string_view gamp::render::gl::mgl_Normal = "mgl_Normal"
inlinestaticconstexpr

Definition at line 190 of file GLLiterals.hpp.

◆ mgl_Color

std::string_view gamp::render::gl::mgl_Color = "mgl_Color"
inlinestaticconstexpr

Definition at line 191 of file GLLiterals.hpp.

◆ mgl_MultiTexCoord

std::string_view gamp::render::gl::mgl_MultiTexCoord = "mgl_MultiTexCoord"
inlinestaticconstexpr

Definition at line 192 of file GLLiterals.hpp.

◆ mgl_InterleaveArray

std::string_view gamp::render::gl::mgl_InterleaveArray = "mgl_InterleaveArray"
inlinestaticconstexpr

Definition at line 193 of file GLLiterals.hpp.

◆ UNDEF

final GLPixelAttributes gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::UNDEF = new GLPixelAttributes(null, PixelFormat.LUMINANCE, 0, 0, true, false)
static

Undefined instance of GLPixelAttributes, having componentCount:=0, format:=0 and type:= 0.

Definition at line 99 of file GLPixelBuffer.hpp.

◆ format

final int gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::format

The OpenGL pixel data format.

Definition at line 309 of file GLPixelBuffer.hpp.

◆ type

final int gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::type

The OpenGL pixel data type.

Definition at line 311 of file GLPixelBuffer.hpp.

◆ pfmt

final PixelFormat gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes::pfmt

PixelFormat describing the component layout

Definition at line 314 of file GLPixelBuffer.hpp.

◆ pixelAttributes

class gamp::render::gl::pixel::GLPixelBuffer::GLPixelAttributes gamp::render::gl::pixel::GLPixelBuffer::pixelAttributes
static

◆ width

final int gamp::render::gl::pixel::GLPixelBuffer::width

Width in pixels, representing buffer's byteSize.

May not represent actual image width as user may re-use buffer for different dimensions, see requiresNewBuffer(GL, int, int, int).

Definition at line 403 of file GLPixelBuffer.hpp.

◆ height

final int gamp::render::gl::pixel::GLPixelBuffer::height

Height in pixels, representing buffer's byteSize.

May not represent actual image height as user may re-use buffer for different dimensions, see requiresNewBuffer(GL, int, int, int).

Definition at line 410 of file GLPixelBuffer.hpp.

◆ depth

final int gamp::render::gl::pixel::GLPixelBuffer::depth

Depth in pixels.

Definition at line 412 of file GLPixelBuffer.hpp.

◆ pack

final boolean gamp::render::gl::pixel::GLPixelBuffer::pack

Data packing direction.

true for read mode GPU -> CPU, e.g. glReadPixels.

false for write mode CPU -> GPU, e.g. glTexImage2D.

Definition at line 418 of file GLPixelBuffer.hpp.

◆ byteSize

final int gamp::render::gl::pixel::GLPixelBuffer::byteSize

Byte size of the buffer.

Actually the number of Buffer#remaining() bytes when passed in ctor.

Definition at line 420 of file GLPixelBuffer.hpp.

◆ buffer

final Buffer gamp::render::gl::pixel::GLPixelBuffer::buffer

Buffer holding the pixel data.

If rewind(), it holds byteSize Buffer#remaining() bytes.

By default the Buffer is a ByteBuffer, due to DefProvider#allocate(GL, PixelFormat.Composition, GLPixelAttributes, boolean, int, int, int, int). However, other GLPixelBufferProvider may utilize different Buffer types.

Definition at line 428 of file GLPixelBuffer.hpp.

◆ bufferElemSize

final int gamp::render::gl::pixel::GLPixelBuffer::bufferElemSize

Buffer element size in bytes.

Definition at line 430 of file GLPixelBuffer.hpp.

◆ allowRowStride

final boolean gamp::render::gl::pixel::GLPixelBuffer::allowRowStride

◆ defaultProviderNoRowStride

gamp::render::gl::pixel::DefaultGLPixelBufferProvider gamp::render::gl::pixel::defaultProviderNoRowStride = new DefaultGLPixelBufferProvider(false)

◆ defaultProviderWithRowStride

final GLPixelBufferProvider gamp::render::gl::pixel::defaultProviderWithRowStride = new DefaultGLPixelBufferProvider(true)
static

Default GLPixelBufferProvider with GLPixelBufferProvider#getAllowRowStride() == true, utilizing best match for GLPixelAttributes and allocating a ByteBuffer.

Definition at line 632 of file GLPixelBuffer.hpp.