Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::GLUtil Namespace Reference

Namespaces

namespace  GLMemory
 

Classes

struct  FormatAndDataType
 
class  glTextureViewCache
 

Functions

BytecreateAndAllocPersistentBuffer (const size_t bufferSize, const gl46core::BufferStorageMask storageMask, const gl46core::BufferAccessMask accessMask, gl46core::GLuint &bufferIdOut, const std::pair< bufferPtr, size_t > initialData, const char *name)
 
void createBuffer (gl46core::GLuint &bufferIdOut, const char *name)
 
void createAndAllocBuffer (const size_t bufferSize, const gl46core::GLenum usageMask, gl46core::GLuint &bufferIdOut, const std::pair< bufferPtr, size_t > initialData, const char *name)
 
void freeBuffer (gl46core::GLuint &bufferId, bufferPtr mappedPtr)
 
void OnStartup ()
 Populate enumeration tables with appropriate API values.
 
FormatAndDataType InternalFormatAndDataType (const GFXImageFormat baseFormat, const GFXDataFormat dataType, const GFXImagePacking packing) noexcept
 
gl46core::GLenum internalTextureType (const TextureType type, const U8 msaaSamples)
 
bool ValidateSDL (const I32 errCode, bool assert)
 
void SubmitRenderCommand (const GenericDrawCommand &drawCommand, gl46core::GLenum internalFormat)
 Note: If internal format is not GL_NONE, an indexed draw is issued!
 
void DebugCallback (const gl46core::GLenum source, const gl46core::GLenum type, const gl46core::GLuint id, const gl46core::GLenum severity, const gl46core::GLsizei length, const gl46core::GLchar *message, const void *userParam)
 Print OpenGL specific messages.
 
template<typename T = gl46core::GLint>
void getGLValue (gl46core::GLenum param, T &value, gl46core::GLint index=-1)
 Wrapper for glGetIntegerv.
 
template<typename T = gl46core::GLint>
void getGLValue (gl46core::GLenum param, T *value)
 
template<typename T = gl46core::GLint>
getGLValue (gl46core::GLenum param)
 
template<typename T = gl46core::GLint>
getGLValueIndexed (gl46core::GLenum param, gl46core::GLint index=-1)
 
template<>
void getGLValue (const gl46core::GLenum param, U32 &value, const gl46core::GLint index)
 
template<>
void getGLValue (const gl46core::GLenum param, F32 &value, const gl46core::GLint index)
 
template<>
void getGLValue (const gl46core::GLenum param, gl46core::GLboolean &value, const gl46core::GLint index)
 
template<>
void getGLValue (const gl46core::GLenum param, D64 &value, const gl46core::GLint index)
 
template<>
void getGLValue (const gl46core::GLenum param, gl46core::GLint64 &value, const gl46core::GLint index)
 

Variables

gl46core::GLuint s_lastQueryResult = GL_NULL_HANDLE
 
const DisplayWindows_glMainRenderWindow
 
thread_local SDL_GLContext s_glSecondaryContext = nullptr
 
NO_DESTROY Mutex s_glSecondaryContextMutex
 
std::array< gl46core::GLenum, to_base(BlendProperty::COUNT)> glBlendTable
 
std::array< gl46core::GLenum, to_base(BlendOperation::COUNT)> glBlendOpTable
 
std::array< gl46core::GLenum, to_base(ComparisonFunction::COUNT)> glCompareFuncTable
 
std::array< gl46core::GLenum, to_base(StencilOperation::COUNT)> glStencilOpTable
 
std::array< gl46core::GLenum, to_base(CullMode::COUNT)> glCullModeTable
 
std::array< gl46core::GLenum, to_base(FillMode::COUNT)> glFillModeTable
 
std::array< gl46core::GLenum, to_base(TextureType::COUNT)> glTextureTypeTable
 
std::array< gl46core::GLenum, to_base(PrimitiveTopology::COUNT)> glPrimitiveTypeTable
 
std::array< gl46core::GLenum, to_base(GFXDataFormat::COUNT)> glDataFormatTable
 
std::array< gl46core::GLenum, to_base(TextureWrap::COUNT)> glWrapTable
 
