OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::GL3PlusPixelUtil Class Reference

Class to do pixel format mapping between GL and OGRE. More...

#include <OgreGL3PlusPixelFormat.h>

Static Public Member Functions

static GLenum getClosestGLImageInternalFormat (PixelFormat format)
 Takes the OGRE pixel format and returns the type that must be provided to GL as internal format for image load/store.
 
static GLenum getClosestGLInternalFormat (PixelFormat format, bool hwGamma)
 Takes the OGRE pixel format and returns the type that must be provided to GL as internal format.
 
static PixelFormat getClosestOGREFormat (GLenum format)
 Function to get the closest matching OGRE format to an internal GL format.
 
static GLenum getGLImageInternalFormat (PixelFormat format)
 Takes the OGRE pixel format and returns the type that must be provided to GL as internal format for image load/store.
 
static GLenum getGLInternalFormat (PixelFormat format, bool hwGamma)
 Takes the OGRE pixel format and returns the type that must be provided to GL as internal format.
 
static GLenum getGLOriginDataType (PixelFormat format)
 Takes the OGRE pixel format and returns type that must be provided to GL as data type for reading it into the GPU.
 
static GLenum getGLOriginFormat (PixelFormat format)
 Takes the OGRE pixel format and returns the appropriate GL one.
 
static size_t getMaxMipmaps (size_t width, size_t height, size_t depth, PixelFormat format)
 Returns the maximum number of Mipmaps that can be generated until we reach the mininum format possible.
 

Detailed Description

Class to do pixel format mapping between GL and OGRE.

Member Function Documentation

◆ getClosestGLImageInternalFormat()

static GLenum Ogre::GL3PlusPixelUtil::getClosestGLImageInternalFormat ( PixelFormat  format)
static

Takes the OGRE pixel format and returns the type that must be provided to GL as internal format for image load/store.

If no match exists, returns the closest match.

Parameters
mFormatThe pixel format

◆ getClosestGLInternalFormat()

static GLenum Ogre::GL3PlusPixelUtil::getClosestGLInternalFormat ( PixelFormat  format,
bool  hwGamma 
)
static

Takes the OGRE pixel format and returns the type that must be provided to GL as internal format.

If no match exists, returns the closest match.

Parameters
mFormatThe pixel format
hwGammaWhether a hardware gamma-corrected version is requested

◆ getClosestOGREFormat()

static PixelFormat Ogre::GL3PlusPixelUtil::getClosestOGREFormat ( GLenum  format)
static

Function to get the closest matching OGRE format to an internal GL format.

To be precise, the format will be chosen that is most efficient to transfer to the card without losing precision.

Remarks
It is valid for this function to always return PF_A8R8G8B8.

◆ getGLImageInternalFormat()

static GLenum Ogre::GL3PlusPixelUtil::getGLImageInternalFormat ( PixelFormat  format)
static

Takes the OGRE pixel format and returns the type that must be provided to GL as internal format for image load/store.

GL_NONE if no match exists.

Parameters
mFormatThe pixel format

◆ getGLInternalFormat()

static GLenum Ogre::GL3PlusPixelUtil::getGLInternalFormat ( PixelFormat  format,
bool  hwGamma 
)
static

Takes the OGRE pixel format and returns the type that must be provided to GL as internal format.

GL_NONE if no match exists.

Parameters
mFormatThe pixel format
hwGammaWhether a hardware gamma-corrected version is requested

◆ getGLOriginDataType()

static GLenum Ogre::GL3PlusPixelUtil::getGLOriginDataType ( PixelFormat  format)
static

Takes the OGRE pixel format and returns type that must be provided to GL as data type for reading it into the GPU.

Returns
a GLenum describing the data type, or 0 if there is no exactly matching one (and conversion is needed)

◆ getGLOriginFormat()

static GLenum Ogre::GL3PlusPixelUtil::getGLOriginFormat ( PixelFormat  format)
static

Takes the OGRE pixel format and returns the appropriate GL one.

Returns
a GLenum describing the format, or 0 if there is no exactly matching one (and conversion is needed)

◆ getMaxMipmaps()

static size_t Ogre::GL3PlusPixelUtil::getMaxMipmaps ( size_t  width,
size_t  height,
size_t  depth,
PixelFormat  format 
)
static

Returns the maximum number of Mipmaps that can be generated until we reach the mininum format possible.

This does not count the base level.

Parameters
widthThe width of the area
heightThe height of the area
depthThe depth of the area
formatThe format of the area
Remarks
In case that the format is non-compressed, this simply returns how many times we can divide this texture in 2 until we reach 1x1. For compressed formats, constraints apply on minimum size and alignment so this might differ.

The documentation for this class was generated from the following file: