33#ifndef DVD_GL_RESOURCES_H_
34#define DVD_GL_RESOURCES_H_
36#include <glbinding/gl46core/gl.h>
47struct GenericDrawCommand;
64 gl46core::GLenum
_access = gl46core::GL_NONE;
65 gl46core::GLenum
_format = gl46core::GL_NONE;
66 gl46core::GLboolean
_layered = gl46core::GL_FALSE;
76 gl46core::GLuint
_id{0u};
86 using VAOData = std::pair<VAOBufferData, VAODivisors>;
89 void init(
U32 maxBindings)
noexcept;
123 std::pair<gl46core::GLuint, bool>
allocate(
size_t hash,
bool retry =
false);
125 gl46core::GLuint
allocate(
bool retry =
false);
126 void deallocate( gl46core::GLuint handle,
U32 frameDelay = 1);
140 eastl::fixed_vector<CacheEntry, InitialCacheSize, true>
_cache;
147template<
typename T = gl46core::GL
int>
148void getGLValue( gl46core::GLenum param, T& value, gl46core::GLint index = -1);
150template<
typename T = gl46core::GL
int>
151void getGLValue( gl46core::GLenum param, T* value);
153template<
typename T = gl46core::GL
int>
156template<
typename T = gl46core::GL
int>
160void DebugCallback( gl46core::GLenum source, gl46core::GLenum type, gl46core::GLuint
id, gl46core::GLenum severity,
161 gl46core::GLsizei length,
const gl46core::GLchar* message,
const void* userParam);
vector< State > _usageMap
eastl::fixed_vector< CacheEntry, InitialCacheSize, true > _cache
std::pair< gl46core::GLuint, bool > allocate(size_t hash, bool retry=false)
void deallocate(gl46core::GLuint handle, U32 frameDelay=1)
vector< gl46core::GLuint > _tempBuffer
vector< gl46core::GLuint > _handles
static constexpr size_t InitialCacheSize
std::pair< VAOBufferData, VAODivisors > VAOData
void init(U32 maxBindings) noexcept
vector< bool > VAODivisors
const BufferBindingParams & bindingParams(gl46core::GLuint index)
bool instanceDivisorFlag(gl46core::GLuint index)
vector< BufferBindingParams > VAOBufferData
std::array< gl46core::GLenum, to_base(QueryType::COUNT)> glQueryTypeTable
NO_DESTROY Mutex s_glSecondaryContextMutex
gl46core::GLuint s_lastQueryResult
std::array< gl46core::GLenum, to_base(StencilOperation::COUNT)> glStencilOpTable
std::array< gl46core::GLenum, to_base(PrimitiveTopology::COUNT)> glPrimitiveTypeTable
std::array< gl46core::GLenum, to_base(ShaderType::COUNT)> glShaderStageTable
std::array< gl46core::GLenum, to_base(BlendOperation::COUNT)> glBlendOpTable
thread_local SDL_GLContext s_glSecondaryContext
std::array< gl46core::GLenum, to_base(GFXDataFormat::COUNT)> glDataFormatTable
const DisplayWindow * s_glMainRenderWindow
void getGLValue(gl46core::GLenum param, T &value, gl46core::GLint index=-1)
Wrapper for glGetIntegerv.
void SubmitRenderCommand(const GenericDrawCommand &drawCommand, const gl46core::GLenum internalFormat)
Note: If internal format is not GL_NONE, an indexed draw is issued!
bool ValidateSDL(const I32 errCode, bool assert)
std::array< gl46core::GLenum, to_base(TextureWrap::COUNT)> glWrapTable
T getGLValueIndexed(gl46core::GLenum param, gl46core::GLint index=-1)
void OnStartup()
Populate enumeration tables with appropriate API values.
std::array< gl46core::GLenum, to_base(BlendProperty::COUNT)> glBlendTable
std::array< gl46core::GLenum, to_base(FillMode::COUNT)> glFillModeTable
gl46core::GLenum internalTextureType(const TextureType type, const U8 msaaSamples)
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.
std::array< gl46core::GLenum, to_base(CullMode::COUNT)> glCullModeTable
std::array< gl46core::GLenum, to_base(TextureType::COUNT)> glTextureTypeTable
std::array< gl46core::GLenum, to_base(ComparisonFunction::COUNT)> glCompareFuncTable
FormatAndDataType InternalFormatAndDataType(const GFXImageFormat baseFormat, const GFXDataFormat dataType, const GFXImagePacking packing) noexcept
Handle console commands that start with a forward slash.
std::shared_mutex SharedMutex
@ COUNT
Place all properties above this.
@ COUNT
Place all properties above this.
constexpr gl46core::GLuint GL_NULL_HANDLE
Invalid object value. Used to compare handles and determine if they were properly created.
@ COUNT
Place all properties above this.
eastl::vector< Type > vector
@ COUNT
Place all properties above this.
@ COUNT
Place all properties above this.
@ COUNT
Place all properties above this.
constexpr auto to_base(const Type value) -> Type
GLIM_ENUM
The enum holding all important GLIM configuration values.
bool operator==(const ImageBindSettings &) const =default
gl46core::GLuint _texture
gl46core::GLboolean _layered
bool operator==(const BufferBindingParams &) const =default