std::array< gl46core::GLenum, to_base(ShaderType::COUNT)> glShaderStageTable
 
std::array< gl46core::GLenum, to_base(QueryType::COUNT)> glQueryTypeTable
 

Function Documentation

◆ createAndAllocBuffer()

void Divide::GLUtil::createAndAllocBuffer ( const size_t  bufferSize,
const gl46core::GLenum  usageMask,
gl46core::GLuint &  bufferIdOut,
const std::pair< bufferPtr, size_t >  initialData,
const char *  name 
)

Definition at line 317 of file glMemoryManager.cpp.

◆ createAndAllocPersistentBuffer()

Byte * Divide::GLUtil::createAndAllocPersistentBuffer ( const size_t  bufferSize,
const gl46core::BufferStorageMask  storageMask,
const gl46core::BufferAccessMask  accessMask,
gl46core::GLuint &  bufferIdOut,
const std::pair< bufferPtr, size_t >  initialData,
const char *  name 
)

Definition at line 268 of file glMemoryManager.cpp.

◆ createBuffer()

void Divide::GLUtil::createBuffer ( gl46core::GLuint &  bufferIdOut,
const char *  name 
)

Definition at line 301 of file glMemoryManager.cpp.

◆ DebugCallback()

void Divide::GLUtil::DebugCallback ( const gl46core::GLenum  source,
const gl46core::GLenum  type,
const gl46core::GLuint  id,
const gl46core::GLenum  severity,
const gl46core::GLsizei  length,
const gl46core::GLchar *  message,
const void *  userParam 
)

Print OpenGL specific messages.

Check the current operation for errors.

Definition at line 745 of file glResources.cpp.

◆ freeBuffer()

void Divide::GLUtil::freeBuffer ( gl46core::GLuint &  bufferId,
bufferPtr  mappedPtr 
)

Definition at line 343 of file glMemoryManager.cpp.

◆ getGLValue() [1/8]

template<>
void Divide::GLUtil::getGLValue ( const gl46core::GLenum  param,
D64 value,
const gl46core::GLint  index 
)
inline

Definition at line 94 of file glResources.inl.

◆ getGLValue() [2/8]

template<>
void Divide::GLUtil::getGLValue ( const gl46core::GLenum  param,
F32 value,
const gl46core::GLint  index 
)
inline

Definition at line 68 of file glResources.inl.

◆ getGLValue() [3/8]

template<>
void Divide::GLUtil::getGLValue ( const gl46core::GLenum  param,
gl46core::GLboolean &  value,
const gl46core::GLint  index 
)
inline

Definition at line 81 of file glResources.inl.

◆ getGLValue() [4/8]

template<>
void Divide::GLUtil::getGLValue ( const gl46core::GLenum  param,
gl46core::GLint64 &  value,
const gl46core::GLint  index 
)
inline

Definition at line 107 of file glResources.inl.

◆ getGLValue() [5/8]

template<>
void Divide::GLUtil::getGLValue ( const gl46core::GLenum  param,
U32 value,
const gl46core::GLint  index 
)
inline

Definition at line 62 of file glResources.inl.

◆ getGLValue() [6/8]

template<typename T = gl46core::GLint>
T Divide::GLUtil::getGLValue ( gl46core::GLenum  param)

Definition at line 120 of file glResources.inl.

◆ getGLValue() [7/8]

template<typename T = gl46core::GLint>
void Divide::GLUtil::getGLValue ( gl46core::GLenum  param,
T &  value,
gl46core::GLint  index = -1 
)

Wrapper for glGetIntegerv.

Definition at line 40 of file glResources.inl.

◆ getGLValue() [8/8]

template<typename T = gl46core::GLint>
void Divide::GLUtil::getGLValue ( gl46core::GLenum  param,
T *  value 
)

Definition at line 56 of file glResources.inl.

◆ getGLValueIndexed()

template<typename T = gl46core::GLint>
T Divide::GLUtil::getGLValueIndexed ( gl46core::GLenum  param,
gl46core::GLint  index = -1 
)

Definition at line 128 of file glResources.inl.

◆ InternalFormatAndDataType()

