nCine::RHI::GL::GLTextureFormat struct

Translates backend-neutral pixel formats into OpenGL formats.

Translation table of the OpenGL backend: maps each logical PixelFormat (plus a BGR/BGRA channel-order flag) to the OpenGL internal format, external format and pixel data type consumed by the texture upload calls, and verifies device support for the compressed families. This is the only place the OpenGL texture-format constants live; pipeline code only ever names a PixelFormat.

Public static functions

static void Resolve(PixelFormat format, bool bgr, GLint& internalFormat, GLenum& externalFormat, GLenum& dataType)
Resolves a pixel format into its OpenGL internal format, external format and data type.
static void CheckSupport(PixelFormat format)
Verifies that the device supports the given pixel format, aborting if it does not.

Function documentation

static void nCine::RHI::GL::GLTextureFormat::Resolve(PixelFormat format, bool bgr, GLint& internalFormat, GLenum& externalFormat, GLenum& dataType)

Resolves a pixel format into its OpenGL internal format, external format and data type.

Parameters
format Backend-neutral pixel format
bgr Whether the external channel order is BGR/BGRA instead of RGB/RGBA
internalFormat Receives the sized OpenGL internal format
externalFormat Receives the external OpenGL format
dataType Receives the OpenGL pixel data type