generate glenum, link glenum, add source gen for text regex

This commit is contained in:
Youmu Liu
2026-08-31 18:12:44 +08:00
parent 667b8d8e43
commit e52d0ac6f3
54 changed files with 4555 additions and 1596 deletions
@@ -1,3 +1,10 @@
// -----------------------------------------------------------------------------
// file="OpenGLFunction.v4_3"
// Project: StgSharp
// Copyright (c) Nitload.
// SPDX-License-Identifier: MIT
// -----------------------------------------------------------------------------
// <auto-generated>
// Generated by StgSharp.GenerateGL.
// Desktop OpenGL 4.3 core-profile forwarding methods.
@@ -19,9 +26,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glClearBufferData">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ClearBufferData(uint target, uint internalFormat, uint format, uint type, void* data)
public void ClearBufferData(BufferStorageTarget target, SizedInternalFormat internalFormat, PixelFormat format, PixelType type, void* data)
{
__context->glClearBufferData(target, internalFormat, format, type, data);
__context->glClearBufferData((uint)target, (uint)internalFormat, (uint)format, (uint)type, data);
}
/// <summary>
@@ -30,9 +37,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glClearBufferSubData">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ClearBufferSubData(uint target, uint internalFormat, nint offset, nint size, uint format, uint type, void* data)
public void ClearBufferSubData(BufferTarget target, SizedInternalFormat internalFormat, nint offset, nint size, PixelFormat format, PixelType type, void* data)
{
__context->glClearBufferSubData(target, internalFormat, offset, size, format, type, data);
__context->glClearBufferSubData((uint)target, (uint)internalFormat, offset, size, (uint)format, (uint)type, data);
}
/// <summary>
@@ -63,9 +70,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glCopyImageSubData">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void CopyImageSubData(uint srcName, uint srcTarget, int srcLevel, int srcX, int srcY, int srcZ, uint dstName, uint dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth)
public void CopyImageSubData(uint srcName, CopyImageSubDataTarget srcTarget, int srcLevel, int srcX, int srcY, int srcZ, uint dstName, CopyImageSubDataTarget dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth)
{
__context->glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
__context->glCopyImageSubData(srcName, (uint)srcTarget, srcLevel, srcX, srcY, srcZ, dstName, (uint)dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
}
/// <summary>
@@ -74,9 +81,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glFramebufferParameteri">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void FrameBufferParameteri(uint target, uint pName, int param)
public void FrameBufferParameteri(FrameBufferTarget target, FrameBufferParameterName pName, int param)
{
__context->glFramebufferParameteri(target, pName, param);
__context->glFramebufferParameteri((uint)target, (uint)pName, param);
}
/// <summary>
@@ -85,9 +92,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetFramebufferParameteriv">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void GetFrameBufferParameteriv(uint target, uint pName, int* @params)
public void GetFrameBufferParameteriv(FrameBufferTarget target, FrameBufferAttachmentParameterName pName, int* @params)
{
__context->glGetFramebufferParameteriv(target, pName, @params);
__context->glGetFramebufferParameteriv((uint)target, (uint)pName, @params);
}
/// <summary>
@@ -96,9 +103,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetInternalformat">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void GetInternalFormat(uint target, uint internalFormat, uint pName, int count, long* @params)
public void GetInternalFormat(TextureTarget target, InternalFormat internalFormat, InternalFormatPName pName, int count, long* @params)
{
__context->glGetInternalformati64v(target, internalFormat, pName, count, @params);
__context->glGetInternalformati64v((uint)target, (uint)internalFormat, (uint)pName, count, @params);
}
/// <summary>
@@ -151,9 +158,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glInvalidateFramebuffer">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void InvalidateFrameBuffer(uint target, int numAttachments, uint* attachments)
public void InvalidateFrameBuffer(FrameBufferTarget target, int numAttachments, InvalidateFrameBufferAttachment* attachments)
{
__context->glInvalidateFramebuffer(target, numAttachments, attachments);
__context->glInvalidateFramebuffer((uint)target, numAttachments, (uint*)attachments);
}
/// <summary>
@@ -162,9 +169,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glInvalidateSubFramebuffer">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void InvalidateSubFrameBuffer(uint target, int numAttachments, uint* attachments, int x, int y, int width, int height)
public void InvalidateSubFrameBuffer(FrameBufferTarget target, int numAttachments, InvalidateFrameBufferAttachment* attachments, int x, int y, int width, int height)
{
__context->glInvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height);
__context->glInvalidateSubFramebuffer((uint)target, numAttachments, (uint*)attachments, x, y, width, height);
}
/// <summary>
@@ -173,9 +180,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glMultiDrawArraysIndirect">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void MultiDrawArraysIndirect(uint mode, void* indirect, int drawcount, int stride)
public void MultiDrawArraysIndirect(PrimitiveType mode, void* indirect, int drawcount, int stride)
{
__context->glMultiDrawArraysIndirect(mode, indirect, drawcount, stride);
__context->glMultiDrawArraysIndirect((uint)mode, indirect, drawcount, stride);
}
/// <summary>
@@ -184,9 +191,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glMultiDrawElementsIndirect">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void MultiDrawElementsIndirect(uint mode, uint type, void* indirect, int drawcount, int stride)
public void MultiDrawElementsIndirect(PrimitiveType mode, DrawElementsType type, void* indirect, int drawcount, int stride)
{
__context->glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride);
__context->glMultiDrawElementsIndirect((uint)mode, (uint)type, indirect, drawcount, stride);
}
/// <summary>
@@ -195,9 +202,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetProgramInterfaceiv">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void GetProgramInterfaceiv(GlHandle program, uint programInterface, uint pName, int* @params)
public void GetProgramInterfaceiv(GlHandle program, ProgramInterface programInterface, ProgramInterfacePName pName, int* @params)
{
__context->glGetProgramInterfaceiv(program.Value, programInterface, pName, @params);
__context->glGetProgramInterfaceiv(program.Value, (uint)programInterface, (uint)pName, @params);
}
/// <summary>
@@ -206,9 +213,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetProgramResourceIndex">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public uint GetProgramResourceIndex(GlHandle program, uint programInterface, byte* name)
public uint GetProgramResourceIndex(GlHandle program, ProgramInterface programInterface, byte* name)
{
return __context->glGetProgramResourceIndex(program.Value, programInterface, name);
return __context->glGetProgramResourceIndex(program.Value, (uint)programInterface, name);
}
/// <summary>
@@ -217,9 +224,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetProgramResourceName">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void GetProgramResourceName(GlHandle program, uint programInterface, uint index, int bufSize, int* length, byte* name)
public void GetProgramResourceName(GlHandle program, ProgramInterface programInterface, uint index, int bufSize, int* length, byte* name)
{
__context->glGetProgramResourceName(program.Value, programInterface, index, bufSize, length, name);
__context->glGetProgramResourceName(program.Value, (uint)programInterface, index, bufSize, length, name);
}
/// <summary>
@@ -228,9 +235,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetProgramResourceiv">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void GetProgramResourceiv(GlHandle program, uint programInterface, uint index, int propCount, uint* props, int count, int* length, int* @params)
public void GetProgramResourceiv(GlHandle program, ProgramInterface programInterface, uint index, int propCount, ProgramResourceProperty* props, int count, int* length, int* @params)
{
__context->glGetProgramResourceiv(program.Value, programInterface, index, propCount, props, count, length, @params);
__context->glGetProgramResourceiv(program.Value, (uint)programInterface, index, propCount, (uint*)props, count, length, @params);
}
/// <summary>
@@ -239,9 +246,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetProgramResourceLocation">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int GetProgramResourceLocation(GlHandle program, uint programInterface, byte* name)
public int GetProgramResourceLocation(GlHandle program, ProgramInterface programInterface, byte* name)
{
return __context->glGetProgramResourceLocation(program.Value, programInterface, name);
return __context->glGetProgramResourceLocation(program.Value, (uint)programInterface, name);
}
/// <summary>
@@ -250,9 +257,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetProgramResourceLocationIndex">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int GetProgramResourceLocationIndex(GlHandle program, uint programInterface, byte* name)
public int GetProgramResourceLocationIndex(GlHandle program, ProgramInterface programInterface, byte* name)
{
return __context->glGetProgramResourceLocationIndex(program.Value, programInterface, name);
return __context->glGetProgramResourceLocationIndex(program.Value, (uint)programInterface, name);
}
/// <summary>
@@ -272,9 +279,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glTexBufferRange">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void TexBufferRange(uint target, uint internalFormat, GlHandle buffer, nint offset, nint size)
public void TexBufferRange(TextureTarget target, SizedInternalFormat internalFormat, GlHandle buffer, nint offset, nint size)
{
__context->glTexBufferRange(target, internalFormat, buffer.Value, offset, size);
__context->glTexBufferRange((uint)target, (uint)internalFormat, buffer.Value, offset, size);
}
/// <summary>
@@ -283,9 +290,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glTexStorage2DMultisample">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void TexStorage2DMultisample(uint target, int samples, uint internalFormat, int width, int height, byte fixedsamplelocations)
public void TexStorage2DMultisample(TextureTarget target, int samples, SizedInternalFormat internalFormat, int width, int height, byte fixedsamplelocations)
{
__context->glTexStorage2DMultisample(target, samples, internalFormat, width, height, fixedsamplelocations);
__context->glTexStorage2DMultisample((uint)target, samples, (uint)internalFormat, width, height, fixedsamplelocations);
}
/// <summary>
@@ -294,9 +301,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glTexStorage3DMultisample">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void TexStorage3DMultisample(uint target, int samples, uint internalFormat, int width, int height, int depth, byte fixedsamplelocations)
public void TexStorage3DMultisample(TextureTarget target, int samples, SizedInternalFormat internalFormat, int width, int height, int depth, byte fixedsamplelocations)
{
__context->glTexStorage3DMultisample(target, samples, internalFormat, width, height, depth, fixedsamplelocations);
__context->glTexStorage3DMultisample((uint)target, samples, (uint)internalFormat, width, height, depth, fixedsamplelocations);
}
/// <summary>
@@ -305,9 +312,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glTextureView">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void TextureView(GlHandle texture, uint target, GlHandle origtexture, uint internalFormat, uint minlevel, uint numlevels, uint minlayer, uint numlayers)
public void TextureView(GlHandle texture, TextureTarget target, GlHandle origtexture, SizedInternalFormat internalFormat, uint minlevel, uint numlevels, uint minlayer, uint numlayers)
{
__context->glTextureView(texture.Value, target, origtexture.Value, internalFormat, minlevel, numlevels, minlayer, numlayers);
__context->glTextureView(texture.Value, (uint)target, origtexture.Value, (uint)internalFormat, minlevel, numlevels, minlayer, numlayers);
}
/// <summary>
@@ -327,9 +334,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glVertexAttribFormat">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void VertexAttributeFormat(uint attributeIndex, int size, uint type, byte normalized, uint relativeOffset)
public void VertexAttributeFormat(uint attributeIndex, int size, VertexAttributeType type, byte normalized, uint relativeOffset)
{
__context->glVertexAttribFormat(attributeIndex, size, type, normalized, relativeOffset);
__context->glVertexAttribFormat(attributeIndex, size, (uint)type, normalized, relativeOffset);
}
/// <summary>
@@ -338,9 +345,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glVertexAttribFormat">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void VertexAttributeIntegerFormat(uint attributeIndex, int size, uint type, uint relativeOffset)
public void VertexAttributeIntegerFormat(uint attributeIndex, int size, VertexAttributeIType type, uint relativeOffset)
{
__context->glVertexAttribIFormat(attributeIndex, size, type, relativeOffset);
__context->glVertexAttribIFormat(attributeIndex, size, (uint)type, relativeOffset);
}
/// <summary>
@@ -349,9 +356,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glVertexAttribFormat">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void VertexAttributeDoubleFormat(uint attributeIndex, int size, uint type, uint relativeOffset)
public void VertexAttributeDoubleFormat(uint attributeIndex, int size, VertexAttributeLType type, uint relativeOffset)
{
__context->glVertexAttribLFormat(attributeIndex, size, type, relativeOffset);
__context->glVertexAttribLFormat(attributeIndex, size, (uint)type, relativeOffset);
}
/// <summary>
@@ -382,9 +389,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glDebugMessageControl">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void DebugMessageControl(uint source, uint type, uint severity, int count, uint* ids, byte enabled)
public void DebugMessageControl(DebugSource source, DebugType type, DebugSeverity severity, int count, uint* ids, byte enabled)
{
__context->glDebugMessageControl(source, type, severity, count, ids, enabled);
__context->glDebugMessageControl((uint)source, (uint)type, (uint)severity, count, ids, enabled);
}
/// <summary>
@@ -393,9 +400,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glDebugMessageInsert">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void DebugMessageInsert(uint source, uint type, uint id, uint severity, int length, byte* buf)
public void DebugMessageInsert(DebugSource source, DebugType type, uint id, DebugSeverity severity, int length, byte* buf)
{
__context->glDebugMessageInsert(source, type, id, severity, length, buf);
__context->glDebugMessageInsert((uint)source, (uint)type, id, (uint)severity, length, buf);
}
/// <summary>
@@ -415,9 +422,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetDebugMessageLog">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public uint GetDebugMessageLog(uint count, int bufSize, uint* sources, uint* types, uint* ids, uint* severities, int* lengths, byte* messageLog)
public uint GetDebugMessageLog(uint count, int bufSize, DebugSource* sources, DebugType* types, uint* ids, DebugSeverity* severities, int* lengths, byte* messageLog)
{
return __context->glGetDebugMessageLog(count, bufSize, sources, types, ids, severities, lengths, messageLog);
return __context->glGetDebugMessageLog(count, bufSize, (uint*)sources, (uint*)types, ids, (uint*)severities, lengths, messageLog);
}
/// <summary>
@@ -426,9 +433,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glPushDebugGroup">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void PushDebugGroup(uint source, uint id, int length, byte* message)
public void PushDebugGroup(DebugSource source, uint id, int length, byte* message)
{
__context->glPushDebugGroup(source, id, length, message);
__context->glPushDebugGroup((uint)source, id, length, message);
}
/// <summary>
@@ -448,9 +455,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glObjectLabel">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ObjectLabel(uint identifier, uint name, int length, byte* label)
public void ObjectLabel(ObjectIdentifier identifier, uint name, int length, byte* label)
{
__context->glObjectLabel(identifier, name, length, label);
__context->glObjectLabel((uint)identifier, name, length, label);
}
/// <summary>
@@ -459,9 +466,9 @@ namespace StgSharp.Graphics.OpenGL
/// <para>See <see href="https://docs.gl/gl4/glGetObjectLabel">docs.gl</see>.</para>
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void GetObjectLabel(uint identifier, uint name, int bufSize, int* length, byte* label)
public void GetObjectLabel(ObjectIdentifier identifier, uint name, int bufSize, int* length, byte* label)
{
__context->glGetObjectLabel(identifier, name, bufSize, length, label);
__context->glGetObjectLabel((uint)identifier, name, bufSize, length, label);
}
/// <summary>