FormatAndDataType Divide::GLUtil::InternalFormatAndDataType ( const GFXImageFormat  baseFormat,
const GFXDataFormat  dataType,
const GFXImagePacking  packing 
)
noexcept

Definition at line 202 of file glResources.cpp.

◆ internalTextureType()

gl46core::GLenum Divide::GLUtil::internalTextureType ( const TextureType  type,
const U8  msaaSamples 
)

Definition at line 413 of file glResources.cpp.

◆ OnStartup()

void Divide::GLUtil::OnStartup ( )

Populate enumeration tables with appropriate API values.

Definition at line 99 of file glResources.cpp.

◆ SubmitRenderCommand()

void Divide::GLUtil::SubmitRenderCommand ( const GenericDrawCommand drawCommand,
const gl46core::GLenum  internalFormat 
)

Note: If internal format is not GL_NONE, an indexed draw is issued!

Definition at line 451 of file glResources.cpp.

◆ ValidateSDL()

bool Divide::GLUtil::ValidateSDL ( const I32  errCode,
bool  assert 
)

Definition at line 436 of file glResources.cpp.

Variable Documentation

◆ glBlendOpTable

std::array< gl46core::GLenum, to_base(BlendOperation::COUNT)> Divide::GLUtil::glBlendOpTable

Definition at line 87 of file glResources.cpp.

◆ glBlendTable

std::array< gl46core::GLenum, to_base(BlendProperty::COUNT)> Divide::GLUtil::glBlendTable

Definition at line 86 of file glResources.cpp.

◆ glCompareFuncTable

std::array< gl46core::GLenum, to_base(ComparisonFunction::COUNT)> Divide::GLUtil::glCompareFuncTable

Definition at line 88 of file glResources.cpp.

◆ glCullModeTable

std::array< gl46core::GLenum, to_base(CullMode::COUNT)> Divide::GLUtil::glCullModeTable

Definition at line 90 of file glResources.cpp.

◆ glDataFormatTable

std::array< gl46core::GLenum, to_base(GFXDataFormat::COUNT)> Divide::GLUtil::glDataFormatTable

Definition at line 94 of file glResources.cpp.

◆ glFillModeTable

std::array< gl46core::GLenum, to_base(FillMode::COUNT)> Divide::GLUtil::glFillModeTable

Definition at line 91 of file glResources.cpp.

◆ glPrimitiveTypeTable

std::array< gl46core::GLenum, to_base(PrimitiveTopology::COUNT)> Divide::GLUtil::glPrimitiveTypeTable

Definition at line 93 of file glResources.cpp.

◆ glQueryTypeTable

std::array< gl46core::GLenum, to_base(QueryType::COUNT)> Divide::GLUtil::glQueryTypeTable

Definition at line 97 of file glResources.cpp.

◆ glShaderStageTable

std::array< gl46core::GLenum, to_base(ShaderType::COUNT)> Divide::GLUtil::glShaderStageTable

Definition at line 96 of file glResources.cpp.

◆ glStencilOpTable

std::array< gl46core::GLenum, to_base(StencilOperation::COUNT)> Divide::GLUtil::glStencilOpTable

Definition at line 89 of file glResources.cpp.

◆ glTextureTypeTable

std::array< gl46core::GLenum, to_base(TextureType::COUNT)> Divide::GLUtil::glTextureTypeTable

Definition at line 92 of file glResources.cpp.

◆ glWrapTable

std::array< gl46core::GLenum, to_base(TextureWrap::COUNT)> Divide::GLUtil::glWrapTable

Definition at line 95 of file glResources.cpp.

◆ s_glMainRenderWindow

const DisplayWindow * Divide::GLUtil::s_glMainRenderWindow

Definition at line 82 of file glResources.cpp.

◆ s_glSecondaryContext

thread_local SDL_GLContext Divide::GLUtil::s_glSecondaryContext = nullptr

Definition at line 83 of file glResources.cpp.

◆ s_glSecondaryContextMutex

Mutex Divide::GLUtil::s_glSecondaryContextMutex

Definition at line 84 of file glResources.cpp.

◆ s_lastQueryResult

gl46core::GLuint Divide::GLUtil::s_lastQueryResult = GL_NULL_HANDLE

Definition at line 80 of file glResources.cpp.