From 665c63c3d0dbaf7e14a3d2375a138e6b4ef45743 Mon Sep 17 00:00:00 2001 From: martinfouilleul Date: Tue, 21 Feb 2023 18:43:30 +0100 Subject: [PATCH] [win32 build/link] - Build milepost as a dynamic library - Add import/export directives to public API symbols - Change example build scripts accordingly --- build.bat | 5 +- examples/canvas/build.bat | 2 +- examples/perf_text/build.bat | 2 +- examples/triangleGL/build.bat | 2 +- examples/triangleGLES/build.bat | 2 +- scripts/glapi.py | 9 +- src/gl_api.h | 2142 +++++++++++++++---------------- src/gl_loader.c | 2 +- src/gl_loader.h | 3 +- src/graphics.h | 174 +-- src/mp_app.h | 796 ++++++------ src/platform/platform.h | 178 +-- src/platform/platform_clock.h | 68 +- src/util/debug_log.h | 195 +-- src/util/hash.h | 58 +- src/util/memory.h | 212 +-- src/util/strings.h | 226 ++-- src/util/utf8.c | 567 ++++---- src/util/utf8.h | 403 +++--- todo.txt | 2 +- 20 files changed, 2529 insertions(+), 2519 deletions(-) diff --git a/build.bat b/build.bat index 8a9f8b3..a111857 100644 --- a/build.bat +++ b/build.bat @@ -6,5 +6,6 @@ set glsl_shaders=src\glsl_shaders\common.glsl src\glsl_shaders\blit_vertex.glsl call python3 scripts\embed_text.py %glsl_shaders% --prefix=glsl_ --output src\glsl_shaders.h set INCLUDES=/I src /I src/util /I src/platform /I ext /I ext/angle_headers -cl /we4013 /Zi /Zc:preprocessor /std:c11 %INCLUDES% /c /Fo:bin/milepost.obj src/milepost.c -lib bin/milepost.obj /OUT:bin/milepost.lib +set LIBS=user32.lib opengl32.lib gdi32.lib shcore.lib /LIBPATH:./bin libEGL.dll.lib libGLESv2.dll.lib + +cl /we4013 /Zi /Zc:preprocessor /DMP_BUILD_DLL /std:c11 %INCLUDES% src/milepost.c /Fo:bin/milepost.o /LD /link %LIBS% /OUT:bin/milepost.dll /IMPLIB:bin/milepost.dll.lib diff --git a/examples/canvas/build.bat b/examples/canvas/build.bat index af425a5..7ea8f70 100644 --- a/examples/canvas/build.bat +++ b/examples/canvas/build.bat @@ -1,4 +1,4 @@ set INCLUDES=/I ..\..\src /I ..\..\src\util /I ..\..\src\platform /I ../../ext /I ../../ext/angle_headers -cl /we4013 /Zi /Zc:preprocessor /std:c11 %INCLUDES% main.c /link /LIBPATH:../../bin milepost.lib user32.lib opengl32.lib gdi32.lib shcore.lib /out:../../bin/example_canvas.exe +cl /we4013 /Zi /Zc:preprocessor /std:c11 %INCLUDES% main.c /link /LIBPATH:../../bin milepost.dll.lib /out:../../bin/example_canvas.exe diff --git a/examples/perf_text/build.bat b/examples/perf_text/build.bat index 5af332d..23f5e5a 100644 --- a/examples/perf_text/build.bat +++ b/examples/perf_text/build.bat @@ -1,4 +1,4 @@ set INCLUDES=/I ..\..\src /I ..\..\src\util /I ..\..\src\platform /I ../../ext -cl /we4013 /Zi /Zc:preprocessor /std:c11 %INCLUDES% main.c /link /LIBPATH:../../bin milepost.lib user32.lib opengl32.lib gdi32.lib shcore.lib /out:../../bin/perf_text.exe +cl /we4013 /Zi /Zc:preprocessor /std:c11 %INCLUDES% main.c /link /LIBPATH:../../bin milepost.dll.lib /out:../../bin/perf_text.exe diff --git a/examples/triangleGL/build.bat b/examples/triangleGL/build.bat index a324aa1..d87334a 100644 --- a/examples/triangleGL/build.bat +++ b/examples/triangleGL/build.bat @@ -1,3 +1,3 @@ set INCLUDES=/I ..\..\src /I ..\..\src\util /I ..\..\src\platform /I ../../ext -cl /we4013 /Zi /Zc:preprocessor /DMG_IMPLEMENTS_BACKEND_GL /std:c11 %INCLUDES% main.c /link /LIBPATH:../../bin milepost.lib user32.lib opengl32.lib gdi32.lib shcore.lib /LIBPATH:../../bin libEGL.dll.lib libGLESv2.dll.lib /out:../../bin/example_gl_triangle.exe +cl /we4013 /Zi /Zc:preprocessor /std:c11 %INCLUDES% main.c /link /LIBPATH:../../bin milepost.dll.lib /out:../../bin/example_gl_triangle.exe diff --git a/examples/triangleGLES/build.bat b/examples/triangleGLES/build.bat index 703566f..02b0cd5 100644 --- a/examples/triangleGLES/build.bat +++ b/examples/triangleGLES/build.bat @@ -1,3 +1,3 @@ set INCLUDES=/I ..\..\src /I ..\..\src\util /I ..\..\src\platform /I ../../ext /I ../../ext/angle_headers -cl /we4013 /Zi /Zc:preprocessor /std:c11 %INCLUDES% main.c /link /LIBPATH:../../bin milepost.lib /LIBPATH:../../bin libEGL.dll.lib libGLESv2.dll.lib user32.lib opengl32.lib gdi32.lib shcore.lib /out:../../bin/example_gles_triangle.exe +cl /we4013 /Zi /Zc:preprocessor /std:c11 %INCLUDES% main.c /link /LIBPATH:../../bin milepost.dll.lib /out:../../bin/example_gles_triangle.exe diff --git a/scripts/glapi.py b/scripts/glapi.py index aedb554..69d13a8 100644 --- a/scripts/glapi.py +++ b/scripts/glapi.py @@ -96,12 +96,13 @@ for func in glall: f.write('\t' + 'PFN' + func.upper() + 'PROC ' + remove_prefix(func, 'gl') + ';\n') f.write('} mg_gl_api;\n\n') -f.write('extern mp_thread_local mg_gl_api* __mgGLAPI;\n\n'); # generate interface macros # TODO guard for different api/versions and only #define functions present in desired version +f.write("MP_API mg_gl_api* mg_gl_get_api(void);\n\n") + for func in glall: - f.write('#define ' + func + ' __mgGLAPI->' + remove_prefix(func, 'gl') + '\n') + f.write('#define ' + func + ' mg_gl_get_api()->' + remove_prefix(func, 'gl') + '\n') emit_end_guard(f, apiName) f.close() @@ -124,8 +125,8 @@ f.write("void mg_gl_load_gl43(mg_gl_api* api, mg_gl_load_proc loadProc);\n") f.write("void mg_gl_load_gles31(mg_gl_api* api, mg_gl_load_proc loadProc);\n") f.write("void mg_gl_load_gles32(mg_gl_api* api, mg_gl_load_proc loadProc);\n\n") -f.write("void mg_gl_select_api(mg_gl_api* api);\n") -f.write("mg_gl_api* mg_gl_get_api(void);\n\n") +f.write("void mg_gl_select_api(mg_gl_api* api);\n\n") + emit_end_guard(f, loaderName) f.close() diff --git a/src/gl_api.h b/src/gl_api.h index 3b08393..33c6a71 100644 --- a/src/gl_api.h +++ b/src/gl_api.h @@ -2,7 +2,7 @@ * * @file: gl_api.h * @note: auto-generated by glapi.py from gl.xml -* @date: 20/022023 +* @date: 21/022023 * *********************************************************/ #ifndef __GL_API_H__ @@ -13,1092 +13,1092 @@ typedef struct mg_gl_api { - PFNGLVERTEXATTRIBP1UIVPROC VertexAttribP1uiv; - PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC GetActiveUniformBlockName; - PFNGLQUERYCOUNTERPROC QueryCounter; - PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC ProgramUniformMatrix3x4fv; - PFNGLFRONTFACEPROC FrontFace; - PFNGLUNIFORM4UIVPROC Uniform4uiv; - PFNGLVERTEXATTRIBFORMATPROC VertexAttribFormat; - PFNGLGENTRANSFORMFEEDBACKSPROC GenTransformFeedbacks; - PFNGLGETVERTEXATTRIBLDVPROC GetVertexAttribLdv; - PFNGLCULLFACEPROC CullFace; - PFNGLBUFFERSUBDATAPROC BufferSubData; - PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample; - PFNGLFINISHPROC Finish; - PFNGLGETVERTEXATTRIBIUIVPROC GetVertexAttribIuiv; - PFNGLGETTRANSFORMFEEDBACKVARYINGPROC GetTransformFeedbackVarying; - PFNGLBINDRENDERBUFFERPROC BindRenderbuffer; - PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer; - PFNGLGETCOMPRESSEDTEXIMAGEPROC GetCompressedTexImage; - PFNGLLOGICOPPROC LogicOp; - PFNGLVERTEXATTRIB4DPROC VertexAttrib4d; - PFNGLDELETESAMPLERSPROC DeleteSamplers; + PFNGLSAMPLERPARAMETERIVPROC SamplerParameteriv; + PFNGLISFRAMEBUFFERPROC IsFramebuffer; + PFNGLMULTIDRAWELEMENTSPROC MultiDrawElements; + PFNGLVERTEXATTRIB3FPROC VertexAttrib3f; + PFNGLGETBUFFERPOINTERVPROC GetBufferPointerv; + PFNGLCOPYTEXSUBIMAGE2DPROC CopyTexSubImage2D; + PFNGLENDTRANSFORMFEEDBACKPROC EndTransformFeedback; PFNGLSAMPLERPARAMETERIPROC SamplerParameteri; - PFNGLVIEWPORTARRAYVPROC ViewportArrayv; - PFNGLDISABLEPROC Disable; - PFNGLUNIFORM3FPROC Uniform3f; - PFNGLOBJECTPTRLABELPROC ObjectPtrLabel; - PFNGLVERTEXATTRIBI3IPROC VertexAttribI3i; - PFNGLMAPBUFFERPROC MapBuffer; - PFNGLGETBUFFERPARAMETERIVPROC GetBufferParameteriv; - PFNGLDELETESYNCPROC DeleteSync; - PFNGLPROGRAMUNIFORM1DPROC ProgramUniform1d; - PFNGLVERTEXATTRIBL1DVPROC VertexAttribL1dv; - PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D; - PFNGLVERTEXATTRIB1FVPROC VertexAttrib1fv; - PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv; - PFNGLPRIMITIVERESTARTINDEXPROC PrimitiveRestartIndex; - PFNGLENABLEVERTEXATTRIBARRAYPROC EnableVertexAttribArray; - PFNGLPATCHPARAMETERIPROC PatchParameteri; - PFNGLVERTEXATTRIBI4UIVPROC VertexAttribI4uiv; - PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC GetActiveAtomicCounterBufferiv; - PFNGLPROGRAMUNIFORM4UIPROC ProgramUniform4ui; - PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D; - PFNGLPROGRAMBINARYPROC ProgramBinary; - PFNGLPUSHDEBUGGROUPPROC PushDebugGroup; - PFNGLBINDFRAGDATALOCATIONINDEXEDPROC BindFragDataLocationIndexed; - PFNGLGETSHADERSOURCEPROC GetShaderSource; - PFNGLENABLEIPROC Enablei; - PFNGLGETNUNIFORMUIVPROC GetnUniformuiv; - PFNGLUNIFORM3IPROC Uniform3i; - PFNGLISPROGRAMPIPELINEPROC IsProgramPipeline; - PFNGLGETPROGRAMSTAGEIVPROC GetProgramStageiv; - PFNGLBINDTEXTUREPROC BindTexture; - PFNGLBINDBUFFERRANGEPROC BindBufferRange; - PFNGLMEMORYBARRIERBYREGIONPROC MemoryBarrierByRegion; - PFNGLBINDPROGRAMPIPELINEPROC BindProgramPipeline; - PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC ProgramUniformMatrix4x2dv; - PFNGLBEGINQUERYINDEXEDPROC BeginQueryIndexed; - PFNGLPOLYGONOFFSETPROC PolygonOffset; - PFNGLPROGRAMUNIFORM4DPROC ProgramUniform4d; - PFNGLGETSTRINGPROC GetString; - PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv; - PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage; - PFNGLINVALIDATETEXIMAGEPROC InvalidateTexImage; - PFNGLPROGRAMUNIFORM2FPROC ProgramUniform2f; - PFNGLSTENCILMASKPROC StencilMask; - PFNGLVERTEXATTRIBIPOINTERPROC VertexAttribIPointer; - PFNGLGETPROGRAMRESOURCELOCATIONPROC GetProgramResourceLocation; - PFNGLTRANSFORMFEEDBACKVARYINGSPROC TransformFeedbackVaryings; - PFNGLTEXTUREVIEWPROC TextureView; - PFNGLBLENDEQUATIONPROC BlendEquation; - PFNGLUNIFORM3IVPROC Uniform3iv; - PFNGLVERTEXATTRIBI1IVPROC VertexAttribI1iv; - PFNGLGETUNIFORMBLOCKINDEXPROC GetUniformBlockIndex; - PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv; - PFNGLDRAWELEMENTSINSTANCEDPROC DrawElementsInstanced; - PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC MultiDrawElementsBaseVertex; + PFNGLDRAWELEMENTSINDIRECTPROC DrawElementsIndirect; PFNGLPROGRAMUNIFORMMATRIX4DVPROC ProgramUniformMatrix4dv; - PFNGLCLEARSTENCILPROC ClearStencil; - PFNGLVERTEXATTRIBI1IPROC VertexAttribI1i; - PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D; - PFNGLDELETEPROGRAMPIPELINESPROC DeleteProgramPipelines; - PFNGLPOINTPARAMETERFVPROC PointParameterfv; - PFNGLSAMPLERPARAMETERIUIVPROC SamplerParameterIuiv; - PFNGLGETFLOATI_VPROC GetFloati_v; - PFNGLGETNUNIFORMIVPROC GetnUniformiv; - PFNGLDETACHSHADERPROC DetachShader; - PFNGLPIXELSTOREIPROC PixelStorei; - PFNGLPROGRAMUNIFORM1FPROC ProgramUniform1f; - PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv; - PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC DrawTransformFeedbackStream; - PFNGLDELETEQUERIESPROC DeleteQueries; - PFNGLCLEARBUFFERDATAPROC ClearBufferData; - PFNGLCLEARBUFFERFIPROC ClearBufferfi; - PFNGLPROGRAMUNIFORMMATRIX4FVPROC ProgramUniformMatrix4fv; - PFNGLSTENCILFUNCPROC StencilFunc; - PFNGLREADNPIXELSPROC ReadnPixels; - PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D; - PFNGLDRAWARRAYSINSTANCEDPROC DrawArraysInstanced; - PFNGLGETACTIVEATTRIBPROC GetActiveAttrib; - PFNGLGENERATEMIPMAPPROC GenerateMipmap; - PFNGLDEPTHMASKPROC DepthMask; + PFNGLTEXPARAMETERFPROC TexParameterf; + PFNGLVERTEXATTRIBFORMATPROC VertexAttribFormat; + PFNGLVERTEXATTRIBI2UIVPROC VertexAttribI2uiv; + PFNGLTEXSUBIMAGE1DPROC TexSubImage1D; + PFNGLRELEASESHADERCOMPILERPROC ReleaseShaderCompiler; + PFNGLUNIFORM2IVPROC Uniform2iv; + PFNGLUNIFORM1FVPROC Uniform1fv; + PFNGLGETNUNIFORMFVPROC GetnUniformfv; + PFNGLTEXIMAGE1DPROC TexImage1D; + PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC DrawRangeElementsBaseVertex; + PFNGLMEMORYBARRIERBYREGIONPROC MemoryBarrierByRegion; + PFNGLGETPROGRAMPIPELINEIVPROC GetProgramPipelineiv; + PFNGLUNIFORM4UIVPROC Uniform4uiv; + PFNGLVERTEXATTRIB1DPROC VertexAttrib1d; + PFNGLDEPTHRANGEARRAYVPROC DepthRangeArrayv; + PFNGLVERTEXATTRIBL3DPROC VertexAttribL3d; + PFNGLMULTIDRAWARRAYSPROC MultiDrawArrays; + PFNGLUNIFORM4DVPROC Uniform4dv; + PFNGLCOPYTEXIMAGE1DPROC CopyTexImage1D; + PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC ProgramUniformMatrix4x3dv; + PFNGLTEXPARAMETERIUIVPROC TexParameterIuiv; + PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv; + PFNGLGETTEXLEVELPARAMETERIVPROC GetTexLevelParameteriv; + PFNGLUNIFORMMATRIX2X4FVPROC UniformMatrix2x4fv; + PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC DrawElementsInstancedBaseVertexBaseInstance; + PFNGLDELETETEXTURESPROC DeleteTextures; + PFNGLTEXIMAGE3DPROC TexImage3D; + PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv; + PFNGLTEXPARAMETERIIVPROC TexParameterIiv; + PFNGLGENVERTEXARRAYSPROC GenVertexArrays; + PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC ProgramUniformMatrix4x2fv; + PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D; + PFNGLPROGRAMUNIFORM3DVPROC ProgramUniform3dv; + PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC GetProgramResourceLocationIndex; + PFNGLDRAWRANGEELEMENTSPROC DrawRangeElements; + PFNGLDISPATCHCOMPUTEINDIRECTPROC DispatchComputeIndirect; + PFNGLGETCOMPRESSEDTEXIMAGEPROC GetCompressedTexImage; + PFNGLGETPROGRAMRESOURCEIVPROC GetProgramResourceiv; + PFNGLDRAWELEMENTSPROC DrawElements; + PFNGLPROGRAMUNIFORM1IPROC ProgramUniform1i; + PFNGLVIEWPORTINDEXEDFVPROC ViewportIndexedfv; + PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer; + PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage; + PFNGLTEXBUFFERRANGEPROC TexBufferRange; + PFNGLBINDBUFFERRANGEPROC BindBufferRange; + PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv; + PFNGLSAMPLERPARAMETERFPROC SamplerParameterf; + PFNGLBINDFRAGDATALOCATIONPROC BindFragDataLocation; + PFNGLVERTEXATTRIB2DPROC VertexAttrib2d; + PFNGLVERTEXATTRIBI4UIPROC VertexAttribI4ui; + PFNGLGETUNIFORMFVPROC GetUniformfv; + PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC ProgramUniformMatrix3x4fv; + PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate; + PFNGLVERTEXATTRIBL3DVPROC VertexAttribL3dv; + PFNGLSCISSORINDEXEDPROC ScissorIndexed; + PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC DrawElementsInstancedBaseVertex; + PFNGLOBJECTPTRLABELPROC ObjectPtrLabel; + PFNGLUNIFORMMATRIX4X3FVPROC UniformMatrix4x3fv; + PFNGLDRAWTRANSFORMFEEDBACKPROC DrawTransformFeedback; PFNGLVERTEXBINDINGDIVISORPROC VertexBindingDivisor; - PFNGLFENCESYNCPROC FenceSync; - PFNGLDRAWARRAYSPROC DrawArrays; + PFNGLPROGRAMUNIFORM4UIVPROC ProgramUniform4uiv; + PFNGLGETQUERYIVPROC GetQueryiv; + PFNGLUNIFORM2UIVPROC Uniform2uiv; + PFNGLGETDEBUGMESSAGELOGPROC GetDebugMessageLog; + PFNGLGETSHADERIVPROC GetShaderiv; + PFNGLVERTEXATTRIBI4IPROC VertexAttribI4i; + PFNGLGETTEXLEVELPARAMETERFVPROC GetTexLevelParameterfv; + PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D; + PFNGLUNIFORM1DVPROC Uniform1dv; + PFNGLGETPROGRAMPIPELINEINFOLOGPROC GetProgramPipelineInfoLog; + PFNGLVERTEXATTRIBPOINTERPROC VertexAttribPointer; + PFNGLGETPROGRAMINFOLOGPROC GetProgramInfoLog; + PFNGLSAMPLERPARAMETERIIVPROC SamplerParameterIiv; + PFNGLENDQUERYINDEXEDPROC EndQueryIndexed; + PFNGLGETVERTEXATTRIBLDVPROC GetVertexAttribLdv; + PFNGLDISABLEPROC Disable; + PFNGLFINISHPROC Finish; + PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus; + PFNGLCLAMPCOLORPROC ClampColor; + PFNGLUNIFORMMATRIX4X2FVPROC UniformMatrix4x2fv; + PFNGLUNIFORMMATRIX4X2DVPROC UniformMatrix4x2dv; + PFNGLSCISSORINDEXEDVPROC ScissorIndexedv; + PFNGLGETFRAGDATALOCATIONPROC GetFragDataLocation; + PFNGLGETINTEGER64I_VPROC GetInteger64i_v; + PFNGLPOLYGONMODEPROC PolygonMode; + PFNGLGETTEXPARAMETERIIVPROC GetTexParameterIiv; + PFNGLLINKPROGRAMPROC LinkProgram; + PFNGLPROGRAMUNIFORM2DVPROC ProgramUniform2dv; + PFNGLUNIFORM1DPROC Uniform1d; + PFNGLUNIFORMMATRIX2X4DVPROC UniformMatrix2x4dv; + PFNGLPROGRAMUNIFORM2IPROC ProgramUniform2i; + PFNGLGETATTACHEDSHADERSPROC GetAttachedShaders; + PFNGLVERTEXATTRIBI1UIVPROC VertexAttribI1uiv; + PFNGLPOINTPARAMETERIPROC PointParameteri; + PFNGLSHADERBINARYPROC ShaderBinary; + PFNGLDETACHSHADERPROC DetachShader; + PFNGLGETFLOATI_VPROC GetFloati_v; + PFNGLDRAWBUFFERPROC DrawBuffer; + PFNGLCLEARBUFFERIVPROC ClearBufferiv; + PFNGLGETVERTEXATTRIBIIVPROC GetVertexAttribIiv; + PFNGLISVERTEXARRAYPROC IsVertexArray; + PFNGLGETINTEGER64VPROC GetInteger64v; + PFNGLGETFRAMEBUFFERPARAMETERIVPROC GetFramebufferParameteriv; + PFNGLGETSAMPLERPARAMETERIIVPROC GetSamplerParameterIiv; + PFNGLUNIFORM3IPROC Uniform3i; + PFNGLPROGRAMUNIFORM4FPROC ProgramUniform4f; + PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv; + PFNGLSAMPLERPARAMETERFVPROC SamplerParameterfv; + PFNGLVERTEXATTRIB4SPROC VertexAttrib4s; + PFNGLGETSHADERSOURCEPROC GetShaderSource; + PFNGLVERTEXATTRIBL4DVPROC VertexAttribL4dv; + PFNGLSTENCILOPSEPARATEPROC StencilOpSeparate; + PFNGLISPROGRAMPIPELINEPROC IsProgramPipeline; + PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC ProgramUniformMatrix3x2dv; + PFNGLQUERYCOUNTERPROC QueryCounter; + PFNGLTEXSTORAGE2DPROC TexStorage2D; + PFNGLREADBUFFERPROC ReadBuffer; + PFNGLGETQUERYOBJECTUI64VPROC GetQueryObjectui64v; + PFNGLVERTEXATTRIBI4UBVPROC VertexAttribI4ubv; + PFNGLINVALIDATEFRAMEBUFFERPROC InvalidateFramebuffer; + PFNGLGETACTIVEATTRIBPROC GetActiveAttrib; + PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv; + PFNGLENABLEPROC Enable; + PFNGLVERTEXATTRIBP3UIVPROC VertexAttribP3uiv; + PFNGLPROGRAMUNIFORM1FVPROC ProgramUniform1fv; + PFNGLPROGRAMUNIFORM1DVPROC ProgramUniform1dv; + PFNGLFLUSHMAPPEDBUFFERRANGEPROC FlushMappedBufferRange; + PFNGLVERTEXATTRIBL1DVPROC VertexAttribL1dv; PFNGLVERTEXATTRIBIFORMATPROC VertexAttribIFormat; PFNGLTEXPARAMETERIVPROC TexParameteriv; - PFNGLBLENDFUNCIPROC BlendFunci; - PFNGLGETVERTEXATTRIBDVPROC GetVertexAttribdv; - PFNGLGETUNIFORMUIVPROC GetUniformuiv; - PFNGLGETUNIFORMLOCATIONPROC GetUniformLocation; - PFNGLUNIFORM4IVPROC Uniform4iv; - PFNGLUNIFORM2IPROC Uniform2i; - PFNGLDEPTHRANGEINDEXEDPROC DepthRangeIndexed; - PFNGLDEPTHRANGEARRAYVPROC DepthRangeArrayv; - PFNGLISTEXTUREPROC IsTexture; - PFNGLPROGRAMUNIFORM2FVPROC ProgramUniform2fv; - PFNGLUNIFORMMATRIX2X3FVPROC UniformMatrix2x3fv; - PFNGLGETACTIVEUNIFORMNAMEPROC GetActiveUniformName; - PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv; - PFNGLPOPDEBUGGROUPPROC PopDebugGroup; - PFNGLVERTEXATTRIBP2UIVPROC VertexAttribP2uiv; - PFNGLGETACTIVEUNIFORMSIVPROC GetActiveUniformsiv; - PFNGLMULTIDRAWARRAYSINDIRECTPROC MultiDrawArraysIndirect; - PFNGLUNIFORMMATRIX2DVPROC UniformMatrix2dv; - PFNGLUNIFORM4FVPROC Uniform4fv; - PFNGLTEXBUFFERPROC TexBuffer; - PFNGLVERTEXATTRIB3SPROC VertexAttrib3s; - PFNGLPOINTPARAMETERIPROC PointParameteri; - PFNGLISFRAMEBUFFERPROC IsFramebuffer; - PFNGLGENTEXTURESPROC GenTextures; - PFNGLUNIFORMMATRIX3X2FVPROC UniformMatrix3x2fv; - PFNGLSHADERBINARYPROC ShaderBinary; - PFNGLUNIFORMMATRIX4X3DVPROC UniformMatrix4x3dv; - PFNGLTEXSTORAGE3DPROC TexStorage3D; - PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv; - PFNGLFRAMEBUFFERPARAMETERIPROC FramebufferParameteri; - PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC ProgramUniformMatrix2x3fv; - PFNGLVIEWPORTPROC Viewport; - PFNGLPROGRAMUNIFORM2UIVPROC ProgramUniform2uiv; - PFNGLBEGINCONDITIONALRENDERPROC BeginConditionalRender; - PFNGLPROGRAMUNIFORM4IVPROC ProgramUniform4iv; - PFNGLGETACTIVEUNIFORMBLOCKIVPROC GetActiveUniformBlockiv; - PFNGLBEGINQUERYPROC BeginQuery; - PFNGLBINDTRANSFORMFEEDBACKPROC BindTransformFeedback; - PFNGLVERTEXATTRIB1DPROC VertexAttrib1d; - PFNGLDELETEPROGRAMPROC DeleteProgram; - PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC DrawTransformFeedbackInstanced; - PFNGLGETSAMPLERPARAMETERIVPROC GetSamplerParameteriv; - PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv; - PFNGLTEXPARAMETERIIVPROC TexParameterIiv; - PFNGLPRIMITIVEBOUNDINGBOXPROC PrimitiveBoundingBox; - PFNGLPROGRAMUNIFORMMATRIX3FVPROC ProgramUniformMatrix3fv; - PFNGLPROGRAMUNIFORM1FVPROC ProgramUniform1fv; - PFNGLVERTEXATTRIBI2IVPROC VertexAttribI2iv; - PFNGLPROGRAMUNIFORM3UIVPROC ProgramUniform3uiv; - PFNGLGETTEXPARAMETERIIVPROC GetTexParameterIiv; - PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D; - PFNGLCREATESHADERPROGRAMVPROC CreateShaderProgramv; - PFNGLPOINTPARAMETERIVPROC PointParameteriv; - PFNGLUNMAPBUFFERPROC UnmapBuffer; - PFNGLGETACTIVEUNIFORMPROC GetActiveUniform; - PFNGLUNIFORM1FVPROC Uniform1fv; - PFNGLWAITSYNCPROC WaitSync; - PFNGLUNIFORM4DVPROC Uniform4dv; - PFNGLTEXIMAGE1DPROC TexImage1D; - PFNGLCOPYTEXSUBIMAGE3DPROC CopyTexSubImage3D; - PFNGLGETSHADERINFOLOGPROC GetShaderInfoLog; - PFNGLREADPIXELSPROC ReadPixels; - PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer; - PFNGLINVALIDATEBUFFERDATAPROC InvalidateBufferData; - PFNGLUNIFORMBLOCKBINDINGPROC UniformBlockBinding; - PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC DrawRangeElementsBaseVertex; - PFNGLUNIFORM2DVPROC Uniform2dv; - PFNGLMULTIDRAWARRAYSPROC MultiDrawArrays; - PFNGLVERTEXATTRIBL3DVPROC VertexAttribL3dv; - PFNGLSHADERSOURCEPROC ShaderSource; - PFNGLGETSHADERPRECISIONFORMATPROC GetShaderPrecisionFormat; - PFNGLGETPROGRAMPIPELINEIVPROC GetProgramPipelineiv; - PFNGLVERTEXATTRIBP4UIVPROC VertexAttribP4uiv; - PFNGLTEXPARAMETERFVPROC TexParameterfv; - PFNGLPROGRAMUNIFORM3UIPROC ProgramUniform3ui; - PFNGLUNIFORM2UIPROC Uniform2ui; - PFNGLVERTEXATTRIBL3DPROC VertexAttribL3d; - PFNGLDISPATCHCOMPUTEPROC DispatchCompute; - PFNGLPROGRAMUNIFORM1IPROC ProgramUniform1i; - PFNGLDRAWBUFFERPROC DrawBuffer; - PFNGLGETPROGRAMBINARYPROC GetProgramBinary; - PFNGLTEXSTORAGE2DMULTISAMPLEPROC TexStorage2DMultisample; - PFNGLBINDBUFFERPROC BindBuffer; - PFNGLPIXELSTOREFPROC PixelStoref; - PFNGLCREATEPROGRAMPROC CreateProgram; - PFNGLVERTEXATTRIB2FPROC VertexAttrib2f; - PFNGLRELEASESHADERCOMPILERPROC ReleaseShaderCompiler; - PFNGLPROGRAMUNIFORM3IVPROC ProgramUniform3iv; - PFNGLPROGRAMUNIFORM4IPROC ProgramUniform4i; - PFNGLUNIFORM3UIPROC Uniform3ui; - PFNGLISBUFFERPROC IsBuffer; - PFNGLACTIVETEXTUREPROC ActiveTexture; - PFNGLUNIFORM4IPROC Uniform4i; - PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv; - PFNGLHINTPROC Hint; - PFNGLTEXIMAGE2DPROC TexImage2D; - PFNGLDEPTHRANGEPROC DepthRange; - PFNGLTEXSUBIMAGE1DPROC TexSubImage1D; - PFNGLGETDOUBLEI_VPROC GetDoublei_v; - PFNGLCOPYTEXSUBIMAGE2DPROC CopyTexSubImage2D; - PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers; - PFNGLDISABLEIPROC Disablei; - PFNGLDELETESHADERPROC DeleteShader; - PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D; - PFNGLUNIFORMMATRIX2X3DVPROC UniformMatrix2x3dv; - PFNGLPROGRAMUNIFORM1DVPROC ProgramUniform1dv; - PFNGLENDQUERYPROC EndQuery; - PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC ProgramUniformMatrix4x3fv; - PFNGLSTENCILOPPROC StencilOp; - PFNGLGENPROGRAMPIPELINESPROC GenProgramPipelines; - PFNGLGETBUFFERSUBDATAPROC GetBufferSubData; - PFNGLUNIFORM2DPROC Uniform2d; - PFNGLGETINTEGERI_VPROC GetIntegeri_v; - PFNGLBLENDFUNCPROC BlendFunc; - PFNGLPROGRAMUNIFORM1UIPROC ProgramUniform1ui; - PFNGLGETVERTEXATTRIBFVPROC GetVertexAttribfv; - PFNGLPROGRAMUNIFORM1IVPROC ProgramUniform1iv; - PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv; - PFNGLVERTEXATTRIBI3UIPROC VertexAttribI3ui; - PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC GetActiveSubroutineUniformName; - PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv; - PFNGLVERTEXATTRIBLPOINTERPROC VertexAttribLPointer; - PFNGLGETQUERYIVPROC GetQueryiv; - PFNGLGENSAMPLERSPROC GenSamplers; - PFNGLGETSHADERIVPROC GetShaderiv; - PFNGLGETVERTEXATTRIBIVPROC GetVertexAttribiv; - PFNGLSHADERSTORAGEBLOCKBINDINGPROC ShaderStorageBlockBinding; - PFNGLGETTEXLEVELPARAMETERFVPROC GetTexLevelParameterfv; - PFNGLGETQUERYINDEXEDIVPROC GetQueryIndexediv; - PFNGLVERTEXATTRIB3FPROC VertexAttrib3f; - PFNGLPROGRAMPARAMETERIPROC ProgramParameteri; - PFNGLGETNUNIFORMFVPROC GetnUniformfv; - PFNGLISSHADERPROC IsShader; - PFNGLBINDFRAGDATALOCATIONPROC BindFragDataLocation; - PFNGLPROGRAMUNIFORM4DVPROC ProgramUniform4dv; - PFNGLUNIFORM2FVPROC Uniform2fv; - PFNGLPROGRAMUNIFORM3DVPROC ProgramUniform3dv; - PFNGLVIEWPORTINDEXEDFVPROC ViewportIndexedfv; - PFNGLDEBUGMESSAGECALLBACKPROC DebugMessageCallback; - PFNGLVERTEXATTRIB2DPROC VertexAttrib2d; - PFNGLGETVERTEXATTRIBPOINTERVPROC GetVertexAttribPointerv; - PFNGLACTIVESHADERPROGRAMPROC ActiveShaderProgram; - PFNGLUNIFORMMATRIX4X3FVPROC UniformMatrix4x3fv; - PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC DrawTransformFeedbackStreamInstanced; - PFNGLGETTEXLEVELPARAMETERIVPROC GetTexLevelParameteriv; - PFNGLUNIFORMSUBROUTINESUIVPROC UniformSubroutinesuiv; - PFNGLUNIFORM3UIVPROC Uniform3uiv; - PFNGLSCISSORINDEXEDPROC ScissorIndexed; - PFNGLISPROGRAMPROC IsProgram; - PFNGLPROGRAMUNIFORM4FPROC ProgramUniform4f; - PFNGLPROGRAMUNIFORMMATRIX3DVPROC ProgramUniformMatrix3dv; - PFNGLVERTEXATTRIBI4SVPROC VertexAttribI4sv; - PFNGLDEPTHRANGEFPROC DepthRangef; - PFNGLUSEPROGRAMSTAGESPROC UseProgramStages; - PFNGLGENVERTEXARRAYSPROC GenVertexArrays; - PFNGLGETPROGRAMPIPELINEINFOLOGPROC GetProgramPipelineInfoLog; - PFNGLVERTEXATTRIB4SPROC VertexAttrib4s; - PFNGLDRAWTRANSFORMFEEDBACKPROC DrawTransformFeedback; - PFNGLREADBUFFERPROC ReadBuffer; - PFNGLBLENDCOLORPROC BlendColor; - PFNGLISSYNCPROC IsSync; - PFNGLGETBOOLEANVPROC GetBooleanv; - PFNGLGETBUFFERPARAMETERI64VPROC GetBufferParameteri64v; - PFNGLCLEARBUFFERFVPROC ClearBufferfv; - PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC DrawElementsInstancedBaseVertexBaseInstance; - PFNGLGETBOOLEANI_VPROC GetBooleani_v; - PFNGLISENABLEDIPROC IsEnabledi; - PFNGLCREATESHADERPROC CreateShader; - PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC GetProgramResourceLocationIndex; - PFNGLBEGINTRANSFORMFEEDBACKPROC BeginTransformFeedback; - PFNGLCLEARBUFFERSUBDATAPROC ClearBufferSubData; - PFNGLTEXPARAMETERIUIVPROC TexParameterIuiv; - PFNGLUNIFORM2UIVPROC Uniform2uiv; - PFNGLISSAMPLERPROC IsSampler; - PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv; - PFNGLCLEARDEPTHFPROC ClearDepthf; - PFNGLUNIFORMMATRIX4DVPROC UniformMatrix4dv; - PFNGLDRAWRANGEELEMENTSPROC DrawRangeElements; - PFNGLATTACHSHADERPROC AttachShader; - PFNGLVERTEXATTRIBL4DPROC VertexAttribL4d; - PFNGLTEXIMAGE3DPROC TexImage3D; - PFNGLGETQUERYOBJECTI64VPROC GetQueryObjecti64v; - PFNGLPROGRAMUNIFORM2DPROC ProgramUniform2d; - PFNGLISVERTEXARRAYPROC IsVertexArray; - PFNGLVERTEXATTRIB2FVPROC VertexAttrib2fv; - PFNGLUNIFORMMATRIX2X4FVPROC UniformMatrix2x4fv; - PFNGLTEXSTORAGE1DPROC TexStorage1D; - PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate; - PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC DrawArraysInstancedBaseInstance; - PFNGLINVALIDATEFRAMEBUFFERPROC InvalidateFramebuffer; - PFNGLVERTEXATTRIBI2UIPROC VertexAttribI2ui; - PFNGLGETUNIFORMINDICESPROC GetUniformIndices; - PFNGLVERTEXATTRIBL1DPROC VertexAttribL1d; - PFNGLBINDFRAMEBUFFERPROC BindFramebuffer; - PFNGLVERTEXATTRIB2SPROC VertexAttrib2s; - PFNGLUNIFORMMATRIX4FVPROC UniformMatrix4fv; - PFNGLCOLORMASKIPROC ColorMaski; - PFNGLGETPROGRAMINFOLOGPROC GetProgramInfoLog; - PFNGLMULTIDRAWELEMENTSINDIRECTPROC MultiDrawElementsIndirect; - PFNGLUNIFORMMATRIX3X4DVPROC UniformMatrix3x4dv; - PFNGLGETOBJECTLABELPROC GetObjectLabel; - PFNGLBLENDEQUATIONIPROC BlendEquationi; - PFNGLUNIFORM3DVPROC Uniform3dv; - PFNGLGETINTERNALFORMATI64VPROC GetInternalformati64v; - PFNGLGETOBJECTPTRLABELPROC GetObjectPtrLabel; - PFNGLPROGRAMUNIFORM2IVPROC ProgramUniform2iv; - PFNGLGETINTEGERVPROC GetIntegerv; - PFNGLBLENDBARRIERPROC BlendBarrier; - PFNGLUNIFORM2FPROC Uniform2f; - PFNGLSCISSORPROC Scissor; - PFNGLGETATTRIBLOCATIONPROC GetAttribLocation; - PFNGLUNIFORM2IVPROC Uniform2iv; - PFNGLUNIFORM4FPROC Uniform4f; - PFNGLVERTEXATTRIBL2DVPROC VertexAttribL2dv; - PFNGLINVALIDATETEXSUBIMAGEPROC InvalidateTexSubImage; - PFNGLBINDVERTEXARRAYPROC BindVertexArray; - PFNGLCLIENTWAITSYNCPROC ClientWaitSync; - PFNGLGENFRAMEBUFFERSPROC GenFramebuffers; - PFNGLSCISSORARRAYVPROC ScissorArrayv; - PFNGLPROGRAMUNIFORM2IPROC ProgramUniform2i; - PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv; - PFNGLGETSYNCIVPROC GetSynciv; - PFNGLDRAWARRAYSINDIRECTPROC DrawArraysIndirect; - PFNGLVERTEXATTRIBLFORMATPROC VertexAttribLFormat; - PFNGLSAMPLERPARAMETERIIVPROC SamplerParameterIiv; - PFNGLVERTEXATTRIBI4USVPROC VertexAttribI4usv; - PFNGLPROGRAMUNIFORM3FPROC ProgramUniform3f; - PFNGLBUFFERDATAPROC BufferData; - PFNGLUNIFORM1FPROC Uniform1f; - PFNGLGETFRAGDATAINDEXPROC GetFragDataIndex; - PFNGLVERTEXATTRIBP4UIPROC VertexAttribP4ui; - PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC ProgramUniformMatrix4x3dv; - PFNGLISENABLEDPROC IsEnabled; - PFNGLVERTEXATTRIB4FVPROC VertexAttrib4fv; - PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer; - PFNGLPROGRAMUNIFORM4UIVPROC ProgramUniform4uiv; - PFNGLDEBUGMESSAGEINSERTPROC DebugMessageInsert; - PFNGLGENRENDERBUFFERSPROC GenRenderbuffers; - PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D; - PFNGLGETQUERYOBJECTUI64VPROC GetQueryObjectui64v; - PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv; - PFNGLVERTEXATTRIBI1UIPROC VertexAttribI1ui; - PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC ProgramUniformMatrix2x4dv; - PFNGLCOPYBUFFERSUBDATAPROC CopyBufferSubData; - PFNGLPAUSETRANSFORMFEEDBACKPROC PauseTransformFeedback; - PFNGLSTENCILFUNCSEPARATEPROC StencilFuncSeparate; - PFNGLGETTEXPARAMETERIUIVPROC GetTexParameterIuiv; - PFNGLTEXSUBIMAGE2DPROC TexSubImage2D; - PFNGLUNIFORM1IPROC Uniform1i; - PFNGLVERTEXATTRIBI4BVPROC VertexAttribI4bv; - PFNGLVERTEXATTRIBI4UIPROC VertexAttribI4ui; - PFNGLUNIFORMMATRIX3X4FVPROC UniformMatrix3x4fv; - PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv; PFNGLSAMPLECOVERAGEPROC SampleCoverage; - PFNGLUNIFORMMATRIX4X2FVPROC UniformMatrix4x2fv; - PFNGLGENBUFFERSPROC GenBuffers; - PFNGLENDQUERYINDEXEDPROC EndQueryIndexed; - PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D; - PFNGLTEXIMAGE2DMULTISAMPLEPROC TexImage2DMultisample; - PFNGLGETPROGRAMRESOURCEIVPROC GetProgramResourceiv; - PFNGLGETERRORPROC GetError; - PFNGLCOLORMASKPROC ColorMask; - PFNGLVERTEXATTRIBP3UIVPROC VertexAttribP3uiv; - PFNGLGETFRAGDATALOCATIONPROC GetFragDataLocation; - PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv; - PFNGLTEXPARAMETERFPROC TexParameterf; - PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC GetFramebufferAttachmentParameteriv; - PFNGLCLEARBUFFERIVPROC ClearBufferiv; - PFNGLGETUNIFORMFVPROC GetUniformfv; - PFNGLBLENDEQUATIONSEPARATEIPROC BlendEquationSeparatei; - PFNGLGETDEBUGMESSAGELOGPROC GetDebugMessageLog; - PFNGLCOPYTEXSUBIMAGE1DPROC CopyTexSubImage1D; - PFNGLVERTEXATTRIBI3UIVPROC VertexAttribI3uiv; - PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers; - PFNGLSAMPLERPARAMETERIVPROC SamplerParameteriv; - PFNGLGETPROGRAMRESOURCEINDEXPROC GetProgramResourceIndex; - PFNGLCOPYTEXIMAGE2DPROC CopyTexImage2D; - PFNGLVERTEXATTRIB3FVPROC VertexAttrib3fv; - PFNGLGETGRAPHICSRESETSTATUSPROC GetGraphicsResetStatus; - PFNGLTEXSUBIMAGE3DPROC TexSubImage3D; - PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC ProgramUniformMatrix3x4dv; - PFNGLGETSTRINGIPROC GetStringi; - PFNGLBINDIMAGETEXTUREPROC BindImageTexture; - PFNGLENDCONDITIONALRENDERPROC EndConditionalRender; - PFNGLVERTEXATTRIBL2DPROC VertexAttribL2d; - PFNGLDRAWBUFFERSPROC DrawBuffers; - PFNGLMEMORYBARRIERPROC MemoryBarrier; - PFNGLTEXPARAMETERIPROC TexParameteri; - PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC ProgramUniformMatrix4x2fv; - PFNGLDEPTHFUNCPROC DepthFunc; - PFNGLGETPROGRAMINTERFACEIVPROC GetProgramInterfaceiv; - PFNGLGETINTEGER64VPROC GetInteger64v; - PFNGLPOINTSIZEPROC PointSize; - PFNGLLINKPROGRAMPROC LinkProgram; - PFNGLFLUSHMAPPEDBUFFERRANGEPROC FlushMappedBufferRange; - PFNGLVERTEXATTRIBI2IPROC VertexAttribI2i; - PFNGLGETFLOATVPROC GetFloatv; - PFNGLVERTEXATTRIBI4IVPROC VertexAttribI4iv; - PFNGLINVALIDATEBUFFERSUBDATAPROC InvalidateBufferSubData; - PFNGLGETPROGRAMIVPROC GetProgramiv; - PFNGLDRAWELEMENTSINDIRECTPROC DrawElementsIndirect; - PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv; - PFNGLUNIFORM1DVPROC Uniform1dv; - PFNGLISQUERYPROC IsQuery; - PFNGLVERTEXATTRIBI3IVPROC VertexAttribI3iv; - PFNGLENDTRANSFORMFEEDBACKPROC EndTransformFeedback; - PFNGLDRAWELEMENTSPROC DrawElements; - PFNGLGETMULTISAMPLEFVPROC GetMultisamplefv; - PFNGLSAMPLERPARAMETERFVPROC SamplerParameterfv; - PFNGLVERTEXATTRIBBINDINGPROC VertexAttribBinding; - PFNGLVERTEXATTRIBP2UIPROC VertexAttribP2ui; - PFNGLUNIFORM4UIPROC Uniform4ui; - PFNGLGETSAMPLERPARAMETERIIVPROC GetSamplerParameterIiv; - PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC GetActiveSubroutineUniformiv; - PFNGLGETUNIFORMSUBROUTINEUIVPROC GetUniformSubroutineuiv; - PFNGLVERTEXATTRIBI4IPROC VertexAttribI4i; - PFNGLGETUNIFORMIVPROC GetUniformiv; - PFNGLSTENCILOPSEPARATEPROC StencilOpSeparate; - PFNGLDRAWELEMENTSBASEVERTEXPROC DrawElementsBaseVertex; - PFNGLVERTEXATTRIBL4DVPROC VertexAttribL4dv; - PFNGLBINDSAMPLERPROC BindSampler; - PFNGLGETTEXPARAMETERFVPROC GetTexParameterfv; - PFNGLPROGRAMUNIFORM3DPROC ProgramUniform3d; - PFNGLGETINTEGER64I_VPROC GetInteger64i_v; - PFNGLGETSUBROUTINEINDEXPROC GetSubroutineIndex; - PFNGLGETSAMPLERPARAMETERFVPROC GetSamplerParameterfv; - PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC ProgramUniformMatrix2x3dv; - PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC DrawElementsInstancedBaseInstance; - PFNGLTEXSTORAGE2DPROC TexStorage2D; - PFNGLPROGRAMUNIFORM3FVPROC ProgramUniform3fv; - PFNGLSAMPLEMASKIPROC SampleMaski; - PFNGLPATCHPARAMETERFVPROC PatchParameterfv; - PFNGLBINDBUFFERBASEPROC BindBufferBase; - PFNGLCLEARPROC Clear; - PFNGLGETACTIVESUBROUTINENAMEPROC GetActiveSubroutineName; - PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC DrawElementsInstancedBaseVertex; - PFNGLGENQUERIESPROC GenQueries; - PFNGLUNIFORMMATRIX3FVPROC UniformMatrix3fv; - PFNGLGETTEXPARAMETERIVPROC GetTexParameteriv; - PFNGLUNIFORMMATRIX2FVPROC UniformMatrix2fv; - PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv; - PFNGLPROVOKINGVERTEXPROC ProvokingVertex; - PFNGLVERTEXATTRIB3DPROC VertexAttrib3d; - PFNGLVERTEXATTRIBI1UIVPROC VertexAttribI1uiv; - PFNGLUNIFORM1UIVPROC Uniform1uiv; - PFNGLVERTEXATTRIB4NUBPROC VertexAttrib4Nub; - PFNGLSTENCILMASKSEPARATEPROC StencilMaskSeparate; - PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv; - PFNGLGETUNIFORMDVPROC GetUniformdv; - PFNGLCLAMPCOLORPROC ClampColor; - PFNGLISTRANSFORMFEEDBACKPROC IsTransformFeedback; - PFNGLGETFRAMEBUFFERPARAMETERIVPROC GetFramebufferParameteriv; - PFNGLPROGRAMUNIFORM1UIVPROC ProgramUniform1uiv; - PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv; - PFNGLISRENDERBUFFERPROC IsRenderbuffer; - PFNGLINVALIDATESUBFRAMEBUFFERPROC InvalidateSubFramebuffer; - PFNGLUNIFORM1IVPROC Uniform1iv; - PFNGLUNIFORM3FVPROC Uniform3fv; - PFNGLVERTEXATTRIBDIVISORPROC VertexAttribDivisor; + PFNGLVERTEXATTRIB2SPROC VertexAttrib2s; + PFNGLDELETEQUERIESPROC DeleteQueries; + PFNGLGETPROGRAMSTAGEIVPROC GetProgramStageiv; PFNGLCLEARCOLORPROC ClearColor; - PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays; - PFNGLPROGRAMUNIFORM2DVPROC ProgramUniform2dv; - PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv; - PFNGLUNIFORM4DPROC Uniform4d; - PFNGLGETTEXIMAGEPROC GetTexImage; - PFNGLCOPYTEXIMAGE1DPROC CopyTexImage1D; - PFNGLOBJECTLABELPROC ObjectLabel; - PFNGLTEXBUFFERRANGEPROC TexBufferRange; + PFNGLGETVERTEXATTRIBDVPROC GetVertexAttribdv; + PFNGLGETQUERYINDEXEDIVPROC GetQueryIndexediv; + PFNGLVERTEXATTRIB3DPROC VertexAttrib3d; + PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC DrawArraysInstancedBaseInstance; + PFNGLVERTEXATTRIBI2IPROC VertexAttribI2i; + PFNGLUNIFORMMATRIX3X4FVPROC UniformMatrix3x4fv; + PFNGLENABLEIPROC Enablei; + PFNGLSTENCILFUNCPROC StencilFunc; + PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv; + PFNGLVERTEXATTRIB2FPROC VertexAttrib2f; + PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv; + PFNGLGENTEXTURESPROC GenTextures; + PFNGLGETUNIFORMIVPROC GetUniformiv; PFNGLDEBUGMESSAGECONTROLPROC DebugMessageControl; - PFNGLPROGRAMUNIFORM4FVPROC ProgramUniform4fv; - PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate; - PFNGLVALIDATEPROGRAMPIPELINEPROC ValidateProgramPipeline; - PFNGLVERTEXATTRIBP1UIPROC VertexAttribP1ui; - PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus; PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC ProgramUniformMatrix2x4fv; - PFNGLSAMPLERPARAMETERFPROC SamplerParameterf; - PFNGLBINDVERTEXBUFFERPROC BindVertexBuffer; - PFNGLGETBUFFERPOINTERVPROC GetBufferPointerv; - PFNGLVALIDATEPROGRAMPROC ValidateProgram; - PFNGLTEXSTORAGE3DMULTISAMPLEPROC TexStorage3DMultisample; - PFNGLRESUMETRANSFORMFEEDBACKPROC ResumeTransformFeedback; - PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC ProgramUniformMatrix3x2fv; - PFNGLCLEARDEPTHPROC ClearDepth; - PFNGLVERTEXATTRIBI2UIVPROC VertexAttribI2uiv; - PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC GetSubroutineUniformLocation; - PFNGLLINEWIDTHPROC LineWidth; - PFNGLVERTEXATTRIB1SPROC VertexAttrib1s; - PFNGLPOINTPARAMETERFPROC PointParameterf; - PFNGLDELETETEXTURESPROC DeleteTextures; - PFNGLVERTEXATTRIBI4UBVPROC VertexAttribI4ubv; - PFNGLENABLEPROC Enable; - PFNGLUNIFORMMATRIX2X4DVPROC UniformMatrix2x4dv; - PFNGLVERTEXATTRIB4FPROC VertexAttrib4f; - PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv; - PFNGLPROGRAMUNIFORMMATRIX2DVPROC ProgramUniformMatrix2dv; - PFNGLMAPBUFFERRANGEPROC MapBufferRange; - PFNGLGETSAMPLERPARAMETERIUIVPROC GetSamplerParameterIuiv; - PFNGLDELETETRANSFORMFEEDBACKSPROC DeleteTransformFeedbacks; + PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC GetFramebufferAttachmentParameteriv; + PFNGLREADNPIXELSPROC ReadnPixels; + PFNGLGETFLOATVPROC GetFloatv; + PFNGLUNIFORMMATRIX4X3DVPROC UniformMatrix4x3dv; + PFNGLUNIFORM2DPROC Uniform2d; + PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays; + PFNGLCLEARBUFFERFVPROC ClearBufferfv; + PFNGLUSEPROGRAMSTAGESPROC UseProgramStages; + PFNGLPROGRAMUNIFORM3DPROC ProgramUniform3d; + PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv; + PFNGLUNIFORMMATRIX2X3FVPROC UniformMatrix2x3fv; + PFNGLISQUERYPROC IsQuery; + PFNGLGETOBJECTPTRLABELPROC GetObjectPtrLabel; + PFNGLLOGICOPPROC LogicOp; + PFNGLENDQUERYPROC EndQuery; + PFNGLPROGRAMBINARYPROC ProgramBinary; + PFNGLISENABLEDIPROC IsEnabledi; + PFNGLPRIMITIVERESTARTINDEXPROC PrimitiveRestartIndex; + PFNGLVERTEXATTRIBI1IPROC VertexAttribI1i; + PFNGLGETBUFFERPARAMETERI64VPROC GetBufferParameteri64v; PFNGLUNIFORMMATRIX3DVPROC UniformMatrix3dv; - PFNGLPROGRAMUNIFORMMATRIX2FVPROC ProgramUniformMatrix2fv; - PFNGLGETPROGRAMRESOURCENAMEPROC GetProgramResourceName; - PFNGLGETVERTEXATTRIBIIVPROC GetVertexAttribIiv; - PFNGLMULTIDRAWELEMENTSPROC MultiDrawElements; - PFNGLFLUSHPROC Flush; - PFNGLVERTEXATTRIB1FPROC VertexAttrib1f; - PFNGLVERTEXATTRIBPOINTERPROC VertexAttribPointer; - PFNGLCOMPILESHADERPROC CompileShader; - PFNGLPROGRAMUNIFORM2UIPROC ProgramUniform2ui; - PFNGLTEXIMAGE3DMULTISAMPLEPROC TexImage3DMultisample; - PFNGLSCISSORINDEXEDVPROC ScissorIndexedv; - PFNGLBLENDFUNCSEPARATEIPROC BlendFuncSeparatei; - PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D; - PFNGLGETATTACHEDSHADERSPROC GetAttachedShaders; - PFNGLCOPYIMAGESUBDATAPROC CopyImageSubData; - PFNGLDELETEBUFFERSPROC DeleteBuffers; + PFNGLBLENDEQUATIONIPROC BlendEquationi; PFNGLUNIFORM1UIPROC Uniform1ui; - PFNGLCLEARBUFFERUIVPROC ClearBufferuiv; - PFNGLDISPATCHCOMPUTEINDIRECTPROC DispatchComputeIndirect; - PFNGLFRAMEBUFFERTEXTUREPROC FramebufferTexture; - PFNGLGETDOUBLEVPROC GetDoublev; - PFNGLDISABLEVERTEXATTRIBARRAYPROC DisableVertexAttribArray; - PFNGLVIEWPORTINDEXEDFPROC ViewportIndexedf; - PFNGLUNIFORM3DPROC Uniform3d; - PFNGLMINSAMPLESHADINGPROC MinSampleShading; - PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv; - PFNGLGETPOINTERVPROC GetPointerv; - PFNGLUNIFORM1DPROC Uniform1d; - PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC ProgramUniformMatrix3x2dv; - PFNGLGETINTERNALFORMATIVPROC GetInternalformativ; - PFNGLUNIFORMMATRIX3X2DVPROC UniformMatrix3x2dv; - PFNGLPOLYGONMODEPROC PolygonMode; + PFNGLPOINTSIZEPROC PointSize; + PFNGLBINDIMAGETEXTUREPROC BindImageTexture; + PFNGLBINDFRAMEBUFFERPROC BindFramebuffer; + PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv; PFNGLUSEPROGRAMPROC UseProgram; + PFNGLBEGINTRANSFORMFEEDBACKPROC BeginTransformFeedback; + PFNGLGENERATEMIPMAPPROC GenerateMipmap; + PFNGLGETUNIFORMSUBROUTINEUIVPROC GetUniformSubroutineuiv; + PFNGLPROGRAMUNIFORM4IPROC ProgramUniform4i; + PFNGLBINDBUFFERBASEPROC BindBufferBase; + PFNGLTEXSTORAGE3DPROC TexStorage3D; + PFNGLUNIFORM3DPROC Uniform3d; + PFNGLFRAMEBUFFERPARAMETERIPROC FramebufferParameteri; + PFNGLGETPROGRAMRESOURCEINDEXPROC GetProgramResourceIndex; PFNGLBINDATTRIBLOCATIONPROC BindAttribLocation; + PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC GetActiveUniformBlockName; + PFNGLBINDVERTEXARRAYPROC BindVertexArray; + PFNGLVERTEXATTRIBBINDINGPROC VertexAttribBinding; + PFNGLGETPROGRAMBINARYPROC GetProgramBinary; + PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC ProgramUniformMatrix3x4dv; + PFNGLPROGRAMUNIFORM3FVPROC ProgramUniform3fv; + PFNGLDEPTHMASKPROC DepthMask; + PFNGLPIXELSTOREIPROC PixelStorei; + PFNGLTEXSUBIMAGE3DPROC TexSubImage3D; + PFNGLFENCESYNCPROC FenceSync; + PFNGLPROGRAMUNIFORM1UIPROC ProgramUniform1ui; + PFNGLPROGRAMUNIFORM2FPROC ProgramUniform2f; + PFNGLPROGRAMUNIFORMMATRIX2FVPROC ProgramUniformMatrix2fv; + PFNGLISENABLEDPROC IsEnabled; + PFNGLGENTRANSFORMFEEDBACKSPROC GenTransformFeedbacks; + PFNGLGETBOOLEANVPROC GetBooleanv; + PFNGLPROGRAMUNIFORM2IVPROC ProgramUniform2iv; + PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv; + PFNGLGETVERTEXATTRIBIVPROC GetVertexAttribiv; + PFNGLUNIFORM2UIPROC Uniform2ui; + PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC ProgramUniformMatrix4x3fv; + PFNGLUNIFORMMATRIX3X2DVPROC UniformMatrix3x2dv; + PFNGLLINEWIDTHPROC LineWidth; + PFNGLGETTEXPARAMETERIVPROC GetTexParameteriv; + PFNGLPROGRAMUNIFORM2UIPROC ProgramUniform2ui; + PFNGLUNIFORM4FPROC Uniform4f; + PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC MultiDrawElementsBaseVertex; + PFNGLACTIVETEXTUREPROC ActiveTexture; + PFNGLINVALIDATETEXIMAGEPROC InvalidateTexImage; + PFNGLVERTEXATTRIBL4DPROC VertexAttribL4d; + PFNGLMAPBUFFERPROC MapBuffer; + PFNGLMULTIDRAWELEMENTSINDIRECTPROC MultiDrawElementsIndirect; + PFNGLDRAWARRAYSINDIRECTPROC DrawArraysIndirect; + PFNGLCOPYTEXSUBIMAGE3DPROC CopyTexSubImage3D; + PFNGLGETVERTEXATTRIBFVPROC GetVertexAttribfv; + PFNGLPROGRAMUNIFORMMATRIX2DVPROC ProgramUniformMatrix2dv; + PFNGLGETERRORPROC GetError; + PFNGLDELETESAMPLERSPROC DeleteSamplers; + PFNGLCOPYIMAGESUBDATAPROC CopyImageSubData; + PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers; + PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC GetActiveAtomicCounterBufferiv; + PFNGLVERTEXATTRIBL1DPROC VertexAttribL1d; + PFNGLVERTEXATTRIBI3UIPROC VertexAttribI3ui; + PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer; + PFNGLCOLORMASKIPROC ColorMaski; + PFNGLUNIFORM2DVPROC Uniform2dv; + PFNGLISSAMPLERPROC IsSampler; + PFNGLBINDVERTEXBUFFERPROC BindVertexBuffer; + PFNGLGETSAMPLERPARAMETERIVPROC GetSamplerParameteriv; + PFNGLUNIFORM3DVPROC Uniform3dv; + PFNGLISTEXTUREPROC IsTexture; + PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv; + PFNGLDELETESYNCPROC DeleteSync; + PFNGLINVALIDATEBUFFERSUBDATAPROC InvalidateBufferSubData; + PFNGLMULTIDRAWARRAYSINDIRECTPROC MultiDrawArraysIndirect; + PFNGLVALIDATEPROGRAMPROC ValidateProgram; + PFNGLVERTEXATTRIBL2DVPROC VertexAttribL2dv; + PFNGLVERTEXATTRIB3FVPROC VertexAttrib3fv; + PFNGLGETPOINTERVPROC GetPointerv; + PFNGLGENBUFFERSPROC GenBuffers; + PFNGLISBUFFERPROC IsBuffer; + PFNGLPROGRAMUNIFORM2DPROC ProgramUniform2d; + PFNGLISSHADERPROC IsShader; + PFNGLBINDSAMPLERPROC BindSampler; + PFNGLDELETETRANSFORMFEEDBACKSPROC DeleteTransformFeedbacks; + PFNGLPROGRAMUNIFORM1IVPROC ProgramUniform1iv; + PFNGLUNIFORMMATRIX2X3DVPROC UniformMatrix2x3dv; + PFNGLUNIFORM3IVPROC Uniform3iv; + PFNGLGETTEXIMAGEPROC GetTexImage; + PFNGLINVALIDATEBUFFERDATAPROC InvalidateBufferData; + PFNGLGETTEXPARAMETERFVPROC GetTexParameterfv; + PFNGLVERTEXATTRIBI3IPROC VertexAttribI3i; + PFNGLDRAWARRAYSPROC DrawArrays; + PFNGLINVALIDATETEXSUBIMAGEPROC InvalidateTexSubImage; + PFNGLPUSHDEBUGGROUPPROC PushDebugGroup; + PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers; + PFNGLSTENCILFUNCSEPARATEPROC StencilFuncSeparate; + PFNGLUNIFORM1UIVPROC Uniform1uiv; + PFNGLGETPROGRAMINTERFACEIVPROC GetProgramInterfaceiv; + PFNGLGENSAMPLERSPROC GenSamplers; + PFNGLBEGINQUERYINDEXEDPROC BeginQueryIndexed; + PFNGLTEXSUBIMAGE2DPROC TexSubImage2D; + PFNGLPRIMITIVEBOUNDINGBOXPROC PrimitiveBoundingBox; + PFNGLSTENCILOPPROC StencilOp; + PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC ProgramUniformMatrix4x2dv; + PFNGLBINDRENDERBUFFERPROC BindRenderbuffer; + PFNGLENABLEVERTEXATTRIBARRAYPROC EnableVertexAttribArray; + PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC DrawTransformFeedbackStreamInstanced; + PFNGLPROGRAMUNIFORM1FPROC ProgramUniform1f; + PFNGLGETFRAGDATAINDEXPROC GetFragDataIndex; + PFNGLGETINTEGERI_VPROC GetIntegeri_v; + PFNGLBINDBUFFERPROC BindBuffer; + PFNGLVERTEXATTRIBLPOINTERPROC VertexAttribLPointer; + PFNGLPOINTPARAMETERIVPROC PointParameteriv; + PFNGLGENRENDERBUFFERSPROC GenRenderbuffers; + PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D; + PFNGLDRAWBUFFERSPROC DrawBuffers; + PFNGLCLIENTWAITSYNCPROC ClientWaitSync; + PFNGLMINSAMPLESHADINGPROC MinSampleShading; + PFNGLFLUSHPROC Flush; + PFNGLISSYNCPROC IsSync; + PFNGLGETACTIVEUNIFORMNAMEPROC GetActiveUniformName; + PFNGLCREATESHADERPROGRAMVPROC CreateShaderProgramv; + PFNGLDISABLEIPROC Disablei; + PFNGLUNIFORMMATRIX3X4DVPROC UniformMatrix3x4dv; + PFNGLPROGRAMUNIFORM2UIVPROC ProgramUniform2uiv; + PFNGLGETINTERNALFORMATIVPROC GetInternalformativ; + PFNGLUNIFORM1IPROC Uniform1i; + PFNGLUNIFORM4IVPROC Uniform4iv; + PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D; + PFNGLFRONTFACEPROC FrontFace; + PFNGLTEXBUFFERPROC TexBuffer; + PFNGLGETNUNIFORMUIVPROC GetnUniformuiv; + PFNGLCREATEPROGRAMPROC CreateProgram; + PFNGLGETACTIVESUBROUTINENAMEPROC GetActiveSubroutineName; + PFNGLVERTEXATTRIBI4USVPROC VertexAttribI4usv; + PFNGLGETBUFFERSUBDATAPROC GetBufferSubData; + PFNGLCREATESHADERPROC CreateShader; + PFNGLGETOBJECTLABELPROC GetObjectLabel; + PFNGLATTACHSHADERPROC AttachShader; + PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv; + PFNGLVERTEXATTRIBL2DPROC VertexAttribL2d; + PFNGLCLEARBUFFERUIVPROC ClearBufferuiv; + PFNGLTEXSTORAGE2DMULTISAMPLEPROC TexStorage2DMultisample; + PFNGLACTIVESHADERPROGRAMPROC ActiveShaderProgram; + PFNGLSAMPLERPARAMETERIUIVPROC SamplerParameterIuiv; + PFNGLVERTEXATTRIB1SPROC VertexAttrib1s; + PFNGLPATCHPARAMETERFVPROC PatchParameterfv; + PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC DrawTransformFeedbackInstanced; + PFNGLUNIFORM3UIPROC Uniform3ui; + PFNGLUNIFORM4DPROC Uniform4d; + PFNGLUNIFORM4FVPROC Uniform4fv; + PFNGLDISPATCHCOMPUTEPROC DispatchCompute; + PFNGLWAITSYNCPROC WaitSync; + PFNGLVERTEXATTRIBI2UIPROC VertexAttribI2ui; + PFNGLVERTEXATTRIB3SPROC VertexAttrib3s; + PFNGLBLENDBARRIERPROC BlendBarrier; + PFNGLPOLYGONOFFSETPROC PolygonOffset; + PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D; + PFNGLENDCONDITIONALRENDERPROC EndConditionalRender; + PFNGLGETUNIFORMUIVPROC GetUniformuiv; + PFNGLPROGRAMUNIFORMMATRIX3FVPROC ProgramUniformMatrix3fv; + PFNGLUNIFORMMATRIX3FVPROC UniformMatrix3fv; + PFNGLVERTEXATTRIBI4IVPROC VertexAttribI4iv; + PFNGLGETSTRINGPROC GetString; + PFNGLCLEARDEPTHFPROC ClearDepthf; + PFNGLISRENDERBUFFERPROC IsRenderbuffer; + PFNGLPOINTPARAMETERFVPROC PointParameterfv; + PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC DrawTransformFeedbackStream; + PFNGLVERTEXATTRIBI3UIVPROC VertexAttribI3uiv; + PFNGLBLENDCOLORPROC BlendColor; + PFNGLDEBUGMESSAGEINSERTPROC DebugMessageInsert; + PFNGLVERTEXATTRIBLFORMATPROC VertexAttribLFormat; + PFNGLPROGRAMUNIFORM4IVPROC ProgramUniform4iv; + PFNGLGETSAMPLERPARAMETERIUIVPROC GetSamplerParameterIuiv; + PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv; + PFNGLTEXSTORAGE3DMULTISAMPLEPROC TexStorage3DMultisample; + PFNGLUNIFORM1FPROC Uniform1f; + PFNGLVERTEXATTRIBP1UIPROC VertexAttribP1ui; + PFNGLSTENCILMASKSEPARATEPROC StencilMaskSeparate; + PFNGLPROGRAMUNIFORM1UIVPROC ProgramUniform1uiv; + PFNGLTEXIMAGE3DMULTISAMPLEPROC TexImage3DMultisample; + PFNGLGETSHADERINFOLOGPROC GetShaderInfoLog; + PFNGLPROVOKINGVERTEXPROC ProvokingVertex; + PFNGLUNIFORM2IPROC Uniform2i; + PFNGLUNIFORMMATRIX2DVPROC UniformMatrix2dv; + PFNGLUNIFORM3FVPROC Uniform3fv; + PFNGLGETSUBROUTINEINDEXPROC GetSubroutineIndex; + PFNGLGENPROGRAMPIPELINESPROC GenProgramPipelines; + PFNGLPROGRAMUNIFORM3UIPROC ProgramUniform3ui; + PFNGLUNIFORMBLOCKBINDINGPROC UniformBlockBinding; + PFNGLGETDOUBLEVPROC GetDoublev; + PFNGLDELETEPROGRAMPIPELINESPROC DeleteProgramPipelines; + PFNGLCLEARBUFFERFIPROC ClearBufferfi; + PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer; + PFNGLBEGINQUERYPROC BeginQuery; + PFNGLCOPYBUFFERSUBDATAPROC CopyBufferSubData; + PFNGLBLENDEQUATIONPROC BlendEquation; + PFNGLOBJECTLABELPROC ObjectLabel; + PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample; + PFNGLGETUNIFORMDVPROC GetUniformdv; + PFNGLPROGRAMUNIFORM2FVPROC ProgramUniform2fv; + PFNGLGETTRANSFORMFEEDBACKVARYINGPROC GetTransformFeedbackVarying; + PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC GetActiveSubroutineUniformName; + PFNGLBLENDFUNCIPROC BlendFunci; + PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC DrawElementsInstancedBaseInstance; + PFNGLUNIFORMMATRIX2FVPROC UniformMatrix2fv; + PFNGLGETSHADERPRECISIONFORMATPROC GetShaderPrecisionFormat; + PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv; + PFNGLBLENDFUNCSEPARATEIPROC BlendFuncSeparatei; + PFNGLBINDTEXTUREPROC BindTexture; + PFNGLINVALIDATESUBFRAMEBUFFERPROC InvalidateSubFramebuffer; + PFNGLPROGRAMUNIFORMMATRIX4FVPROC ProgramUniformMatrix4fv; + PFNGLSHADERSTORAGEBLOCKBINDINGPROC ShaderStorageBlockBinding; + PFNGLUNMAPBUFFERPROC UnmapBuffer; + PFNGLPROGRAMUNIFORM4FVPROC ProgramUniform4fv; + PFNGLBEGINCONDITIONALRENDERPROC BeginConditionalRender; + PFNGLVIEWPORTPROC Viewport; + PFNGLTEXPARAMETERIPROC TexParameteri; + PFNGLPATCHPARAMETERIPROC PatchParameteri; + PFNGLVERTEXATTRIBI4SVPROC VertexAttribI4sv; + PFNGLMEMORYBARRIERPROC MemoryBarrier; + PFNGLPROGRAMUNIFORM3UIVPROC ProgramUniform3uiv; + PFNGLVERTEXATTRIBI1IVPROC VertexAttribI1iv; + PFNGLVERTEXATTRIB2FVPROC VertexAttrib2fv; + PFNGLVERTEXATTRIBIPOINTERPROC VertexAttribIPointer; + PFNGLDRAWELEMENTSBASEVERTEXPROC DrawElementsBaseVertex; + PFNGLPROGRAMUNIFORM4UIPROC ProgramUniform4ui; + PFNGLVERTEXATTRIBP1UIVPROC VertexAttribP1uiv; + PFNGLPROGRAMUNIFORMMATRIX3DVPROC ProgramUniformMatrix3dv; + PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D; + PFNGLCLEARBUFFERDATAPROC ClearBufferData; + PFNGLDRAWELEMENTSINSTANCEDPROC DrawElementsInstanced; + PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC ProgramUniformMatrix2x4dv; + PFNGLSCISSORARRAYVPROC ScissorArrayv; + PFNGLPAUSETRANSFORMFEEDBACKPROC PauseTransformFeedback; + PFNGLDRAWARRAYSINSTANCEDPROC DrawArraysInstanced; + PFNGLREADPIXELSPROC ReadPixels; + PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC GetActiveSubroutineUniformiv; + PFNGLVERTEXATTRIBP2UIVPROC VertexAttribP2uiv; + PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC ProgramUniformMatrix2x3dv; + PFNGLBLENDFUNCPROC BlendFunc; + PFNGLGETVERTEXATTRIBPOINTERVPROC GetVertexAttribPointerv; + PFNGLGETGRAPHICSRESETSTATUSPROC GetGraphicsResetStatus; + PFNGLTRANSFORMFEEDBACKVARYINGSPROC TransformFeedbackVaryings; + PFNGLGETBUFFERPARAMETERIVPROC GetBufferParameteriv; + PFNGLVERTEXATTRIBI4BVPROC VertexAttribI4bv; + PFNGLDEPTHFUNCPROC DepthFunc; + PFNGLUNIFORM3FPROC Uniform3f; + PFNGLISTRANSFORMFEEDBACKPROC IsTransformFeedback; + PFNGLGETATTRIBLOCATIONPROC GetAttribLocation; + PFNGLGETINTEGERVPROC GetIntegerv; + PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate; + PFNGLCOPYTEXSUBIMAGE1DPROC CopyTexSubImage1D; + PFNGLGETQUERYOBJECTI64VPROC GetQueryObjecti64v; + PFNGLGETPROGRAMRESOURCELOCATIONPROC GetProgramResourceLocation; + PFNGLGETNUNIFORMIVPROC GetnUniformiv; + PFNGLDELETEBUFFERSPROC DeleteBuffers; + PFNGLVERTEXATTRIBP4UIVPROC VertexAttribP4uiv; + PFNGLGETSTRINGIPROC GetStringi; + PFNGLTEXTUREVIEWPROC TextureView; + PFNGLVIEWPORTINDEXEDFPROC ViewportIndexedf; + PFNGLGENQUERIESPROC GenQueries; + PFNGLDEPTHRANGEPROC DepthRange; + PFNGLRESUMETRANSFORMFEEDBACKPROC ResumeTransformFeedback; + PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D; + PFNGLVERTEXATTRIB4DPROC VertexAttrib4d; + PFNGLGETUNIFORMLOCATIONPROC GetUniformLocation; + PFNGLVERTEXATTRIBP2UIPROC VertexAttribP2ui; + PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv; + PFNGLUNIFORM1IVPROC Uniform1iv; + PFNGLDEBUGMESSAGECALLBACKPROC DebugMessageCallback; + PFNGLVERTEXATTRIB1FVPROC VertexAttrib1fv; + PFNGLUNIFORMMATRIX3X2FVPROC UniformMatrix3x2fv; + PFNGLDEPTHRANGEFPROC DepthRangef; + PFNGLPROGRAMUNIFORM3FPROC ProgramUniform3f; + PFNGLUNIFORMMATRIX4FVPROC UniformMatrix4fv; + PFNGLDISABLEVERTEXATTRIBARRAYPROC DisableVertexAttribArray; + PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D; + PFNGLUNIFORMMATRIX4DVPROC UniformMatrix4dv; + PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC GetSubroutineUniformLocation; + PFNGLUNIFORM4UIPROC Uniform4ui; + PFNGLMAPBUFFERRANGEPROC MapBufferRange; + PFNGLGETPROGRAMRESOURCENAMEPROC GetProgramResourceName; + PFNGLDELETESHADERPROC DeleteShader; + PFNGLVERTEXATTRIB4FPROC VertexAttrib4f; + PFNGLGETUNIFORMBLOCKINDEXPROC GetUniformBlockIndex; + PFNGLBINDTRANSFORMFEEDBACKPROC BindTransformFeedback; + PFNGLCULLFACEPROC CullFace; + PFNGLDEPTHRANGEINDEXEDPROC DepthRangeIndexed; + PFNGLGENFRAMEBUFFERSPROC GenFramebuffers; PFNGLVERTEXATTRIBP3UIPROC VertexAttribP3ui; + PFNGLHINTPROC Hint; + PFNGLUNIFORM4IPROC Uniform4i; + PFNGLGETACTIVEUNIFORMSIVPROC GetActiveUniformsiv; PFNGLPROGRAMUNIFORM3IPROC ProgramUniform3i; - PFNGLUNIFORMMATRIX4X2DVPROC UniformMatrix4x2dv; + PFNGLGETACTIVEUNIFORMBLOCKIVPROC GetActiveUniformBlockiv; + PFNGLGETMULTISAMPLEFVPROC GetMultisamplefv; + PFNGLCOMPILESHADERPROC CompileShader; + PFNGLTEXIMAGE2DMULTISAMPLEPROC TexImage2DMultisample; + PFNGLCLEARDEPTHPROC ClearDepth; + PFNGLGETUNIFORMINDICESPROC GetUniformIndices; + PFNGLGETSYNCIVPROC GetSynciv; + PFNGLVERTEXATTRIBI2IVPROC VertexAttribI2iv; + PFNGLSHADERSOURCEPROC ShaderSource; + PFNGLPOPDEBUGGROUPPROC PopDebugGroup; + PFNGLTEXIMAGE2DPROC TexImage2D; + PFNGLCOPYTEXIMAGE2DPROC CopyTexImage2D; + PFNGLGETPROGRAMIVPROC GetProgramiv; + PFNGLCLEARPROC Clear; + PFNGLPIXELSTOREFPROC PixelStoref; + PFNGLFRAMEBUFFERTEXTUREPROC FramebufferTexture; + PFNGLVERTEXATTRIB1FPROC VertexAttrib1f; + PFNGLBINDFRAGDATALOCATIONINDEXEDPROC BindFragDataLocationIndexed; + PFNGLCLEARSTENCILPROC ClearStencil; + PFNGLSCISSORPROC Scissor; + PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv; + PFNGLPROGRAMPARAMETERIPROC ProgramParameteri; + PFNGLTEXPARAMETERFVPROC TexParameterfv; + PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv; + PFNGLPROGRAMUNIFORM4DPROC ProgramUniform4d; + PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv; + PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D; + PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv; + PFNGLCLEARBUFFERSUBDATAPROC ClearBufferSubData; + PFNGLVERTEXATTRIBP4UIPROC VertexAttribP4ui; + PFNGLVERTEXATTRIB4FVPROC VertexAttrib4fv; + PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv; + PFNGLSTENCILMASKPROC StencilMask; + PFNGLUNIFORM2FVPROC Uniform2fv; + PFNGLVERTEXATTRIBI1UIPROC VertexAttribI1ui; + PFNGLVERTEXATTRIBDIVISORPROC VertexAttribDivisor; + PFNGLUNIFORM2FPROC Uniform2f; + PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC ProgramUniformMatrix2x3fv; + PFNGLBLENDEQUATIONSEPARATEIPROC BlendEquationSeparatei; + PFNGLVIEWPORTARRAYVPROC ViewportArrayv; + PFNGLGETVERTEXATTRIBIUIVPROC GetVertexAttribIuiv; + PFNGLVALIDATEPROGRAMPIPELINEPROC ValidateProgramPipeline; + PFNGLGETTEXPARAMETERIUIVPROC GetTexParameterIuiv; + PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC ProgramUniformMatrix3x2fv; + PFNGLVERTEXATTRIB4NUBPROC VertexAttrib4Nub; + PFNGLUNIFORM3UIVPROC Uniform3uiv; + PFNGLGETINTERNALFORMATI64VPROC GetInternalformati64v; + PFNGLPROGRAMUNIFORM3IVPROC ProgramUniform3iv; + PFNGLVERTEXATTRIBI4UIVPROC VertexAttribI4uiv; + PFNGLBINDPROGRAMPIPELINEPROC BindProgramPipeline; + PFNGLPOINTPARAMETERFPROC PointParameterf; + PFNGLBUFFERSUBDATAPROC BufferSubData; + PFNGLPROGRAMUNIFORM4DVPROC ProgramUniform4dv; + PFNGLCOLORMASKPROC ColorMask; + PFNGLISPROGRAMPROC IsProgram; + PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv; + PFNGLVERTEXATTRIBI3IVPROC VertexAttribI3iv; + PFNGLBUFFERDATAPROC BufferData; + PFNGLUNIFORMSUBROUTINESUIVPROC UniformSubroutinesuiv; + PFNGLGETDOUBLEI_VPROC GetDoublei_v; + PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv; + PFNGLPROGRAMUNIFORM1DPROC ProgramUniform1d; + PFNGLGETACTIVEUNIFORMPROC GetActiveUniform; + PFNGLSAMPLEMASKIPROC SampleMaski; + PFNGLDELETEPROGRAMPROC DeleteProgram; + PFNGLGETSAMPLERPARAMETERFVPROC GetSamplerParameterfv; + PFNGLTEXSTORAGE1DPROC TexStorage1D; + PFNGLGETBOOLEANI_VPROC GetBooleani_v; } mg_gl_api; -extern mp_thread_local mg_gl_api* __mgGLAPI; +MP_API mg_gl_api* mg_gl_get_api(void); -#define glVertexAttribP1uiv __mgGLAPI->VertexAttribP1uiv -#define glGetActiveUniformBlockName __mgGLAPI->GetActiveUniformBlockName -#define glQueryCounter __mgGLAPI->QueryCounter -#define glProgramUniformMatrix3x4fv __mgGLAPI->ProgramUniformMatrix3x4fv -#define glFrontFace __mgGLAPI->FrontFace -#define glUniform4uiv __mgGLAPI->Uniform4uiv -#define glVertexAttribFormat __mgGLAPI->VertexAttribFormat -#define glGenTransformFeedbacks __mgGLAPI->GenTransformFeedbacks -#define glGetVertexAttribLdv __mgGLAPI->GetVertexAttribLdv -#define glCullFace __mgGLAPI->CullFace -#define glBufferSubData __mgGLAPI->BufferSubData -#define glRenderbufferStorageMultisample __mgGLAPI->RenderbufferStorageMultisample -#define glFinish __mgGLAPI->Finish -#define glGetVertexAttribIuiv __mgGLAPI->GetVertexAttribIuiv -#define glGetTransformFeedbackVarying __mgGLAPI->GetTransformFeedbackVarying -#define glBindRenderbuffer __mgGLAPI->BindRenderbuffer -#define glFramebufferRenderbuffer __mgGLAPI->FramebufferRenderbuffer -#define glGetCompressedTexImage __mgGLAPI->GetCompressedTexImage -#define glLogicOp __mgGLAPI->LogicOp -#define glVertexAttrib4d __mgGLAPI->VertexAttrib4d -#define glDeleteSamplers __mgGLAPI->DeleteSamplers -#define glSamplerParameteri __mgGLAPI->SamplerParameteri -#define glViewportArrayv __mgGLAPI->ViewportArrayv -#define glDisable __mgGLAPI->Disable -#define glUniform3f __mgGLAPI->Uniform3f -#define glObjectPtrLabel __mgGLAPI->ObjectPtrLabel -#define glVertexAttribI3i __mgGLAPI->VertexAttribI3i -#define glMapBuffer __mgGLAPI->MapBuffer -#define glGetBufferParameteriv __mgGLAPI->GetBufferParameteriv -#define glDeleteSync __mgGLAPI->DeleteSync -#define glProgramUniform1d __mgGLAPI->ProgramUniform1d -#define glVertexAttribL1dv __mgGLAPI->VertexAttribL1dv -#define glFramebufferTexture3D __mgGLAPI->FramebufferTexture3D -#define glVertexAttrib1fv __mgGLAPI->VertexAttrib1fv -#define glVertexAttrib4Niv __mgGLAPI->VertexAttrib4Niv -#define glPrimitiveRestartIndex __mgGLAPI->PrimitiveRestartIndex -#define glEnableVertexAttribArray __mgGLAPI->EnableVertexAttribArray -#define glPatchParameteri __mgGLAPI->PatchParameteri -#define glVertexAttribI4uiv __mgGLAPI->VertexAttribI4uiv -#define glGetActiveAtomicCounterBufferiv __mgGLAPI->GetActiveAtomicCounterBufferiv -#define glProgramUniform4ui __mgGLAPI->ProgramUniform4ui -#define glCompressedTexImage2D __mgGLAPI->CompressedTexImage2D -#define glProgramBinary __mgGLAPI->ProgramBinary -#define glPushDebugGroup __mgGLAPI->PushDebugGroup -#define glBindFragDataLocationIndexed __mgGLAPI->BindFragDataLocationIndexed -#define glGetShaderSource __mgGLAPI->GetShaderSource -#define glEnablei __mgGLAPI->Enablei -#define glGetnUniformuiv __mgGLAPI->GetnUniformuiv -#define glUniform3i __mgGLAPI->Uniform3i -#define glIsProgramPipeline __mgGLAPI->IsProgramPipeline -#define glGetProgramStageiv __mgGLAPI->GetProgramStageiv -#define glBindTexture __mgGLAPI->BindTexture -#define glBindBufferRange __mgGLAPI->BindBufferRange -#define glMemoryBarrierByRegion __mgGLAPI->MemoryBarrierByRegion -#define glBindProgramPipeline __mgGLAPI->BindProgramPipeline -#define glProgramUniformMatrix4x2dv __mgGLAPI->ProgramUniformMatrix4x2dv -#define glBeginQueryIndexed __mgGLAPI->BeginQueryIndexed -#define glPolygonOffset __mgGLAPI->PolygonOffset -#define glProgramUniform4d __mgGLAPI->ProgramUniform4d -#define glGetString __mgGLAPI->GetString -#define glVertexAttrib4ubv __mgGLAPI->VertexAttrib4ubv -#define glRenderbufferStorage __mgGLAPI->RenderbufferStorage -#define glInvalidateTexImage __mgGLAPI->InvalidateTexImage -#define glProgramUniform2f __mgGLAPI->ProgramUniform2f -#define glStencilMask __mgGLAPI->StencilMask -#define glVertexAttribIPointer __mgGLAPI->VertexAttribIPointer -#define glGetProgramResourceLocation __mgGLAPI->GetProgramResourceLocation -#define glTransformFeedbackVaryings __mgGLAPI->TransformFeedbackVaryings -#define glTextureView __mgGLAPI->TextureView -#define glBlendEquation __mgGLAPI->BlendEquation -#define glUniform3iv __mgGLAPI->Uniform3iv -#define glVertexAttribI1iv __mgGLAPI->VertexAttribI1iv -#define glGetUniformBlockIndex __mgGLAPI->GetUniformBlockIndex -#define glVertexAttrib4usv __mgGLAPI->VertexAttrib4usv -#define glDrawElementsInstanced __mgGLAPI->DrawElementsInstanced -#define glMultiDrawElementsBaseVertex __mgGLAPI->MultiDrawElementsBaseVertex -#define glProgramUniformMatrix4dv __mgGLAPI->ProgramUniformMatrix4dv -#define glClearStencil __mgGLAPI->ClearStencil -#define glVertexAttribI1i __mgGLAPI->VertexAttribI1i -#define glCompressedTexSubImage2D __mgGLAPI->CompressedTexSubImage2D -#define glDeleteProgramPipelines __mgGLAPI->DeleteProgramPipelines -#define glPointParameterfv __mgGLAPI->PointParameterfv -#define glSamplerParameterIuiv __mgGLAPI->SamplerParameterIuiv -#define glGetFloati_v __mgGLAPI->GetFloati_v -#define glGetnUniformiv __mgGLAPI->GetnUniformiv -#define glDetachShader __mgGLAPI->DetachShader -#define glPixelStorei __mgGLAPI->PixelStorei -#define glProgramUniform1f __mgGLAPI->ProgramUniform1f -#define glGetQueryObjectiv __mgGLAPI->GetQueryObjectiv -#define glDrawTransformFeedbackStream __mgGLAPI->DrawTransformFeedbackStream -#define glDeleteQueries __mgGLAPI->DeleteQueries -#define glClearBufferData __mgGLAPI->ClearBufferData -#define glClearBufferfi __mgGLAPI->ClearBufferfi -#define glProgramUniformMatrix4fv __mgGLAPI->ProgramUniformMatrix4fv -#define glStencilFunc __mgGLAPI->StencilFunc -#define glReadnPixels __mgGLAPI->ReadnPixels -#define glFramebufferTexture2D __mgGLAPI->FramebufferTexture2D -#define glDrawArraysInstanced __mgGLAPI->DrawArraysInstanced -#define glGetActiveAttrib __mgGLAPI->GetActiveAttrib -#define glGenerateMipmap __mgGLAPI->GenerateMipmap -#define glDepthMask __mgGLAPI->DepthMask -#define glVertexBindingDivisor __mgGLAPI->VertexBindingDivisor -#define glFenceSync __mgGLAPI->FenceSync -#define glDrawArrays __mgGLAPI->DrawArrays -#define glVertexAttribIFormat __mgGLAPI->VertexAttribIFormat -#define glTexParameteriv __mgGLAPI->TexParameteriv -#define glBlendFunci __mgGLAPI->BlendFunci -#define glGetVertexAttribdv __mgGLAPI->GetVertexAttribdv -#define glGetUniformuiv __mgGLAPI->GetUniformuiv -#define glGetUniformLocation __mgGLAPI->GetUniformLocation -#define glUniform4iv __mgGLAPI->Uniform4iv -#define glUniform2i __mgGLAPI->Uniform2i -#define glDepthRangeIndexed __mgGLAPI->DepthRangeIndexed -#define glDepthRangeArrayv __mgGLAPI->DepthRangeArrayv -#define glIsTexture __mgGLAPI->IsTexture -#define glProgramUniform2fv __mgGLAPI->ProgramUniform2fv -#define glUniformMatrix2x3fv __mgGLAPI->UniformMatrix2x3fv -#define glGetActiveUniformName __mgGLAPI->GetActiveUniformName -#define glGetQueryObjectuiv __mgGLAPI->GetQueryObjectuiv -#define glPopDebugGroup __mgGLAPI->PopDebugGroup -#define glVertexAttribP2uiv __mgGLAPI->VertexAttribP2uiv -#define glGetActiveUniformsiv __mgGLAPI->GetActiveUniformsiv -#define glMultiDrawArraysIndirect __mgGLAPI->MultiDrawArraysIndirect -#define glUniformMatrix2dv __mgGLAPI->UniformMatrix2dv -#define glUniform4fv __mgGLAPI->Uniform4fv -#define glTexBuffer __mgGLAPI->TexBuffer -#define glVertexAttrib3s __mgGLAPI->VertexAttrib3s -#define glPointParameteri __mgGLAPI->PointParameteri -#define glIsFramebuffer __mgGLAPI->IsFramebuffer -#define glGenTextures __mgGLAPI->GenTextures -#define glUniformMatrix3x2fv __mgGLAPI->UniformMatrix3x2fv -#define glShaderBinary __mgGLAPI->ShaderBinary -#define glUniformMatrix4x3dv __mgGLAPI->UniformMatrix4x3dv -#define glTexStorage3D __mgGLAPI->TexStorage3D -#define glVertexAttrib4Nubv __mgGLAPI->VertexAttrib4Nubv -#define glFramebufferParameteri __mgGLAPI->FramebufferParameteri -#define glProgramUniformMatrix2x3fv __mgGLAPI->ProgramUniformMatrix2x3fv -#define glViewport __mgGLAPI->Viewport -#define glProgramUniform2uiv __mgGLAPI->ProgramUniform2uiv -#define glBeginConditionalRender __mgGLAPI->BeginConditionalRender -#define glProgramUniform4iv __mgGLAPI->ProgramUniform4iv -#define glGetActiveUniformBlockiv __mgGLAPI->GetActiveUniformBlockiv -#define glBeginQuery __mgGLAPI->BeginQuery -#define glBindTransformFeedback __mgGLAPI->BindTransformFeedback -#define glVertexAttrib1d __mgGLAPI->VertexAttrib1d -#define glDeleteProgram __mgGLAPI->DeleteProgram -#define glDrawTransformFeedbackInstanced __mgGLAPI->DrawTransformFeedbackInstanced -#define glGetSamplerParameteriv __mgGLAPI->GetSamplerParameteriv -#define glVertexAttrib4Nsv __mgGLAPI->VertexAttrib4Nsv -#define glTexParameterIiv __mgGLAPI->TexParameterIiv -#define glPrimitiveBoundingBox __mgGLAPI->PrimitiveBoundingBox -#define glProgramUniformMatrix3fv __mgGLAPI->ProgramUniformMatrix3fv -#define glProgramUniform1fv __mgGLAPI->ProgramUniform1fv -#define glVertexAttribI2iv __mgGLAPI->VertexAttribI2iv -#define glProgramUniform3uiv __mgGLAPI->ProgramUniform3uiv -#define glGetTexParameterIiv __mgGLAPI->GetTexParameterIiv -#define glFramebufferTexture1D __mgGLAPI->FramebufferTexture1D -#define glCreateShaderProgramv __mgGLAPI->CreateShaderProgramv -#define glPointParameteriv __mgGLAPI->PointParameteriv -#define glUnmapBuffer __mgGLAPI->UnmapBuffer -#define glGetActiveUniform __mgGLAPI->GetActiveUniform -#define glUniform1fv __mgGLAPI->Uniform1fv -#define glWaitSync __mgGLAPI->WaitSync -#define glUniform4dv __mgGLAPI->Uniform4dv -#define glTexImage1D __mgGLAPI->TexImage1D -#define glCopyTexSubImage3D __mgGLAPI->CopyTexSubImage3D -#define glGetShaderInfoLog __mgGLAPI->GetShaderInfoLog -#define glReadPixels __mgGLAPI->ReadPixels -#define glFramebufferTextureLayer __mgGLAPI->FramebufferTextureLayer -#define glInvalidateBufferData __mgGLAPI->InvalidateBufferData -#define glUniformBlockBinding __mgGLAPI->UniformBlockBinding -#define glDrawRangeElementsBaseVertex __mgGLAPI->DrawRangeElementsBaseVertex -#define glUniform2dv __mgGLAPI->Uniform2dv -#define glMultiDrawArrays __mgGLAPI->MultiDrawArrays -#define glVertexAttribL3dv __mgGLAPI->VertexAttribL3dv -#define glShaderSource __mgGLAPI->ShaderSource -#define glGetShaderPrecisionFormat __mgGLAPI->GetShaderPrecisionFormat -#define glGetProgramPipelineiv __mgGLAPI->GetProgramPipelineiv -#define glVertexAttribP4uiv __mgGLAPI->VertexAttribP4uiv -#define glTexParameterfv __mgGLAPI->TexParameterfv -#define glProgramUniform3ui __mgGLAPI->ProgramUniform3ui -#define glUniform2ui __mgGLAPI->Uniform2ui -#define glVertexAttribL3d __mgGLAPI->VertexAttribL3d -#define glDispatchCompute __mgGLAPI->DispatchCompute -#define glProgramUniform1i __mgGLAPI->ProgramUniform1i -#define glDrawBuffer __mgGLAPI->DrawBuffer -#define glGetProgramBinary __mgGLAPI->GetProgramBinary -#define glTexStorage2DMultisample __mgGLAPI->TexStorage2DMultisample -#define glBindBuffer __mgGLAPI->BindBuffer -#define glPixelStoref __mgGLAPI->PixelStoref -#define glCreateProgram __mgGLAPI->CreateProgram -#define glVertexAttrib2f __mgGLAPI->VertexAttrib2f -#define glReleaseShaderCompiler __mgGLAPI->ReleaseShaderCompiler -#define glProgramUniform3iv __mgGLAPI->ProgramUniform3iv -#define glProgramUniform4i __mgGLAPI->ProgramUniform4i -#define glUniform3ui __mgGLAPI->Uniform3ui -#define glIsBuffer __mgGLAPI->IsBuffer -#define glActiveTexture __mgGLAPI->ActiveTexture -#define glUniform4i __mgGLAPI->Uniform4i -#define glVertexAttrib4Nbv __mgGLAPI->VertexAttrib4Nbv -#define glHint __mgGLAPI->Hint -#define glTexImage2D __mgGLAPI->TexImage2D -#define glDepthRange __mgGLAPI->DepthRange -#define glTexSubImage1D __mgGLAPI->TexSubImage1D -#define glGetDoublei_v __mgGLAPI->GetDoublei_v -#define glCopyTexSubImage2D __mgGLAPI->CopyTexSubImage2D -#define glDeleteRenderbuffers __mgGLAPI->DeleteRenderbuffers -#define glDisablei __mgGLAPI->Disablei -#define glDeleteShader __mgGLAPI->DeleteShader -#define glCompressedTexSubImage3D __mgGLAPI->CompressedTexSubImage3D -#define glUniformMatrix2x3dv __mgGLAPI->UniformMatrix2x3dv -#define glProgramUniform1dv __mgGLAPI->ProgramUniform1dv -#define glEndQuery __mgGLAPI->EndQuery -#define glProgramUniformMatrix4x3fv __mgGLAPI->ProgramUniformMatrix4x3fv -#define glStencilOp __mgGLAPI->StencilOp -#define glGenProgramPipelines __mgGLAPI->GenProgramPipelines -#define glGetBufferSubData __mgGLAPI->GetBufferSubData -#define glUniform2d __mgGLAPI->Uniform2d -#define glGetIntegeri_v __mgGLAPI->GetIntegeri_v -#define glBlendFunc __mgGLAPI->BlendFunc -#define glProgramUniform1ui __mgGLAPI->ProgramUniform1ui -#define glGetVertexAttribfv __mgGLAPI->GetVertexAttribfv -#define glProgramUniform1iv __mgGLAPI->ProgramUniform1iv -#define glGetRenderbufferParameteriv __mgGLAPI->GetRenderbufferParameteriv -#define glVertexAttribI3ui __mgGLAPI->VertexAttribI3ui -#define glGetActiveSubroutineUniformName __mgGLAPI->GetActiveSubroutineUniformName -#define glVertexAttrib4Nuiv __mgGLAPI->VertexAttrib4Nuiv -#define glVertexAttribLPointer __mgGLAPI->VertexAttribLPointer -#define glGetQueryiv __mgGLAPI->GetQueryiv -#define glGenSamplers __mgGLAPI->GenSamplers -#define glGetShaderiv __mgGLAPI->GetShaderiv -#define glGetVertexAttribiv __mgGLAPI->GetVertexAttribiv -#define glShaderStorageBlockBinding __mgGLAPI->ShaderStorageBlockBinding -#define glGetTexLevelParameterfv __mgGLAPI->GetTexLevelParameterfv -#define glGetQueryIndexediv __mgGLAPI->GetQueryIndexediv -#define glVertexAttrib3f __mgGLAPI->VertexAttrib3f -#define glProgramParameteri __mgGLAPI->ProgramParameteri -#define glGetnUniformfv __mgGLAPI->GetnUniformfv -#define glIsShader __mgGLAPI->IsShader -#define glBindFragDataLocation __mgGLAPI->BindFragDataLocation -#define glProgramUniform4dv __mgGLAPI->ProgramUniform4dv -#define glUniform2fv __mgGLAPI->Uniform2fv -#define glProgramUniform3dv __mgGLAPI->ProgramUniform3dv -#define glViewportIndexedfv __mgGLAPI->ViewportIndexedfv -#define glDebugMessageCallback __mgGLAPI->DebugMessageCallback -#define glVertexAttrib2d __mgGLAPI->VertexAttrib2d -#define glGetVertexAttribPointerv __mgGLAPI->GetVertexAttribPointerv -#define glActiveShaderProgram __mgGLAPI->ActiveShaderProgram -#define glUniformMatrix4x3fv __mgGLAPI->UniformMatrix4x3fv -#define glDrawTransformFeedbackStreamInstanced __mgGLAPI->DrawTransformFeedbackStreamInstanced -#define glGetTexLevelParameteriv __mgGLAPI->GetTexLevelParameteriv -#define glUniformSubroutinesuiv __mgGLAPI->UniformSubroutinesuiv -#define glUniform3uiv __mgGLAPI->Uniform3uiv -#define glScissorIndexed __mgGLAPI->ScissorIndexed -#define glIsProgram __mgGLAPI->IsProgram -#define glProgramUniform4f __mgGLAPI->ProgramUniform4f -#define glProgramUniformMatrix3dv __mgGLAPI->ProgramUniformMatrix3dv -#define glVertexAttribI4sv __mgGLAPI->VertexAttribI4sv -#define glDepthRangef __mgGLAPI->DepthRangef -#define glUseProgramStages __mgGLAPI->UseProgramStages -#define glGenVertexArrays __mgGLAPI->GenVertexArrays -#define glGetProgramPipelineInfoLog __mgGLAPI->GetProgramPipelineInfoLog -#define glVertexAttrib4s __mgGLAPI->VertexAttrib4s -#define glDrawTransformFeedback __mgGLAPI->DrawTransformFeedback -#define glReadBuffer __mgGLAPI->ReadBuffer -#define glBlendColor __mgGLAPI->BlendColor -#define glIsSync __mgGLAPI->IsSync -#define glGetBooleanv __mgGLAPI->GetBooleanv -#define glGetBufferParameteri64v __mgGLAPI->GetBufferParameteri64v -#define glClearBufferfv __mgGLAPI->ClearBufferfv -#define glDrawElementsInstancedBaseVertexBaseInstance __mgGLAPI->DrawElementsInstancedBaseVertexBaseInstance -#define glGetBooleani_v __mgGLAPI->GetBooleani_v -#define glIsEnabledi __mgGLAPI->IsEnabledi -#define glCreateShader __mgGLAPI->CreateShader -#define glGetProgramResourceLocationIndex __mgGLAPI->GetProgramResourceLocationIndex -#define glBeginTransformFeedback __mgGLAPI->BeginTransformFeedback -#define glClearBufferSubData __mgGLAPI->ClearBufferSubData -#define glTexParameterIuiv __mgGLAPI->TexParameterIuiv -#define glUniform2uiv __mgGLAPI->Uniform2uiv -#define glIsSampler __mgGLAPI->IsSampler -#define glVertexAttrib4sv __mgGLAPI->VertexAttrib4sv -#define glClearDepthf __mgGLAPI->ClearDepthf -#define glUniformMatrix4dv __mgGLAPI->UniformMatrix4dv -#define glDrawRangeElements __mgGLAPI->DrawRangeElements -#define glAttachShader __mgGLAPI->AttachShader -#define glVertexAttribL4d __mgGLAPI->VertexAttribL4d -#define glTexImage3D __mgGLAPI->TexImage3D -#define glGetQueryObjecti64v __mgGLAPI->GetQueryObjecti64v -#define glProgramUniform2d __mgGLAPI->ProgramUniform2d -#define glIsVertexArray __mgGLAPI->IsVertexArray -#define glVertexAttrib2fv __mgGLAPI->VertexAttrib2fv -#define glUniformMatrix2x4fv __mgGLAPI->UniformMatrix2x4fv -#define glTexStorage1D __mgGLAPI->TexStorage1D -#define glBlendFuncSeparate __mgGLAPI->BlendFuncSeparate -#define glDrawArraysInstancedBaseInstance __mgGLAPI->DrawArraysInstancedBaseInstance -#define glInvalidateFramebuffer __mgGLAPI->InvalidateFramebuffer -#define glVertexAttribI2ui __mgGLAPI->VertexAttribI2ui -#define glGetUniformIndices __mgGLAPI->GetUniformIndices -#define glVertexAttribL1d __mgGLAPI->VertexAttribL1d -#define glBindFramebuffer __mgGLAPI->BindFramebuffer -#define glVertexAttrib2s __mgGLAPI->VertexAttrib2s -#define glUniformMatrix4fv __mgGLAPI->UniformMatrix4fv -#define glColorMaski __mgGLAPI->ColorMaski -#define glGetProgramInfoLog __mgGLAPI->GetProgramInfoLog -#define glMultiDrawElementsIndirect __mgGLAPI->MultiDrawElementsIndirect -#define glUniformMatrix3x4dv __mgGLAPI->UniformMatrix3x4dv -#define glGetObjectLabel __mgGLAPI->GetObjectLabel -#define glBlendEquationi __mgGLAPI->BlendEquationi -#define glUniform3dv __mgGLAPI->Uniform3dv -#define glGetInternalformati64v __mgGLAPI->GetInternalformati64v -#define glGetObjectPtrLabel __mgGLAPI->GetObjectPtrLabel -#define glProgramUniform2iv __mgGLAPI->ProgramUniform2iv -#define glGetIntegerv __mgGLAPI->GetIntegerv -#define glBlendBarrier __mgGLAPI->BlendBarrier -#define glUniform2f __mgGLAPI->Uniform2f -#define glScissor __mgGLAPI->Scissor -#define glGetAttribLocation __mgGLAPI->GetAttribLocation -#define glUniform2iv __mgGLAPI->Uniform2iv -#define glUniform4f __mgGLAPI->Uniform4f -#define glVertexAttribL2dv __mgGLAPI->VertexAttribL2dv -#define glInvalidateTexSubImage __mgGLAPI->InvalidateTexSubImage -#define glBindVertexArray __mgGLAPI->BindVertexArray -#define glClientWaitSync __mgGLAPI->ClientWaitSync -#define glGenFramebuffers __mgGLAPI->GenFramebuffers -#define glScissorArrayv __mgGLAPI->ScissorArrayv -#define glProgramUniform2i __mgGLAPI->ProgramUniform2i -#define glVertexAttrib4Nusv __mgGLAPI->VertexAttrib4Nusv -#define glGetSynciv __mgGLAPI->GetSynciv -#define glDrawArraysIndirect __mgGLAPI->DrawArraysIndirect -#define glVertexAttribLFormat __mgGLAPI->VertexAttribLFormat -#define glSamplerParameterIiv __mgGLAPI->SamplerParameterIiv -#define glVertexAttribI4usv __mgGLAPI->VertexAttribI4usv -#define glProgramUniform3f __mgGLAPI->ProgramUniform3f -#define glBufferData __mgGLAPI->BufferData -#define glUniform1f __mgGLAPI->Uniform1f -#define glGetFragDataIndex __mgGLAPI->GetFragDataIndex -#define glVertexAttribP4ui __mgGLAPI->VertexAttribP4ui -#define glProgramUniformMatrix4x3dv __mgGLAPI->ProgramUniformMatrix4x3dv -#define glIsEnabled __mgGLAPI->IsEnabled -#define glVertexAttrib4fv __mgGLAPI->VertexAttrib4fv -#define glBlitFramebuffer __mgGLAPI->BlitFramebuffer -#define glProgramUniform4uiv __mgGLAPI->ProgramUniform4uiv -#define glDebugMessageInsert __mgGLAPI->DebugMessageInsert -#define glGenRenderbuffers __mgGLAPI->GenRenderbuffers -#define glCompressedTexImage1D __mgGLAPI->CompressedTexImage1D -#define glGetQueryObjectui64v __mgGLAPI->GetQueryObjectui64v -#define glVertexAttrib4uiv __mgGLAPI->VertexAttrib4uiv -#define glVertexAttribI1ui __mgGLAPI->VertexAttribI1ui -#define glProgramUniformMatrix2x4dv __mgGLAPI->ProgramUniformMatrix2x4dv -#define glCopyBufferSubData __mgGLAPI->CopyBufferSubData -#define glPauseTransformFeedback __mgGLAPI->PauseTransformFeedback -#define glStencilFuncSeparate __mgGLAPI->StencilFuncSeparate -#define glGetTexParameterIuiv __mgGLAPI->GetTexParameterIuiv -#define glTexSubImage2D __mgGLAPI->TexSubImage2D -#define glUniform1i __mgGLAPI->Uniform1i -#define glVertexAttribI4bv __mgGLAPI->VertexAttribI4bv -#define glVertexAttribI4ui __mgGLAPI->VertexAttribI4ui -#define glUniformMatrix3x4fv __mgGLAPI->UniformMatrix3x4fv -#define glVertexAttrib2sv __mgGLAPI->VertexAttrib2sv -#define glSampleCoverage __mgGLAPI->SampleCoverage -#define glUniformMatrix4x2fv __mgGLAPI->UniformMatrix4x2fv -#define glGenBuffers __mgGLAPI->GenBuffers -#define glEndQueryIndexed __mgGLAPI->EndQueryIndexed -#define glCompressedTexImage3D __mgGLAPI->CompressedTexImage3D -#define glTexImage2DMultisample __mgGLAPI->TexImage2DMultisample -#define glGetProgramResourceiv __mgGLAPI->GetProgramResourceiv -#define glGetError __mgGLAPI->GetError -#define glColorMask __mgGLAPI->ColorMask -#define glVertexAttribP3uiv __mgGLAPI->VertexAttribP3uiv -#define glGetFragDataLocation __mgGLAPI->GetFragDataLocation -#define glVertexAttrib3sv __mgGLAPI->VertexAttrib3sv -#define glTexParameterf __mgGLAPI->TexParameterf -#define glGetFramebufferAttachmentParameteriv __mgGLAPI->GetFramebufferAttachmentParameteriv -#define glClearBufferiv __mgGLAPI->ClearBufferiv -#define glGetUniformfv __mgGLAPI->GetUniformfv -#define glBlendEquationSeparatei __mgGLAPI->BlendEquationSeparatei -#define glGetDebugMessageLog __mgGLAPI->GetDebugMessageLog -#define glCopyTexSubImage1D __mgGLAPI->CopyTexSubImage1D -#define glVertexAttribI3uiv __mgGLAPI->VertexAttribI3uiv -#define glDeleteFramebuffers __mgGLAPI->DeleteFramebuffers -#define glSamplerParameteriv __mgGLAPI->SamplerParameteriv -#define glGetProgramResourceIndex __mgGLAPI->GetProgramResourceIndex -#define glCopyTexImage2D __mgGLAPI->CopyTexImage2D -#define glVertexAttrib3fv __mgGLAPI->VertexAttrib3fv -#define glGetGraphicsResetStatus __mgGLAPI->GetGraphicsResetStatus -#define glTexSubImage3D __mgGLAPI->TexSubImage3D -#define glProgramUniformMatrix3x4dv __mgGLAPI->ProgramUniformMatrix3x4dv -#define glGetStringi __mgGLAPI->GetStringi -#define glBindImageTexture __mgGLAPI->BindImageTexture -#define glEndConditionalRender __mgGLAPI->EndConditionalRender -#define glVertexAttribL2d __mgGLAPI->VertexAttribL2d -#define glDrawBuffers __mgGLAPI->DrawBuffers -#define glMemoryBarrier __mgGLAPI->MemoryBarrier -#define glTexParameteri __mgGLAPI->TexParameteri -#define glProgramUniformMatrix4x2fv __mgGLAPI->ProgramUniformMatrix4x2fv -#define glDepthFunc __mgGLAPI->DepthFunc -#define glGetProgramInterfaceiv __mgGLAPI->GetProgramInterfaceiv -#define glGetInteger64v __mgGLAPI->GetInteger64v -#define glPointSize __mgGLAPI->PointSize -#define glLinkProgram __mgGLAPI->LinkProgram -#define glFlushMappedBufferRange __mgGLAPI->FlushMappedBufferRange -#define glVertexAttribI2i __mgGLAPI->VertexAttribI2i -#define glGetFloatv __mgGLAPI->GetFloatv -#define glVertexAttribI4iv __mgGLAPI->VertexAttribI4iv -#define glInvalidateBufferSubData __mgGLAPI->InvalidateBufferSubData -#define glGetProgramiv __mgGLAPI->GetProgramiv -#define glDrawElementsIndirect __mgGLAPI->DrawElementsIndirect -#define glVertexAttrib3dv __mgGLAPI->VertexAttrib3dv -#define glUniform1dv __mgGLAPI->Uniform1dv -#define glIsQuery __mgGLAPI->IsQuery -#define glVertexAttribI3iv __mgGLAPI->VertexAttribI3iv -#define glEndTransformFeedback __mgGLAPI->EndTransformFeedback -#define glDrawElements __mgGLAPI->DrawElements -#define glGetMultisamplefv __mgGLAPI->GetMultisamplefv -#define glSamplerParameterfv __mgGLAPI->SamplerParameterfv -#define glVertexAttribBinding __mgGLAPI->VertexAttribBinding -#define glVertexAttribP2ui __mgGLAPI->VertexAttribP2ui -#define glUniform4ui __mgGLAPI->Uniform4ui -#define glGetSamplerParameterIiv __mgGLAPI->GetSamplerParameterIiv -#define glGetActiveSubroutineUniformiv __mgGLAPI->GetActiveSubroutineUniformiv -#define glGetUniformSubroutineuiv __mgGLAPI->GetUniformSubroutineuiv -#define glVertexAttribI4i __mgGLAPI->VertexAttribI4i -#define glGetUniformiv __mgGLAPI->GetUniformiv -#define glStencilOpSeparate __mgGLAPI->StencilOpSeparate -#define glDrawElementsBaseVertex __mgGLAPI->DrawElementsBaseVertex -#define glVertexAttribL4dv __mgGLAPI->VertexAttribL4dv -#define glBindSampler __mgGLAPI->BindSampler -#define glGetTexParameterfv __mgGLAPI->GetTexParameterfv -#define glProgramUniform3d __mgGLAPI->ProgramUniform3d -#define glGetInteger64i_v __mgGLAPI->GetInteger64i_v -#define glGetSubroutineIndex __mgGLAPI->GetSubroutineIndex -#define glGetSamplerParameterfv __mgGLAPI->GetSamplerParameterfv -#define glProgramUniformMatrix2x3dv __mgGLAPI->ProgramUniformMatrix2x3dv -#define glDrawElementsInstancedBaseInstance __mgGLAPI->DrawElementsInstancedBaseInstance -#define glTexStorage2D __mgGLAPI->TexStorage2D -#define glProgramUniform3fv __mgGLAPI->ProgramUniform3fv -#define glSampleMaski __mgGLAPI->SampleMaski -#define glPatchParameterfv __mgGLAPI->PatchParameterfv -#define glBindBufferBase __mgGLAPI->BindBufferBase -#define glClear __mgGLAPI->Clear -#define glGetActiveSubroutineName __mgGLAPI->GetActiveSubroutineName -#define glDrawElementsInstancedBaseVertex __mgGLAPI->DrawElementsInstancedBaseVertex -#define glGenQueries __mgGLAPI->GenQueries -#define glUniformMatrix3fv __mgGLAPI->UniformMatrix3fv -#define glGetTexParameteriv __mgGLAPI->GetTexParameteriv -#define glUniformMatrix2fv __mgGLAPI->UniformMatrix2fv -#define glVertexAttrib1dv __mgGLAPI->VertexAttrib1dv -#define glProvokingVertex __mgGLAPI->ProvokingVertex -#define glVertexAttrib3d __mgGLAPI->VertexAttrib3d -#define glVertexAttribI1uiv __mgGLAPI->VertexAttribI1uiv -#define glUniform1uiv __mgGLAPI->Uniform1uiv -#define glVertexAttrib4Nub __mgGLAPI->VertexAttrib4Nub -#define glStencilMaskSeparate __mgGLAPI->StencilMaskSeparate -#define glVertexAttrib2dv __mgGLAPI->VertexAttrib2dv -#define glGetUniformdv __mgGLAPI->GetUniformdv -#define glClampColor __mgGLAPI->ClampColor -#define glIsTransformFeedback __mgGLAPI->IsTransformFeedback -#define glGetFramebufferParameteriv __mgGLAPI->GetFramebufferParameteriv -#define glProgramUniform1uiv __mgGLAPI->ProgramUniform1uiv -#define glVertexAttrib4iv __mgGLAPI->VertexAttrib4iv -#define glIsRenderbuffer __mgGLAPI->IsRenderbuffer -#define glInvalidateSubFramebuffer __mgGLAPI->InvalidateSubFramebuffer -#define glUniform1iv __mgGLAPI->Uniform1iv -#define glUniform3fv __mgGLAPI->Uniform3fv -#define glVertexAttribDivisor __mgGLAPI->VertexAttribDivisor -#define glClearColor __mgGLAPI->ClearColor -#define glDeleteVertexArrays __mgGLAPI->DeleteVertexArrays -#define glProgramUniform2dv __mgGLAPI->ProgramUniform2dv -#define glVertexAttrib1sv __mgGLAPI->VertexAttrib1sv -#define glUniform4d __mgGLAPI->Uniform4d -#define glGetTexImage __mgGLAPI->GetTexImage -#define glCopyTexImage1D __mgGLAPI->CopyTexImage1D -#define glObjectLabel __mgGLAPI->ObjectLabel -#define glTexBufferRange __mgGLAPI->TexBufferRange -#define glDebugMessageControl __mgGLAPI->DebugMessageControl -#define glProgramUniform4fv __mgGLAPI->ProgramUniform4fv -#define glBlendEquationSeparate __mgGLAPI->BlendEquationSeparate -#define glValidateProgramPipeline __mgGLAPI->ValidateProgramPipeline -#define glVertexAttribP1ui __mgGLAPI->VertexAttribP1ui -#define glCheckFramebufferStatus __mgGLAPI->CheckFramebufferStatus -#define glProgramUniformMatrix2x4fv __mgGLAPI->ProgramUniformMatrix2x4fv -#define glSamplerParameterf __mgGLAPI->SamplerParameterf -#define glBindVertexBuffer __mgGLAPI->BindVertexBuffer -#define glGetBufferPointerv __mgGLAPI->GetBufferPointerv -#define glValidateProgram __mgGLAPI->ValidateProgram -#define glTexStorage3DMultisample __mgGLAPI->TexStorage3DMultisample -#define glResumeTransformFeedback __mgGLAPI->ResumeTransformFeedback -#define glProgramUniformMatrix3x2fv __mgGLAPI->ProgramUniformMatrix3x2fv -#define glClearDepth __mgGLAPI->ClearDepth -#define glVertexAttribI2uiv __mgGLAPI->VertexAttribI2uiv -#define glGetSubroutineUniformLocation __mgGLAPI->GetSubroutineUniformLocation -#define glLineWidth __mgGLAPI->LineWidth -#define glVertexAttrib1s __mgGLAPI->VertexAttrib1s -#define glPointParameterf __mgGLAPI->PointParameterf -#define glDeleteTextures __mgGLAPI->DeleteTextures -#define glVertexAttribI4ubv __mgGLAPI->VertexAttribI4ubv -#define glEnable __mgGLAPI->Enable -#define glUniformMatrix2x4dv __mgGLAPI->UniformMatrix2x4dv -#define glVertexAttrib4f __mgGLAPI->VertexAttrib4f -#define glVertexAttrib4dv __mgGLAPI->VertexAttrib4dv -#define glProgramUniformMatrix2dv __mgGLAPI->ProgramUniformMatrix2dv -#define glMapBufferRange __mgGLAPI->MapBufferRange -#define glGetSamplerParameterIuiv __mgGLAPI->GetSamplerParameterIuiv -#define glDeleteTransformFeedbacks __mgGLAPI->DeleteTransformFeedbacks -#define glUniformMatrix3dv __mgGLAPI->UniformMatrix3dv -#define glProgramUniformMatrix2fv __mgGLAPI->ProgramUniformMatrix2fv -#define glGetProgramResourceName __mgGLAPI->GetProgramResourceName -#define glGetVertexAttribIiv __mgGLAPI->GetVertexAttribIiv -#define glMultiDrawElements __mgGLAPI->MultiDrawElements -#define glFlush __mgGLAPI->Flush -#define glVertexAttrib1f __mgGLAPI->VertexAttrib1f -#define glVertexAttribPointer __mgGLAPI->VertexAttribPointer -#define glCompileShader __mgGLAPI->CompileShader -#define glProgramUniform2ui __mgGLAPI->ProgramUniform2ui -#define glTexImage3DMultisample __mgGLAPI->TexImage3DMultisample -#define glScissorIndexedv __mgGLAPI->ScissorIndexedv -#define glBlendFuncSeparatei __mgGLAPI->BlendFuncSeparatei -#define glCompressedTexSubImage1D __mgGLAPI->CompressedTexSubImage1D -#define glGetAttachedShaders __mgGLAPI->GetAttachedShaders -#define glCopyImageSubData __mgGLAPI->CopyImageSubData -#define glDeleteBuffers __mgGLAPI->DeleteBuffers -#define glUniform1ui __mgGLAPI->Uniform1ui -#define glClearBufferuiv __mgGLAPI->ClearBufferuiv -#define glDispatchComputeIndirect __mgGLAPI->DispatchComputeIndirect -#define glFramebufferTexture __mgGLAPI->FramebufferTexture -#define glGetDoublev __mgGLAPI->GetDoublev -#define glDisableVertexAttribArray __mgGLAPI->DisableVertexAttribArray -#define glViewportIndexedf __mgGLAPI->ViewportIndexedf -#define glUniform3d __mgGLAPI->Uniform3d -#define glMinSampleShading __mgGLAPI->MinSampleShading -#define glVertexAttrib4bv __mgGLAPI->VertexAttrib4bv -#define glGetPointerv __mgGLAPI->GetPointerv -#define glUniform1d __mgGLAPI->Uniform1d -#define glProgramUniformMatrix3x2dv __mgGLAPI->ProgramUniformMatrix3x2dv -#define glGetInternalformativ __mgGLAPI->GetInternalformativ -#define glUniformMatrix3x2dv __mgGLAPI->UniformMatrix3x2dv -#define glPolygonMode __mgGLAPI->PolygonMode -#define glUseProgram __mgGLAPI->UseProgram -#define glBindAttribLocation __mgGLAPI->BindAttribLocation -#define glVertexAttribP3ui __mgGLAPI->VertexAttribP3ui -#define glProgramUniform3i __mgGLAPI->ProgramUniform3i -#define glUniformMatrix4x2dv __mgGLAPI->UniformMatrix4x2dv +#define glSamplerParameteriv mg_gl_get_api()->SamplerParameteriv +#define glIsFramebuffer mg_gl_get_api()->IsFramebuffer +#define glMultiDrawElements mg_gl_get_api()->MultiDrawElements +#define glVertexAttrib3f mg_gl_get_api()->VertexAttrib3f +#define glGetBufferPointerv mg_gl_get_api()->GetBufferPointerv +#define glCopyTexSubImage2D mg_gl_get_api()->CopyTexSubImage2D +#define glEndTransformFeedback mg_gl_get_api()->EndTransformFeedback +#define glSamplerParameteri mg_gl_get_api()->SamplerParameteri +#define glDrawElementsIndirect mg_gl_get_api()->DrawElementsIndirect +#define glProgramUniformMatrix4dv mg_gl_get_api()->ProgramUniformMatrix4dv +#define glTexParameterf mg_gl_get_api()->TexParameterf +#define glVertexAttribFormat mg_gl_get_api()->VertexAttribFormat +#define glVertexAttribI2uiv mg_gl_get_api()->VertexAttribI2uiv +#define glTexSubImage1D mg_gl_get_api()->TexSubImage1D +#define glReleaseShaderCompiler mg_gl_get_api()->ReleaseShaderCompiler +#define glUniform2iv mg_gl_get_api()->Uniform2iv +#define glUniform1fv mg_gl_get_api()->Uniform1fv +#define glGetnUniformfv mg_gl_get_api()->GetnUniformfv +#define glTexImage1D mg_gl_get_api()->TexImage1D +#define glDrawRangeElementsBaseVertex mg_gl_get_api()->DrawRangeElementsBaseVertex +#define glMemoryBarrierByRegion mg_gl_get_api()->MemoryBarrierByRegion +#define glGetProgramPipelineiv mg_gl_get_api()->GetProgramPipelineiv +#define glUniform4uiv mg_gl_get_api()->Uniform4uiv +#define glVertexAttrib1d mg_gl_get_api()->VertexAttrib1d +#define glDepthRangeArrayv mg_gl_get_api()->DepthRangeArrayv +#define glVertexAttribL3d mg_gl_get_api()->VertexAttribL3d +#define glMultiDrawArrays mg_gl_get_api()->MultiDrawArrays +#define glUniform4dv mg_gl_get_api()->Uniform4dv +#define glCopyTexImage1D mg_gl_get_api()->CopyTexImage1D +#define glProgramUniformMatrix4x3dv mg_gl_get_api()->ProgramUniformMatrix4x3dv +#define glTexParameterIuiv mg_gl_get_api()->TexParameterIuiv +#define glVertexAttrib4Nubv mg_gl_get_api()->VertexAttrib4Nubv +#define glGetTexLevelParameteriv mg_gl_get_api()->GetTexLevelParameteriv +#define glUniformMatrix2x4fv mg_gl_get_api()->UniformMatrix2x4fv +#define glDrawElementsInstancedBaseVertexBaseInstance mg_gl_get_api()->DrawElementsInstancedBaseVertexBaseInstance +#define glDeleteTextures mg_gl_get_api()->DeleteTextures +#define glTexImage3D mg_gl_get_api()->TexImage3D +#define glVertexAttrib4dv mg_gl_get_api()->VertexAttrib4dv +#define glTexParameterIiv mg_gl_get_api()->TexParameterIiv +#define glGenVertexArrays mg_gl_get_api()->GenVertexArrays +#define glProgramUniformMatrix4x2fv mg_gl_get_api()->ProgramUniformMatrix4x2fv +#define glCompressedTexImage3D mg_gl_get_api()->CompressedTexImage3D +#define glProgramUniform3dv mg_gl_get_api()->ProgramUniform3dv +#define glGetProgramResourceLocationIndex mg_gl_get_api()->GetProgramResourceLocationIndex +#define glDrawRangeElements mg_gl_get_api()->DrawRangeElements +#define glDispatchComputeIndirect mg_gl_get_api()->DispatchComputeIndirect +#define glGetCompressedTexImage mg_gl_get_api()->GetCompressedTexImage +#define glGetProgramResourceiv mg_gl_get_api()->GetProgramResourceiv +#define glDrawElements mg_gl_get_api()->DrawElements +#define glProgramUniform1i mg_gl_get_api()->ProgramUniform1i +#define glViewportIndexedfv mg_gl_get_api()->ViewportIndexedfv +#define glFramebufferRenderbuffer mg_gl_get_api()->FramebufferRenderbuffer +#define glRenderbufferStorage mg_gl_get_api()->RenderbufferStorage +#define glTexBufferRange mg_gl_get_api()->TexBufferRange +#define glBindBufferRange mg_gl_get_api()->BindBufferRange +#define glVertexAttrib4bv mg_gl_get_api()->VertexAttrib4bv +#define glSamplerParameterf mg_gl_get_api()->SamplerParameterf +#define glBindFragDataLocation mg_gl_get_api()->BindFragDataLocation +#define glVertexAttrib2d mg_gl_get_api()->VertexAttrib2d +#define glVertexAttribI4ui mg_gl_get_api()->VertexAttribI4ui +#define glGetUniformfv mg_gl_get_api()->GetUniformfv +#define glProgramUniformMatrix3x4fv mg_gl_get_api()->ProgramUniformMatrix3x4fv +#define glBlendEquationSeparate mg_gl_get_api()->BlendEquationSeparate +#define glVertexAttribL3dv mg_gl_get_api()->VertexAttribL3dv +#define glScissorIndexed mg_gl_get_api()->ScissorIndexed +#define glDrawElementsInstancedBaseVertex mg_gl_get_api()->DrawElementsInstancedBaseVertex +#define glObjectPtrLabel mg_gl_get_api()->ObjectPtrLabel +#define glUniformMatrix4x3fv mg_gl_get_api()->UniformMatrix4x3fv +#define glDrawTransformFeedback mg_gl_get_api()->DrawTransformFeedback +#define glVertexBindingDivisor mg_gl_get_api()->VertexBindingDivisor +#define glProgramUniform4uiv mg_gl_get_api()->ProgramUniform4uiv +#define glGetQueryiv mg_gl_get_api()->GetQueryiv +#define glUniform2uiv mg_gl_get_api()->Uniform2uiv +#define glGetDebugMessageLog mg_gl_get_api()->GetDebugMessageLog +#define glGetShaderiv mg_gl_get_api()->GetShaderiv +#define glVertexAttribI4i mg_gl_get_api()->VertexAttribI4i +#define glGetTexLevelParameterfv mg_gl_get_api()->GetTexLevelParameterfv +#define glCompressedTexSubImage2D mg_gl_get_api()->CompressedTexSubImage2D +#define glUniform1dv mg_gl_get_api()->Uniform1dv +#define glGetProgramPipelineInfoLog mg_gl_get_api()->GetProgramPipelineInfoLog +#define glVertexAttribPointer mg_gl_get_api()->VertexAttribPointer +#define glGetProgramInfoLog mg_gl_get_api()->GetProgramInfoLog +#define glSamplerParameterIiv mg_gl_get_api()->SamplerParameterIiv +#define glEndQueryIndexed mg_gl_get_api()->EndQueryIndexed +#define glGetVertexAttribLdv mg_gl_get_api()->GetVertexAttribLdv +#define glDisable mg_gl_get_api()->Disable +#define glFinish mg_gl_get_api()->Finish +#define glCheckFramebufferStatus mg_gl_get_api()->CheckFramebufferStatus +#define glClampColor mg_gl_get_api()->ClampColor +#define glUniformMatrix4x2fv mg_gl_get_api()->UniformMatrix4x2fv +#define glUniformMatrix4x2dv mg_gl_get_api()->UniformMatrix4x2dv +#define glScissorIndexedv mg_gl_get_api()->ScissorIndexedv +#define glGetFragDataLocation mg_gl_get_api()->GetFragDataLocation +#define glGetInteger64i_v mg_gl_get_api()->GetInteger64i_v +#define glPolygonMode mg_gl_get_api()->PolygonMode +#define glGetTexParameterIiv mg_gl_get_api()->GetTexParameterIiv +#define glLinkProgram mg_gl_get_api()->LinkProgram +#define glProgramUniform2dv mg_gl_get_api()->ProgramUniform2dv +#define glUniform1d mg_gl_get_api()->Uniform1d +#define glUniformMatrix2x4dv mg_gl_get_api()->UniformMatrix2x4dv +#define glProgramUniform2i mg_gl_get_api()->ProgramUniform2i +#define glGetAttachedShaders mg_gl_get_api()->GetAttachedShaders +#define glVertexAttribI1uiv mg_gl_get_api()->VertexAttribI1uiv +#define glPointParameteri mg_gl_get_api()->PointParameteri +#define glShaderBinary mg_gl_get_api()->ShaderBinary +#define glDetachShader mg_gl_get_api()->DetachShader +#define glGetFloati_v mg_gl_get_api()->GetFloati_v +#define glDrawBuffer mg_gl_get_api()->DrawBuffer +#define glClearBufferiv mg_gl_get_api()->ClearBufferiv +#define glGetVertexAttribIiv mg_gl_get_api()->GetVertexAttribIiv +#define glIsVertexArray mg_gl_get_api()->IsVertexArray +#define glGetInteger64v mg_gl_get_api()->GetInteger64v +#define glGetFramebufferParameteriv mg_gl_get_api()->GetFramebufferParameteriv +#define glGetSamplerParameterIiv mg_gl_get_api()->GetSamplerParameterIiv +#define glUniform3i mg_gl_get_api()->Uniform3i +#define glProgramUniform4f mg_gl_get_api()->ProgramUniform4f +#define glGetRenderbufferParameteriv mg_gl_get_api()->GetRenderbufferParameteriv +#define glSamplerParameterfv mg_gl_get_api()->SamplerParameterfv +#define glVertexAttrib4s mg_gl_get_api()->VertexAttrib4s +#define glGetShaderSource mg_gl_get_api()->GetShaderSource +#define glVertexAttribL4dv mg_gl_get_api()->VertexAttribL4dv +#define glStencilOpSeparate mg_gl_get_api()->StencilOpSeparate +#define glIsProgramPipeline mg_gl_get_api()->IsProgramPipeline +#define glProgramUniformMatrix3x2dv mg_gl_get_api()->ProgramUniformMatrix3x2dv +#define glQueryCounter mg_gl_get_api()->QueryCounter +#define glTexStorage2D mg_gl_get_api()->TexStorage2D +#define glReadBuffer mg_gl_get_api()->ReadBuffer +#define glGetQueryObjectui64v mg_gl_get_api()->GetQueryObjectui64v +#define glVertexAttribI4ubv mg_gl_get_api()->VertexAttribI4ubv +#define glInvalidateFramebuffer mg_gl_get_api()->InvalidateFramebuffer +#define glGetActiveAttrib mg_gl_get_api()->GetActiveAttrib +#define glVertexAttrib4iv mg_gl_get_api()->VertexAttrib4iv +#define glEnable mg_gl_get_api()->Enable +#define glVertexAttribP3uiv mg_gl_get_api()->VertexAttribP3uiv +#define glProgramUniform1fv mg_gl_get_api()->ProgramUniform1fv +#define glProgramUniform1dv mg_gl_get_api()->ProgramUniform1dv +#define glFlushMappedBufferRange mg_gl_get_api()->FlushMappedBufferRange +#define glVertexAttribL1dv mg_gl_get_api()->VertexAttribL1dv +#define glVertexAttribIFormat mg_gl_get_api()->VertexAttribIFormat +#define glTexParameteriv mg_gl_get_api()->TexParameteriv +#define glSampleCoverage mg_gl_get_api()->SampleCoverage +#define glVertexAttrib2s mg_gl_get_api()->VertexAttrib2s +#define glDeleteQueries mg_gl_get_api()->DeleteQueries +#define glGetProgramStageiv mg_gl_get_api()->GetProgramStageiv +#define glClearColor mg_gl_get_api()->ClearColor +#define glGetVertexAttribdv mg_gl_get_api()->GetVertexAttribdv +#define glGetQueryIndexediv mg_gl_get_api()->GetQueryIndexediv +#define glVertexAttrib3d mg_gl_get_api()->VertexAttrib3d +#define glDrawArraysInstancedBaseInstance mg_gl_get_api()->DrawArraysInstancedBaseInstance +#define glVertexAttribI2i mg_gl_get_api()->VertexAttribI2i +#define glUniformMatrix3x4fv mg_gl_get_api()->UniformMatrix3x4fv +#define glEnablei mg_gl_get_api()->Enablei +#define glStencilFunc mg_gl_get_api()->StencilFunc +#define glVertexAttrib4Nusv mg_gl_get_api()->VertexAttrib4Nusv +#define glVertexAttrib2f mg_gl_get_api()->VertexAttrib2f +#define glVertexAttrib4sv mg_gl_get_api()->VertexAttrib4sv +#define glGenTextures mg_gl_get_api()->GenTextures +#define glGetUniformiv mg_gl_get_api()->GetUniformiv +#define glDebugMessageControl mg_gl_get_api()->DebugMessageControl +#define glProgramUniformMatrix2x4fv mg_gl_get_api()->ProgramUniformMatrix2x4fv +#define glGetFramebufferAttachmentParameteriv mg_gl_get_api()->GetFramebufferAttachmentParameteriv +#define glReadnPixels mg_gl_get_api()->ReadnPixels +#define glGetFloatv mg_gl_get_api()->GetFloatv +#define glUniformMatrix4x3dv mg_gl_get_api()->UniformMatrix4x3dv +#define glUniform2d mg_gl_get_api()->Uniform2d +#define glDeleteVertexArrays mg_gl_get_api()->DeleteVertexArrays +#define glClearBufferfv mg_gl_get_api()->ClearBufferfv +#define glUseProgramStages mg_gl_get_api()->UseProgramStages +#define glProgramUniform3d mg_gl_get_api()->ProgramUniform3d +#define glVertexAttrib2dv mg_gl_get_api()->VertexAttrib2dv +#define glUniformMatrix2x3fv mg_gl_get_api()->UniformMatrix2x3fv +#define glIsQuery mg_gl_get_api()->IsQuery +#define glGetObjectPtrLabel mg_gl_get_api()->GetObjectPtrLabel +#define glLogicOp mg_gl_get_api()->LogicOp +#define glEndQuery mg_gl_get_api()->EndQuery +#define glProgramBinary mg_gl_get_api()->ProgramBinary +#define glIsEnabledi mg_gl_get_api()->IsEnabledi +#define glPrimitiveRestartIndex mg_gl_get_api()->PrimitiveRestartIndex +#define glVertexAttribI1i mg_gl_get_api()->VertexAttribI1i +#define glGetBufferParameteri64v mg_gl_get_api()->GetBufferParameteri64v +#define glUniformMatrix3dv mg_gl_get_api()->UniformMatrix3dv +#define glBlendEquationi mg_gl_get_api()->BlendEquationi +#define glUniform1ui mg_gl_get_api()->Uniform1ui +#define glPointSize mg_gl_get_api()->PointSize +#define glBindImageTexture mg_gl_get_api()->BindImageTexture +#define glBindFramebuffer mg_gl_get_api()->BindFramebuffer +#define glVertexAttrib1dv mg_gl_get_api()->VertexAttrib1dv +#define glUseProgram mg_gl_get_api()->UseProgram +#define glBeginTransformFeedback mg_gl_get_api()->BeginTransformFeedback +#define glGenerateMipmap mg_gl_get_api()->GenerateMipmap +#define glGetUniformSubroutineuiv mg_gl_get_api()->GetUniformSubroutineuiv +#define glProgramUniform4i mg_gl_get_api()->ProgramUniform4i +#define glBindBufferBase mg_gl_get_api()->BindBufferBase +#define glTexStorage3D mg_gl_get_api()->TexStorage3D +#define glUniform3d mg_gl_get_api()->Uniform3d +#define glFramebufferParameteri mg_gl_get_api()->FramebufferParameteri +#define glGetProgramResourceIndex mg_gl_get_api()->GetProgramResourceIndex +#define glBindAttribLocation mg_gl_get_api()->BindAttribLocation +#define glGetActiveUniformBlockName mg_gl_get_api()->GetActiveUniformBlockName +#define glBindVertexArray mg_gl_get_api()->BindVertexArray +#define glVertexAttribBinding mg_gl_get_api()->VertexAttribBinding +#define glGetProgramBinary mg_gl_get_api()->GetProgramBinary +#define glProgramUniformMatrix3x4dv mg_gl_get_api()->ProgramUniformMatrix3x4dv +#define glProgramUniform3fv mg_gl_get_api()->ProgramUniform3fv +#define glDepthMask mg_gl_get_api()->DepthMask +#define glPixelStorei mg_gl_get_api()->PixelStorei +#define glTexSubImage3D mg_gl_get_api()->TexSubImage3D +#define glFenceSync mg_gl_get_api()->FenceSync +#define glProgramUniform1ui mg_gl_get_api()->ProgramUniform1ui +#define glProgramUniform2f mg_gl_get_api()->ProgramUniform2f +#define glProgramUniformMatrix2fv mg_gl_get_api()->ProgramUniformMatrix2fv +#define glIsEnabled mg_gl_get_api()->IsEnabled +#define glGenTransformFeedbacks mg_gl_get_api()->GenTransformFeedbacks +#define glGetBooleanv mg_gl_get_api()->GetBooleanv +#define glProgramUniform2iv mg_gl_get_api()->ProgramUniform2iv +#define glVertexAttrib4Nuiv mg_gl_get_api()->VertexAttrib4Nuiv +#define glGetVertexAttribiv mg_gl_get_api()->GetVertexAttribiv +#define glUniform2ui mg_gl_get_api()->Uniform2ui +#define glProgramUniformMatrix4x3fv mg_gl_get_api()->ProgramUniformMatrix4x3fv +#define glUniformMatrix3x2dv mg_gl_get_api()->UniformMatrix3x2dv +#define glLineWidth mg_gl_get_api()->LineWidth +#define glGetTexParameteriv mg_gl_get_api()->GetTexParameteriv +#define glProgramUniform2ui mg_gl_get_api()->ProgramUniform2ui +#define glUniform4f mg_gl_get_api()->Uniform4f +#define glMultiDrawElementsBaseVertex mg_gl_get_api()->MultiDrawElementsBaseVertex +#define glActiveTexture mg_gl_get_api()->ActiveTexture +#define glInvalidateTexImage mg_gl_get_api()->InvalidateTexImage +#define glVertexAttribL4d mg_gl_get_api()->VertexAttribL4d +#define glMapBuffer mg_gl_get_api()->MapBuffer +#define glMultiDrawElementsIndirect mg_gl_get_api()->MultiDrawElementsIndirect +#define glDrawArraysIndirect mg_gl_get_api()->DrawArraysIndirect +#define glCopyTexSubImage3D mg_gl_get_api()->CopyTexSubImage3D +#define glGetVertexAttribfv mg_gl_get_api()->GetVertexAttribfv +#define glProgramUniformMatrix2dv mg_gl_get_api()->ProgramUniformMatrix2dv +#define glGetError mg_gl_get_api()->GetError +#define glDeleteSamplers mg_gl_get_api()->DeleteSamplers +#define glCopyImageSubData mg_gl_get_api()->CopyImageSubData +#define glDeleteFramebuffers mg_gl_get_api()->DeleteFramebuffers +#define glGetActiveAtomicCounterBufferiv mg_gl_get_api()->GetActiveAtomicCounterBufferiv +#define glVertexAttribL1d mg_gl_get_api()->VertexAttribL1d +#define glVertexAttribI3ui mg_gl_get_api()->VertexAttribI3ui +#define glFramebufferTextureLayer mg_gl_get_api()->FramebufferTextureLayer +#define glColorMaski mg_gl_get_api()->ColorMaski +#define glUniform2dv mg_gl_get_api()->Uniform2dv +#define glIsSampler mg_gl_get_api()->IsSampler +#define glBindVertexBuffer mg_gl_get_api()->BindVertexBuffer +#define glGetSamplerParameteriv mg_gl_get_api()->GetSamplerParameteriv +#define glUniform3dv mg_gl_get_api()->Uniform3dv +#define glIsTexture mg_gl_get_api()->IsTexture +#define glVertexAttrib2sv mg_gl_get_api()->VertexAttrib2sv +#define glDeleteSync mg_gl_get_api()->DeleteSync +#define glInvalidateBufferSubData mg_gl_get_api()->InvalidateBufferSubData +#define glMultiDrawArraysIndirect mg_gl_get_api()->MultiDrawArraysIndirect +#define glValidateProgram mg_gl_get_api()->ValidateProgram +#define glVertexAttribL2dv mg_gl_get_api()->VertexAttribL2dv +#define glVertexAttrib3fv mg_gl_get_api()->VertexAttrib3fv +#define glGetPointerv mg_gl_get_api()->GetPointerv +#define glGenBuffers mg_gl_get_api()->GenBuffers +#define glIsBuffer mg_gl_get_api()->IsBuffer +#define glProgramUniform2d mg_gl_get_api()->ProgramUniform2d +#define glIsShader mg_gl_get_api()->IsShader +#define glBindSampler mg_gl_get_api()->BindSampler +#define glDeleteTransformFeedbacks mg_gl_get_api()->DeleteTransformFeedbacks +#define glProgramUniform1iv mg_gl_get_api()->ProgramUniform1iv +#define glUniformMatrix2x3dv mg_gl_get_api()->UniformMatrix2x3dv +#define glUniform3iv mg_gl_get_api()->Uniform3iv +#define glGetTexImage mg_gl_get_api()->GetTexImage +#define glInvalidateBufferData mg_gl_get_api()->InvalidateBufferData +#define glGetTexParameterfv mg_gl_get_api()->GetTexParameterfv +#define glVertexAttribI3i mg_gl_get_api()->VertexAttribI3i +#define glDrawArrays mg_gl_get_api()->DrawArrays +#define glInvalidateTexSubImage mg_gl_get_api()->InvalidateTexSubImage +#define glPushDebugGroup mg_gl_get_api()->PushDebugGroup +#define glDeleteRenderbuffers mg_gl_get_api()->DeleteRenderbuffers +#define glStencilFuncSeparate mg_gl_get_api()->StencilFuncSeparate +#define glUniform1uiv mg_gl_get_api()->Uniform1uiv +#define glGetProgramInterfaceiv mg_gl_get_api()->GetProgramInterfaceiv +#define glGenSamplers mg_gl_get_api()->GenSamplers +#define glBeginQueryIndexed mg_gl_get_api()->BeginQueryIndexed +#define glTexSubImage2D mg_gl_get_api()->TexSubImage2D +#define glPrimitiveBoundingBox mg_gl_get_api()->PrimitiveBoundingBox +#define glStencilOp mg_gl_get_api()->StencilOp +#define glProgramUniformMatrix4x2dv mg_gl_get_api()->ProgramUniformMatrix4x2dv +#define glBindRenderbuffer mg_gl_get_api()->BindRenderbuffer +#define glEnableVertexAttribArray mg_gl_get_api()->EnableVertexAttribArray +#define glDrawTransformFeedbackStreamInstanced mg_gl_get_api()->DrawTransformFeedbackStreamInstanced +#define glProgramUniform1f mg_gl_get_api()->ProgramUniform1f +#define glGetFragDataIndex mg_gl_get_api()->GetFragDataIndex +#define glGetIntegeri_v mg_gl_get_api()->GetIntegeri_v +#define glBindBuffer mg_gl_get_api()->BindBuffer +#define glVertexAttribLPointer mg_gl_get_api()->VertexAttribLPointer +#define glPointParameteriv mg_gl_get_api()->PointParameteriv +#define glGenRenderbuffers mg_gl_get_api()->GenRenderbuffers +#define glCompressedTexImage2D mg_gl_get_api()->CompressedTexImage2D +#define glDrawBuffers mg_gl_get_api()->DrawBuffers +#define glClientWaitSync mg_gl_get_api()->ClientWaitSync +#define glMinSampleShading mg_gl_get_api()->MinSampleShading +#define glFlush mg_gl_get_api()->Flush +#define glIsSync mg_gl_get_api()->IsSync +#define glGetActiveUniformName mg_gl_get_api()->GetActiveUniformName +#define glCreateShaderProgramv mg_gl_get_api()->CreateShaderProgramv +#define glDisablei mg_gl_get_api()->Disablei +#define glUniformMatrix3x4dv mg_gl_get_api()->UniformMatrix3x4dv +#define glProgramUniform2uiv mg_gl_get_api()->ProgramUniform2uiv +#define glGetInternalformativ mg_gl_get_api()->GetInternalformativ +#define glUniform1i mg_gl_get_api()->Uniform1i +#define glUniform4iv mg_gl_get_api()->Uniform4iv +#define glCompressedTexImage1D mg_gl_get_api()->CompressedTexImage1D +#define glFrontFace mg_gl_get_api()->FrontFace +#define glTexBuffer mg_gl_get_api()->TexBuffer +#define glGetnUniformuiv mg_gl_get_api()->GetnUniformuiv +#define glCreateProgram mg_gl_get_api()->CreateProgram +#define glGetActiveSubroutineName mg_gl_get_api()->GetActiveSubroutineName +#define glVertexAttribI4usv mg_gl_get_api()->VertexAttribI4usv +#define glGetBufferSubData mg_gl_get_api()->GetBufferSubData +#define glCreateShader mg_gl_get_api()->CreateShader +#define glGetObjectLabel mg_gl_get_api()->GetObjectLabel +#define glAttachShader mg_gl_get_api()->AttachShader +#define glVertexAttrib4Niv mg_gl_get_api()->VertexAttrib4Niv +#define glVertexAttribL2d mg_gl_get_api()->VertexAttribL2d +#define glClearBufferuiv mg_gl_get_api()->ClearBufferuiv +#define glTexStorage2DMultisample mg_gl_get_api()->TexStorage2DMultisample +#define glActiveShaderProgram mg_gl_get_api()->ActiveShaderProgram +#define glSamplerParameterIuiv mg_gl_get_api()->SamplerParameterIuiv +#define glVertexAttrib1s mg_gl_get_api()->VertexAttrib1s +#define glPatchParameterfv mg_gl_get_api()->PatchParameterfv +#define glDrawTransformFeedbackInstanced mg_gl_get_api()->DrawTransformFeedbackInstanced +#define glUniform3ui mg_gl_get_api()->Uniform3ui +#define glUniform4d mg_gl_get_api()->Uniform4d +#define glUniform4fv mg_gl_get_api()->Uniform4fv +#define glDispatchCompute mg_gl_get_api()->DispatchCompute +#define glWaitSync mg_gl_get_api()->WaitSync +#define glVertexAttribI2ui mg_gl_get_api()->VertexAttribI2ui +#define glVertexAttrib3s mg_gl_get_api()->VertexAttrib3s +#define glBlendBarrier mg_gl_get_api()->BlendBarrier +#define glPolygonOffset mg_gl_get_api()->PolygonOffset +#define glFramebufferTexture1D mg_gl_get_api()->FramebufferTexture1D +#define glEndConditionalRender mg_gl_get_api()->EndConditionalRender +#define glGetUniformuiv mg_gl_get_api()->GetUniformuiv +#define glProgramUniformMatrix3fv mg_gl_get_api()->ProgramUniformMatrix3fv +#define glUniformMatrix3fv mg_gl_get_api()->UniformMatrix3fv +#define glVertexAttribI4iv mg_gl_get_api()->VertexAttribI4iv +#define glGetString mg_gl_get_api()->GetString +#define glClearDepthf mg_gl_get_api()->ClearDepthf +#define glIsRenderbuffer mg_gl_get_api()->IsRenderbuffer +#define glPointParameterfv mg_gl_get_api()->PointParameterfv +#define glDrawTransformFeedbackStream mg_gl_get_api()->DrawTransformFeedbackStream +#define glVertexAttribI3uiv mg_gl_get_api()->VertexAttribI3uiv +#define glBlendColor mg_gl_get_api()->BlendColor +#define glDebugMessageInsert mg_gl_get_api()->DebugMessageInsert +#define glVertexAttribLFormat mg_gl_get_api()->VertexAttribLFormat +#define glProgramUniform4iv mg_gl_get_api()->ProgramUniform4iv +#define glGetSamplerParameterIuiv mg_gl_get_api()->GetSamplerParameterIuiv +#define glGetQueryObjectuiv mg_gl_get_api()->GetQueryObjectuiv +#define glTexStorage3DMultisample mg_gl_get_api()->TexStorage3DMultisample +#define glUniform1f mg_gl_get_api()->Uniform1f +#define glVertexAttribP1ui mg_gl_get_api()->VertexAttribP1ui +#define glStencilMaskSeparate mg_gl_get_api()->StencilMaskSeparate +#define glProgramUniform1uiv mg_gl_get_api()->ProgramUniform1uiv +#define glTexImage3DMultisample mg_gl_get_api()->TexImage3DMultisample +#define glGetShaderInfoLog mg_gl_get_api()->GetShaderInfoLog +#define glProvokingVertex mg_gl_get_api()->ProvokingVertex +#define glUniform2i mg_gl_get_api()->Uniform2i +#define glUniformMatrix2dv mg_gl_get_api()->UniformMatrix2dv +#define glUniform3fv mg_gl_get_api()->Uniform3fv +#define glGetSubroutineIndex mg_gl_get_api()->GetSubroutineIndex +#define glGenProgramPipelines mg_gl_get_api()->GenProgramPipelines +#define glProgramUniform3ui mg_gl_get_api()->ProgramUniform3ui +#define glUniformBlockBinding mg_gl_get_api()->UniformBlockBinding +#define glGetDoublev mg_gl_get_api()->GetDoublev +#define glDeleteProgramPipelines mg_gl_get_api()->DeleteProgramPipelines +#define glClearBufferfi mg_gl_get_api()->ClearBufferfi +#define glBlitFramebuffer mg_gl_get_api()->BlitFramebuffer +#define glBeginQuery mg_gl_get_api()->BeginQuery +#define glCopyBufferSubData mg_gl_get_api()->CopyBufferSubData +#define glBlendEquation mg_gl_get_api()->BlendEquation +#define glObjectLabel mg_gl_get_api()->ObjectLabel +#define glRenderbufferStorageMultisample mg_gl_get_api()->RenderbufferStorageMultisample +#define glGetUniformdv mg_gl_get_api()->GetUniformdv +#define glProgramUniform2fv mg_gl_get_api()->ProgramUniform2fv +#define glGetTransformFeedbackVarying mg_gl_get_api()->GetTransformFeedbackVarying +#define glGetActiveSubroutineUniformName mg_gl_get_api()->GetActiveSubroutineUniformName +#define glBlendFunci mg_gl_get_api()->BlendFunci +#define glDrawElementsInstancedBaseInstance mg_gl_get_api()->DrawElementsInstancedBaseInstance +#define glUniformMatrix2fv mg_gl_get_api()->UniformMatrix2fv +#define glGetShaderPrecisionFormat mg_gl_get_api()->GetShaderPrecisionFormat +#define glVertexAttrib4ubv mg_gl_get_api()->VertexAttrib4ubv +#define glBlendFuncSeparatei mg_gl_get_api()->BlendFuncSeparatei +#define glBindTexture mg_gl_get_api()->BindTexture +#define glInvalidateSubFramebuffer mg_gl_get_api()->InvalidateSubFramebuffer +#define glProgramUniformMatrix4fv mg_gl_get_api()->ProgramUniformMatrix4fv +#define glShaderStorageBlockBinding mg_gl_get_api()->ShaderStorageBlockBinding +#define glUnmapBuffer mg_gl_get_api()->UnmapBuffer +#define glProgramUniform4fv mg_gl_get_api()->ProgramUniform4fv +#define glBeginConditionalRender mg_gl_get_api()->BeginConditionalRender +#define glViewport mg_gl_get_api()->Viewport +#define glTexParameteri mg_gl_get_api()->TexParameteri +#define glPatchParameteri mg_gl_get_api()->PatchParameteri +#define glVertexAttribI4sv mg_gl_get_api()->VertexAttribI4sv +#define glMemoryBarrier mg_gl_get_api()->MemoryBarrier +#define glProgramUniform3uiv mg_gl_get_api()->ProgramUniform3uiv +#define glVertexAttribI1iv mg_gl_get_api()->VertexAttribI1iv +#define glVertexAttrib2fv mg_gl_get_api()->VertexAttrib2fv +#define glVertexAttribIPointer mg_gl_get_api()->VertexAttribIPointer +#define glDrawElementsBaseVertex mg_gl_get_api()->DrawElementsBaseVertex +#define glProgramUniform4ui mg_gl_get_api()->ProgramUniform4ui +#define glVertexAttribP1uiv mg_gl_get_api()->VertexAttribP1uiv +#define glProgramUniformMatrix3dv mg_gl_get_api()->ProgramUniformMatrix3dv +#define glCompressedTexSubImage3D mg_gl_get_api()->CompressedTexSubImage3D +#define glClearBufferData mg_gl_get_api()->ClearBufferData +#define glDrawElementsInstanced mg_gl_get_api()->DrawElementsInstanced +#define glProgramUniformMatrix2x4dv mg_gl_get_api()->ProgramUniformMatrix2x4dv +#define glScissorArrayv mg_gl_get_api()->ScissorArrayv +#define glPauseTransformFeedback mg_gl_get_api()->PauseTransformFeedback +#define glDrawArraysInstanced mg_gl_get_api()->DrawArraysInstanced +#define glReadPixels mg_gl_get_api()->ReadPixels +#define glGetActiveSubroutineUniformiv mg_gl_get_api()->GetActiveSubroutineUniformiv +#define glVertexAttribP2uiv mg_gl_get_api()->VertexAttribP2uiv +#define glProgramUniformMatrix2x3dv mg_gl_get_api()->ProgramUniformMatrix2x3dv +#define glBlendFunc mg_gl_get_api()->BlendFunc +#define glGetVertexAttribPointerv mg_gl_get_api()->GetVertexAttribPointerv +#define glGetGraphicsResetStatus mg_gl_get_api()->GetGraphicsResetStatus +#define glTransformFeedbackVaryings mg_gl_get_api()->TransformFeedbackVaryings +#define glGetBufferParameteriv mg_gl_get_api()->GetBufferParameteriv +#define glVertexAttribI4bv mg_gl_get_api()->VertexAttribI4bv +#define glDepthFunc mg_gl_get_api()->DepthFunc +#define glUniform3f mg_gl_get_api()->Uniform3f +#define glIsTransformFeedback mg_gl_get_api()->IsTransformFeedback +#define glGetAttribLocation mg_gl_get_api()->GetAttribLocation +#define glGetIntegerv mg_gl_get_api()->GetIntegerv +#define glBlendFuncSeparate mg_gl_get_api()->BlendFuncSeparate +#define glCopyTexSubImage1D mg_gl_get_api()->CopyTexSubImage1D +#define glGetQueryObjecti64v mg_gl_get_api()->GetQueryObjecti64v +#define glGetProgramResourceLocation mg_gl_get_api()->GetProgramResourceLocation +#define glGetnUniformiv mg_gl_get_api()->GetnUniformiv +#define glDeleteBuffers mg_gl_get_api()->DeleteBuffers +#define glVertexAttribP4uiv mg_gl_get_api()->VertexAttribP4uiv +#define glGetStringi mg_gl_get_api()->GetStringi +#define glTextureView mg_gl_get_api()->TextureView +#define glViewportIndexedf mg_gl_get_api()->ViewportIndexedf +#define glGenQueries mg_gl_get_api()->GenQueries +#define glDepthRange mg_gl_get_api()->DepthRange +#define glResumeTransformFeedback mg_gl_get_api()->ResumeTransformFeedback +#define glFramebufferTexture2D mg_gl_get_api()->FramebufferTexture2D +#define glVertexAttrib4d mg_gl_get_api()->VertexAttrib4d +#define glGetUniformLocation mg_gl_get_api()->GetUniformLocation +#define glVertexAttribP2ui mg_gl_get_api()->VertexAttribP2ui +#define glVertexAttrib3sv mg_gl_get_api()->VertexAttrib3sv +#define glUniform1iv mg_gl_get_api()->Uniform1iv +#define glDebugMessageCallback mg_gl_get_api()->DebugMessageCallback +#define glVertexAttrib1fv mg_gl_get_api()->VertexAttrib1fv +#define glUniformMatrix3x2fv mg_gl_get_api()->UniformMatrix3x2fv +#define glDepthRangef mg_gl_get_api()->DepthRangef +#define glProgramUniform3f mg_gl_get_api()->ProgramUniform3f +#define glUniformMatrix4fv mg_gl_get_api()->UniformMatrix4fv +#define glDisableVertexAttribArray mg_gl_get_api()->DisableVertexAttribArray +#define glCompressedTexSubImage1D mg_gl_get_api()->CompressedTexSubImage1D +#define glUniformMatrix4dv mg_gl_get_api()->UniformMatrix4dv +#define glGetSubroutineUniformLocation mg_gl_get_api()->GetSubroutineUniformLocation +#define glUniform4ui mg_gl_get_api()->Uniform4ui +#define glMapBufferRange mg_gl_get_api()->MapBufferRange +#define glGetProgramResourceName mg_gl_get_api()->GetProgramResourceName +#define glDeleteShader mg_gl_get_api()->DeleteShader +#define glVertexAttrib4f mg_gl_get_api()->VertexAttrib4f +#define glGetUniformBlockIndex mg_gl_get_api()->GetUniformBlockIndex +#define glBindTransformFeedback mg_gl_get_api()->BindTransformFeedback +#define glCullFace mg_gl_get_api()->CullFace +#define glDepthRangeIndexed mg_gl_get_api()->DepthRangeIndexed +#define glGenFramebuffers mg_gl_get_api()->GenFramebuffers +#define glVertexAttribP3ui mg_gl_get_api()->VertexAttribP3ui +#define glHint mg_gl_get_api()->Hint +#define glUniform4i mg_gl_get_api()->Uniform4i +#define glGetActiveUniformsiv mg_gl_get_api()->GetActiveUniformsiv +#define glProgramUniform3i mg_gl_get_api()->ProgramUniform3i +#define glGetActiveUniformBlockiv mg_gl_get_api()->GetActiveUniformBlockiv +#define glGetMultisamplefv mg_gl_get_api()->GetMultisamplefv +#define glCompileShader mg_gl_get_api()->CompileShader +#define glTexImage2DMultisample mg_gl_get_api()->TexImage2DMultisample +#define glClearDepth mg_gl_get_api()->ClearDepth +#define glGetUniformIndices mg_gl_get_api()->GetUniformIndices +#define glGetSynciv mg_gl_get_api()->GetSynciv +#define glVertexAttribI2iv mg_gl_get_api()->VertexAttribI2iv +#define glShaderSource mg_gl_get_api()->ShaderSource +#define glPopDebugGroup mg_gl_get_api()->PopDebugGroup +#define glTexImage2D mg_gl_get_api()->TexImage2D +#define glCopyTexImage2D mg_gl_get_api()->CopyTexImage2D +#define glGetProgramiv mg_gl_get_api()->GetProgramiv +#define glClear mg_gl_get_api()->Clear +#define glPixelStoref mg_gl_get_api()->PixelStoref +#define glFramebufferTexture mg_gl_get_api()->FramebufferTexture +#define glVertexAttrib1f mg_gl_get_api()->VertexAttrib1f +#define glBindFragDataLocationIndexed mg_gl_get_api()->BindFragDataLocationIndexed +#define glClearStencil mg_gl_get_api()->ClearStencil +#define glScissor mg_gl_get_api()->Scissor +#define glVertexAttrib4usv mg_gl_get_api()->VertexAttrib4usv +#define glProgramParameteri mg_gl_get_api()->ProgramParameteri +#define glTexParameterfv mg_gl_get_api()->TexParameterfv +#define glVertexAttrib4Nbv mg_gl_get_api()->VertexAttrib4Nbv +#define glProgramUniform4d mg_gl_get_api()->ProgramUniform4d +#define glGetQueryObjectiv mg_gl_get_api()->GetQueryObjectiv +#define glFramebufferTexture3D mg_gl_get_api()->FramebufferTexture3D +#define glVertexAttrib4uiv mg_gl_get_api()->VertexAttrib4uiv +#define glClearBufferSubData mg_gl_get_api()->ClearBufferSubData +#define glVertexAttribP4ui mg_gl_get_api()->VertexAttribP4ui +#define glVertexAttrib4fv mg_gl_get_api()->VertexAttrib4fv +#define glVertexAttrib3dv mg_gl_get_api()->VertexAttrib3dv +#define glStencilMask mg_gl_get_api()->StencilMask +#define glUniform2fv mg_gl_get_api()->Uniform2fv +#define glVertexAttribI1ui mg_gl_get_api()->VertexAttribI1ui +#define glVertexAttribDivisor mg_gl_get_api()->VertexAttribDivisor +#define glUniform2f mg_gl_get_api()->Uniform2f +#define glProgramUniformMatrix2x3fv mg_gl_get_api()->ProgramUniformMatrix2x3fv +#define glBlendEquationSeparatei mg_gl_get_api()->BlendEquationSeparatei +#define glViewportArrayv mg_gl_get_api()->ViewportArrayv +#define glGetVertexAttribIuiv mg_gl_get_api()->GetVertexAttribIuiv +#define glValidateProgramPipeline mg_gl_get_api()->ValidateProgramPipeline +#define glGetTexParameterIuiv mg_gl_get_api()->GetTexParameterIuiv +#define glProgramUniformMatrix3x2fv mg_gl_get_api()->ProgramUniformMatrix3x2fv +#define glVertexAttrib4Nub mg_gl_get_api()->VertexAttrib4Nub +#define glUniform3uiv mg_gl_get_api()->Uniform3uiv +#define glGetInternalformati64v mg_gl_get_api()->GetInternalformati64v +#define glProgramUniform3iv mg_gl_get_api()->ProgramUniform3iv +#define glVertexAttribI4uiv mg_gl_get_api()->VertexAttribI4uiv +#define glBindProgramPipeline mg_gl_get_api()->BindProgramPipeline +#define glPointParameterf mg_gl_get_api()->PointParameterf +#define glBufferSubData mg_gl_get_api()->BufferSubData +#define glProgramUniform4dv mg_gl_get_api()->ProgramUniform4dv +#define glColorMask mg_gl_get_api()->ColorMask +#define glIsProgram mg_gl_get_api()->IsProgram +#define glVertexAttrib4Nsv mg_gl_get_api()->VertexAttrib4Nsv +#define glVertexAttribI3iv mg_gl_get_api()->VertexAttribI3iv +#define glBufferData mg_gl_get_api()->BufferData +#define glUniformSubroutinesuiv mg_gl_get_api()->UniformSubroutinesuiv +#define glGetDoublei_v mg_gl_get_api()->GetDoublei_v +#define glVertexAttrib1sv mg_gl_get_api()->VertexAttrib1sv +#define glProgramUniform1d mg_gl_get_api()->ProgramUniform1d +#define glGetActiveUniform mg_gl_get_api()->GetActiveUniform +#define glSampleMaski mg_gl_get_api()->SampleMaski +#define glDeleteProgram mg_gl_get_api()->DeleteProgram +#define glGetSamplerParameterfv mg_gl_get_api()->GetSamplerParameterfv +#define glTexStorage1D mg_gl_get_api()->TexStorage1D +#define glGetBooleani_v mg_gl_get_api()->GetBooleani_v #endif // __GL_API_H__ diff --git a/src/gl_loader.c b/src/gl_loader.c index 57d7ad5..f768b25 100644 --- a/src/gl_loader.c +++ b/src/gl_loader.c @@ -2,7 +2,7 @@ * * @file: gl_loader.c * @note: auto-generated by glapi.py from gl.xml -* @date: 20/022023 +* @date: 21/022023 * *********************************************************/ #include"gl_loader.h" diff --git a/src/gl_loader.h b/src/gl_loader.h index 039a0ff..5ab0901 100644 --- a/src/gl_loader.h +++ b/src/gl_loader.h @@ -2,7 +2,7 @@ * * @file: gl_loader.h * @note: auto-generated by glapi.py from gl.xml -* @date: 20/022023 +* @date: 21/022023 * *********************************************************/ #ifndef __GL_LOADER_H__ @@ -18,6 +18,5 @@ void mg_gl_load_gles31(mg_gl_api* api, mg_gl_load_proc loadProc); void mg_gl_load_gles32(mg_gl_api* api, mg_gl_load_proc loadProc); void mg_gl_select_api(mg_gl_api* api); -mg_gl_api* mg_gl_get_api(void); #endif // __GL_LOADER_H__ diff --git a/src/graphics.h b/src/graphics.h index 0f9faeb..c6ee3ac 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -79,27 +79,27 @@ typedef enum { //TODO: add MG_INCLUDE_OPENGL/GLES/etc, once we know how we make different gl versions co-exist -bool mg_is_surface_backend_available(mg_backend_id id); -bool mg_is_canvas_backend_available(mg_backend_id id); +MP_API bool mg_is_surface_backend_available(mg_backend_id id); +MP_API bool mg_is_canvas_backend_available(mg_backend_id id); //------------------------------------------------------------------------------------------ //NOTE(martin): graphics surface //------------------------------------------------------------------------------------------ typedef struct mg_surface { u64 h; } mg_surface; -mg_surface mg_surface_nil(); -bool mg_surface_is_nil(mg_surface surface); +MP_API mg_surface mg_surface_nil(); +MP_API bool mg_surface_is_nil(mg_surface surface); -mg_surface mg_surface_create_for_window(mp_window window, mg_backend_id backend); -void mg_surface_destroy(mg_surface surface); -void mg_surface_prepare(mg_surface surface); -void mg_surface_present(mg_surface surface); -void mg_surface_swap_interval(mg_surface surface, int swap); -vec2 mg_surface_contents_scaling(mg_surface surface); -mp_rect mg_surface_get_frame(mg_surface surface); -void mg_surface_set_frame(mg_surface surface, mp_rect frame); -bool mg_surface_get_hidden(mg_surface surface); -void mg_surface_set_hidden(mg_surface surface, bool hidden); +MP_API mg_surface mg_surface_create_for_window(mp_window window, mg_backend_id backend); +MP_API void mg_surface_destroy(mg_surface surface); +MP_API void mg_surface_prepare(mg_surface surface); +MP_API void mg_surface_present(mg_surface surface); +MP_API void mg_surface_swap_interval(mg_surface surface, int swap); +MP_API vec2 mg_surface_contents_scaling(mg_surface surface); +MP_API mp_rect mg_surface_get_frame(mg_surface surface); +MP_API void mg_surface_set_frame(mg_surface surface, mp_rect frame); +MP_API bool mg_surface_get_hidden(mg_surface surface); +MP_API void mg_surface_set_hidden(mg_surface surface, bool hidden); //------------------------------------------------------------------------------------------ @@ -161,128 +161,128 @@ typedef struct mg_text_extents //------------------------------------------------------------------------------------------ //NOTE(martin): graphics canvas //------------------------------------------------------------------------------------------ -mg_canvas mg_canvas_nil(); -bool mg_canvas_is_nil(mg_canvas canvas); +MP_API mg_canvas mg_canvas_nil(); +MP_API bool mg_canvas_is_nil(mg_canvas canvas); -mg_canvas mg_canvas_create(mg_surface surface); -void mg_canvas_destroy(mg_canvas canvas); -mg_canvas mg_canvas_set_current(mg_canvas canvas); +MP_API mg_canvas mg_canvas_create(mg_surface surface); +MP_API void mg_canvas_destroy(mg_canvas canvas); +MP_API mg_canvas mg_canvas_set_current(mg_canvas canvas); -void mg_flush(); +MP_API void mg_flush(); //------------------------------------------------------------------------------------------ //NOTE(martin): transform, viewport and clipping //------------------------------------------------------------------------------------------ -void mg_viewport(mp_rect viewPort); +MP_API void mg_viewport(mp_rect viewPort); -void mg_matrix_push(mg_mat2x3 matrix); -void mg_matrix_pop(); +MP_API void mg_matrix_push(mg_mat2x3 matrix); +MP_API void mg_matrix_pop(); -void mg_clip_push(f32 x, f32 y, f32 w, f32 h); -void mg_clip_pop(); +MP_API void mg_clip_push(f32 x, f32 y, f32 w, f32 h); +MP_API void mg_clip_pop(); //------------------------------------------------------------------------------------------ //NOTE(martin): graphics attributes setting/getting //------------------------------------------------------------------------------------------ -void mg_set_color(mg_color color); -void mg_set_color_rgba(f32 r, f32 g, f32 b, f32 a); -void mg_set_width(f32 width); -void mg_set_tolerance(f32 tolerance); -void mg_set_joint(mg_joint_type joint); -void mg_set_max_joint_excursion(f32 maxJointExcursion); -void mg_set_cap(mg_cap_type cap); -void mg_set_font(mg_font font); -void mg_set_font_size(f32 size); -void mg_set_text_flip(bool flip); +MP_API void mg_set_color(mg_color color); +MP_API void mg_set_color_rgba(f32 r, f32 g, f32 b, f32 a); +MP_API void mg_set_width(f32 width); +MP_API void mg_set_tolerance(f32 tolerance); +MP_API void mg_set_joint(mg_joint_type joint); +MP_API void mg_set_max_joint_excursion(f32 maxJointExcursion); +MP_API void mg_set_cap(mg_cap_type cap); +MP_API void mg_set_font(mg_font font); +MP_API void mg_set_font_size(f32 size); +MP_API void mg_set_text_flip(bool flip); -mg_color mg_get_color(); -f32 mg_get_width(); -f32 mg_get_tolerance(); -mg_joint_type mg_get_joint(); -f32 mg_get_max_joint_excursion(); -mg_cap_type mg_get_cap(); -mg_font mg_get_font(); -f32 mg_get_font_size(); -bool mg_get_text_flip(); +MP_API mg_color mg_get_color(); +MP_API f32 mg_get_width(); +MP_API f32 mg_get_tolerance(); +MP_API mg_joint_type mg_get_joint(); +MP_API f32 mg_get_max_joint_excursion(); +MP_API mg_cap_type mg_get_cap(); +MP_API mg_font mg_get_font(); +MP_API f32 mg_get_font_size(); +MP_API bool mg_get_text_flip(); //------------------------------------------------------------------------------------------ //NOTE(martin): path construction //------------------------------------------------------------------------------------------ -vec2 mg_get_position(); -void mg_move_to(f32 x, f32 y); -void mg_line_to(f32 x, f32 y); -void mg_quadratic_to(f32 x1, f32 y1, f32 x2, f32 y2); -void mg_cubic_to(f32 x1, f32 y1, f32 x2, f32 y2, f32 x3, f32 y3); -void mg_close_path(); +MP_API vec2 mg_get_position(); +MP_API void mg_move_to(f32 x, f32 y); +MP_API void mg_line_to(f32 x, f32 y); +MP_API void mg_quadratic_to(f32 x1, f32 y1, f32 x2, f32 y2); +MP_API void mg_cubic_to(f32 x1, f32 y1, f32 x2, f32 y2, f32 x3, f32 y3); +MP_API void mg_close_path(); -mp_rect mg_glyph_outlines(str32 glyphIndices); -void mg_codepoints_outlines(str32 string); -void mg_text_outlines(str8 string); +MP_API mp_rect mg_glyph_outlines(str32 glyphIndices); +MP_API void mg_codepoints_outlines(str32 string); +MP_API void mg_text_outlines(str8 string); //------------------------------------------------------------------------------------------ //NOTE(martin): clear/fill/stroke //------------------------------------------------------------------------------------------ -void mg_clear(); -void mg_fill(); -void mg_stroke(); +MP_API void mg_clear(); +MP_API void mg_fill(); +MP_API void mg_stroke(); //------------------------------------------------------------------------------------------ //NOTE(martin): 'fast' shapes primitives //------------------------------------------------------------------------------------------ -void mg_rectangle_fill(f32 x, f32 y, f32 w, f32 h); -void mg_rectangle_stroke(f32 x, f32 y, f32 w, f32 h); -void mg_rounded_rectangle_fill(f32 x, f32 y, f32 w, f32 h, f32 r); -void mg_rounded_rectangle_stroke(f32 x, f32 y, f32 w, f32 h, f32 r); -void mg_ellipse_fill(f32 x, f32 y, f32 rx, f32 ry); -void mg_ellipse_stroke(f32 x, f32 y, f32 rx, f32 ry); -void mg_circle_fill(f32 x, f32 y, f32 r); -void mg_circle_stroke(f32 x, f32 y, f32 r); -void mg_arc(f32 x, f32 y, f32 r, f32 arcAngle, f32 startAngle); +MP_API void mg_rectangle_fill(f32 x, f32 y, f32 w, f32 h); +MP_API void mg_rectangle_stroke(f32 x, f32 y, f32 w, f32 h); +MP_API void mg_rounded_rectangle_fill(f32 x, f32 y, f32 w, f32 h, f32 r); +MP_API void mg_rounded_rectangle_stroke(f32 x, f32 y, f32 w, f32 h, f32 r); +MP_API void mg_ellipse_fill(f32 x, f32 y, f32 rx, f32 ry); +MP_API void mg_ellipse_stroke(f32 x, f32 y, f32 rx, f32 ry); +MP_API void mg_circle_fill(f32 x, f32 y, f32 r); +MP_API void mg_circle_stroke(f32 x, f32 y, f32 r); +MP_API void mg_arc(f32 x, f32 y, f32 r, f32 arcAngle, f32 startAngle); //------------------------------------------------------------------------------------------ //NOTE(martin): fonts //------------------------------------------------------------------------------------------ -mg_font mg_font_nil(); -mg_font mg_font_create_from_memory(u32 size, byte* buffer, u32 rangeCount, unicode_range* ranges); -void mg_font_destroy(mg_font font); +MP_API mg_font mg_font_nil(); +MP_API mg_font mg_font_create_from_memory(u32 size, byte* buffer, u32 rangeCount, unicode_range* ranges); +MP_API void mg_font_destroy(mg_font font); //NOTE(martin): the following int valued functions return -1 if font is invalid or codepoint is not present in font// //TODO(martin): add enum error codes -mg_font_extents mg_font_get_extents(mg_font font); -mg_font_extents mg_font_get_scaled_extents(mg_font font, f32 emSize); -f32 mg_font_get_scale_for_em_pixels(mg_font font, f32 emSize); +MP_API mg_font_extents mg_font_get_extents(mg_font font); +MP_API mg_font_extents mg_font_get_scaled_extents(mg_font font, f32 emSize); +MP_API f32 mg_font_get_scale_for_em_pixels(mg_font font, f32 emSize); //NOTE(martin): if you need to process more than one codepoint, first convert your codepoints to glyph indices, then use the // glyph index versions of the functions, which can take an array of glyph indices. -str32 mg_font_get_glyph_indices(mg_font font, str32 codePoints, str32 backing); -str32 mg_font_push_glyph_indices(mg_font font, mem_arena* arena, str32 codePoints); -u32 mg_font_get_glyph_index(mg_font font, utf32 codePoint); +MP_API str32 mg_font_get_glyph_indices(mg_font font, str32 codePoints, str32 backing); +MP_API str32 mg_font_push_glyph_indices(mg_font font, mem_arena* arena, str32 codePoints); +MP_API u32 mg_font_get_glyph_index(mg_font font, utf32 codePoint); -int mg_font_get_codepoint_extents(mg_font font, utf32 codePoint, mg_text_extents* outExtents); +MP_API int mg_font_get_codepoint_extents(mg_font font, utf32 codePoint, mg_text_extents* outExtents); -int mg_font_get_glyph_extents(mg_font font, str32 glyphIndices, mg_text_extents* outExtents); +MP_API int mg_font_get_glyph_extents(mg_font font, str32 glyphIndices, mg_text_extents* outExtents); -mp_rect mg_text_bounding_box_utf32(mg_font font, f32 fontSize, str32 text); -mp_rect mg_text_bounding_box(mg_font font, f32 fontSize, str8 text); +MP_API mp_rect mg_text_bounding_box_utf32(mg_font font, f32 fontSize, str32 text); +MP_API mp_rect mg_text_bounding_box(mg_font font, f32 fontSize, str8 text); //------------------------------------------------------------------------------------------ //NOTE(martin): images //------------------------------------------------------------------------------------------ typedef struct mg_image { u64 h; } mg_image; -mg_image mg_image_nil(); -bool mg_image_equal(mg_image a, mg_image b); +MP_API mg_image mg_image_nil(); +MP_API bool mg_image_equal(mg_image a, mg_image b); -mg_image mg_image_create_from_rgba8(u32 width, u32 height, u8* pixels); -mg_image mg_image_create_from_data(str8 data, bool flip); -mg_image mg_image_create_from_file(str8 path, bool flip); +MP_API mg_image mg_image_create_from_rgba8(u32 width, u32 height, u8* pixels); +MP_API mg_image mg_image_create_from_data(str8 data, bool flip); +MP_API mg_image mg_image_create_from_file(str8 path, bool flip); -void mg_image_drestroy(mg_image image); +MP_API void mg_image_drestroy(mg_image image); -vec2 mg_image_size(mg_image image); -void mg_image_draw(mg_image image, mp_rect rect); -void mg_rounded_image_draw(mg_image image, mp_rect rect, f32 roundness); +MP_API vec2 mg_image_size(mg_image image); +MP_API void mg_image_draw(mg_image image, mp_rect rect); +MP_API void mg_rounded_image_draw(mg_image image, mp_rect rect, f32 roundness); #endif //__GRAPHICS_H_ diff --git a/src/mp_app.h b/src/mp_app.h index e46fff2..b907548 100644 --- a/src/mp_app.h +++ b/src/mp_app.h @@ -1,398 +1,398 @@ -/************************************************************//** -* -* @file: platform_app.h -* @author: Martin Fouilleul -* @date: 16/05/2020 -* @revision: -* -*****************************************************************/ -#ifndef __PLATFORM_APP_H_ -#define __PLATFORM_APP_H_ - -#include"typedefs.h" -#include"utf8.h" -#include"lists.h" - -#ifdef __cplusplus -extern "C" { -#endif - -//-------------------------------------------------------------------- -// Typedefs, enums and constants -//-------------------------------------------------------------------- - -typedef struct mp_window { u64 h; } mp_window; - -typedef enum { MP_MOUSE_CURSOR_ARROW, - MP_MOUSE_CURSOR_RESIZE_0, - MP_MOUSE_CURSOR_RESIZE_90, - MP_MOUSE_CURSOR_RESIZE_45, - MP_MOUSE_CURSOR_RESIZE_135, - MP_MOUSE_CURSOR_TEXT } mp_mouse_cursor; - -typedef i32 mp_window_style; -static const mp_window_style MP_WINDOW_STYLE_NO_TITLE = 0x01<<0, - MP_WINDOW_STYLE_FIXED_SIZE = 0x01<<1, - MP_WINDOW_STYLE_NO_CLOSE = 0x01<<2, - MP_WINDOW_STYLE_NO_MINIFY = 0x01<<3, - MP_WINDOW_STYLE_NO_FOCUS = 0x01<<4, - MP_WINDOW_STYLE_FLOAT = 0x01<<5, - MP_WINDOW_STYLE_POPUPMENU = 0x01<<6, - MP_WINDOW_STYLE_NO_BUTTONS = 0x01<<7; - -typedef enum { MP_EVENT_NONE, - MP_EVENT_KEYBOARD_MODS, //TODO: remove, keep only key? - MP_EVENT_KEYBOARD_KEY, - MP_EVENT_KEYBOARD_CHAR, - MP_EVENT_MOUSE_BUTTON, - MP_EVENT_MOUSE_MOVE, - MP_EVENT_MOUSE_WHEEL, - MP_EVENT_MOUSE_ENTER, - MP_EVENT_MOUSE_LEAVE, - MP_EVENT_WINDOW_RESIZE, - MP_EVENT_WINDOW_MOVE, - MP_EVENT_WINDOW_FOCUS, - MP_EVENT_WINDOW_UNFOCUS, - MP_EVENT_WINDOW_HIDE, // rename to minimize? - MP_EVENT_WINDOW_SHOW, // rename to restore? - MP_EVENT_WINDOW_CLOSE, - MP_EVENT_PATHDROP, - MP_EVENT_FRAME, - MP_EVENT_QUIT } mp_event_type; - -typedef enum { MP_KEY_NO_ACTION, - MP_KEY_PRESS, - MP_KEY_RELEASE, - MP_KEY_REPEAT } mp_key_action; - -typedef enum { MP_KEY_UNKNOWN = 0, - MP_KEY_SPACE = 32, - MP_KEY_APOSTROPHE = 39, /* ' */ - MP_KEY_COMMA = 44, /* , */ - MP_KEY_MINUS = 45, // - - MP_KEY_PERIOD = 46, // . - MP_KEY_SLASH = 47, // / - MP_KEY_0 = 48, - MP_KEY_1 = 49, - MP_KEY_2 = 50, - MP_KEY_3 = 51, - MP_KEY_4 = 52, - MP_KEY_5 = 53, - MP_KEY_6 = 54, - MP_KEY_7 = 55, - MP_KEY_8 = 56, - MP_KEY_9 = 57, - MP_KEY_SEMICOLON = 59, // ; - MP_KEY_EQUAL = 61, // = - MP_KEY_A = 65, - MP_KEY_B = 66, - MP_KEY_C = 67, - MP_KEY_D = 68, - MP_KEY_E = 69, - MP_KEY_F = 70, - MP_KEY_G = 71, - MP_KEY_H = 72, - MP_KEY_I = 73, - MP_KEY_J = 74, - MP_KEY_K = 75, - MP_KEY_L = 76, - MP_KEY_M = 77, - MP_KEY_N = 78, - MP_KEY_O = 79, - MP_KEY_P = 80, - MP_KEY_Q = 81, - MP_KEY_R = 82, - MP_KEY_S = 83, - MP_KEY_T = 84, - MP_KEY_U = 85, - MP_KEY_V = 86, - MP_KEY_W = 87, - MP_KEY_X = 88, - MP_KEY_Y = 89, - MP_KEY_Z = 90, - MP_KEY_LEFT_BRACKET = 91, // [ - MP_KEY_BACKSLASH = 92, // \ */ - MP_KEY_RIGHT_BRACKET = 93, // ] - MP_KEY_GRAVE_ACCENT = 96, // ` - MP_KEY_WORLD_1 = 161, // non-US #1 - MP_KEY_WORLD_2 = 162, // non-US #2 - MP_KEY_ESCAPE = 256, - MP_KEY_ENTER = 257, - MP_KEY_TAB = 258, - MP_KEY_BACKSPACE = 259, - MP_KEY_INSERT = 260, - MP_KEY_DELETE = 261, - MP_KEY_RIGHT = 262, - MP_KEY_LEFT = 263, - MP_KEY_DOWN = 264, - MP_KEY_UP = 265, - MP_KEY_PAGE_UP = 266, - MP_KEY_PAGE_DOWN = 267, - MP_KEY_HOME = 268, - MP_KEY_END = 269, - MP_KEY_CAPS_LOCK = 280, - MP_KEY_SCROLL_LOCK = 281, - MP_KEY_NUM_LOCK = 282, - MP_KEY_PRINT_SCREEN = 283, - MP_KEY_PAUSE = 284, - MP_KEY_F1 = 290, - MP_KEY_F2 = 291, - MP_KEY_F3 = 292, - MP_KEY_F4 = 293, - MP_KEY_F5 = 294, - MP_KEY_F6 = 295, - MP_KEY_F7 = 296, - MP_KEY_F8 = 297, - MP_KEY_F9 = 298, - MP_KEY_F10 = 299, - MP_KEY_F11 = 300, - MP_KEY_F12 = 301, - MP_KEY_F13 = 302, - MP_KEY_F14 = 303, - MP_KEY_F15 = 304, - MP_KEY_F16 = 305, - MP_KEY_F17 = 306, - MP_KEY_F18 = 307, - MP_KEY_F19 = 308, - MP_KEY_F20 = 309, - MP_KEY_F21 = 310, - MP_KEY_F22 = 311, - MP_KEY_F23 = 312, - MP_KEY_F24 = 313, - MP_KEY_F25 = 314, - MP_KEY_KP_0 = 320, - MP_KEY_KP_1 = 321, - MP_KEY_KP_2 = 322, - MP_KEY_KP_3 = 323, - MP_KEY_KP_4 = 324, - MP_KEY_KP_5 = 325, - MP_KEY_KP_6 = 326, - MP_KEY_KP_7 = 327, - MP_KEY_KP_8 = 328, - MP_KEY_KP_9 = 329, - MP_KEY_KP_DECIMAL = 330, - MP_KEY_KP_DIVIDE = 331, - MP_KEY_KP_MULTIPLY = 332, - MP_KEY_KP_SUBTRACT = 333, - MP_KEY_KP_ADD = 334, - MP_KEY_KP_ENTER = 335, - MP_KEY_KP_EQUAL = 336, - MP_KEY_LEFT_SHIFT = 340, - MP_KEY_LEFT_CONTROL = 341, - MP_KEY_LEFT_ALT = 342, - MP_KEY_LEFT_SUPER = 343, - MP_KEY_RIGHT_SHIFT = 344, - MP_KEY_RIGHT_CONTROL = 345, - MP_KEY_RIGHT_ALT = 346, - MP_KEY_RIGHT_SUPER = 347, - MP_KEY_MENU = 348, - MP_KEY_COUNT } mp_key_code; - -typedef enum { - MP_KEYMOD_NONE = 0x00, - MP_KEYMOD_ALT = 0x01, - MP_KEYMOD_SHIFT = 0x02, - MP_KEYMOD_CTRL = 0x04, - MP_KEYMOD_CMD = 0x08 } mp_key_mods; - -typedef enum { - MP_MOUSE_LEFT = 0x00, - MP_MOUSE_RIGHT = 0x01, - MP_MOUSE_MIDDLE = 0x02, - MP_MOUSE_EXT1 = 0x03, - MP_MOUSE_EXT2 = 0x04, - MP_MOUSE_BUTTON_COUNT } mp_mouse_button; - -typedef struct mp_key_event // keyboard and mouse buttons input -{ - mp_key_action action; - i32 code; - mp_key_mods mods; - char label[8]; - u8 labelLen; - int clickCount; -} mp_key_event; - -typedef struct mp_char_event // character input -{ - utf32 codepoint; - char sequence[8]; - u8 seqLen; -} mp_char_event; - -typedef struct mp_move_event // mouse move/scroll -{ - f32 x; - f32 y; - f32 deltaX; - f32 deltaY; - mp_key_mods mods; -} mp_move_event; - -typedef struct mp_frame_event // window resize / move -{ - mp_rect rect; -} mp_frame_event; - -typedef struct mp_event -{ - //TODO clipboard and path drop - - mp_window window; - mp_event_type type; - - union - { - mp_key_event key; - mp_char_event character; - mp_move_event move; - mp_frame_event frame; - str8 path; - }; - - //TODO(martin): chain externally ? - list_elt list; -} mp_event; - -//-------------------------------------------------------------------- -// app management -//-------------------------------------------------------------------- - -void mp_init(); -void mp_terminate(); - -bool mp_should_quit(); -void mp_cancel_quit(); -void mp_request_quit(); - -void mp_set_cursor(mp_mouse_cursor cursor); - -//-------------------------------------------------------------------- -// Main loop and events handling -//-------------------------------------------------------------------- - -void mp_pump_events(f64 timeout); -bool mp_next_event(mp_event* event); - -typedef void(*mp_live_resize_callback)(mp_event event, void* data); -void mp_set_live_resize_callback(mp_live_resize_callback callback, void* data); - -//-------------------------------------------------------------------- -// window management -//-------------------------------------------------------------------- - -bool mp_window_handle_is_null(mp_window window); -mp_window mp_window_null_handle(); - -mp_window mp_window_create(mp_rect contentRect, const char* title, mp_window_style style); -void mp_window_destroy(mp_window window); -void* mp_window_native_pointer(mp_window window); - -bool mp_window_should_close(mp_window window); -void mp_window_request_close(mp_window window); -void mp_window_cancel_close(mp_window window); - -bool mp_window_is_hidden(mp_window window); -void mp_window_hide(mp_window window); -void mp_window_show(mp_window window); - -bool mp_window_is_minimized(mp_window window); -bool mp_window_is_maximized(mp_window window); -void mp_window_minimize(mp_window window); -void mp_window_maximize(mp_window window); -void mp_window_restore(mp_window window); - -bool mp_window_has_focus(mp_window window); -void mp_window_focus(mp_window window); -void mp_window_unfocus(mp_window window); - -void mp_window_send_to_back(mp_window window); -void mp_window_bring_to_front(mp_window window); - -mp_rect mp_window_get_content_rect(mp_window window); -mp_rect mp_window_get_frame_rect(mp_window window); -void mp_window_set_content_rect(mp_window window, mp_rect contentRect); -void mp_window_set_frame_rect(mp_window window, mp_rect frameRect); - -void mp_window_center(mp_window window); - -mp_rect mp_window_content_rect_for_frame_rect(mp_rect frameRect, mp_window_style style); -mp_rect mp_window_frame_rect_for_content_rect(mp_rect contentRect, mp_window_style style); - -//-------------------------------------------------------------------- -// Input state polling -//-------------------------------------------------------------------- -bool mp_input_key_down(mp_key_code key); -bool mp_input_key_pressed(mp_key_code key); -bool mp_input_key_released(mp_key_code key); -mp_key_mods mp_input_key_mods(); - -str8 mp_key_to_label(mp_key_code key); -mp_key_code mp_label_to_key(str8 label); - -bool mp_input_mouse_down(mp_mouse_button button); -bool mp_input_mouse_pressed(mp_mouse_button button); -bool mp_input_mouse_released(mp_mouse_button button); -bool mp_input_mouse_clicked(mp_mouse_button button); -bool mp_input_mouse_double_clicked(mp_mouse_button button); - -vec2 mp_input_mouse_position(); -vec2 mp_input_mouse_delta(); -vec2 mp_input_mouse_wheel(); - -str32 mp_input_text_utf32(mem_arena* arena); -str8 mp_input_text_utf8(mem_arena* arena); - -//-------------------------------------------------------------------- -// Clipboard -//-------------------------------------------------------------------- -void mp_clipboard_clear(); - -void mp_clipboard_set_string(str8 string); -str8 mp_clipboard_get_string(mem_arena* arena); -str8 mp_clipboard_copy_string(str8 backing); - -bool mp_clipboard_has_tag(const char* tag); -void mp_clipboard_set_data_for_tag(const char* tag, str8 data); -str8 mp_clipboard_get_data_for_tag(mem_arena* arena, const char* tag); - -//-------------------------------------------------------------------- -// native open/save/alert windows -//-------------------------------------------------------------------- - -str8 mp_open_dialog(mem_arena* arena, - const char* title, - const char* defaultPath, - int filterCount, - const char** filters, - bool directory); - -str8 mp_save_dialog(mem_arena* arena, - const char* title, - const char* defaultPath, - int filterCount, - const char** filters); - -int mp_alert_popup(const char* title, - const char* message, - u32 count, - const char** options); - - -//-------------------------------------------------------------------- -// file system stuff... //TODO: move elsewhere -//-------------------------------------------------------------------- -int mp_file_move(str8 from, str8 to); -int mp_file_remove(str8 path); - -int mp_directory_create(str8 path); - -str8 mp_app_get_resource_path(mem_arena* arena, const char* name); -str8 mp_app_get_executable_path(mem_arena* arena); - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif //__PLATFORM_APP_H_ +/************************************************************//** +* +* @file: platform_app.h +* @author: Martin Fouilleul +* @date: 16/05/2020 +* @revision: +* +*****************************************************************/ +#ifndef __PLATFORM_APP_H_ +#define __PLATFORM_APP_H_ + +#include"typedefs.h" +#include"utf8.h" +#include"lists.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//-------------------------------------------------------------------- +// Typedefs, enums and constants +//-------------------------------------------------------------------- + +typedef struct mp_window { u64 h; } mp_window; + +typedef enum { MP_MOUSE_CURSOR_ARROW, + MP_MOUSE_CURSOR_RESIZE_0, + MP_MOUSE_CURSOR_RESIZE_90, + MP_MOUSE_CURSOR_RESIZE_45, + MP_MOUSE_CURSOR_RESIZE_135, + MP_MOUSE_CURSOR_TEXT } mp_mouse_cursor; + +typedef i32 mp_window_style; +static const mp_window_style MP_WINDOW_STYLE_NO_TITLE = 0x01<<0, + MP_WINDOW_STYLE_FIXED_SIZE = 0x01<<1, + MP_WINDOW_STYLE_NO_CLOSE = 0x01<<2, + MP_WINDOW_STYLE_NO_MINIFY = 0x01<<3, + MP_WINDOW_STYLE_NO_FOCUS = 0x01<<4, + MP_WINDOW_STYLE_FLOAT = 0x01<<5, + MP_WINDOW_STYLE_POPUPMENU = 0x01<<6, + MP_WINDOW_STYLE_NO_BUTTONS = 0x01<<7; + +typedef enum { MP_EVENT_NONE, + MP_EVENT_KEYBOARD_MODS, //TODO: remove, keep only key? + MP_EVENT_KEYBOARD_KEY, + MP_EVENT_KEYBOARD_CHAR, + MP_EVENT_MOUSE_BUTTON, + MP_EVENT_MOUSE_MOVE, + MP_EVENT_MOUSE_WHEEL, + MP_EVENT_MOUSE_ENTER, + MP_EVENT_MOUSE_LEAVE, + MP_EVENT_WINDOW_RESIZE, + MP_EVENT_WINDOW_MOVE, + MP_EVENT_WINDOW_FOCUS, + MP_EVENT_WINDOW_UNFOCUS, + MP_EVENT_WINDOW_HIDE, // rename to minimize? + MP_EVENT_WINDOW_SHOW, // rename to restore? + MP_EVENT_WINDOW_CLOSE, + MP_EVENT_PATHDROP, + MP_EVENT_FRAME, + MP_EVENT_QUIT } mp_event_type; + +typedef enum { MP_KEY_NO_ACTION, + MP_KEY_PRESS, + MP_KEY_RELEASE, + MP_KEY_REPEAT } mp_key_action; + +typedef enum { MP_KEY_UNKNOWN = 0, + MP_KEY_SPACE = 32, + MP_KEY_APOSTROPHE = 39, /* ' */ + MP_KEY_COMMA = 44, /* , */ + MP_KEY_MINUS = 45, // - + MP_KEY_PERIOD = 46, // . + MP_KEY_SLASH = 47, // / + MP_KEY_0 = 48, + MP_KEY_1 = 49, + MP_KEY_2 = 50, + MP_KEY_3 = 51, + MP_KEY_4 = 52, + MP_KEY_5 = 53, + MP_KEY_6 = 54, + MP_KEY_7 = 55, + MP_KEY_8 = 56, + MP_KEY_9 = 57, + MP_KEY_SEMICOLON = 59, // ; + MP_KEY_EQUAL = 61, // = + MP_KEY_A = 65, + MP_KEY_B = 66, + MP_KEY_C = 67, + MP_KEY_D = 68, + MP_KEY_E = 69, + MP_KEY_F = 70, + MP_KEY_G = 71, + MP_KEY_H = 72, + MP_KEY_I = 73, + MP_KEY_J = 74, + MP_KEY_K = 75, + MP_KEY_L = 76, + MP_KEY_M = 77, + MP_KEY_N = 78, + MP_KEY_O = 79, + MP_KEY_P = 80, + MP_KEY_Q = 81, + MP_KEY_R = 82, + MP_KEY_S = 83, + MP_KEY_T = 84, + MP_KEY_U = 85, + MP_KEY_V = 86, + MP_KEY_W = 87, + MP_KEY_X = 88, + MP_KEY_Y = 89, + MP_KEY_Z = 90, + MP_KEY_LEFT_BRACKET = 91, // [ + MP_KEY_BACKSLASH = 92, // \ */ + MP_KEY_RIGHT_BRACKET = 93, // ] + MP_KEY_GRAVE_ACCENT = 96, // ` + MP_KEY_WORLD_1 = 161, // non-US #1 + MP_KEY_WORLD_2 = 162, // non-US #2 + MP_KEY_ESCAPE = 256, + MP_KEY_ENTER = 257, + MP_KEY_TAB = 258, + MP_KEY_BACKSPACE = 259, + MP_KEY_INSERT = 260, + MP_KEY_DELETE = 261, + MP_KEY_RIGHT = 262, + MP_KEY_LEFT = 263, + MP_KEY_DOWN = 264, + MP_KEY_UP = 265, + MP_KEY_PAGE_UP = 266, + MP_KEY_PAGE_DOWN = 267, + MP_KEY_HOME = 268, + MP_KEY_END = 269, + MP_KEY_CAPS_LOCK = 280, + MP_KEY_SCROLL_LOCK = 281, + MP_KEY_NUM_LOCK = 282, + MP_KEY_PRINT_SCREEN = 283, + MP_KEY_PAUSE = 284, + MP_KEY_F1 = 290, + MP_KEY_F2 = 291, + MP_KEY_F3 = 292, + MP_KEY_F4 = 293, + MP_KEY_F5 = 294, + MP_KEY_F6 = 295, + MP_KEY_F7 = 296, + MP_KEY_F8 = 297, + MP_KEY_F9 = 298, + MP_KEY_F10 = 299, + MP_KEY_F11 = 300, + MP_KEY_F12 = 301, + MP_KEY_F13 = 302, + MP_KEY_F14 = 303, + MP_KEY_F15 = 304, + MP_KEY_F16 = 305, + MP_KEY_F17 = 306, + MP_KEY_F18 = 307, + MP_KEY_F19 = 308, + MP_KEY_F20 = 309, + MP_KEY_F21 = 310, + MP_KEY_F22 = 311, + MP_KEY_F23 = 312, + MP_KEY_F24 = 313, + MP_KEY_F25 = 314, + MP_KEY_KP_0 = 320, + MP_KEY_KP_1 = 321, + MP_KEY_KP_2 = 322, + MP_KEY_KP_3 = 323, + MP_KEY_KP_4 = 324, + MP_KEY_KP_5 = 325, + MP_KEY_KP_6 = 326, + MP_KEY_KP_7 = 327, + MP_KEY_KP_8 = 328, + MP_KEY_KP_9 = 329, + MP_KEY_KP_DECIMAL = 330, + MP_KEY_KP_DIVIDE = 331, + MP_KEY_KP_MULTIPLY = 332, + MP_KEY_KP_SUBTRACT = 333, + MP_KEY_KP_ADD = 334, + MP_KEY_KP_ENTER = 335, + MP_KEY_KP_EQUAL = 336, + MP_KEY_LEFT_SHIFT = 340, + MP_KEY_LEFT_CONTROL = 341, + MP_KEY_LEFT_ALT = 342, + MP_KEY_LEFT_SUPER = 343, + MP_KEY_RIGHT_SHIFT = 344, + MP_KEY_RIGHT_CONTROL = 345, + MP_KEY_RIGHT_ALT = 346, + MP_KEY_RIGHT_SUPER = 347, + MP_KEY_MENU = 348, + MP_KEY_COUNT } mp_key_code; + +typedef enum { + MP_KEYMOD_NONE = 0x00, + MP_KEYMOD_ALT = 0x01, + MP_KEYMOD_SHIFT = 0x02, + MP_KEYMOD_CTRL = 0x04, + MP_KEYMOD_CMD = 0x08 } mp_key_mods; + +typedef enum { + MP_MOUSE_LEFT = 0x00, + MP_MOUSE_RIGHT = 0x01, + MP_MOUSE_MIDDLE = 0x02, + MP_MOUSE_EXT1 = 0x03, + MP_MOUSE_EXT2 = 0x04, + MP_MOUSE_BUTTON_COUNT } mp_mouse_button; + +typedef struct mp_key_event // keyboard and mouse buttons input +{ + mp_key_action action; + i32 code; + mp_key_mods mods; + char label[8]; + u8 labelLen; + int clickCount; +} mp_key_event; + +typedef struct mp_char_event // character input +{ + utf32 codepoint; + char sequence[8]; + u8 seqLen; +} mp_char_event; + +typedef struct mp_move_event // mouse move/scroll +{ + f32 x; + f32 y; + f32 deltaX; + f32 deltaY; + mp_key_mods mods; +} mp_move_event; + +typedef struct mp_frame_event // window resize / move +{ + mp_rect rect; +} mp_frame_event; + +typedef struct mp_event +{ + //TODO clipboard and path drop + + mp_window window; + mp_event_type type; + + union + { + mp_key_event key; + mp_char_event character; + mp_move_event move; + mp_frame_event frame; + str8 path; + }; + + //TODO(martin): chain externally ? + list_elt list; +} mp_event; + +//-------------------------------------------------------------------- +// app management +//-------------------------------------------------------------------- + +MP_API void mp_init(void); +MP_API void mp_terminate(void); + +MP_API bool mp_should_quit(void); +MP_API void mp_cancel_quit(void); +MP_API void mp_request_quit(void); + +MP_API void mp_set_cursor(mp_mouse_cursor cursor); + +//-------------------------------------------------------------------- +// Main loop and events handling +//-------------------------------------------------------------------- + +MP_API void mp_pump_events(f64 timeout); +MP_API bool mp_next_event(mp_event* event); + +typedef void(*mp_live_resize_callback)(mp_event event, void* data); +MP_API void mp_set_live_resize_callback(mp_live_resize_callback callback, void* data); + +//-------------------------------------------------------------------- +// window management +//-------------------------------------------------------------------- + +MP_API bool mp_window_handle_is_null(mp_window window); +MP_API mp_window mp_window_null_handle(void); + +MP_API mp_window mp_window_create(mp_rect contentRect, const char* title, mp_window_style style); +MP_API void mp_window_destroy(mp_window window); +MP_API void* mp_window_native_pointer(mp_window window); + +MP_API bool mp_window_should_close(mp_window window); +MP_API void mp_window_request_close(mp_window window); +MP_API void mp_window_cancel_close(mp_window window); + +MP_API bool mp_window_is_hidden(mp_window window); +MP_API void mp_window_hide(mp_window window); +MP_API void mp_window_show(mp_window window); + +MP_API bool mp_window_is_minimized(mp_window window); +MP_API bool mp_window_is_maximized(mp_window window); +MP_API void mp_window_minimize(mp_window window); +MP_API void mp_window_maximize(mp_window window); +MP_API void mp_window_restore(mp_window window); + +MP_API bool mp_window_has_focus(mp_window window); +MP_API void mp_window_focus(mp_window window); +MP_API void mp_window_unfocus(mp_window window); + +MP_API void mp_window_send_to_back(mp_window window); +MP_API void mp_window_bring_to_front(mp_window window); + +MP_API mp_rect mp_window_get_content_rect(mp_window window); +MP_API mp_rect mp_window_get_frame_rect(mp_window window); +MP_API void mp_window_set_content_rect(mp_window window, mp_rect contentRect); +MP_API void mp_window_set_frame_rect(mp_window window, mp_rect frameRect); + +MP_API void mp_window_center(mp_window window); + +MP_API mp_rect mp_window_content_rect_for_frame_rect(mp_rect frameRect, mp_window_style style); +MP_API mp_rect mp_window_frame_rect_for_content_rect(mp_rect contentRect, mp_window_style style); + +//-------------------------------------------------------------------- +// Input state polling +//-------------------------------------------------------------------- +MP_API bool mp_input_key_down(mp_key_code key); +MP_API bool mp_input_key_pressed(mp_key_code key); +MP_API bool mp_input_key_released(mp_key_code key); +MP_API mp_key_mods mp_input_key_mods(void); + +MP_API str8 mp_key_to_label(mp_key_code key); +MP_API mp_key_code mp_label_to_key(str8 label); + +MP_API bool mp_input_mouse_down(mp_mouse_button button); +MP_API bool mp_input_mouse_pressed(mp_mouse_button button); +MP_API bool mp_input_mouse_released(mp_mouse_button button); +MP_API bool mp_input_mouse_clicked(mp_mouse_button button); +MP_API bool mp_input_mouse_double_clicked(mp_mouse_button button); + +MP_API vec2 mp_input_mouse_position(void); +MP_API vec2 mp_input_mouse_delta(void); +MP_API vec2 mp_input_mouse_wheel(void); + +MP_API str32 mp_input_text_utf32(mem_arena* arena); +MP_API str8 mp_input_text_utf8(mem_arena* arena); + +//-------------------------------------------------------------------- +// Clipboard +//-------------------------------------------------------------------- +MP_API void mp_clipboard_clear(void); + +MP_API void mp_clipboard_set_string(str8 string); +MP_API str8 mp_clipboard_get_string(mem_arena* arena); +MP_API str8 mp_clipboard_copy_string(str8 backing); + +MP_API bool mp_clipboard_has_tag(const char* tag); +MP_API void mp_clipboard_set_data_for_tag(const char* tag, str8 data); +MP_API str8 mp_clipboard_get_data_for_tag(mem_arena* arena, const char* tag); + +//-------------------------------------------------------------------- +// native open/save/alert windows +//-------------------------------------------------------------------- + +MP_API str8 mp_open_dialog(mem_arena* arena, + const char* title, + const char* defaultPath, + int filterCount, + const char** filters, + bool directory); + +MP_API str8 mp_save_dialog(mem_arena* arena, + const char* title, + const char* defaultPath, + int filterCount, + const char** filters); + +MP_API int mp_alert_popup(const char* title, + const char* message, + u32 count, + const char** options); + + +//-------------------------------------------------------------------- +// file system stuff... //TODO: move elsewhere +//-------------------------------------------------------------------- +MP_API int mp_file_move(str8 from, str8 to); +MP_API int mp_file_remove(str8 path); + +MP_API int mp_directory_create(str8 path); + +MP_API str8 mp_app_get_resource_path(mem_arena* arena, const char* name); +MP_API str8 mp_app_get_executable_path(mem_arena* arena); + + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif //__PLATFORM_APP_H_ diff --git a/src/platform/platform.h b/src/platform/platform.h index 23c90c7..019cb6a 100644 --- a/src/platform/platform.h +++ b/src/platform/platform.h @@ -1,85 +1,93 @@ -//***************************************************************** -// -// $file: platform.h $ -// $author: Martin Fouilleul $ -// $date: 22/12/2022 $ -// $revision: $ -// $note: (C) 2022 by Martin Fouilleul - all rights reserved $ -// -//***************************************************************** -#ifndef __PLATFORM_H_ -#define __PLATFORM_H_ - -//----------------------------------------------------------------- -// Compiler identification -//----------------------------------------------------------------- -#if defined(__clang__) - #define COMPILER_CLANG 1 - #if defined(__apple_build_version__) - #define COMPILER_CLANG_APPLE 1 - #elif defined(_MSC_VER) - #define COMPILER_CLANG_CL 1 - #endif - -#elif defined(_MSC_VER) - #define COMPILER_CL 1 -#elif defined(__GNUC__) - #define COMPILER_GCC 1 -#else - #error "Can't identify compiler" -#endif - -//----------------------------------------------------------------- -// OS identification -//----------------------------------------------------------------- -#if defined(_WIN64) - #define OS_WIN64 1 -#elif defined(_WIN32) - #error "Unsupported OS (32bit only version of Windows)" -#elif defined(__APPLE__) && defined(__MACH__) - #define OS_MACOS 1 -#elif defined(__gnu_linux__) - #define OS_LINUX 1 -#else - #error "Can't identify OS" -#endif - -//----------------------------------------------------------------- -// Architecture identification -//----------------------------------------------------------------- -#if defined(COMPILER_CL) - #if defined(_M_AMD64) - #define ARCH_X64 1 - #elif defined(_M_I86) - #define ARCH_X86 1 - #elif defined(_M_ARM64) - #define ARCH_ARM64 1 - #elif defined(_M_ARM) - #define ARCH_ARM32 1 - #else - #error "Can't identify architecture" - #endif -#else - #if defined(__x86_64__) - #define ARCH_X64 1 - #elif defined(__i386__) - #define ARCH_X86 1 - #elif defined(__arm__) - #define ARCH_ARM32 1 - #elif defined(__aarch64__) - #define ARCH_ARM64 1 - #else - #error "Can't identify architecture" - #endif -#endif - -//----------------------------------------------------------------- -// platform helper macros -//----------------------------------------------------------------- -#if defined(COMPILER_CL) - #define mp_thread_local __declspec(thread) -#elif defined(COMPILER_GCC) || defined(COMPILER_CLANG) - #define mp_thread_local __thread -#endif - -#endif // __PLATFORM_H_ +//***************************************************************** +// +// $file: platform.h $ +// $author: Martin Fouilleul $ +// $date: 22/12/2022 $ +// $revision: $ +// $note: (C) 2022 by Martin Fouilleul - all rights reserved $ +// +//***************************************************************** +#ifndef __PLATFORM_H_ +#define __PLATFORM_H_ + +//----------------------------------------------------------------- +// Compiler identification +//----------------------------------------------------------------- +#if defined(__clang__) + #define COMPILER_CLANG 1 + #if defined(__apple_build_version__) + #define COMPILER_CLANG_APPLE 1 + #elif defined(_MSC_VER) + #define COMPILER_CLANG_CL 1 + #endif + +#elif defined(_MSC_VER) + #define COMPILER_CL 1 +#elif defined(__GNUC__) + #define COMPILER_GCC 1 +#else + #error "Can't identify compiler" +#endif + +//----------------------------------------------------------------- +// OS identification +//----------------------------------------------------------------- +#if defined(_WIN64) + #define OS_WIN64 1 +#elif defined(_WIN32) + #error "Unsupported OS (32bit only version of Windows)" +#elif defined(__APPLE__) && defined(__MACH__) + #define OS_MACOS 1 +#elif defined(__gnu_linux__) + #define OS_LINUX 1 +#else + #error "Can't identify OS" +#endif + +//----------------------------------------------------------------- +// Architecture identification +//----------------------------------------------------------------- +#if defined(COMPILER_CL) + #if defined(_M_AMD64) + #define ARCH_X64 1 + #elif defined(_M_I86) + #define ARCH_X86 1 + #elif defined(_M_ARM64) + #define ARCH_ARM64 1 + #elif defined(_M_ARM) + #define ARCH_ARM32 1 + #else + #error "Can't identify architecture" + #endif +#else + #if defined(__x86_64__) + #define ARCH_X64 1 + #elif defined(__i386__) + #define ARCH_X86 1 + #elif defined(__arm__) + #define ARCH_ARM32 1 + #elif defined(__aarch64__) + #define ARCH_ARM64 1 + #else + #error "Can't identify architecture" + #endif +#endif + +//----------------------------------------------------------------- +// platform helper macros +//----------------------------------------------------------------- +#if defined(COMPILER_CL) + #if defined(MP_BUILD_DLL) + #define MP_API __declspec(dllexport) + #else + #define MP_API __declspec(dllimport) + #endif + + #define mp_thread_local __declspec(thread) + +#elif defined(COMPILER_GCC) || defined(COMPILER_CLANG) + #define MP_API + #define mp_thread_local __thread +#endif + +#endif // __PLATFORM_H_ diff --git a/src/platform/platform_clock.h b/src/platform/platform_clock.h index 29d982d..29736f6 100644 --- a/src/platform/platform_clock.h +++ b/src/platform/platform_clock.h @@ -1,34 +1,34 @@ -/************************************************************//** -* -* @file: platform_clock.h -* @author: Martin Fouilleul -* @date: 07/03/2019 -* @revision: -* -*****************************************************************/ -#ifndef __PLATFORM_CLOCK_H_ -#define __PLATFORM_CLOCK_H_ - -#include"typedefs.h" - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -typedef enum { - MP_CLOCK_MONOTONIC, // clock that increment monotonically - MP_CLOCK_UPTIME, // clock that increment monotonically during uptime - MP_CLOCK_DATE // clock that is driven by the platform time -} mp_clock_kind; - -void mp_clock_init(); // initialize the clock subsystem -u64 mp_get_timestamp(mp_clock_kind clock); -f64 mp_get_time(mp_clock_kind clock); -void mp_sleep_nanoseconds(u64 nanoseconds); // sleep for a given number of nanoseconds - -#ifdef __cplusplus -} // extern "C" -#endif // __cplusplus - - -#endif //__PLATFORM_CLOCK_H_ +/************************************************************//** +* +* @file: platform_clock.h +* @author: Martin Fouilleul +* @date: 07/03/2019 +* @revision: +* +*****************************************************************/ +#ifndef __PLATFORM_CLOCK_H_ +#define __PLATFORM_CLOCK_H_ + +#include"typedefs.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +typedef enum { + MP_CLOCK_MONOTONIC, // clock that increment monotonically + MP_CLOCK_UPTIME, // clock that increment monotonically during uptime + MP_CLOCK_DATE // clock that is driven by the platform time +} mp_clock_kind; + +MP_API void mp_clock_init(); // initialize the clock subsystem +MP_API u64 mp_get_timestamp(mp_clock_kind clock); +MP_API f64 mp_get_time(mp_clock_kind clock); +MP_API void mp_sleep_nanoseconds(u64 nanoseconds); // sleep for a given number of nanoseconds + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + + +#endif //__PLATFORM_CLOCK_H_ diff --git a/src/util/debug_log.h b/src/util/debug_log.h index db041d5..34df11d 100644 --- a/src/util/debug_log.h +++ b/src/util/debug_log.h @@ -1,97 +1,98 @@ -/************************************************************//** -* -* @file: debug_log.h -* @author: Martin Fouilleul -* @date: 05/04/2019 -* @revision: -* -*****************************************************************/ -#ifndef __DEBUG_LOG_H_ -#define __DEBUG_LOG_H_ - -#include -#include"typedefs.h" -#include"macro_helpers.h" - -#ifdef __cplusplus -extern "C" { -#endif -//NOTE(martin): the default logging level can be adjusted by defining LOG_DEFAULT_LEVEL. As the name suggest, it is the default, but it -// can be adjusted at runtime with LogLevel() -#ifndef LOG_DEFAULT_LEVEL - #define LOG_DEFAULT_LEVEL LOG_LEVEL_WARNING -#endif - -//NOTE(martin): the default output can be adjusted by defining LOG_DEFAULT_OUTPUT. It can be adjusted at runtime with LogOutput() -#ifndef LOG_DEFAULT_OUTPUT - #define LOG_DEFAULT_OUTPUT stdout -#endif - -//NOTE(martin): LOG_SUBSYSTEM can be defined in each compilation unit to associate it with a subsystem, like this: -// #define LOG_SUBSYSTEM "name" - -typedef enum { LOG_LEVEL_ERROR, - LOG_LEVEL_WARNING, - LOG_LEVEL_MESSAGE, - LOG_LEVEL_DEBUG, - LOG_LEVEL_COUNT } log_level; - -void LogGeneric(log_level level, - const char* subsystem, - const char* functionName, - const char* fileName, - u32 line, - const char* msg, - ...); - -void LogOutput(FILE* output); -void LogLevel(log_level level); -void LogFilter(const char* subsystem, log_level level); - -#define LOG_GENERIC(level, func, file, line, msg, ...) LogGeneric(level, LOG_SUBSYSTEM, func, file, line, msg, ##__VA_ARGS__ ) - -#define LOG_ERROR(msg, ...) LOG_GENERIC(LOG_LEVEL_ERROR, __FUNCTION__, __FILE__, __LINE__, msg, ##__VA_ARGS__ ) - -//NOTE(martin): warnings, messages, and debug info can be enabled in debug mode by defining LOG_COMPILE_XXX, XXX being the max desired log level -// error logging is always compiled -#if defined(LOG_COMPILE_WARNING) || defined(LOG_COMPILE_MESSAGE) || defined(LOG_COMPILE_DEBUG) - #define LOG_WARNING(msg, ...) LOG_GENERIC(LOG_LEVEL_WARNING, __FUNCTION__, __FILE__, __LINE__, msg, ##__VA_ARGS__ ) - - #if defined(LOG_COMPILE_MESSAGE) || defined(LOG_COMPILE_DEBUG) - #define LOG_MESSAGE(msg, ...) LOG_GENERIC(LOG_LEVEL_MESSAGE, __FUNCTION__, __FILE__, __LINE__, msg, ##__VA_ARGS__ ) - - #if defined(LOG_COMPILE_DEBUG) - #define LOG_DEBUG(msg, ...) LOG_GENERIC(LOG_LEVEL_DEBUG, __FUNCTION__, __FILE__, __LINE__, msg, ##__VA_ARGS__ ) - #else - #define LOG_DEBUG(msg, ...) - #endif - #else - #define LOG_MESSAGE(msg, ...) - #define LOG_DEBUG(msg, ...) - #endif -#else - #define LOG_WARNING(msg, ...) - #define LOG_MESSAGE(msg, ...) - #define LOG_DEBUG(msg, ...) -#endif - -#ifndef NO_ASSERT - #include - #define _ASSERT_(x, msg) assert(x && msg) - #define ASSERT(x, ...) _ASSERT_(x, #__VA_ARGS__) - - #ifdef DEBUG - #define DEBUG_ASSERT(x, ...) ASSERT(x, ##__VA_ARGS__ ) - #else - #define DEBUG_ASSERT(x, ...) - #endif -#else - #define ASSERT(x, ...) - #define DEBUG_ASSERT(x, ...) -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif //__DEBUG_LOG_H_ +/************************************************************//** +* +* @file: debug_log.h +* @author: Martin Fouilleul +* @date: 05/04/2019 +* @revision: +* +*****************************************************************/ +#ifndef __DEBUG_LOG_H_ +#define __DEBUG_LOG_H_ + +#include +#include"platform.h" +#include"typedefs.h" +#include"macro_helpers.h" + +#ifdef __cplusplus +extern "C" { +#endif +//NOTE(martin): the default logging level can be adjusted by defining LOG_DEFAULT_LEVEL. As the name suggest, it is the default, but it +// can be adjusted at runtime with LogLevel() +#ifndef LOG_DEFAULT_LEVEL + #define LOG_DEFAULT_LEVEL LOG_LEVEL_WARNING +#endif + +//NOTE(martin): the default output can be adjusted by defining LOG_DEFAULT_OUTPUT. It can be adjusted at runtime with LogOutput() +#ifndef LOG_DEFAULT_OUTPUT + #define LOG_DEFAULT_OUTPUT stdout +#endif + +//NOTE(martin): LOG_SUBSYSTEM can be defined in each compilation unit to associate it with a subsystem, like this: +// #define LOG_SUBSYSTEM "name" + +typedef enum { LOG_LEVEL_ERROR, + LOG_LEVEL_WARNING, + LOG_LEVEL_MESSAGE, + LOG_LEVEL_DEBUG, + LOG_LEVEL_COUNT } log_level; + +MP_API void LogGeneric(log_level level, + const char* subsystem, + const char* functionName, + const char* fileName, + u32 line, + const char* msg, + ...); + +MP_API void LogOutput(FILE* output); +MP_API void LogLevel(log_level level); +MP_API void LogFilter(const char* subsystem, log_level level); + +#define LOG_GENERIC(level, func, file, line, msg, ...) LogGeneric(level, LOG_SUBSYSTEM, func, file, line, msg, ##__VA_ARGS__ ) + +#define LOG_ERROR(msg, ...) LOG_GENERIC(LOG_LEVEL_ERROR, __FUNCTION__, __FILE__, __LINE__, msg, ##__VA_ARGS__ ) + +//NOTE(martin): warnings, messages, and debug info can be enabled in debug mode by defining LOG_COMPILE_XXX, XXX being the max desired log level +// error logging is always compiled +#if defined(LOG_COMPILE_WARNING) || defined(LOG_COMPILE_MESSAGE) || defined(LOG_COMPILE_DEBUG) + #define LOG_WARNING(msg, ...) LOG_GENERIC(LOG_LEVEL_WARNING, __FUNCTION__, __FILE__, __LINE__, msg, ##__VA_ARGS__ ) + + #if defined(LOG_COMPILE_MESSAGE) || defined(LOG_COMPILE_DEBUG) + #define LOG_MESSAGE(msg, ...) LOG_GENERIC(LOG_LEVEL_MESSAGE, __FUNCTION__, __FILE__, __LINE__, msg, ##__VA_ARGS__ ) + + #if defined(LOG_COMPILE_DEBUG) + #define LOG_DEBUG(msg, ...) LOG_GENERIC(LOG_LEVEL_DEBUG, __FUNCTION__, __FILE__, __LINE__, msg, ##__VA_ARGS__ ) + #else + #define LOG_DEBUG(msg, ...) + #endif + #else + #define LOG_MESSAGE(msg, ...) + #define LOG_DEBUG(msg, ...) + #endif +#else + #define LOG_WARNING(msg, ...) + #define LOG_MESSAGE(msg, ...) + #define LOG_DEBUG(msg, ...) +#endif + +#ifndef NO_ASSERT + #include + #define _ASSERT_(x, msg) assert(x && msg) + #define ASSERT(x, ...) _ASSERT_(x, #__VA_ARGS__) + + #ifdef DEBUG + #define DEBUG_ASSERT(x, ...) ASSERT(x, ##__VA_ARGS__ ) + #else + #define DEBUG_ASSERT(x, ...) + #endif +#else + #define ASSERT(x, ...) + #define DEBUG_ASSERT(x, ...) +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif //__DEBUG_LOG_H_ diff --git a/src/util/hash.h b/src/util/hash.h index b482a4c..6d492a1 100644 --- a/src/util/hash.h +++ b/src/util/hash.h @@ -1,29 +1,29 @@ -/************************************************************//** -* -* @file: hash.h -* @author: Martin Fouilleul -* @date: 08/08/2022 -* @revision: -* -*****************************************************************/ -#ifndef __HASH_H_ -#define __HASH_H_ - -#include"typedefs.h" -#include"strings.h" - -#ifdef __cplusplus -extern "C" { -#endif - -u64 mp_hash_aes_u64(u64 x); -u64 mp_hash_aes_u64_x2(u64 x, u64 y); -u64 mp_hash_aes_string(str8 string); -u64 mp_hash_aes_string_seed(str8 string, u64 seed); - -#ifdef __cplusplus -} // extern "C" -#endif - - -#endif //__HASH_H_ +/************************************************************//** +* +* @file: hash.h +* @author: Martin Fouilleul +* @date: 08/08/2022 +* @revision: +* +*****************************************************************/ +#ifndef __HASH_H_ +#define __HASH_H_ + +#include"typedefs.h" +#include"strings.h" + +#ifdef __cplusplus +extern "C" { +#endif + +MP_API u64 mp_hash_aes_u64(u64 x); +MP_API u64 mp_hash_aes_u64_x2(u64 x, u64 y); +MP_API u64 mp_hash_aes_string(str8 string); +MP_API u64 mp_hash_aes_string_seed(str8 string, u64 seed); + +#ifdef __cplusplus +} // extern "C" +#endif + + +#endif //__HASH_H_ diff --git a/src/util/memory.h b/src/util/memory.h index 4e04e16..bedb53f 100644 --- a/src/util/memory.h +++ b/src/util/memory.h @@ -1,106 +1,106 @@ -/************************************************************//** -* -* @file: memory.h -* @author: Martin Fouilleul -* @date: 24/10/2019 -* @revision: -* -*****************************************************************/ -#ifndef __MEMORY_H_ -#define __MEMORY_H_ - -#include"typedefs.h" -#include"lists.h" - -#ifdef __cplusplus -extern "C" { -#endif - -//-------------------------------------------------------------------------------- -//NOTE(martin): base allocator -//-------------------------------------------------------------------------------- -typedef void*(*mem_reserve_function)(void* context, u64 size); -typedef void(*mem_modify_function)(void* context, void* ptr, u64 size); - -typedef struct mem_base_allocator -{ - mem_reserve_function reserve; - mem_modify_function commit; - mem_modify_function decommit; - mem_modify_function release; - void* context; - -} mem_base_allocator; - -mem_base_allocator* mem_base_allocator_default(); - -#define mem_base_reserve(base, size) base->reserve(base->context, size) -#define mem_base_commit(base, ptr, size) base->commit(base->context, ptr, size) -#define mem_base_decommit(base, ptr, size) base->decommit(base->context, ptr, size) -#define mem_base_release(base, ptr, size) base->release(base->context, ptr, size) - -//-------------------------------------------------------------------------------- -//NOTE(martin): memory arena -//-------------------------------------------------------------------------------- -typedef struct mem_arena -{ - mem_base_allocator* base; - char* ptr; - u64 offset; - u64 committed; - u64 cap; -} mem_arena; - -typedef struct mem_arena_options -{ - mem_base_allocator* base; - u64 reserve; -} mem_arena_options; - -void mem_arena_init(mem_arena* arena); -void mem_arena_init_with_options(mem_arena* arena, mem_arena_options* options); -void mem_arena_release(mem_arena* arena); - -void* mem_arena_alloc(mem_arena* arena, u64 size); -void mem_arena_clear(mem_arena* arena); - -#define mem_arena_alloc_type(arena, type) ((type*)mem_arena_alloc(arena, sizeof(type))) -#define mem_arena_alloc_array(arena, type, count) ((type*)mem_arena_alloc(arena, sizeof(type)*(count))) - -//-------------------------------------------------------------------------------- -//NOTE(martin): memory pool -//-------------------------------------------------------------------------------- -typedef struct mem_pool -{ - mem_arena arena; - list_info freeList; - u64 blockSize; -} mem_pool; - -typedef struct mem_pool_options -{ - mem_base_allocator* base; - u64 reserve; -} mem_pool_options; - -void mem_pool_init(mem_pool* pool, u64 blockSize); -void mem_pool_init_with_options(mem_pool* pool, u64 blockSize, mem_pool_options* options); -void mem_pool_release(mem_pool* pool); - -void* mem_pool_alloc(mem_pool* pool); -void mem_pool_recycle(mem_pool* pool, void* ptr); -void mem_pool_clear(mem_pool* pool); - -#define mem_pool_alloc_type(arena, type) ((type*)mem_pool_alloc(arena)) - -//-------------------------------------------------------------------------------- -//NOTE(martin): per-thread implicit scratch arena -//-------------------------------------------------------------------------------- -void mem_scratch_clear(); -mem_arena* mem_scratch(); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif //__MEMORY_H_ +/************************************************************//** +* +* @file: memory.h +* @author: Martin Fouilleul +* @date: 24/10/2019 +* @revision: +* +*****************************************************************/ +#ifndef __MEMORY_H_ +#define __MEMORY_H_ + +#include"typedefs.h" +#include"lists.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//-------------------------------------------------------------------------------- +//NOTE(martin): base allocator +//-------------------------------------------------------------------------------- +typedef void*(*mem_reserve_function)(void* context, u64 size); +typedef void(*mem_modify_function)(void* context, void* ptr, u64 size); + +typedef struct mem_base_allocator +{ + mem_reserve_function reserve; + mem_modify_function commit; + mem_modify_function decommit; + mem_modify_function release; + void* context; + +} mem_base_allocator; + +MP_API mem_base_allocator* mem_base_allocator_default(); + +#define mem_base_reserve(base, size) base->reserve(base->context, size) +#define mem_base_commit(base, ptr, size) base->commit(base->context, ptr, size) +#define mem_base_decommit(base, ptr, size) base->decommit(base->context, ptr, size) +#define mem_base_release(base, ptr, size) base->release(base->context, ptr, size) + +//-------------------------------------------------------------------------------- +//NOTE(martin): memory arena +//-------------------------------------------------------------------------------- +typedef struct mem_arena +{ + mem_base_allocator* base; + char* ptr; + u64 offset; + u64 committed; + u64 cap; +} mem_arena; + +typedef struct mem_arena_options +{ + mem_base_allocator* base; + u64 reserve; +} mem_arena_options; + +MP_API void mem_arena_init(mem_arena* arena); +MP_API void mem_arena_init_with_options(mem_arena* arena, mem_arena_options* options); +MP_API void mem_arena_release(mem_arena* arena); + +MP_API void* mem_arena_alloc(mem_arena* arena, u64 size); +MP_API void mem_arena_clear(mem_arena* arena); + +#define mem_arena_alloc_type(arena, type) ((type*)mem_arena_alloc(arena, sizeof(type))) +#define mem_arena_alloc_array(arena, type, count) ((type*)mem_arena_alloc(arena, sizeof(type)*(count))) + +//-------------------------------------------------------------------------------- +//NOTE(martin): memory pool +//-------------------------------------------------------------------------------- +typedef struct mem_pool +{ + mem_arena arena; + list_info freeList; + u64 blockSize; +} mem_pool; + +typedef struct mem_pool_options +{ + mem_base_allocator* base; + u64 reserve; +} mem_pool_options; + +MP_API void mem_pool_init(mem_pool* pool, u64 blockSize); +MP_API void mem_pool_init_with_options(mem_pool* pool, u64 blockSize, mem_pool_options* options); +MP_API void mem_pool_release(mem_pool* pool); + +MP_API void* mem_pool_alloc(mem_pool* pool); +MP_API void mem_pool_recycle(mem_pool* pool, void* ptr); +MP_API void mem_pool_clear(mem_pool* pool); + +#define mem_pool_alloc_type(arena, type) ((type*)mem_pool_alloc(arena)) + +//-------------------------------------------------------------------------------- +//NOTE(martin): per-thread implicit scratch arena +//-------------------------------------------------------------------------------- +MP_API void mem_scratch_clear(); +MP_API mem_arena* mem_scratch(); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif //__MEMORY_H_ diff --git a/src/util/strings.h b/src/util/strings.h index 28e39d3..2b1bbb7 100644 --- a/src/util/strings.h +++ b/src/util/strings.h @@ -1,113 +1,113 @@ -/************************************************************//** -* -* @file: strings.h -* @author: Martin Fouilleul -* @date: 29/05/2021 -* @revision: -* -*****************************************************************/ -#ifndef __STRINGS_H_ -#define __STRINGS_H_ - -#include"typedefs.h" -#include"lists.h" -#include"memory.h" - -#ifdef __cplusplus -extern "C" { -#endif - -//---------------------------------------------------------------------------------- -// string slices as values -//---------------------------------------------------------------------------------- -typedef struct str8 -{ - u64 len; - char* ptr; -} str8; - -#define str8_lit(s) ((str8){.len = sizeof(s)-1, .ptr = (char*)(s)}) -#define str8_unbox(s) (int)((s).len), ((s).ptr) - -str8 str8_from_buffer(u64 len, char* buffer); -str8 str8_from_cstring(char* str); -str8 str8_slice(str8 s, u64 start, u64 end); - -str8 str8_push_buffer(mem_arena* arena, u64 len, char* buffer); -str8 str8_push_cstring(mem_arena* arena, const char* str); -str8 str8_push_copy(mem_arena* arena, str8 s); -str8 str8_push_slice(mem_arena* arena, str8 s, u64 start, u64 end); - -str8 str8_pushfv(mem_arena* arena, const char* format, va_list args); -str8 str8_pushf(mem_arena* arena, const char* format, ...); - -int str8_cmp(str8 s1, str8 s2); - -char* str8_to_cstring(mem_arena* arena, str8 string); -//---------------------------------------------------------------------------------- -// string lists -//---------------------------------------------------------------------------------- -typedef struct str8_elt -{ - list_elt listElt; - str8 string; -} str8_elt; - -typedef struct str8_list -{ - list_info list; - u64 eltCount; - u64 len; -} str8_list; - -void str8_list_push(mem_arena* arena, str8_list* list, str8 str); -void str8_list_pushf(mem_arena* arena, str8_list* list, const char* format, ...); - -str8 str8_list_join(mem_arena* arena, str8_list list); -str8_list str8_split(mem_arena* arena, str8 str, str8_list separators); - -//---------------------------------------------------------------------------------- -// u32 strings -//---------------------------------------------------------------------------------- -typedef struct str32 -{ - u64 len; - u32* ptr; -} str32; - -str32 str32_from_buffer(u64 len, u32* buffer); -str32 str32_slice(str32 s, u64 start, u64 end); - -str32 str32_push_buffer(mem_arena* arena, u64 len, u32* buffer); -str32 str32_push_copy(mem_arena* arena, str32 s); -str32 str32_push_slice(mem_arena* arena, str32 s, u64 start, u64 end); - -typedef struct str32_elt -{ - list_elt listElt; - str32 string; -} str32_elt; - -typedef struct str32_list -{ - list_info list; - u64 eltCount; - u64 len; -} str32_list; - -void str32_list_push(mem_arena* arena, str32_list* list, str32 str); -str32 str32_list_join(mem_arena* arena, str32_list list); -str32_list str32_split(mem_arena* arena, str32 str, str32_list separators); - -//---------------------------------------------------------------------------------- -// Paths helpers -//---------------------------------------------------------------------------------- -str8 mp_path_directory(str8 fullPath); -str8 mp_path_base_name(str8 fullPath); - -#ifdef __cplusplus -} // extern "C" -#endif - - -#endif //__STRINGS_H_ +/************************************************************//** +* +* @file: strings.h +* @author: Martin Fouilleul +* @date: 29/05/2021 +* @revision: +* +*****************************************************************/ +#ifndef __STRINGS_H_ +#define __STRINGS_H_ + +#include"typedefs.h" +#include"lists.h" +#include"memory.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//---------------------------------------------------------------------------------- +// string slices as values +//---------------------------------------------------------------------------------- +typedef struct str8 +{ + u64 len; + char* ptr; +} str8; + +#define str8_lit(s) ((str8){.len = sizeof(s)-1, .ptr = (char*)(s)}) +#define str8_unbox(s) (int)((s).len), ((s).ptr) + +MP_API str8 str8_from_buffer(u64 len, char* buffer); +MP_API str8 str8_from_cstring(char* str); +MP_API str8 str8_slice(str8 s, u64 start, u64 end); + +MP_API str8 str8_push_buffer(mem_arena* arena, u64 len, char* buffer); +MP_API str8 str8_push_cstring(mem_arena* arena, const char* str); +MP_API str8 str8_push_copy(mem_arena* arena, str8 s); +MP_API str8 str8_push_slice(mem_arena* arena, str8 s, u64 start, u64 end); + +MP_API str8 str8_pushfv(mem_arena* arena, const char* format, va_list args); +MP_API str8 str8_pushf(mem_arena* arena, const char* format, ...); + +MP_API int str8_cmp(str8 s1, str8 s2); + +MP_API char* str8_to_cstring(mem_arena* arena, str8 string); +//---------------------------------------------------------------------------------- +// string lists +//---------------------------------------------------------------------------------- +typedef struct str8_elt +{ + list_elt listElt; + str8 string; +} str8_elt; + +typedef struct str8_list +{ + list_info list; + u64 eltCount; + u64 len; +} str8_list; + +MP_API void str8_list_push(mem_arena* arena, str8_list* list, str8 str); +MP_API void str8_list_pushf(mem_arena* arena, str8_list* list, const char* format, ...); + +MP_API str8 str8_list_join(mem_arena* arena, str8_list list); +MP_API str8_list str8_split(mem_arena* arena, str8 str, str8_list separators); + +//---------------------------------------------------------------------------------- +// u32 strings +//---------------------------------------------------------------------------------- +typedef struct str32 +{ + u64 len; + u32* ptr; +} str32; + +MP_API str32 str32_from_buffer(u64 len, u32* buffer); +MP_API str32 str32_slice(str32 s, u64 start, u64 end); + +MP_API str32 str32_push_buffer(mem_arena* arena, u64 len, u32* buffer); +MP_API str32 str32_push_copy(mem_arena* arena, str32 s); +MP_API str32 str32_push_slice(mem_arena* arena, str32 s, u64 start, u64 end); + +typedef struct str32_elt +{ + list_elt listElt; + str32 string; +} str32_elt; + +typedef struct str32_list +{ + list_info list; + u64 eltCount; + u64 len; +} str32_list; + +MP_API void str32_list_push(mem_arena* arena, str32_list* list, str32 str); +MP_API str32 str32_list_join(mem_arena* arena, str32_list list); +MP_API str32_list str32_split(mem_arena* arena, str32 str, str32_list separators); + +//---------------------------------------------------------------------------------- +// Paths helpers +//---------------------------------------------------------------------------------- +MP_API str8 mp_path_directory(str8 fullPath); +MP_API str8 mp_path_base_name(str8 fullPath); + +#ifdef __cplusplus +} // extern "C" +#endif + + +#endif //__STRINGS_H_ diff --git a/src/util/utf8.c b/src/util/utf8.c index d0c6c61..8bf5cc8 100644 --- a/src/util/utf8.c +++ b/src/util/utf8.c @@ -1,283 +1,284 @@ -//***************************************************************** -// -// $file: utf8.c $ -// $author: Martin Fouilleul $ -// $date: 05/11/2016 $ -// $revision: $ -// $note: (C) 2016 by Martin Fouilleul - all rights reserved $ -// -//***************************************************************** -#include"utf8.h" -#include - -//----------------------------------------------------------------- -// utf-8 gore -//----------------------------------------------------------------- -const u32 offsetsFromUTF8[6] = { - 0x00000000UL, 0x00003080UL, 0x000E2080UL, - 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; - -const char trailingBytesForUTF8[256] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 -}; - -#define utf8_is_start_byte(c) (((c)&0xc0)!=0x80) - -//----------------------------------------------------------------- -//NOTE: getting sizes / offsets / indices -//----------------------------------------------------------------- - -u32 utf8_size_from_leading_char(char leadingChar) -{ - return(trailingBytesForUTF8[(unsigned int)(unsigned char)leadingChar] + 1); -} - -u32 utf8_codepoint_size(utf32 codePoint) -{ - if(codePoint < 0x80) - { - return(1); - } - if(codePoint < 0x800) - { - return(2); - } - if(codePoint < 0x10000) - { - return(3); - } - if(codePoint < 0x110000) - { - return(4); - } - return(0); -} - -u64 utf8_codepoint_count_for_string(str8 string) -{ - u64 byteOffset = 0; - u64 codePointIndex = 0; - for(; - (byteOffset < string.len) && (string.ptr[byteOffset] != 0); - codePointIndex++) - { - utf8_dec decode = utf8_decode_at(string, byteOffset); - byteOffset += decode.size; - } - return(codePointIndex); -} - -u64 utf8_byte_count_for_codepoints(str32 codePoints) -{ - //NOTE(martin): return the exact number of bytes taken by the encoded - // version of codePoints. (ie do not attempt to provision - // for a zero terminator). - u64 byteCount = 0; - for(u64 i=0; i= string.len) - { - res = string.len; - } - else - { - u64 nextOffset = byteOffset + utf8_size_from_leading_char(string.ptr[byteOffset]); - res = minimum(nextOffset, string.len); - } - return(res); -} - -u64 utf8_prev_offset(str8 string, u64 byteOffset) -{ - u64 res = 0; - if(byteOffset > string.len) - { - res = string.len; - } - else if(byteOffset) - { - byteOffset--; - while(byteOffset > 0 && !utf8_is_start_byte(string.ptr[byteOffset])) - { - byteOffset--; - } - res = byteOffset; - } - return(res); -} - -//----------------------------------------------------------------- -//NOTE: encoding / decoding -//----------------------------------------------------------------- - -utf8_dec utf8_decode_at(str8 string, u64 offset) -{ - //NOTE(martin): get the first codepoint in str, and advance index to the - // next utf8 character - //TODO(martin): check for utf-16 surrogate pairs - utf32 cp = 0; - u64 sz = 0; - - if(offset >= string.len || !string.ptr[offset]) - { - cp = 0; - sz = 1; - } - else if( !utf8_is_start_byte(string.ptr[offset])) - { - //NOTE(martin): unexpected continuation or invalid character. - cp = 0xfffd; - sz = 1; - } - else - { - int expectedSize = utf8_size_from_leading_char(string.ptr[offset]); - do - { - /*NOTE(martin): - we shift 6 bits and add the next byte at each round. - at the end we have our utf8 codepoint, added to the shifted versions - of the utf8 leading bits for each encoded byte. These values are - precomputed in offsetsFromUTF8. - */ - unsigned char b = string.ptr[offset]; - cp <<= 6; - cp += b; - offset += 1; - sz++; - - if(b == 0xc0 || b == 0xc1 || b >= 0xc5) - { - //NOTE(martin): invalid byte encountered - break; - } - - } while( offset < string.len - && string.ptr[offset] - && !utf8_is_start_byte(string.ptr[offset]) - && sz < expectedSize); - - if(sz != expectedSize) - { - //NOTE(martin): if we encountered an error, we return the replacement codepoint U+FFFD - cp = 0xfffd; - } - else - { - cp -= offsetsFromUTF8[sz-1]; - - //NOTE(martin): check for invalid codepoints - if(cp > 0x10ffff || (cp >= 0xd800 && cp <= 0xdfff)) - { - cp = 0xfffd; - } - } - } - utf8_dec res = {.codepoint = cp, .size = sz}; - return(res); -} - -utf8_dec utf8_decode(str8 string) -{ - return(utf8_decode_at(string, 0)); -} - -str8 utf8_encode(char* dest, utf32 codePoint) -{ - u64 sz = 0; - if (codePoint < 0x80) - { - dest[0] = (char)codePoint; - sz = 1; - } - else if (codePoint < 0x800) - { - dest[0] = (codePoint>>6) | 0xC0; - dest[1] = (codePoint & 0x3F) | 0x80; - sz = 2; - } - else if (codePoint < 0x10000) - { - dest[0] = (codePoint>>12) | 0xE0; - dest[1] = ((codePoint>>6) & 0x3F) | 0x80; - dest[2] = (codePoint & 0x3F) | 0x80; - sz = 3; - } - else if (codePoint < 0x110000) - { - dest[0] = (codePoint>>18) | 0xF0; - dest[1] = ((codePoint>>12) & 0x3F) | 0x80; - dest[2] = ((codePoint>>6) & 0x3F) | 0x80; - dest[3] = (codePoint & 0x3F) | 0x80; - sz = 4; - } - str8 res = {.len = sz, .ptr = dest}; - return(res); -} - -str32 utf8_to_codepoints(u64 maxCount, utf32* backing, str8 string) -{ - u64 codePointIndex = 0; - u64 byteOffset = 0; - for(; codePointIndex < maxCount && byteOffset < string.len; codePointIndex++) - { - utf8_dec decode = utf8_decode_at(string, byteOffset); - backing[codePointIndex] = decode.codepoint; - byteOffset += decode.size; - } - str32 res = {.len = codePointIndex, .ptr = backing}; - return(res); -} - -str8 utf8_from_codepoints(u64 maxBytes, char* backing, str32 codePoints) -{ - u64 byteOffset = 0; - for(u64 codePointIndex = 0; (codePointIndex < codePoints.len); codePointIndex++) - { - utf32 codePoint = codePoints.ptr[codePointIndex]; - u32 byteCount = utf8_codepoint_size(codePoint); - if(byteOffset + byteCount > maxBytes) - { - break; - } - utf8_encode(backing+byteOffset, codePoint); - byteOffset += byteCount; - } - str8 res = {.len = byteOffset, .ptr = backing}; - return(res); -} - -str32 utf8_push_to_codepoints(mem_arena* arena, str8 string) -{ - u64 count = utf8_codepoint_count_for_string(string); - utf32* backing = mem_arena_alloc_array(arena, utf32, count); - str32 res = utf8_to_codepoints(count, backing, string); - return(res); -} - -str8 utf8_push_from_codepoints(mem_arena* arena, str32 codePoints) -{ - u64 count = utf8_byte_count_for_codepoints(codePoints); - char* backing = mem_arena_alloc_array(arena, char, count); - str8 res = utf8_from_codepoints(count, backing, codePoints); - return(res); -} - -#define UNICODE_RANGE(start, cnt, name) const unicode_range _cat2_(UNICODE_RANGE_, name) = { .firstCodePoint = start, .count = cnt }; -UNICODE_RANGES -#undef UNICODE_RANGE +//***************************************************************** +// +// $file: utf8.c $ +// $author: Martin Fouilleul $ +// $date: 05/11/2016 $ +// $revision: $ +// $note: (C) 2016 by Martin Fouilleul - all rights reserved $ +// +//***************************************************************** +#include"utf8.h" +#include"platform.h" +#include + +//----------------------------------------------------------------- +// utf-8 gore +//----------------------------------------------------------------- +const u32 offsetsFromUTF8[6] = { + 0x00000000UL, 0x00003080UL, 0x000E2080UL, + 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; + +const char trailingBytesForUTF8[256] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 +}; + +#define utf8_is_start_byte(c) (((c)&0xc0)!=0x80) + +//----------------------------------------------------------------- +//NOTE: getting sizes / offsets / indices +//----------------------------------------------------------------- + +u32 utf8_size_from_leading_char(char leadingChar) +{ + return(trailingBytesForUTF8[(unsigned int)(unsigned char)leadingChar] + 1); +} + +u32 utf8_codepoint_size(utf32 codePoint) +{ + if(codePoint < 0x80) + { + return(1); + } + if(codePoint < 0x800) + { + return(2); + } + if(codePoint < 0x10000) + { + return(3); + } + if(codePoint < 0x110000) + { + return(4); + } + return(0); +} + +u64 utf8_codepoint_count_for_string(str8 string) +{ + u64 byteOffset = 0; + u64 codePointIndex = 0; + for(; + (byteOffset < string.len) && (string.ptr[byteOffset] != 0); + codePointIndex++) + { + utf8_dec decode = utf8_decode_at(string, byteOffset); + byteOffset += decode.size; + } + return(codePointIndex); +} + +u64 utf8_byte_count_for_codepoints(str32 codePoints) +{ + //NOTE(martin): return the exact number of bytes taken by the encoded + // version of codePoints. (ie do not attempt to provision + // for a zero terminator). + u64 byteCount = 0; + for(u64 i=0; i= string.len) + { + res = string.len; + } + else + { + u64 nextOffset = byteOffset + utf8_size_from_leading_char(string.ptr[byteOffset]); + res = minimum(nextOffset, string.len); + } + return(res); +} + +u64 utf8_prev_offset(str8 string, u64 byteOffset) +{ + u64 res = 0; + if(byteOffset > string.len) + { + res = string.len; + } + else if(byteOffset) + { + byteOffset--; + while(byteOffset > 0 && !utf8_is_start_byte(string.ptr[byteOffset])) + { + byteOffset--; + } + res = byteOffset; + } + return(res); +} + +//----------------------------------------------------------------- +//NOTE: encoding / decoding +//----------------------------------------------------------------- + +utf8_dec utf8_decode_at(str8 string, u64 offset) +{ + //NOTE(martin): get the first codepoint in str, and advance index to the + // next utf8 character + //TODO(martin): check for utf-16 surrogate pairs + utf32 cp = 0; + u64 sz = 0; + + if(offset >= string.len || !string.ptr[offset]) + { + cp = 0; + sz = 1; + } + else if( !utf8_is_start_byte(string.ptr[offset])) + { + //NOTE(martin): unexpected continuation or invalid character. + cp = 0xfffd; + sz = 1; + } + else + { + int expectedSize = utf8_size_from_leading_char(string.ptr[offset]); + do + { + /*NOTE(martin): + we shift 6 bits and add the next byte at each round. + at the end we have our utf8 codepoint, added to the shifted versions + of the utf8 leading bits for each encoded byte. These values are + precomputed in offsetsFromUTF8. + */ + unsigned char b = string.ptr[offset]; + cp <<= 6; + cp += b; + offset += 1; + sz++; + + if(b == 0xc0 || b == 0xc1 || b >= 0xc5) + { + //NOTE(martin): invalid byte encountered + break; + } + + } while( offset < string.len + && string.ptr[offset] + && !utf8_is_start_byte(string.ptr[offset]) + && sz < expectedSize); + + if(sz != expectedSize) + { + //NOTE(martin): if we encountered an error, we return the replacement codepoint U+FFFD + cp = 0xfffd; + } + else + { + cp -= offsetsFromUTF8[sz-1]; + + //NOTE(martin): check for invalid codepoints + if(cp > 0x10ffff || (cp >= 0xd800 && cp <= 0xdfff)) + { + cp = 0xfffd; + } + } + } + utf8_dec res = {.codepoint = cp, .size = sz}; + return(res); +} + +utf8_dec utf8_decode(str8 string) +{ + return(utf8_decode_at(string, 0)); +} + +str8 utf8_encode(char* dest, utf32 codePoint) +{ + u64 sz = 0; + if (codePoint < 0x80) + { + dest[0] = (char)codePoint; + sz = 1; + } + else if (codePoint < 0x800) + { + dest[0] = (codePoint>>6) | 0xC0; + dest[1] = (codePoint & 0x3F) | 0x80; + sz = 2; + } + else if (codePoint < 0x10000) + { + dest[0] = (codePoint>>12) | 0xE0; + dest[1] = ((codePoint>>6) & 0x3F) | 0x80; + dest[2] = (codePoint & 0x3F) | 0x80; + sz = 3; + } + else if (codePoint < 0x110000) + { + dest[0] = (codePoint>>18) | 0xF0; + dest[1] = ((codePoint>>12) & 0x3F) | 0x80; + dest[2] = ((codePoint>>6) & 0x3F) | 0x80; + dest[3] = (codePoint & 0x3F) | 0x80; + sz = 4; + } + str8 res = {.len = sz, .ptr = dest}; + return(res); +} + +str32 utf8_to_codepoints(u64 maxCount, utf32* backing, str8 string) +{ + u64 codePointIndex = 0; + u64 byteOffset = 0; + for(; codePointIndex < maxCount && byteOffset < string.len; codePointIndex++) + { + utf8_dec decode = utf8_decode_at(string, byteOffset); + backing[codePointIndex] = decode.codepoint; + byteOffset += decode.size; + } + str32 res = {.len = codePointIndex, .ptr = backing}; + return(res); +} + +str8 utf8_from_codepoints(u64 maxBytes, char* backing, str32 codePoints) +{ + u64 byteOffset = 0; + for(u64 codePointIndex = 0; (codePointIndex < codePoints.len); codePointIndex++) + { + utf32 codePoint = codePoints.ptr[codePointIndex]; + u32 byteCount = utf8_codepoint_size(codePoint); + if(byteOffset + byteCount > maxBytes) + { + break; + } + utf8_encode(backing+byteOffset, codePoint); + byteOffset += byteCount; + } + str8 res = {.len = byteOffset, .ptr = backing}; + return(res); +} + +str32 utf8_push_to_codepoints(mem_arena* arena, str8 string) +{ + u64 count = utf8_codepoint_count_for_string(string); + utf32* backing = mem_arena_alloc_array(arena, utf32, count); + str32 res = utf8_to_codepoints(count, backing, string); + return(res); +} + +str8 utf8_push_from_codepoints(mem_arena* arena, str32 codePoints) +{ + u64 count = utf8_byte_count_for_codepoints(codePoints); + char* backing = mem_arena_alloc_array(arena, char, count); + str8 res = utf8_from_codepoints(count, backing, codePoints); + return(res); +} + +#define UNICODE_RANGE(start, cnt, name) MP_API extern const unicode_range _cat2_(UNICODE_RANGE_, name) = { .firstCodePoint = start, .count = cnt }; +UNICODE_RANGES +#undef UNICODE_RANGE diff --git a/src/util/utf8.h b/src/util/utf8.h index b65d579..62b1062 100644 --- a/src/util/utf8.h +++ b/src/util/utf8.h @@ -1,202 +1,201 @@ -//***************************************************************** -// -// $file: utf8.h $ -// $author: Martin Fouilleul $ -// $date: 05/11/2016 $ -// $revision: $ -// $note: (C) 2016 by Martin Fouilleul - all rights reserved $ -// -//***************************************************************** -#ifndef __UTF8_H_ -#define __UTF8_H_ - -#include"typedefs.h" -#include"macro_helpers.h" -#include"strings.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef u32 utf32; - -//----------------------------------------------------------------- -//NOTE: getting sizes / offsets / indices -//----------------------------------------------------------------- -u32 utf8_size_from_leading_char(char leadingChar); -u32 utf8_codepoint_size(utf32 codePoint); - -u64 utf8_codepoint_count_for_string(str8 string); -u64 utf8_byte_count_for_codepoints(str32 codePoints); - -u64 utf8_next_offset(str8 string, u64 byteOffset); -u64 utf8_prev_offset(str8 string, u64 byteOffset); - -//----------------------------------------------------------------- -//NOTE: encoding / decoding -//----------------------------------------------------------------- -typedef struct utf8_dec -{ - utf32 codepoint; //NOTE: decoded codepoint - u32 size; //NOTE: size of corresponding utf8 sequence -} utf8_dec; - -utf8_dec utf8_decode(str8 string); //NOTE: decode a single utf8 sequence at start of string -utf8_dec utf8_decode_at(str8 string, u64 offset); //NOTE: decode a single utf8 sequence starting at byte offset -str8 utf8_encode(char* dst, utf32 codePoint); //NOTE: encode codepoint into backing buffer dst - -str32 utf8_to_codepoints(u64 maxCount, utf32* backing, str8 string); -str8 utf8_from_codepoints(u64 maxBytes, char* backing, str32 codePoints); - -str32 utf8_push_to_codepoints(mem_arena* arena, str8 string); -str8 utf8_push_from_codepoints(mem_arena* arena, str32 codePoints); - -//----------------------------------------------------------------- -// utf8 range struct and X-macros for defining utf8 ranges -//----------------------------------------------------------------- - -typedef struct unicode_range -{ - utf32 firstCodePoint; - u32 count; -} unicode_range; - -//NOTE(martin): range declared here are defined in utf8.cpp -// they can be used by prefixing them with UTF8_RANGE_, as in 'UTF8_RANGE_BASIC_LATIN' -#define UNICODE_RANGES \ -UNICODE_RANGE(0x0000, 127, BASIC_LATIN) \ -UNICODE_RANGE(0x0080, 127, C1_CONTROLS_AND_LATIN_1_SUPPLEMENT) \ -UNICODE_RANGE(0x0100, 127, LATIN_EXTENDED_A) \ -UNICODE_RANGE(0x0180, 207, LATIN_EXTENDED_B) \ -UNICODE_RANGE(0x0250, 95, IPA_EXTENSIONS) \ -UNICODE_RANGE(0x02b0, 79, SPACING_MODIFIER_LETTERS) \ -UNICODE_RANGE(0x0300, 111, COMBINING_DIACRITICAL_MARKS) \ -UNICODE_RANGE(0x0370, 143, GREEK_COPTIC) \ -UNICODE_RANGE(0x0400, 255, CYRILLIC) \ -UNICODE_RANGE(0x0500, 47, CYRILLIC_SUPPLEMENT) \ -UNICODE_RANGE(0x0530, 95, ARMENIAN) \ -UNICODE_RANGE(0x0590, 111, HEBREW) \ -UNICODE_RANGE(0x0600, 255, ARABIC) \ -UNICODE_RANGE(0x0700, 79, SYRIAC) \ -UNICODE_RANGE(0x0780, 63, THAANA) \ -UNICODE_RANGE(0x0900, 127, DEVANAGARI) \ -UNICODE_RANGE(0x0980, 127, BENGALI_ASSAMESE) \ -UNICODE_RANGE(0x0a00, 127, GURMUKHI) \ -UNICODE_RANGE(0x0a80, 127, GUJARATI) \ -UNICODE_RANGE(0x0b00, 127, ORIYA) \ -UNICODE_RANGE(0x0b80, 127, TAMIL) \ -UNICODE_RANGE(0x0c00, 127, TELUGU) \ -UNICODE_RANGE(0x0c80, 127, KANNADA) \ -UNICODE_RANGE(0x0d00, 255, MALAYALAM) \ -UNICODE_RANGE(0x0d80, 127, SINHALA) \ -UNICODE_RANGE(0x0e00, 127, THAI) \ -UNICODE_RANGE(0x0e80, 127, LAO) \ -UNICODE_RANGE(0x0f00, 255, TIBETAN) \ -UNICODE_RANGE(0x1000, 159, MYANMAR) \ -UNICODE_RANGE(0x10a0, 95, GEORGIAN) \ -UNICODE_RANGE(0x1100, 255, HANGUL_JAMO) \ -UNICODE_RANGE(0x1200, 383, ETHIOPIC) \ -UNICODE_RANGE(0x13a0, 95, CHEROKEE) \ -UNICODE_RANGE(0x1400, 639, UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS) \ -UNICODE_RANGE(0x1680, 31, OGHAM) \ -UNICODE_RANGE(0x16a0, 95, RUNIC) \ -UNICODE_RANGE(0x1700, 31, TAGALOG) \ -UNICODE_RANGE(0x1720, 31, HANUNOO) \ -UNICODE_RANGE(0x1740, 31, BUHID) \ -UNICODE_RANGE(0x1760, 31, TAGBANWA) \ -UNICODE_RANGE(0x1780, 127, KHMER) \ -UNICODE_RANGE(0x1800, 175, MONGOLIAN) \ -UNICODE_RANGE(0x1900, 79, LIMBU) \ -UNICODE_RANGE(0x1950, 47, TAI_LE) \ -UNICODE_RANGE(0x19e0, 31, KHMER_SYMBOLS) \ -UNICODE_RANGE(0x1d00, 127, PHONETIC_EXTENSIONS) \ -UNICODE_RANGE(0x1e00, 255, LATIN_EXTENDED_ADDITIONAL) \ -UNICODE_RANGE(0x1f00, 255, GREEK_EXTENDED) \ -UNICODE_RANGE(0x2000, 111, GENERAL_PUNCTUATION) \ -UNICODE_RANGE(0x2070, 47, SUPERSCRIPTS_AND_SUBSCRIPTS) \ -UNICODE_RANGE(0x20a0, 47, CURRENCY_SYMBOLS) \ -UNICODE_RANGE(0x20d0, 47, COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS) \ -UNICODE_RANGE(0x2100, 79, LETTERLIKE_SYMBOLS) \ -UNICODE_RANGE(0x2150, 63, NUMBER_FORMS) \ -UNICODE_RANGE(0x2190, 111, ARROWS) \ -UNICODE_RANGE(0x2200, 255, MATHEMATICAL_OPERATORS) \ -UNICODE_RANGE(0x2300, 255, MISCELLANEOUS_TECHNICAL) \ -UNICODE_RANGE(0x2400, 63, CONTROL_PICTURES) \ -UNICODE_RANGE(0x2440, 31, OPTICAL_CHARACTER_RECOGNITION) \ -UNICODE_RANGE(0x2460, 159, ENCLOSED_ALPHANUMERICS) \ -UNICODE_RANGE(0x2500, 127, BOX_DRAWING) \ -UNICODE_RANGE(0x2580, 31, BLOCK_ELEMENTS) \ -UNICODE_RANGE(0x25a0, 95, GEOMETRIC_SHAPES) \ -UNICODE_RANGE(0x2600, 255, MISCELLANEOUS_SYMBOLS) \ -UNICODE_RANGE(0x2700, 191, DINGBATS) \ -UNICODE_RANGE(0x27c0, 47, MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A) \ -UNICODE_RANGE(0x27f0, 15, SUPPLEMENTAL_ARROWS_A) \ -UNICODE_RANGE(0x2800, 255, BRAILLE_PATTERNS) \ -UNICODE_RANGE(0x2900, 127, SUPPLEMENTAL_ARROWS_B) \ -UNICODE_RANGE(0x2980, 127, MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B) \ -UNICODE_RANGE(0x2a00, 255, SUPPLEMENTAL_MATHEMATICAL_OPERATORS) \ -UNICODE_RANGE(0x2b00, 255, MISCELLANEOUS_SYMBOLS_AND_ARROWS) \ -UNICODE_RANGE(0x2e80, 127, CJK_RADICALS_SUPPLEMENT) \ -UNICODE_RANGE(0x2f00, 223, KANGXI_RADICALS) \ -UNICODE_RANGE(0x2ff0, 15, IDEOGRAPHIC_DESCRIPTION_CHARACTERS) \ -UNICODE_RANGE(0x3000, 63, CJK_SYMBOLS_AND_PUNCTUATION) \ -UNICODE_RANGE(0x3040, 95, HIRAGANA) \ -UNICODE_RANGE(0x30a0, 95, KATAKANA) \ -UNICODE_RANGE(0x3100, 47, BOPOMOFO) \ -UNICODE_RANGE(0x3130, 95, HANGUL_COMPATIBILITY_JAMO) \ -UNICODE_RANGE(0x3190, 15, KANBUN_KUNTEN) \ -UNICODE_RANGE(0x31a0, 31, BOPOMOFO_EXTENDED) \ -UNICODE_RANGE(0x31f0, 15, KATAKANA_PHONETIC_EXTENSIONS) \ -UNICODE_RANGE(0x3200, 255, ENCLOSED_CJK_LETTERS_AND_MONTHS) \ -UNICODE_RANGE(0x3300, 255, CJK_COMPATIBILITY) \ -UNICODE_RANGE(0x3400, 6591, CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A) \ -UNICODE_RANGE(0x4dc0, 63, YIJING_HEXAGRAM_SYMBOLS) \ -UNICODE_RANGE(0x4e00, 20911, CJK_UNIFIED_IDEOGRAPHS) \ -UNICODE_RANGE(0xa000, 1167, YI_SYLLABLES) \ -UNICODE_RANGE(0xa490, 63, YI_RADICALS) \ -UNICODE_RANGE(0xac00, 11183, HANGUL_SYLLABLES) \ -UNICODE_RANGE(0xd800, 1023, HIGH_SURROGATE_AREA) \ -UNICODE_RANGE(0xdc00, 1023, LOW_SURROGATE_AREA) \ -UNICODE_RANGE(0xe000, 6399, PRIVATE_USE_AREA) \ -UNICODE_RANGE(0xf900, 511, CJK_COMPATIBILITY_IDEOGRAPHS) \ -UNICODE_RANGE(0xfb00, 79, ALPHABETIC_PRESENTATION_FORMS) \ -UNICODE_RANGE(0xfb50, 687, ARABIC_PRESENTATION_FORMS_A) \ -UNICODE_RANGE(0xfe00, 15, VARIATION_SELECTORS) \ -UNICODE_RANGE(0xfe20, 15, COMBINING_HALF_MARKS) \ -UNICODE_RANGE(0xfe30, 31, CJK_COMPATIBILITY_FORMS) \ -UNICODE_RANGE(0xfe50, 31, SMALL_FORM_VARIANTS) \ -UNICODE_RANGE(0xfe70, 143, ARABIC_PRESENTATION_FORMS_B) \ -UNICODE_RANGE(0xff00, 239, HALFWIDTH_AND_FULLWIDTH_FORMS) \ -UNICODE_RANGE(0xfff0, 15, SPECIALS) \ -UNICODE_RANGE(0x10000, 127, LINEAR_B_SYLLABARY) \ -UNICODE_RANGE(0x10080, 127, LINEAR_B_IDEOGRAMS) \ -UNICODE_RANGE(0x10100, 63, AEGEAN_NUMBERS) \ -UNICODE_RANGE(0x10300, 47, OLD_ITALIC) \ -UNICODE_RANGE(0x10330, 31, GOTHIC) \ -UNICODE_RANGE(0x10380, 31, UGARITIC) \ -UNICODE_RANGE(0x10400, 79, DESERET) \ -UNICODE_RANGE(0x10450, 47, SHAVIAN) \ -UNICODE_RANGE(0x10480, 47, OSMANYA) \ -UNICODE_RANGE(0x10800, 63, CYPRIOT_SYLLABARY) \ -UNICODE_RANGE(0x1d000, 255, BYZANTINE_MUSICAL_SYMBOLS) \ -UNICODE_RANGE(0x1d100, 255, MUSICAL_SYMBOLS) \ -UNICODE_RANGE(0x1d300, 95, TAI_XUAN_JING_SYMBOLS) \ -UNICODE_RANGE(0x1d400, 1023, MATHEMATICAL_ALPHANUMERIC_SYMBOLS) \ -UNICODE_RANGE(0x20000, 42719, CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B) \ -UNICODE_RANGE(0x2f800, 543, CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT) \ -UNICODE_RANGE(0xe0000, 127, TAGS) \ -UNICODE_RANGE(0xe0100, 239, VARIATION_SELECTORS_SUPPLEMENT) \ -UNICODE_RANGE(0xf0000, 65533, SUPPLEMENTARY_PRIVATE_USE_AREA_A) \ -UNICODE_RANGE(0x100000, 65533, SUPPLEMENTARY_PRIVATE_USE_AREA_B) - - -#define UNICODE_RANGE(start, count, name) \ - extern const unicode_range _cat2_(UNICODE_RANGE_, name); -UNICODE_RANGES -#undef UNICODE_RANGE - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif //__UTF8_H_ +//***************************************************************** +// +// $file: utf8.h $ +// $author: Martin Fouilleul $ +// $date: 05/11/2016 $ +// $revision: $ +// $note: (C) 2016 by Martin Fouilleul - all rights reserved $ +// +//***************************************************************** +#ifndef __UTF8_H_ +#define __UTF8_H_ + +#include"typedefs.h" +#include"macro_helpers.h" +#include"strings.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef u32 utf32; + +//----------------------------------------------------------------- +//NOTE: getting sizes / offsets / indices +//----------------------------------------------------------------- +MP_API u32 utf8_size_from_leading_char(char leadingChar); +MP_API u32 utf8_codepoint_size(utf32 codePoint); + +MP_API u64 utf8_codepoint_count_for_string(str8 string); +MP_API u64 utf8_byte_count_for_codepoints(str32 codePoints); + +MP_API u64 utf8_next_offset(str8 string, u64 byteOffset); +MP_API u64 utf8_prev_offset(str8 string, u64 byteOffset); + +//----------------------------------------------------------------- +//NOTE: encoding / decoding +//----------------------------------------------------------------- +typedef struct utf8_dec +{ + utf32 codepoint; //NOTE: decoded codepoint + u32 size; //NOTE: size of corresponding utf8 sequence +} utf8_dec; + +MP_API utf8_dec utf8_decode(str8 string); //NOTE: decode a single utf8 sequence at start of string +MP_API utf8_dec utf8_decode_at(str8 string, u64 offset); //NOTE: decode a single utf8 sequence starting at byte offset +MP_API str8 utf8_encode(char* dst, utf32 codePoint); //NOTE: encode codepoint into backing buffer dst + +MP_API str32 utf8_to_codepoints(u64 maxCount, utf32* backing, str8 string); +MP_API str8 utf8_from_codepoints(u64 maxBytes, char* backing, str32 codePoints); + +MP_API str32 utf8_push_to_codepoints(mem_arena* arena, str8 string); +MP_API str8 utf8_push_from_codepoints(mem_arena* arena, str32 codePoints); + +//----------------------------------------------------------------- +// utf8 range struct and X-macros for defining utf8 ranges +//----------------------------------------------------------------- + +typedef struct unicode_range +{ + utf32 firstCodePoint; + u32 count; +} unicode_range; + +//NOTE(martin): range declared here are defined in utf8.cpp +// they can be used by prefixing them with UTF8_RANGE_, as in 'UTF8_RANGE_BASIC_LATIN' +#define UNICODE_RANGES \ +UNICODE_RANGE(0x0000, 127, BASIC_LATIN) \ +UNICODE_RANGE(0x0080, 127, C1_CONTROLS_AND_LATIN_1_SUPPLEMENT) \ +UNICODE_RANGE(0x0100, 127, LATIN_EXTENDED_A) \ +UNICODE_RANGE(0x0180, 207, LATIN_EXTENDED_B) \ +UNICODE_RANGE(0x0250, 95, IPA_EXTENSIONS) \ +UNICODE_RANGE(0x02b0, 79, SPACING_MODIFIER_LETTERS) \ +UNICODE_RANGE(0x0300, 111, COMBINING_DIACRITICAL_MARKS) \ +UNICODE_RANGE(0x0370, 143, GREEK_COPTIC) \ +UNICODE_RANGE(0x0400, 255, CYRILLIC) \ +UNICODE_RANGE(0x0500, 47, CYRILLIC_SUPPLEMENT) \ +UNICODE_RANGE(0x0530, 95, ARMENIAN) \ +UNICODE_RANGE(0x0590, 111, HEBREW) \ +UNICODE_RANGE(0x0600, 255, ARABIC) \ +UNICODE_RANGE(0x0700, 79, SYRIAC) \ +UNICODE_RANGE(0x0780, 63, THAANA) \ +UNICODE_RANGE(0x0900, 127, DEVANAGARI) \ +UNICODE_RANGE(0x0980, 127, BENGALI_ASSAMESE) \ +UNICODE_RANGE(0x0a00, 127, GURMUKHI) \ +UNICODE_RANGE(0x0a80, 127, GUJARATI) \ +UNICODE_RANGE(0x0b00, 127, ORIYA) \ +UNICODE_RANGE(0x0b80, 127, TAMIL) \ +UNICODE_RANGE(0x0c00, 127, TELUGU) \ +UNICODE_RANGE(0x0c80, 127, KANNADA) \ +UNICODE_RANGE(0x0d00, 255, MALAYALAM) \ +UNICODE_RANGE(0x0d80, 127, SINHALA) \ +UNICODE_RANGE(0x0e00, 127, THAI) \ +UNICODE_RANGE(0x0e80, 127, LAO) \ +UNICODE_RANGE(0x0f00, 255, TIBETAN) \ +UNICODE_RANGE(0x1000, 159, MYANMAR) \ +UNICODE_RANGE(0x10a0, 95, GEORGIAN) \ +UNICODE_RANGE(0x1100, 255, HANGUL_JAMO) \ +UNICODE_RANGE(0x1200, 383, ETHIOPIC) \ +UNICODE_RANGE(0x13a0, 95, CHEROKEE) \ +UNICODE_RANGE(0x1400, 639, UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS) \ +UNICODE_RANGE(0x1680, 31, OGHAM) \ +UNICODE_RANGE(0x16a0, 95, RUNIC) \ +UNICODE_RANGE(0x1700, 31, TAGALOG) \ +UNICODE_RANGE(0x1720, 31, HANUNOO) \ +UNICODE_RANGE(0x1740, 31, BUHID) \ +UNICODE_RANGE(0x1760, 31, TAGBANWA) \ +UNICODE_RANGE(0x1780, 127, KHMER) \ +UNICODE_RANGE(0x1800, 175, MONGOLIAN) \ +UNICODE_RANGE(0x1900, 79, LIMBU) \ +UNICODE_RANGE(0x1950, 47, TAI_LE) \ +UNICODE_RANGE(0x19e0, 31, KHMER_SYMBOLS) \ +UNICODE_RANGE(0x1d00, 127, PHONETIC_EXTENSIONS) \ +UNICODE_RANGE(0x1e00, 255, LATIN_EXTENDED_ADDITIONAL) \ +UNICODE_RANGE(0x1f00, 255, GREEK_EXTENDED) \ +UNICODE_RANGE(0x2000, 111, GENERAL_PUNCTUATION) \ +UNICODE_RANGE(0x2070, 47, SUPERSCRIPTS_AND_SUBSCRIPTS) \ +UNICODE_RANGE(0x20a0, 47, CURRENCY_SYMBOLS) \ +UNICODE_RANGE(0x20d0, 47, COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS) \ +UNICODE_RANGE(0x2100, 79, LETTERLIKE_SYMBOLS) \ +UNICODE_RANGE(0x2150, 63, NUMBER_FORMS) \ +UNICODE_RANGE(0x2190, 111, ARROWS) \ +UNICODE_RANGE(0x2200, 255, MATHEMATICAL_OPERATORS) \ +UNICODE_RANGE(0x2300, 255, MISCELLANEOUS_TECHNICAL) \ +UNICODE_RANGE(0x2400, 63, CONTROL_PICTURES) \ +UNICODE_RANGE(0x2440, 31, OPTICAL_CHARACTER_RECOGNITION) \ +UNICODE_RANGE(0x2460, 159, ENCLOSED_ALPHANUMERICS) \ +UNICODE_RANGE(0x2500, 127, BOX_DRAWING) \ +UNICODE_RANGE(0x2580, 31, BLOCK_ELEMENTS) \ +UNICODE_RANGE(0x25a0, 95, GEOMETRIC_SHAPES) \ +UNICODE_RANGE(0x2600, 255, MISCELLANEOUS_SYMBOLS) \ +UNICODE_RANGE(0x2700, 191, DINGBATS) \ +UNICODE_RANGE(0x27c0, 47, MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A) \ +UNICODE_RANGE(0x27f0, 15, SUPPLEMENTAL_ARROWS_A) \ +UNICODE_RANGE(0x2800, 255, BRAILLE_PATTERNS) \ +UNICODE_RANGE(0x2900, 127, SUPPLEMENTAL_ARROWS_B) \ +UNICODE_RANGE(0x2980, 127, MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B) \ +UNICODE_RANGE(0x2a00, 255, SUPPLEMENTAL_MATHEMATICAL_OPERATORS) \ +UNICODE_RANGE(0x2b00, 255, MISCELLANEOUS_SYMBOLS_AND_ARROWS) \ +UNICODE_RANGE(0x2e80, 127, CJK_RADICALS_SUPPLEMENT) \ +UNICODE_RANGE(0x2f00, 223, KANGXI_RADICALS) \ +UNICODE_RANGE(0x2ff0, 15, IDEOGRAPHIC_DESCRIPTION_CHARACTERS) \ +UNICODE_RANGE(0x3000, 63, CJK_SYMBOLS_AND_PUNCTUATION) \ +UNICODE_RANGE(0x3040, 95, HIRAGANA) \ +UNICODE_RANGE(0x30a0, 95, KATAKANA) \ +UNICODE_RANGE(0x3100, 47, BOPOMOFO) \ +UNICODE_RANGE(0x3130, 95, HANGUL_COMPATIBILITY_JAMO) \ +UNICODE_RANGE(0x3190, 15, KANBUN_KUNTEN) \ +UNICODE_RANGE(0x31a0, 31, BOPOMOFO_EXTENDED) \ +UNICODE_RANGE(0x31f0, 15, KATAKANA_PHONETIC_EXTENSIONS) \ +UNICODE_RANGE(0x3200, 255, ENCLOSED_CJK_LETTERS_AND_MONTHS) \ +UNICODE_RANGE(0x3300, 255, CJK_COMPATIBILITY) \ +UNICODE_RANGE(0x3400, 6591, CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A) \ +UNICODE_RANGE(0x4dc0, 63, YIJING_HEXAGRAM_SYMBOLS) \ +UNICODE_RANGE(0x4e00, 20911, CJK_UNIFIED_IDEOGRAPHS) \ +UNICODE_RANGE(0xa000, 1167, YI_SYLLABLES) \ +UNICODE_RANGE(0xa490, 63, YI_RADICALS) \ +UNICODE_RANGE(0xac00, 11183, HANGUL_SYLLABLES) \ +UNICODE_RANGE(0xd800, 1023, HIGH_SURROGATE_AREA) \ +UNICODE_RANGE(0xdc00, 1023, LOW_SURROGATE_AREA) \ +UNICODE_RANGE(0xe000, 6399, PRIVATE_USE_AREA) \ +UNICODE_RANGE(0xf900, 511, CJK_COMPATIBILITY_IDEOGRAPHS) \ +UNICODE_RANGE(0xfb00, 79, ALPHABETIC_PRESENTATION_FORMS) \ +UNICODE_RANGE(0xfb50, 687, ARABIC_PRESENTATION_FORMS_A) \ +UNICODE_RANGE(0xfe00, 15, VARIATION_SELECTORS) \ +UNICODE_RANGE(0xfe20, 15, COMBINING_HALF_MARKS) \ +UNICODE_RANGE(0xfe30, 31, CJK_COMPATIBILITY_FORMS) \ +UNICODE_RANGE(0xfe50, 31, SMALL_FORM_VARIANTS) \ +UNICODE_RANGE(0xfe70, 143, ARABIC_PRESENTATION_FORMS_B) \ +UNICODE_RANGE(0xff00, 239, HALFWIDTH_AND_FULLWIDTH_FORMS) \ +UNICODE_RANGE(0xfff0, 15, SPECIALS) \ +UNICODE_RANGE(0x10000, 127, LINEAR_B_SYLLABARY) \ +UNICODE_RANGE(0x10080, 127, LINEAR_B_IDEOGRAMS) \ +UNICODE_RANGE(0x10100, 63, AEGEAN_NUMBERS) \ +UNICODE_RANGE(0x10300, 47, OLD_ITALIC) \ +UNICODE_RANGE(0x10330, 31, GOTHIC) \ +UNICODE_RANGE(0x10380, 31, UGARITIC) \ +UNICODE_RANGE(0x10400, 79, DESERET) \ +UNICODE_RANGE(0x10450, 47, SHAVIAN) \ +UNICODE_RANGE(0x10480, 47, OSMANYA) \ +UNICODE_RANGE(0x10800, 63, CYPRIOT_SYLLABARY) \ +UNICODE_RANGE(0x1d000, 255, BYZANTINE_MUSICAL_SYMBOLS) \ +UNICODE_RANGE(0x1d100, 255, MUSICAL_SYMBOLS) \ +UNICODE_RANGE(0x1d300, 95, TAI_XUAN_JING_SYMBOLS) \ +UNICODE_RANGE(0x1d400, 1023, MATHEMATICAL_ALPHANUMERIC_SYMBOLS) \ +UNICODE_RANGE(0x20000, 42719, CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B) \ +UNICODE_RANGE(0x2f800, 543, CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT) \ +UNICODE_RANGE(0xe0000, 127, TAGS) \ +UNICODE_RANGE(0xe0100, 239, VARIATION_SELECTORS_SUPPLEMENT) \ +UNICODE_RANGE(0xf0000, 65533, SUPPLEMENTARY_PRIVATE_USE_AREA_A) \ +UNICODE_RANGE(0x100000, 65533, SUPPLEMENTARY_PRIVATE_USE_AREA_B) + +#define UNICODE_RANGE(start, count, name) \ + MP_API extern const unicode_range _cat2_(UNICODE_RANGE_, name); +UNICODE_RANGES +#undef UNICODE_RANGE + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif //__UTF8_H_ diff --git a/todo.txt b/todo.txt index 0acc067..a951b07 100644 --- a/todo.txt +++ b/todo.txt @@ -16,7 +16,7 @@ Overview [.] Make linking with libEGL optional, even if EGL backend is compiled in milepost? [x] using weak linking on macos [ ] use /DELAYLOAD:lib on windows? -[.] Remove the need for client apps to link with all dependent libs explicitly +[x] Remove the need for client apps to link with all dependent libs explicitly [!] Allow controlling surface overlaying [!] Sort out contents scaling for high dpi on osx