From e52d0ac6f324983943f50eb8a86e47874edfd19a Mon Sep 17 00:00:00 2001 From: Youmu Liu <105042599+Nitload-NSI@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:12:44 +0800 Subject: [PATCH] generate glenum, link glenum, add source gen for text regex --- src/StgSharp.Graphics/Camera.cs | 48 +- .../OpenGL/Api/OpenGLFunction.Context.cs | 76 - .../OpenGL/Api/OpenGLFunction.Diagnostics.cs | 10 +- .../OpenGL/Api/OpenGLFunction.Shader.cs | 95 +- src/StgSharp.Graphics/OpenGL/Buffer/FBO.cs | 13 - .../OpenGL/Buffer/TextureGL.cs | 24 - .../OpenGL/Generated/GlEnums.g.cs | 2246 +++++++++++++++++ .../OpenGL/Generated/OpenGLFunction.Base.g.cs | 647 +++-- .../OpenGL/Generated/OpenGLFunction.v3_3.g.cs | 75 +- .../OpenGL/Generated/OpenGLFunction.v4_0.g.cs | 97 +- .../OpenGL/Generated/OpenGLFunction.v4_1.g.cs | 49 +- .../OpenGL/Generated/OpenGLFunction.v4_2.g.cs | 55 +- .../OpenGL/Generated/OpenGLFunction.v4_3.g.cs | 123 +- .../OpenGL/Generated/OpenGLFunction.v4_4.g.cs | 27 +- .../OpenGL/Generated/OpenGLFunction.v4_5.g.cs | 315 +-- .../OpenGL/Generated/OpenGLFunction.v4_6.g.cs | 15 +- .../OpenGL/Generated/OpenglContext.g.cs | 7 + .../OpenGL/Generated/glContextShadow.g.cs | 7 + .../OpenGL/Generated/glconst.cs | 7 + .../OpenGL/{ShaderEdit => }/Shader.cs | 23 +- .../OpenGL/ShaderEdit/Uniform.cs | 68 - src/StgSharp.Graphics/OpenGL/glApiManager.cs | 4 +- src/StgSharp.Graphics/OpenGL/glEnum.cs | 204 -- src/StgSharp.Graphics/OpenGL/glHandle.cs | 15 +- src/StgSharp.Graphics/PlainGeometryMesh.cs | 39 +- src/StgSharp.Graphics/RenderStream.cs | 6 +- src/StgSharp.Graphics/TextureProvider.cs | 53 - .../{ViewPort.cs => ViewSurface.cs} | 12 +- src/StgSharp.Graphics/frameworkSyncContext.cs | 60 - .../GeometryOperation/GeometryOperation.cs | 22 +- .../Geometries/IInstancing.cs | 24 +- .../Geometries/IInstancingBuffer.cs | 4 +- .../Numeric/Graphics/GraphicsMatrix.cs | 2 +- .../Numeric/Graphics/Vec4_T.cs | 88 +- .../Numeric/Graphics/Vector.GetLength.cs | 101 +- .../Numeric/Graphics/Vector.Normalize.cs | 96 +- .../Numeric/Graphics/Vector.Orthogonalize.cs | 89 +- .../COUNT_UNIT_GENERATION.md | 169 ++ .../Text/TextRegexSourceGen.GenClass.cs | 140 +- .../Text/TextRegexSourceGen.GenContext.cs | 2 +- .../{Partical.cs => Partical.cs.old} | 68 +- test/StgSharpDebug/TestRender.cs | 2 +- tools/README.md | 2 +- tools/StgSharp.GenerateGL/GenerateCli.cs | 41 +- .../Generation/GlEnumProjector.cs | 336 +++ .../Generation/GlEnumTypeMap.cs | 122 + .../Generation/GlGenerationTarget.cs | 20 + .../GlManagedApiSuppressionFilter.cs | 44 + .../Generation/ManagedApiModel.cs | 4 +- .../Generation/ManagedApiPlanner.cs | 81 +- .../Generation/ManagedEnumModel.cs | 24 + .../Generation/OpenGlGenerator.cs | 220 +- tools/StgSharp.GenerateGL/README.md | 24 +- tools/StgSharp.GenerateGL/XmlCli.cs | 6 +- 54 files changed, 4555 insertions(+), 1596 deletions(-) delete mode 100644 src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Context.cs create mode 100644 src/StgSharp.Graphics/OpenGL/Generated/GlEnums.g.cs rename src/StgSharp.Graphics/OpenGL/{ShaderEdit => }/Shader.cs (61%) delete mode 100644 src/StgSharp.Graphics/OpenGL/ShaderEdit/Uniform.cs delete mode 100644 src/StgSharp.Graphics/OpenGL/glEnum.cs delete mode 100644 src/StgSharp.Graphics/TextureProvider.cs rename src/StgSharp.Graphics/{ViewPort.cs => ViewSurface.cs} (94%) delete mode 100644 src/StgSharp.Graphics/frameworkSyncContext.cs create mode 100644 src/StgSharp.RegularAnalysis/COUNT_UNIT_GENERATION.md rename test/StgSharpDebug/RenderStream/{Partical.cs => Partical.cs.old} (89%) create mode 100644 tools/StgSharp.GenerateGL/Generation/GlEnumProjector.cs create mode 100644 tools/StgSharp.GenerateGL/Generation/GlEnumTypeMap.cs create mode 100644 tools/StgSharp.GenerateGL/Generation/GlGenerationTarget.cs create mode 100644 tools/StgSharp.GenerateGL/Generation/GlManagedApiSuppressionFilter.cs create mode 100644 tools/StgSharp.GenerateGL/Generation/ManagedEnumModel.cs diff --git a/src/StgSharp.Graphics/Camera.cs b/src/StgSharp.Graphics/Camera.cs index 6a87a602..242d03a1 100644 --- a/src/StgSharp.Graphics/Camera.cs +++ b/src/StgSharp.Graphics/Camera.cs @@ -7,6 +7,7 @@ using StgSharp.Mathematics.Numeric.Graphics; using System; +using System.Numerics; namespace StgSharp.Mathematics.Numeric.Graphics { @@ -22,13 +23,13 @@ namespace StgSharp.Mathematics.Numeric.Graphics internal Radius _pitch; internal Radius _row; internal Radius _yaw; - internal Vec3 _target, up; + internal Vec3 _target, up; public Camera() { cameraAtt = GraphicsMatrix.Unit; - _target = Vec3.Zero; - up = Vec3.Zero; + _target = Vec3.Zero; + up = Vec3.Zero; _isLookAtAvailable = false; _lookAt = GraphicsMatrix.Unit; rotationAtt = GraphicsMatrix.Unit; @@ -36,9 +37,9 @@ namespace StgSharp.Mathematics.Numeric.Graphics } public Camera( - Vec3 position, - Vec3 target, - Vec3 up + Vec3 position, + Vec3 target, + Vec3 up ) : this() { @@ -60,7 +61,7 @@ namespace StgSharp.Mathematics.Numeric.Graphics return _lookAt; } GraphicsMatrix move = GraphicsMatrix.Unit; - move.column[3].vec -= cameraAtt.column[3].vec; + move.column[3] -= cameraAtt.column[3]; _lookAt = rotationAtt.Transpose * move; _isLookAtAvailable = true; return _lookAt; @@ -97,15 +98,15 @@ namespace StgSharp.Mathematics.Numeric.Graphics } public void SetViewDirection( - Vec3 position, - Vec3 target, - Vec3 up + Vec3 position, + Vec3 target, + Vec3 up ) { - Vec3 direction = position - target; - if ((position.reg == cameraAtt.column[3].reg) && + Vec3 direction = position - target; + if ((position == cameraAtt.column[3].XYZ) && (this.up == up) && - (cameraAtt.column[3].reg == direction.reg)) { + (cameraAtt.column[3].XYZ == direction)) { return; } if (direction.GetLength() == 0) @@ -123,12 +124,12 @@ namespace StgSharp.Mathematics.Numeric.Graphics direction.Orthogonalize(ref up); - Vec3 right = Linear.Orthogonalize(Linear.Cross(up, direction)); + Vec3 right = Linear.Orthogonalize(Vec3.Cross(up, direction)); - cameraAtt.column[0].reg = right.reg; - cameraAtt.column[1].reg = up.reg; - cameraAtt.column[2].reg = direction.reg; - cameraAtt.column[3].reg = position.reg; + cameraAtt.column[0].XYZ = right; + cameraAtt.column[1].XYZ = up; + cameraAtt.column[2].XYZ = direction; + cameraAtt.column[3].XYZ = position; InternalPitch(); InternalRow(); @@ -137,8 +138,8 @@ namespace StgSharp.Mathematics.Numeric.Graphics public void SetViewRange( Radius fovRadius, - Vec2 size, - Vec2 offset, + Vec2 size, + Vec2 offset, (float front, float back) depthRange ) { @@ -161,15 +162,16 @@ namespace StgSharp.Mathematics.Numeric.Graphics } public void Test( - params Vec4[] vec + params Vec4[] vec ) { Console.WriteLine(View); Console.WriteLine(Projection); Console.WriteLine(Projection * View); Console.WriteLine(View); - foreach (Vec4 item in vec) { - Console.Write($"{Projection * View * item};"); + foreach (Vec4 item in vec) + { + // Console.Write($"{Projection * View * item};"); } } diff --git a/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Context.cs b/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Context.cs deleted file mode 100644 index aaf1b8a5..00000000 --- a/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Context.cs +++ /dev/null @@ -1,76 +0,0 @@ -// ----------------------------------------------------------------------------- -// file="OpenGLFunction.Context" -// Project: StgSharp -// Copyright (c) Nitload. -// SPDX-License-Identifier: MIT -// ----------------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Threading; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - private static readonly Dictionary contextToGLMap = []; - private static readonly ThreadLocal _currentGL = new(); - private OpenglContext* _context; - - private readonly Lazy _attachmentColorRange; - - private OpenGLFunction() - { - // textureUnitCountGetter = glConst.MAX_TEXTURE_IMAGE_UNITS; - // UnusedTextureImageUint = []; - _attachmentColorRange = new Lazy( - () => GetMaskInteger(glConst.MAX_COLOR_ATTACHMENTS)); - } - - public int AttachmentColorRange => _attachmentColorRange.Value; - - public static OpenGLFunction CurrentGL - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _currentGL.Value!; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal set => _currentGL.Value = value; - } - - internal IntPtr ContextHandle => (IntPtr)_context; - - protected ref OpenglContext Context - { - get - { - #if DEBUG - ArgumentNullException.ThrowIfNull(_context, nameof(_context)); - #endif - return ref (*_context); - } - } - - internal static OpenGLFunction BuildGlFunctionPackage( - IntPtr handle - ) - { - if (contextToGLMap.TryGetValue(handle, out OpenGLFunction pack)) { - return pack; - } - pack = new OpenGLFunction - { - _context = (OpenglContext*)handle - }; - contextToGLMap.Add(handle, pack); - return pack; - } - - ~OpenGLFunction() - { - _ = contextToGLMap.Remove(ContextHandle); - } - - } -} diff --git a/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Diagnostics.cs b/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Diagnostics.cs index 8017fbce..f5d00c0f 100644 --- a/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Diagnostics.cs +++ b/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Diagnostics.cs @@ -19,7 +19,7 @@ namespace StgSharp.Graphics.OpenGL bool shouldReportWhenNormal ) { - uint code = _context->glGetError(); + uint code = __context->glGetError(); if (code != glConst.NO_ERROR) { throw new GlExecutionException(code); } @@ -34,7 +34,7 @@ namespace StgSharp.Graphics.OpenGL uint code = 0; for (int i = 0; i < 1024; i++) { - code = _context->glGetError(); + code = __context->glGetError(); if (code == 0) { return; } @@ -50,7 +50,7 @@ namespace StgSharp.Graphics.OpenGL [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void ClearGraphicError() { - while (_context->glGetError() != 0) { } + while (__context->glGetError() != 0) { } } public unsafe int GetMaskInteger( @@ -58,14 +58,14 @@ namespace StgSharp.Graphics.OpenGL ) { int ret = 0; - _context->glGetIntegerv(statusCode, &ret); + __context->glGetIntegerv(statusCode, &ret); return ret; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void WaitAccomplishment() { - _context->glFinish(); + __context->glFinish(); } } diff --git a/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Shader.cs b/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Shader.cs index 84e2a5a7..0542d427 100644 --- a/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Shader.cs +++ b/src/StgSharp.Graphics/OpenGL/Api/OpenGLFunction.Shader.cs @@ -38,10 +38,10 @@ namespace StgSharp.Graphics.OpenGL ShaderType type ) { - GlHandle handle = CreateShader((uint)type); + GlHandle handle = GlHandle.Create(__context->glCreateShader((uint)type)); if (handle.Value == 0) { - uint error = _context->glGetError(); + uint error = __context->glGetError(); throw new InvalidOperationException($"Failed in creating shader: {error}"); } return handle; @@ -76,13 +76,13 @@ namespace StgSharp.Graphics.OpenGL ) { int status; - _context->glGetShaderiv(shader.Value, statusName, &status); + __context->glGetShaderiv(shader.Value, statusName, &status); if (status != 0) { return string.Empty; } int logLength; - _context->glGetShaderiv(shader.Value, glConst.INFO_LOG_LENGTH, &logLength); + __context->glGetShaderiv(shader.Value, glConst.INFO_LOG_LENGTH, &logLength); if (logLength <= 1) { return string.Empty; } @@ -91,75 +91,11 @@ namespace StgSharp.Graphics.OpenGL fixed (byte* logPtr = log) { int written; - _context->glGetShaderInfoLog(shader.Value, log.Length, &written, logPtr); + __context->glGetShaderInfoLog(shader.Value, log.Length, &written, logPtr); return Encoding.UTF8.GetString(log, 0, Math.Clamp(written, 0, log.Length)); } } - public GlHandle GetUniformLocation( - GlHandle program, - string name - ) - { - ArgumentNullException.ThrowIfNull(name); - - int byteCount = Encoding.UTF8.GetByteCount(name); - Span utf8Name = byteCount < 256 - ? stackalloc byte[byteCount + 1] - : new byte[byteCount + 1]; - int written = Encoding.UTF8.GetBytes(name.AsSpan(), utf8Name); - utf8Name[written] = 0; - - int location; - fixed (byte* namePtr = utf8Name) { - location = _context->glGetUniformLocation(program.Value, namePtr); - } - - #if DEBUG - if (location == -1) { - throw new UniformEmptyReferenceException(nameof(program), name); - } - #endif - - return GlHandle.CreateSigned(location); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Uniform GetUniform( - GlHandle program, - string name - ) where T : unmanaged - { - return new Uniform(GetUniformLocation(program, name)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Uniform GetUniform( - GlHandle program, - string name - ) where T : unmanaged where U : struct - { - return new Uniform(GetUniformLocation(program, name)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Uniform GetUniform( - GlHandle program, - string name - ) where T : unmanaged where U : struct where V : struct - { - return new Uniform(GetUniformLocation(program, name)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Uniform GetUniform( - GlHandle program, - string name - ) where T : unmanaged where U : struct where V : struct where W : struct - { - return new Uniform(GetUniformLocation(program, name)); - } - public void ShaderSource( GlHandle shader, ReadOnlySpan source @@ -170,10 +106,23 @@ namespace StgSharp.Graphics.OpenGL { byte emptySource = 0; byte* sourceAddress = sourcePtr == null ? &emptySource : sourcePtr; - _context->glShaderSource(shader.Value, 1, &sourceAddress, &length); + __context->glShaderSource(shader.Value, 1, &sourceAddress, &length); } } + public void ShaderSource( + GlHandle shader, + ReadOnlySpan source + ) + { + int byteCount = Encoding.UTF8.GetByteCount(source); + Span utf8Source = byteCount < 1024 ? + stackalloc byte[byteCount] : + new byte[byteCount]; + int written = Encoding.UTF8.GetBytes(source, utf8Source); + ShaderSource(shader, utf8Source[..written]); + } + public void ShaderSource( GlHandle shader, string source @@ -182,9 +131,9 @@ namespace StgSharp.Graphics.OpenGL ArgumentNullException.ThrowIfNull(source); int byteCount = Encoding.UTF8.GetByteCount(source); - Span utf8Source = byteCount < 1024 - ? stackalloc byte[byteCount] - : new byte[byteCount]; + Span utf8Source = byteCount < 1024 ? + stackalloc byte[byteCount] : + new byte[byteCount]; int written = Encoding.UTF8.GetBytes(source.AsSpan(), utf8Source); ShaderSource(shader, utf8Source[..written]); } diff --git a/src/StgSharp.Graphics/OpenGL/Buffer/FBO.cs b/src/StgSharp.Graphics/OpenGL/Buffer/FBO.cs index afbd0f64..45173814 100644 --- a/src/StgSharp.Graphics/OpenGL/Buffer/FBO.cs +++ b/src/StgSharp.Graphics/OpenGL/Buffer/FBO.cs @@ -7,19 +7,6 @@ namespace StgSharp.Graphics.OpenGL { - #pragma warning disable CA1008 - #pragma warning disable CA1028 - public enum FrameBufferTarget : uint - #pragma warning restore CA1028 - #pragma warning restore CA1008 - { - - Read = glConst.READ_FRAMEBUFFER, - All = glConst.FRAMEBUFFER, - Draw = glConst.DRAW_FRAMEBUFFER, - - } - /// A set of OpenGL framebuffer handles. public sealed record class FrameBuffer( GlHandle[] Handles diff --git a/src/StgSharp.Graphics/OpenGL/Buffer/TextureGL.cs b/src/StgSharp.Graphics/OpenGL/Buffer/TextureGL.cs index 05eabde5..f5e15fa2 100644 --- a/src/StgSharp.Graphics/OpenGL/Buffer/TextureGL.cs +++ b/src/StgSharp.Graphics/OpenGL/Buffer/TextureGL.cs @@ -40,30 +40,6 @@ namespace StgSharp.Graphics.OpenGL } - #pragma warning disable CA1008 - public enum TextureUnit - #pragma warning restore CA1008 - { - - Unit0 = glConst.TEXTURE0, - Unit1 = glConst.TEXTURE1, - Unit2 = glConst.TEXTURE2, - Unit3 = glConst.TEXTURE3, - Unit4 = glConst.TEXTURE4, - Unit5 = glConst.TEXTURE5, - Unit6 = glConst.TEXTURE6, - Unit7 = glConst.TEXTURE7, - Unit8 = glConst.TEXTURE8, - Unit9 = glConst.TEXTURE9, - Unit10 = glConst.TEXTURE10, - Unit11 = glConst.TEXTURE11, - Unit12 = glConst.TEXTURE12, - Unit13 = glConst.TEXTURE13, - Unit14 = glConst.TEXTURE14, - Unit15 = glConst.TEXTURE15, - - } - #pragma warning disable CA1008 public enum TextureWrap #pragma warning restore CA1008 diff --git a/src/StgSharp.Graphics/OpenGL/Generated/GlEnums.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/GlEnums.g.cs new file mode 100644 index 00000000..5c05175c --- /dev/null +++ b/src/StgSharp.Graphics/OpenGL/Generated/GlEnums.g.cs @@ -0,0 +1,2246 @@ +// ----------------------------------------------------------------------------- +// file="GlEnums" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + +// +// Generated by StgSharp.GenerateGL. +// Strongly typed desktop OpenGL enum groups. +// + +namespace StgSharp.Graphics.OpenGL +{ + /// Native OpenGL group AtomicCounterBufferPName. + public enum AtomicCounterBufferPName : uint + { + AtomicCounterBufferActiveAtomicCounterIndices = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES), + AtomicCounterBufferActiveAtomicCounters = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS), + AtomicCounterBufferBinding = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_BINDING), + AtomicCounterBufferDataSize = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_DATA_SIZE), + AtomicCounterBufferReferencedByComputeShader = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER), + AtomicCounterBufferReferencedByFragmentShader = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER), + AtomicCounterBufferReferencedByGeometryShader = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER), + AtomicCounterBufferReferencedByTessControlShader = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER), + AtomicCounterBufferReferencedByTessEvaluationShader = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER), + AtomicCounterBufferReferencedByVertexShader = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER), + } + + /// Native OpenGL group AttributeType. + public enum AttributeType : uint + { + Bool = unchecked((uint)glConst.BOOL), + BoolVec2 = unchecked((uint)glConst.BOOL_VEC2), + BoolVec3 = unchecked((uint)glConst.BOOL_VEC3), + BoolVec4 = unchecked((uint)glConst.BOOL_VEC4), + Double = unchecked((uint)glConst.DOUBLE), + DoubleMat2 = unchecked((uint)glConst.DOUBLE_MAT2), + DoubleMat2x3 = unchecked((uint)glConst.DOUBLE_MAT2x3), + DoubleMat2x4 = unchecked((uint)glConst.DOUBLE_MAT2x4), + DoubleMat3 = unchecked((uint)glConst.DOUBLE_MAT3), + DoubleMat3x2 = unchecked((uint)glConst.DOUBLE_MAT3x2), + DoubleMat3x4 = unchecked((uint)glConst.DOUBLE_MAT3x4), + DoubleMat4 = unchecked((uint)glConst.DOUBLE_MAT4), + DoubleMat4x2 = unchecked((uint)glConst.DOUBLE_MAT4x2), + DoubleMat4x3 = unchecked((uint)glConst.DOUBLE_MAT4x3), + DoubleVec2 = unchecked((uint)glConst.DOUBLE_VEC2), + DoubleVec3 = unchecked((uint)glConst.DOUBLE_VEC3), + DoubleVec4 = unchecked((uint)glConst.DOUBLE_VEC4), + Float = unchecked((uint)glConst.FLOAT), + FloatMat2 = unchecked((uint)glConst.FLOAT_MAT2), + FloatMat2x3 = unchecked((uint)glConst.FLOAT_MAT2x3), + FloatMat2x4 = unchecked((uint)glConst.FLOAT_MAT2x4), + FloatMat3 = unchecked((uint)glConst.FLOAT_MAT3), + FloatMat3x2 = unchecked((uint)glConst.FLOAT_MAT3x2), + FloatMat3x4 = unchecked((uint)glConst.FLOAT_MAT3x4), + FloatMat4 = unchecked((uint)glConst.FLOAT_MAT4), + FloatMat4x2 = unchecked((uint)glConst.FLOAT_MAT4x2), + FloatMat4x3 = unchecked((uint)glConst.FLOAT_MAT4x3), + FloatVec2 = unchecked((uint)glConst.FLOAT_VEC2), + FloatVec3 = unchecked((uint)glConst.FLOAT_VEC3), + FloatVec4 = unchecked((uint)glConst.FLOAT_VEC4), + Image1D = unchecked((uint)glConst.IMAGE_1D), + Image1DArray = unchecked((uint)glConst.IMAGE_1D_ARRAY), + Image2D = unchecked((uint)glConst.IMAGE_2D), + Image2DArray = unchecked((uint)glConst.IMAGE_2D_ARRAY), + Image2DMultisample = unchecked((uint)glConst.IMAGE_2D_MULTISAMPLE), + Image2DMultisampleArray = unchecked((uint)glConst.IMAGE_2D_MULTISAMPLE_ARRAY), + Image2DRect = unchecked((uint)glConst.IMAGE_2D_RECT), + Image3D = unchecked((uint)glConst.IMAGE_3D), + ImageBuffer = unchecked((uint)glConst.IMAGE_BUFFER), + ImageCube = unchecked((uint)glConst.IMAGE_CUBE), + ImageCubeMapArray = unchecked((uint)glConst.IMAGE_CUBE_MAP_ARRAY), + Int = unchecked((uint)glConst.INT), + IntImage1D = unchecked((uint)glConst.INT_IMAGE_1D), + IntImage1DArray = unchecked((uint)glConst.INT_IMAGE_1D_ARRAY), + IntImage2D = unchecked((uint)glConst.INT_IMAGE_2D), + IntImage2DArray = unchecked((uint)glConst.INT_IMAGE_2D_ARRAY), + IntImage2DMultisample = unchecked((uint)glConst.INT_IMAGE_2D_MULTISAMPLE), + IntImage2DMultisampleArray = unchecked((uint)glConst.INT_IMAGE_2D_MULTISAMPLE_ARRAY), + IntImage2DRect = unchecked((uint)glConst.INT_IMAGE_2D_RECT), + IntImage3D = unchecked((uint)glConst.INT_IMAGE_3D), + IntImageBuffer = unchecked((uint)glConst.INT_IMAGE_BUFFER), + IntImageCube = unchecked((uint)glConst.INT_IMAGE_CUBE), + IntImageCubeMapArray = unchecked((uint)glConst.INT_IMAGE_CUBE_MAP_ARRAY), + IntSampler1D = unchecked((uint)glConst.INT_SAMPLER_1D), + IntSampler1DArray = unchecked((uint)glConst.INT_SAMPLER_1D_ARRAY), + IntSampler2D = unchecked((uint)glConst.INT_SAMPLER_2D), + IntSampler2DArray = unchecked((uint)glConst.INT_SAMPLER_2D_ARRAY), + IntSampler2DMultisample = unchecked((uint)glConst.INT_SAMPLER_2D_MULTISAMPLE), + IntSampler2DMultisampleArray = unchecked((uint)glConst.INT_SAMPLER_2D_MULTISAMPLE_ARRAY), + IntSampler2DRect = unchecked((uint)glConst.INT_SAMPLER_2D_RECT), + IntSampler3D = unchecked((uint)glConst.INT_SAMPLER_3D), + IntSamplerBuffer = unchecked((uint)glConst.INT_SAMPLER_BUFFER), + IntSamplerCube = unchecked((uint)glConst.INT_SAMPLER_CUBE), + IntSamplerCubeMapArray = unchecked((uint)glConst.INT_SAMPLER_CUBE_MAP_ARRAY), + IntVec2 = unchecked((uint)glConst.INT_VEC2), + IntVec3 = unchecked((uint)glConst.INT_VEC3), + IntVec4 = unchecked((uint)glConst.INT_VEC4), + Sampler1D = unchecked((uint)glConst.SAMPLER_1D), + Sampler1DArrayShadow = unchecked((uint)glConst.SAMPLER_1D_ARRAY_SHADOW), + Sampler1DShadow = unchecked((uint)glConst.SAMPLER_1D_SHADOW), + Sampler2D = unchecked((uint)glConst.SAMPLER_2D), + Sampler2DArrayShadow = unchecked((uint)glConst.SAMPLER_2D_ARRAY_SHADOW), + Sampler2DMultisample = unchecked((uint)glConst.SAMPLER_2D_MULTISAMPLE), + Sampler2DMultisampleArray = unchecked((uint)glConst.SAMPLER_2D_MULTISAMPLE_ARRAY), + Sampler2DRect = unchecked((uint)glConst.SAMPLER_2D_RECT), + Sampler2DRectShadow = unchecked((uint)glConst.SAMPLER_2D_RECT_SHADOW), + Sampler2DShadow = unchecked((uint)glConst.SAMPLER_2D_SHADOW), + Sampler3D = unchecked((uint)glConst.SAMPLER_3D), + SamplerBuffer = unchecked((uint)glConst.SAMPLER_BUFFER), + SamplerCube = unchecked((uint)glConst.SAMPLER_CUBE), + SamplerCubeMapArray = unchecked((uint)glConst.SAMPLER_CUBE_MAP_ARRAY), + SamplerCubeMapArrayShadow = unchecked((uint)glConst.SAMPLER_CUBE_MAP_ARRAY_SHADOW), + SamplerCubeShadow = unchecked((uint)glConst.SAMPLER_CUBE_SHADOW), + UnsignedInt = unchecked((uint)glConst.UNSIGNED_INT), + UnsignedIntImage1D = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_1D), + UnsignedIntImage1DArray = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_1D_ARRAY), + UnsignedIntImage2D = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_2D), + UnsignedIntImage2DArray = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_2D_ARRAY), + UnsignedIntImage2DMultisample = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_2D_MULTISAMPLE), + UnsignedIntImage2DMultisampleArray = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY), + UnsignedIntImage2DRect = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_2D_RECT), + UnsignedIntImage3D = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_3D), + UnsignedIntImageBuffer = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_BUFFER), + UnsignedIntImageCube = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_CUBE), + UnsignedIntImageCubeMapArray = unchecked((uint)glConst.UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY), + UnsignedIntSampler1D = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_1D), + UnsignedIntSampler1DArray = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_1D_ARRAY), + UnsignedIntSampler2D = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D), + UnsignedIntSampler2DArray = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D_ARRAY), + UnsignedIntSampler2DMultisample = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE), + UnsignedIntSampler2DMultisampleArray = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY), + UnsignedIntSampler2DRect = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D_RECT), + UnsignedIntSampler3D = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_3D), + UnsignedIntSamplerBuffer = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_BUFFER), + UnsignedIntSamplerCube = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_CUBE), + UnsignedIntSamplerCubeMapArray = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY), + UnsignedIntVec2 = unchecked((uint)glConst.UNSIGNED_INT_VEC2), + UnsignedIntVec3 = unchecked((uint)glConst.UNSIGNED_INT_VEC3), + UnsignedIntVec4 = unchecked((uint)glConst.UNSIGNED_INT_VEC4), + } + + /// Native OpenGL group BindTransformFeedbackTarget. + public enum BindTransformFeedbackTarget : uint + { + TransformFeedback = unchecked((uint)glConst.TRANSFORM_FEEDBACK), + } + + /// Native OpenGL group BlendEquationModeEXT. + public enum BlendEquationMode : uint + { + FuncAdd = unchecked((uint)glConst.FUNC_ADD), + FuncReverseSubtract = unchecked((uint)glConst.FUNC_REVERSE_SUBTRACT), + FuncSubtract = unchecked((uint)glConst.FUNC_SUBTRACT), + Max = unchecked((uint)glConst.MAX), + Min = unchecked((uint)glConst.MIN), + } + + /// Native OpenGL group BlendingFactor. + public enum BlendingFactor : uint + { + ConstantAlpha = unchecked((uint)glConst.CONSTANT_ALPHA), + ConstantColor = unchecked((uint)glConst.CONSTANT_COLOR), + DstAlpha = unchecked((uint)glConst.DST_ALPHA), + DstColor = unchecked((uint)glConst.DST_COLOR), + One = unchecked((uint)glConst.ONE), + OneMinusConstantAlpha = unchecked((uint)glConst.ONE_MINUS_CONSTANT_ALPHA), + OneMinusConstantColor = unchecked((uint)glConst.ONE_MINUS_CONSTANT_COLOR), + OneMinusDstAlpha = unchecked((uint)glConst.ONE_MINUS_DST_ALPHA), + OneMinusDstColor = unchecked((uint)glConst.ONE_MINUS_DST_COLOR), + OneMinusSrc1Alpha = unchecked((uint)glConst.ONE_MINUS_SRC1_ALPHA), + OneMinusSrc1Color = unchecked((uint)glConst.ONE_MINUS_SRC1_COLOR), + OneMinusSrcAlpha = unchecked((uint)glConst.ONE_MINUS_SRC_ALPHA), + OneMinusSrcColor = unchecked((uint)glConst.ONE_MINUS_SRC_COLOR), + Src1Alpha = unchecked((uint)glConst.SRC1_ALPHA), + Src1Color = unchecked((uint)glConst.SRC1_COLOR), + SrcAlpha = unchecked((uint)glConst.SRC_ALPHA), + SrcAlphaSaturate = unchecked((uint)glConst.SRC_ALPHA_SATURATE), + SrcColor = unchecked((uint)glConst.SRC_COLOR), + Zero = unchecked((uint)glConst.ZERO), + } + + /// Native OpenGL group BlitFramebufferFilter. + public enum BlitFrameBufferFilter : uint + { + Linear = unchecked((uint)glConst.LINEAR), + Nearest = unchecked((uint)glConst.NEAREST), + } + + /// Native OpenGL group BufferAccessARB. + public enum BufferAccess : uint + { + ReadOnly = unchecked((uint)glConst.READ_ONLY), + ReadWrite = unchecked((uint)glConst.READ_WRITE), + WriteOnly = unchecked((uint)glConst.WRITE_ONLY), + } + + /// Native OpenGL group BufferPNameARB. + public enum BufferPName : uint + { + BufferAccess = unchecked((uint)glConst.BUFFER_ACCESS), + BufferAccessFlags = unchecked((uint)glConst.BUFFER_ACCESS_FLAGS), + BufferImmutableStorage = unchecked((uint)glConst.BUFFER_IMMUTABLE_STORAGE), + BufferMapLength = unchecked((uint)glConst.BUFFER_MAP_LENGTH), + BufferMapOffset = unchecked((uint)glConst.BUFFER_MAP_OFFSET), + BufferMapped = unchecked((uint)glConst.BUFFER_MAPPED), + BufferSize = unchecked((uint)glConst.BUFFER_SIZE), + BufferStorageFlags = unchecked((uint)glConst.BUFFER_STORAGE_FLAGS), + BufferUsage = unchecked((uint)glConst.BUFFER_USAGE), + } + + /// Native OpenGL group BufferPointerNameARB. + public enum BufferPointerName : uint + { + BufferMapPointer = unchecked((uint)glConst.BUFFER_MAP_POINTER), + } + + /// Native OpenGL group BufferStorageMask. + [System.Flags] + public enum BufferStorageMask : uint + { + None = 0u, + ClientStorageBit = unchecked((uint)glConst.CLIENT_STORAGE_BIT), + DynamicStorageBit = unchecked((uint)glConst.DYNAMIC_STORAGE_BIT), + MapCoherentBit = unchecked((uint)glConst.MAP_COHERENT_BIT), + MapPersistentBit = unchecked((uint)glConst.MAP_PERSISTENT_BIT), + MapReadBit = unchecked((uint)glConst.MAP_READ_BIT), + MapWriteBit = unchecked((uint)glConst.MAP_WRITE_BIT), + } + + /// Native OpenGL group BufferStorageTarget. + public enum BufferStorageTarget : uint + { + ArrayBuffer = unchecked((uint)glConst.ARRAY_BUFFER), + AtomicCounterBuffer = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER), + CopyReadBuffer = unchecked((uint)glConst.COPY_READ_BUFFER), + CopyWriteBuffer = unchecked((uint)glConst.COPY_WRITE_BUFFER), + DispatchIndirectBuffer = unchecked((uint)glConst.DISPATCH_INDIRECT_BUFFER), + DrawIndirectBuffer = unchecked((uint)glConst.DRAW_INDIRECT_BUFFER), + ElementArrayBuffer = unchecked((uint)glConst.ELEMENT_ARRAY_BUFFER), + PixelPackBuffer = unchecked((uint)glConst.PIXEL_PACK_BUFFER), + PixelUnpackBuffer = unchecked((uint)glConst.PIXEL_UNPACK_BUFFER), + QueryBuffer = unchecked((uint)glConst.QUERY_BUFFER), + ShaderStorageBuffer = unchecked((uint)glConst.SHADER_STORAGE_BUFFER), + TextureBuffer = unchecked((uint)glConst.TEXTURE_BUFFER), + TransformFeedbackBuffer = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER), + UniformBuffer = unchecked((uint)glConst.UNIFORM_BUFFER), + } + + /// Native OpenGL group BufferTargetARB. + public enum BufferTarget : uint + { + ArrayBuffer = unchecked((uint)glConst.ARRAY_BUFFER), + AtomicCounterBuffer = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER), + CopyReadBuffer = unchecked((uint)glConst.COPY_READ_BUFFER), + CopyWriteBuffer = unchecked((uint)glConst.COPY_WRITE_BUFFER), + DispatchIndirectBuffer = unchecked((uint)glConst.DISPATCH_INDIRECT_BUFFER), + DrawIndirectBuffer = unchecked((uint)glConst.DRAW_INDIRECT_BUFFER), + ElementArrayBuffer = unchecked((uint)glConst.ELEMENT_ARRAY_BUFFER), + ParameterBuffer = unchecked((uint)glConst.PARAMETER_BUFFER), + PixelPackBuffer = unchecked((uint)glConst.PIXEL_PACK_BUFFER), + PixelUnpackBuffer = unchecked((uint)glConst.PIXEL_UNPACK_BUFFER), + QueryBuffer = unchecked((uint)glConst.QUERY_BUFFER), + ShaderStorageBuffer = unchecked((uint)glConst.SHADER_STORAGE_BUFFER), + TextureBuffer = unchecked((uint)glConst.TEXTURE_BUFFER), + TransformFeedbackBuffer = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER), + UniformBuffer = unchecked((uint)glConst.UNIFORM_BUFFER), + } + + /// Native OpenGL group BufferUsageARB. + public enum BufferUsage : uint + { + DynamicCopy = unchecked((uint)glConst.DYNAMIC_COPY), + DynamicDraw = unchecked((uint)glConst.DYNAMIC_DRAW), + DynamicRead = unchecked((uint)glConst.DYNAMIC_READ), + StaticCopy = unchecked((uint)glConst.STATIC_COPY), + StaticDraw = unchecked((uint)glConst.STATIC_DRAW), + StaticRead = unchecked((uint)glConst.STATIC_READ), + StreamCopy = unchecked((uint)glConst.STREAM_COPY), + StreamDraw = unchecked((uint)glConst.STREAM_DRAW), + StreamRead = unchecked((uint)glConst.STREAM_READ), + } + + /// Native OpenGL group ClampColorModeARB. + public enum ClampColorMode : uint + { + False = unchecked((uint)glConst.FALSE), + FixedOnly = unchecked((uint)glConst.FIXED_ONLY), + True = unchecked((uint)glConst.TRUE), + } + + /// Native OpenGL group ClampColorTargetARB. + public enum ClampColorTarget : uint + { + ClampReadColor = unchecked((uint)glConst.CLAMP_READ_COLOR), + } + + /// Native OpenGL group Buffer. + public enum ClearBuffer : uint + { + Color = unchecked((uint)glConst.COLOR), + Depth = unchecked((uint)glConst.DEPTH), + Stencil = unchecked((uint)glConst.STENCIL), + } + + /// Native OpenGL group ClearBufferMask. + [System.Flags] + public enum ClearBufferMask : uint + { + None = 0u, + ColorBufferBit = unchecked((uint)glConst.COLOR_BUFFER_BIT), + DepthBufferBit = unchecked((uint)glConst.DEPTH_BUFFER_BIT), + StencilBufferBit = unchecked((uint)glConst.STENCIL_BUFFER_BIT), + } + + /// Native OpenGL group ClipControlDepth. + public enum ClipControlDepth : uint + { + NegativeOneToOne = unchecked((uint)glConst.NEGATIVE_ONE_TO_ONE), + ZeroToOne = unchecked((uint)glConst.ZERO_TO_ONE), + } + + /// Native OpenGL group ClipControlOrigin. + public enum ClipControlOrigin : uint + { + LowerLeft = unchecked((uint)glConst.LOWER_LEFT), + UpperLeft = unchecked((uint)glConst.UPPER_LEFT), + } + + /// Native OpenGL group ColorBuffer. + public enum ColorBuffer : uint + { + Back = unchecked((uint)glConst.BACK), + BackLeft = unchecked((uint)glConst.BACK_LEFT), + BackRight = unchecked((uint)glConst.BACK_RIGHT), + ColorAttachment0 = unchecked((uint)glConst.COLOR_ATTACHMENT0), + ColorAttachment1 = unchecked((uint)glConst.COLOR_ATTACHMENT1), + ColorAttachment10 = unchecked((uint)glConst.COLOR_ATTACHMENT10), + ColorAttachment11 = unchecked((uint)glConst.COLOR_ATTACHMENT11), + ColorAttachment12 = unchecked((uint)glConst.COLOR_ATTACHMENT12), + ColorAttachment13 = unchecked((uint)glConst.COLOR_ATTACHMENT13), + ColorAttachment14 = unchecked((uint)glConst.COLOR_ATTACHMENT14), + ColorAttachment15 = unchecked((uint)glConst.COLOR_ATTACHMENT15), + ColorAttachment16 = unchecked((uint)glConst.COLOR_ATTACHMENT16), + ColorAttachment17 = unchecked((uint)glConst.COLOR_ATTACHMENT17), + ColorAttachment18 = unchecked((uint)glConst.COLOR_ATTACHMENT18), + ColorAttachment19 = unchecked((uint)glConst.COLOR_ATTACHMENT19), + ColorAttachment2 = unchecked((uint)glConst.COLOR_ATTACHMENT2), + ColorAttachment20 = unchecked((uint)glConst.COLOR_ATTACHMENT20), + ColorAttachment21 = unchecked((uint)glConst.COLOR_ATTACHMENT21), + ColorAttachment22 = unchecked((uint)glConst.COLOR_ATTACHMENT22), + ColorAttachment23 = unchecked((uint)glConst.COLOR_ATTACHMENT23), + ColorAttachment24 = unchecked((uint)glConst.COLOR_ATTACHMENT24), + ColorAttachment25 = unchecked((uint)glConst.COLOR_ATTACHMENT25), + ColorAttachment26 = unchecked((uint)glConst.COLOR_ATTACHMENT26), + ColorAttachment27 = unchecked((uint)glConst.COLOR_ATTACHMENT27), + ColorAttachment28 = unchecked((uint)glConst.COLOR_ATTACHMENT28), + ColorAttachment29 = unchecked((uint)glConst.COLOR_ATTACHMENT29), + ColorAttachment3 = unchecked((uint)glConst.COLOR_ATTACHMENT3), + ColorAttachment30 = unchecked((uint)glConst.COLOR_ATTACHMENT30), + ColorAttachment31 = unchecked((uint)glConst.COLOR_ATTACHMENT31), + ColorAttachment4 = unchecked((uint)glConst.COLOR_ATTACHMENT4), + ColorAttachment5 = unchecked((uint)glConst.COLOR_ATTACHMENT5), + ColorAttachment6 = unchecked((uint)glConst.COLOR_ATTACHMENT6), + ColorAttachment7 = unchecked((uint)glConst.COLOR_ATTACHMENT7), + ColorAttachment8 = unchecked((uint)glConst.COLOR_ATTACHMENT8), + ColorAttachment9 = unchecked((uint)glConst.COLOR_ATTACHMENT9), + Front = unchecked((uint)glConst.FRONT), + FrontAndBack = unchecked((uint)glConst.FRONT_AND_BACK), + FrontLeft = unchecked((uint)glConst.FRONT_LEFT), + FrontRight = unchecked((uint)glConst.FRONT_RIGHT), + Left = unchecked((uint)glConst.LEFT), + None = unchecked((uint)glConst.NONE), + Right = unchecked((uint)glConst.RIGHT), + } + + /// Native OpenGL group ConditionalRenderMode. + public enum ConditionalRenderMode : uint + { + QueryByRegionNoWait = unchecked((uint)glConst.QUERY_BY_REGION_NO_WAIT), + QueryByRegionNoWaitInverted = unchecked((uint)glConst.QUERY_BY_REGION_NO_WAIT_INVERTED), + QueryByRegionWait = unchecked((uint)glConst.QUERY_BY_REGION_WAIT), + QueryByRegionWaitInverted = unchecked((uint)glConst.QUERY_BY_REGION_WAIT_INVERTED), + QueryNoWait = unchecked((uint)glConst.QUERY_NO_WAIT), + QueryNoWaitInverted = unchecked((uint)glConst.QUERY_NO_WAIT_INVERTED), + QueryWait = unchecked((uint)glConst.QUERY_WAIT), + QueryWaitInverted = unchecked((uint)glConst.QUERY_WAIT_INVERTED), + } + + /// Native OpenGL group CopyBufferSubDataTarget. + public enum CopyBufferSubDataTarget : uint + { + ArrayBuffer = unchecked((uint)glConst.ARRAY_BUFFER), + AtomicCounterBuffer = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER), + CopyReadBuffer = unchecked((uint)glConst.COPY_READ_BUFFER), + CopyWriteBuffer = unchecked((uint)glConst.COPY_WRITE_BUFFER), + DispatchIndirectBuffer = unchecked((uint)glConst.DISPATCH_INDIRECT_BUFFER), + DrawIndirectBuffer = unchecked((uint)glConst.DRAW_INDIRECT_BUFFER), + ElementArrayBuffer = unchecked((uint)glConst.ELEMENT_ARRAY_BUFFER), + PixelPackBuffer = unchecked((uint)glConst.PIXEL_PACK_BUFFER), + PixelUnpackBuffer = unchecked((uint)glConst.PIXEL_UNPACK_BUFFER), + QueryBuffer = unchecked((uint)glConst.QUERY_BUFFER), + ShaderStorageBuffer = unchecked((uint)glConst.SHADER_STORAGE_BUFFER), + TextureBuffer = unchecked((uint)glConst.TEXTURE_BUFFER), + TransformFeedbackBuffer = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER), + UniformBuffer = unchecked((uint)glConst.UNIFORM_BUFFER), + } + + /// Native OpenGL group CopyImageSubDataTarget. + public enum CopyImageSubDataTarget : uint + { + RenderBuffer = unchecked((uint)glConst.RENDERBUFFER), + Texture1D = unchecked((uint)glConst.TEXTURE_1D), + Texture1DArray = unchecked((uint)glConst.TEXTURE_1D_ARRAY), + Texture2D = unchecked((uint)glConst.TEXTURE_2D), + Texture2DArray = unchecked((uint)glConst.TEXTURE_2D_ARRAY), + Texture2DMultisample = unchecked((uint)glConst.TEXTURE_2D_MULTISAMPLE), + Texture2DMultisampleArray = unchecked((uint)glConst.TEXTURE_2D_MULTISAMPLE_ARRAY), + Texture3D = unchecked((uint)glConst.TEXTURE_3D), + TextureCubeMap = unchecked((uint)glConst.TEXTURE_CUBE_MAP), + TextureCubeMapArray = unchecked((uint)glConst.TEXTURE_CUBE_MAP_ARRAY), + TextureRectangle = unchecked((uint)glConst.TEXTURE_RECTANGLE), + } + + /// Native OpenGL group DebugSeverity. + public enum DebugSeverity : uint + { + DebugSeverityHigh = unchecked((uint)glConst.DEBUG_SEVERITY_HIGH), + DebugSeverityLow = unchecked((uint)glConst.DEBUG_SEVERITY_LOW), + DebugSeverityMedium = unchecked((uint)glConst.DEBUG_SEVERITY_MEDIUM), + DebugSeverityNotification = unchecked((uint)glConst.DEBUG_SEVERITY_NOTIFICATION), + DontCare = unchecked((uint)glConst.DONT_CARE), + } + + /// Native OpenGL group DebugSource. + public enum DebugSource : uint + { + DebugSourceApi = unchecked((uint)glConst.DEBUG_SOURCE_API), + DebugSourceApplication = unchecked((uint)glConst.DEBUG_SOURCE_APPLICATION), + DebugSourceOther = unchecked((uint)glConst.DEBUG_SOURCE_OTHER), + DebugSourceShaderCompiler = unchecked((uint)glConst.DEBUG_SOURCE_SHADER_COMPILER), + DebugSourceThirdParty = unchecked((uint)glConst.DEBUG_SOURCE_THIRD_PARTY), + DebugSourceWindowSystem = unchecked((uint)glConst.DEBUG_SOURCE_WINDOW_SYSTEM), + DontCare = unchecked((uint)glConst.DONT_CARE), + } + + /// Native OpenGL group DebugType. + public enum DebugType : uint + { + DebugTypeDeprecatedBehavior = unchecked((uint)glConst.DEBUG_TYPE_DEPRECATED_BEHAVIOR), + DebugTypeError = unchecked((uint)glConst.DEBUG_TYPE_ERROR), + DebugTypeMarker = unchecked((uint)glConst.DEBUG_TYPE_MARKER), + DebugTypeOther = unchecked((uint)glConst.DEBUG_TYPE_OTHER), + DebugTypePerformance = unchecked((uint)glConst.DEBUG_TYPE_PERFORMANCE), + DebugTypePopGroup = unchecked((uint)glConst.DEBUG_TYPE_POP_GROUP), + DebugTypePortability = unchecked((uint)glConst.DEBUG_TYPE_PORTABILITY), + DebugTypePushGroup = unchecked((uint)glConst.DEBUG_TYPE_PUSH_GROUP), + DebugTypeUndefinedBehavior = unchecked((uint)glConst.DEBUG_TYPE_UNDEFINED_BEHAVIOR), + DontCare = unchecked((uint)glConst.DONT_CARE), + } + + /// Native OpenGL group DepthFunction. + public enum DepthFunction : uint + { + Always = unchecked((uint)glConst.ALWAYS), + Equal = unchecked((uint)glConst.EQUAL), + Gequal = unchecked((uint)glConst.GEQUAL), + Greater = unchecked((uint)glConst.GREATER), + Lequal = unchecked((uint)glConst.LEQUAL), + Less = unchecked((uint)glConst.LESS), + Never = unchecked((uint)glConst.NEVER), + Notequal = unchecked((uint)glConst.NOTEQUAL), + } + + /// Native OpenGL group DrawBufferMode. + public enum DrawBufferMode : uint + { + Back = unchecked((uint)glConst.BACK), + BackLeft = unchecked((uint)glConst.BACK_LEFT), + BackRight = unchecked((uint)glConst.BACK_RIGHT), + ColorAttachment0 = unchecked((uint)glConst.COLOR_ATTACHMENT0), + ColorAttachment1 = unchecked((uint)glConst.COLOR_ATTACHMENT1), + ColorAttachment10 = unchecked((uint)glConst.COLOR_ATTACHMENT10), + ColorAttachment11 = unchecked((uint)glConst.COLOR_ATTACHMENT11), + ColorAttachment12 = unchecked((uint)glConst.COLOR_ATTACHMENT12), + ColorAttachment13 = unchecked((uint)glConst.COLOR_ATTACHMENT13), + ColorAttachment14 = unchecked((uint)glConst.COLOR_ATTACHMENT14), + ColorAttachment15 = unchecked((uint)glConst.COLOR_ATTACHMENT15), + ColorAttachment16 = unchecked((uint)glConst.COLOR_ATTACHMENT16), + ColorAttachment17 = unchecked((uint)glConst.COLOR_ATTACHMENT17), + ColorAttachment18 = unchecked((uint)glConst.COLOR_ATTACHMENT18), + ColorAttachment19 = unchecked((uint)glConst.COLOR_ATTACHMENT19), + ColorAttachment2 = unchecked((uint)glConst.COLOR_ATTACHMENT2), + ColorAttachment20 = unchecked((uint)glConst.COLOR_ATTACHMENT20), + ColorAttachment21 = unchecked((uint)glConst.COLOR_ATTACHMENT21), + ColorAttachment22 = unchecked((uint)glConst.COLOR_ATTACHMENT22), + ColorAttachment23 = unchecked((uint)glConst.COLOR_ATTACHMENT23), + ColorAttachment24 = unchecked((uint)glConst.COLOR_ATTACHMENT24), + ColorAttachment25 = unchecked((uint)glConst.COLOR_ATTACHMENT25), + ColorAttachment26 = unchecked((uint)glConst.COLOR_ATTACHMENT26), + ColorAttachment27 = unchecked((uint)glConst.COLOR_ATTACHMENT27), + ColorAttachment28 = unchecked((uint)glConst.COLOR_ATTACHMENT28), + ColorAttachment29 = unchecked((uint)glConst.COLOR_ATTACHMENT29), + ColorAttachment3 = unchecked((uint)glConst.COLOR_ATTACHMENT3), + ColorAttachment30 = unchecked((uint)glConst.COLOR_ATTACHMENT30), + ColorAttachment31 = unchecked((uint)glConst.COLOR_ATTACHMENT31), + ColorAttachment4 = unchecked((uint)glConst.COLOR_ATTACHMENT4), + ColorAttachment5 = unchecked((uint)glConst.COLOR_ATTACHMENT5), + ColorAttachment6 = unchecked((uint)glConst.COLOR_ATTACHMENT6), + ColorAttachment7 = unchecked((uint)glConst.COLOR_ATTACHMENT7), + ColorAttachment8 = unchecked((uint)glConst.COLOR_ATTACHMENT8), + ColorAttachment9 = unchecked((uint)glConst.COLOR_ATTACHMENT9), + Front = unchecked((uint)glConst.FRONT), + FrontAndBack = unchecked((uint)glConst.FRONT_AND_BACK), + FrontLeft = unchecked((uint)glConst.FRONT_LEFT), + FrontRight = unchecked((uint)glConst.FRONT_RIGHT), + Left = unchecked((uint)glConst.LEFT), + None = unchecked((uint)glConst.NONE), + Right = unchecked((uint)glConst.RIGHT), + } + + /// Native OpenGL group DrawElementsType. + public enum DrawElementsType : uint + { + UnsignedByte = unchecked((uint)glConst.UNSIGNED_BYTE), + UnsignedInt = unchecked((uint)glConst.UNSIGNED_INT), + UnsignedShort = unchecked((uint)glConst.UNSIGNED_SHORT), + } + + /// Native OpenGL group EnableCap. + public enum EnableCap : uint + { + Blend = unchecked((uint)glConst.BLEND), + ClipDistance0 = unchecked((uint)glConst.CLIP_DISTANCE0), + ClipDistance1 = unchecked((uint)glConst.CLIP_DISTANCE1), + ClipDistance2 = unchecked((uint)glConst.CLIP_DISTANCE2), + ClipDistance3 = unchecked((uint)glConst.CLIP_DISTANCE3), + ClipDistance4 = unchecked((uint)glConst.CLIP_DISTANCE4), + ClipDistance5 = unchecked((uint)glConst.CLIP_DISTANCE5), + ClipDistance6 = unchecked((uint)glConst.CLIP_DISTANCE6), + ClipDistance7 = unchecked((uint)glConst.CLIP_DISTANCE7), + ColorLogicOp = unchecked((uint)glConst.COLOR_LOGIC_OP), + CullFace = unchecked((uint)glConst.CULL_FACE), + DebugOutput = unchecked((uint)glConst.DEBUG_OUTPUT), + DebugOutputSynchronous = unchecked((uint)glConst.DEBUG_OUTPUT_SYNCHRONOUS), + DepthClamp = unchecked((uint)glConst.DEPTH_CLAMP), + DepthTest = unchecked((uint)glConst.DEPTH_TEST), + Dither = unchecked((uint)glConst.DITHER), + FrameBufferSrgb = unchecked((uint)glConst.FRAMEBUFFER_SRGB), + LineSmooth = unchecked((uint)glConst.LINE_SMOOTH), + Multisample = unchecked((uint)glConst.MULTISAMPLE), + PolygonOffsetFill = unchecked((uint)glConst.POLYGON_OFFSET_FILL), + PolygonOffsetLine = unchecked((uint)glConst.POLYGON_OFFSET_LINE), + PolygonOffsetPoint = unchecked((uint)glConst.POLYGON_OFFSET_POINT), + PolygonSmooth = unchecked((uint)glConst.POLYGON_SMOOTH), + PrimitiveRestart = unchecked((uint)glConst.PRIMITIVE_RESTART), + PrimitiveRestartFixedIndex = unchecked((uint)glConst.PRIMITIVE_RESTART_FIXED_INDEX), + ProgramPointSize = unchecked((uint)glConst.PROGRAM_POINT_SIZE), + RasterizerDiscard = unchecked((uint)glConst.RASTERIZER_DISCARD), + SampleAlphaToCoverage = unchecked((uint)glConst.SAMPLE_ALPHA_TO_COVERAGE), + SampleAlphaToOne = unchecked((uint)glConst.SAMPLE_ALPHA_TO_ONE), + SampleCoverage = unchecked((uint)glConst.SAMPLE_COVERAGE), + SampleMask = unchecked((uint)glConst.SAMPLE_MASK), + SampleShading = unchecked((uint)glConst.SAMPLE_SHADING), + ScissorTest = unchecked((uint)glConst.SCISSOR_TEST), + StencilTest = unchecked((uint)glConst.STENCIL_TEST), + Texture1D = unchecked((uint)glConst.TEXTURE_1D), + Texture2D = unchecked((uint)glConst.TEXTURE_2D), + TextureCubeMap = unchecked((uint)glConst.TEXTURE_CUBE_MAP), + TextureCubeMapSeamless = unchecked((uint)glConst.TEXTURE_CUBE_MAP_SEAMLESS), + TextureRectangle = unchecked((uint)glConst.TEXTURE_RECTANGLE), + VertexArray = unchecked((uint)glConst.VERTEX_ARRAY), + } + + /// Native OpenGL group ErrorCode. + public enum ErrorCode : uint + { + InvalidEnum = unchecked((uint)glConst.INVALID_ENUM), + InvalidFrameBufferOperation = unchecked((uint)glConst.INVALID_FRAMEBUFFER_OPERATION), + InvalidOperation = unchecked((uint)glConst.INVALID_OPERATION), + InvalidValue = unchecked((uint)glConst.INVALID_VALUE), + NoError = unchecked((uint)glConst.NO_ERROR), + OutOfMemory = unchecked((uint)glConst.OUT_OF_MEMORY), + StackOverflow = unchecked((uint)glConst.STACK_OVERFLOW), + StackUnderflow = unchecked((uint)glConst.STACK_UNDERFLOW), + } + + /// Native OpenGL group FramebufferAttachment. + public enum FrameBufferAttachment : uint + { + ColorAttachment0 = unchecked((uint)glConst.COLOR_ATTACHMENT0), + ColorAttachment1 = unchecked((uint)glConst.COLOR_ATTACHMENT1), + ColorAttachment10 = unchecked((uint)glConst.COLOR_ATTACHMENT10), + ColorAttachment11 = unchecked((uint)glConst.COLOR_ATTACHMENT11), + ColorAttachment12 = unchecked((uint)glConst.COLOR_ATTACHMENT12), + ColorAttachment13 = unchecked((uint)glConst.COLOR_ATTACHMENT13), + ColorAttachment14 = unchecked((uint)glConst.COLOR_ATTACHMENT14), + ColorAttachment15 = unchecked((uint)glConst.COLOR_ATTACHMENT15), + ColorAttachment16 = unchecked((uint)glConst.COLOR_ATTACHMENT16), + ColorAttachment17 = unchecked((uint)glConst.COLOR_ATTACHMENT17), + ColorAttachment18 = unchecked((uint)glConst.COLOR_ATTACHMENT18), + ColorAttachment19 = unchecked((uint)glConst.COLOR_ATTACHMENT19), + ColorAttachment2 = unchecked((uint)glConst.COLOR_ATTACHMENT2), + ColorAttachment20 = unchecked((uint)glConst.COLOR_ATTACHMENT20), + ColorAttachment21 = unchecked((uint)glConst.COLOR_ATTACHMENT21), + ColorAttachment22 = unchecked((uint)glConst.COLOR_ATTACHMENT22), + ColorAttachment23 = unchecked((uint)glConst.COLOR_ATTACHMENT23), + ColorAttachment24 = unchecked((uint)glConst.COLOR_ATTACHMENT24), + ColorAttachment25 = unchecked((uint)glConst.COLOR_ATTACHMENT25), + ColorAttachment26 = unchecked((uint)glConst.COLOR_ATTACHMENT26), + ColorAttachment27 = unchecked((uint)glConst.COLOR_ATTACHMENT27), + ColorAttachment28 = unchecked((uint)glConst.COLOR_ATTACHMENT28), + ColorAttachment29 = unchecked((uint)glConst.COLOR_ATTACHMENT29), + ColorAttachment3 = unchecked((uint)glConst.COLOR_ATTACHMENT3), + ColorAttachment30 = unchecked((uint)glConst.COLOR_ATTACHMENT30), + ColorAttachment31 = unchecked((uint)glConst.COLOR_ATTACHMENT31), + ColorAttachment4 = unchecked((uint)glConst.COLOR_ATTACHMENT4), + ColorAttachment5 = unchecked((uint)glConst.COLOR_ATTACHMENT5), + ColorAttachment6 = unchecked((uint)glConst.COLOR_ATTACHMENT6), + ColorAttachment7 = unchecked((uint)glConst.COLOR_ATTACHMENT7), + ColorAttachment8 = unchecked((uint)glConst.COLOR_ATTACHMENT8), + ColorAttachment9 = unchecked((uint)glConst.COLOR_ATTACHMENT9), + DepthAttachment = unchecked((uint)glConst.DEPTH_ATTACHMENT), + DepthStencilAttachment = unchecked((uint)glConst.DEPTH_STENCIL_ATTACHMENT), + StencilAttachment = unchecked((uint)glConst.STENCIL_ATTACHMENT), + } + + /// Native OpenGL group FramebufferAttachmentParameterName. + public enum FrameBufferAttachmentParameterName : uint + { + FrameBufferAttachmentAlphaSize = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE), + FrameBufferAttachmentBlueSize = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE), + FrameBufferAttachmentColorEncoding = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING), + FrameBufferAttachmentComponentType = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE), + FrameBufferAttachmentDepthSize = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE), + FrameBufferAttachmentGreenSize = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE), + FrameBufferAttachmentLayered = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_LAYERED), + FrameBufferAttachmentObjectName = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME), + FrameBufferAttachmentObjectType = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE), + FrameBufferAttachmentRedSize = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_RED_SIZE), + FrameBufferAttachmentStencilSize = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE), + FrameBufferAttachmentTextureCubeMapFace = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE), + FrameBufferAttachmentTextureLayer = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER), + FrameBufferAttachmentTextureLevel = unchecked((uint)glConst.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL), + } + + /// Native OpenGL group FramebufferParameterName. + public enum FrameBufferParameterName : uint + { + FrameBufferDefaultFixedSampleLocations = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS), + FrameBufferDefaultHeight = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_HEIGHT), + FrameBufferDefaultLayers = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_LAYERS), + FrameBufferDefaultSamples = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_SAMPLES), + FrameBufferDefaultWidth = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_WIDTH), + } + + /// Native OpenGL group FramebufferStatus. + public enum FrameBufferStatus : uint + { + FrameBufferComplete = unchecked((uint)glConst.FRAMEBUFFER_COMPLETE), + FrameBufferIncompleteAttachment = unchecked((uint)glConst.FRAMEBUFFER_INCOMPLETE_ATTACHMENT), + FrameBufferIncompleteDrawBuffer = unchecked((uint)glConst.FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER), + FrameBufferIncompleteLayerTargets = unchecked((uint)glConst.FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS), + FrameBufferIncompleteMissingAttachment = unchecked((uint)glConst.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT), + FrameBufferIncompleteMultisample = unchecked((uint)glConst.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE), + FrameBufferIncompleteReadBuffer = unchecked((uint)glConst.FRAMEBUFFER_INCOMPLETE_READ_BUFFER), + FrameBufferUndefined = unchecked((uint)glConst.FRAMEBUFFER_UNDEFINED), + FrameBufferUnsupported = unchecked((uint)glConst.FRAMEBUFFER_UNSUPPORTED), + } + + /// Native OpenGL group FramebufferTarget. + public enum FrameBufferTarget : uint + { + DrawFrameBuffer = unchecked((uint)glConst.DRAW_FRAMEBUFFER), + FrameBuffer = unchecked((uint)glConst.FRAMEBUFFER), + ReadFrameBuffer = unchecked((uint)glConst.READ_FRAMEBUFFER), + } + + /// Native OpenGL group FrontFaceDirection. + public enum FrontFaceDirection : uint + { + Ccw = unchecked((uint)glConst.CCW), + Cw = unchecked((uint)glConst.CW), + } + + /// Native OpenGL group GetFramebufferParameter. + public enum GetFrameBufferParameter : uint + { + Doublebuffer = unchecked((uint)glConst.DOUBLEBUFFER), + FrameBufferDefaultFixedSampleLocations = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS), + FrameBufferDefaultHeight = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_HEIGHT), + FrameBufferDefaultLayers = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_LAYERS), + FrameBufferDefaultSamples = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_SAMPLES), + FrameBufferDefaultWidth = unchecked((uint)glConst.FRAMEBUFFER_DEFAULT_WIDTH), + ImplementationColorReadFormat = unchecked((uint)glConst.IMPLEMENTATION_COLOR_READ_FORMAT), + ImplementationColorReadType = unchecked((uint)glConst.IMPLEMENTATION_COLOR_READ_TYPE), + SampleBuffers = unchecked((uint)glConst.SAMPLE_BUFFERS), + Samples = unchecked((uint)glConst.SAMPLES), + Stereo = unchecked((uint)glConst.STEREO), + } + + /// Native OpenGL group GetMultisamplePNameNV. + public enum GetMultisamplePName : uint + { + SamplePosition = unchecked((uint)glConst.SAMPLE_POSITION), + } + + /// Native OpenGL group GetPName. + public enum GetPName : uint + { + ActiveTexture = unchecked((uint)glConst.ACTIVE_TEXTURE), + AliasedLineWidthRange = unchecked((uint)glConst.ALIASED_LINE_WIDTH_RANGE), + ArrayBufferBinding = unchecked((uint)glConst.ARRAY_BUFFER_BINDING), + Blend = unchecked((uint)glConst.BLEND), + BlendColor = unchecked((uint)glConst.BLEND_COLOR), + BlendDst = unchecked((uint)glConst.BLEND_DST), + BlendDstAlpha = unchecked((uint)glConst.BLEND_DST_ALPHA), + BlendDstRgb = unchecked((uint)glConst.BLEND_DST_RGB), + BlendEquation = unchecked((uint)glConst.BLEND_EQUATION), + BlendEquationAlpha = unchecked((uint)glConst.BLEND_EQUATION_ALPHA), + BlendEquationRgb = unchecked((uint)glConst.BLEND_EQUATION_RGB), + BlendSrc = unchecked((uint)glConst.BLEND_SRC), + BlendSrcAlpha = unchecked((uint)glConst.BLEND_SRC_ALPHA), + BlendSrcRgb = unchecked((uint)glConst.BLEND_SRC_RGB), + ClipDepthMode = unchecked((uint)glConst.CLIP_DEPTH_MODE), + ClipOrigin = unchecked((uint)glConst.CLIP_ORIGIN), + ColorClearValue = unchecked((uint)glConst.COLOR_CLEAR_VALUE), + ColorLogicOp = unchecked((uint)glConst.COLOR_LOGIC_OP), + ColorWritemask = unchecked((uint)glConst.COLOR_WRITEMASK), + CompressedTextureFormats = unchecked((uint)glConst.COMPRESSED_TEXTURE_FORMATS), + ContextFlags = unchecked((uint)glConst.CONTEXT_FLAGS), + ContextProfileMask = unchecked((uint)glConst.CONTEXT_PROFILE_MASK), + CullFace = unchecked((uint)glConst.CULL_FACE), + CullFaceMode = unchecked((uint)glConst.CULL_FACE_MODE), + CurrentProgram = unchecked((uint)glConst.CURRENT_PROGRAM), + DebugGroupStackDepth = unchecked((uint)glConst.DEBUG_GROUP_STACK_DEPTH), + DepthClearValue = unchecked((uint)glConst.DEPTH_CLEAR_VALUE), + DepthFunc = unchecked((uint)glConst.DEPTH_FUNC), + DepthRange = unchecked((uint)glConst.DEPTH_RANGE), + DepthTest = unchecked((uint)glConst.DEPTH_TEST), + DepthWritemask = unchecked((uint)glConst.DEPTH_WRITEMASK), + DispatchIndirectBufferBinding = unchecked((uint)glConst.DISPATCH_INDIRECT_BUFFER_BINDING), + Dither = unchecked((uint)glConst.DITHER), + Doublebuffer = unchecked((uint)glConst.DOUBLEBUFFER), + DrawBuffer = unchecked((uint)glConst.DRAW_BUFFER), + DrawFrameBufferBinding = unchecked((uint)glConst.DRAW_FRAMEBUFFER_BINDING), + ElementArrayBufferBinding = unchecked((uint)glConst.ELEMENT_ARRAY_BUFFER_BINDING), + FragmentShaderDerivativeHint = unchecked((uint)glConst.FRAGMENT_SHADER_DERIVATIVE_HINT), + FrontFace = unchecked((uint)glConst.FRONT_FACE), + ImplementationColorReadFormat = unchecked((uint)glConst.IMPLEMENTATION_COLOR_READ_FORMAT), + ImplementationColorReadType = unchecked((uint)glConst.IMPLEMENTATION_COLOR_READ_TYPE), + LayerProvokingVertex = unchecked((uint)glConst.LAYER_PROVOKING_VERTEX), + LineSmooth = unchecked((uint)glConst.LINE_SMOOTH), + LineSmoothHint = unchecked((uint)glConst.LINE_SMOOTH_HINT), + LineWidth = unchecked((uint)glConst.LINE_WIDTH), + LineWidthGranularity = unchecked((uint)glConst.LINE_WIDTH_GRANULARITY), + LineWidthRange = unchecked((uint)glConst.LINE_WIDTH_RANGE), + LogicOpMode = unchecked((uint)glConst.LOGIC_OP_MODE), + MajorVersion = unchecked((uint)glConst.MAJOR_VERSION), + Max3DTextureSize = unchecked((uint)glConst.MAX_3D_TEXTURE_SIZE), + MaxArrayTextureLayers = unchecked((uint)glConst.MAX_ARRAY_TEXTURE_LAYERS), + MaxClipDistances = unchecked((uint)glConst.MAX_CLIP_DISTANCES), + MaxColorAttachments = unchecked((uint)glConst.MAX_COLOR_ATTACHMENTS), + MaxColorTextureSamples = unchecked((uint)glConst.MAX_COLOR_TEXTURE_SAMPLES), + MaxCombinedAtomicCounters = unchecked((uint)glConst.MAX_COMBINED_ATOMIC_COUNTERS), + MaxCombinedComputeUniformComponents = unchecked((uint)glConst.MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS), + MaxCombinedFragmentUniformComponents = unchecked((uint)glConst.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS), + MaxCombinedGeometryUniformComponents = unchecked((uint)glConst.MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS), + MaxCombinedShaderStorageBlocks = unchecked((uint)glConst.MAX_COMBINED_SHADER_STORAGE_BLOCKS), + MaxCombinedTextureImageUnits = unchecked((uint)glConst.MAX_COMBINED_TEXTURE_IMAGE_UNITS), + MaxCombinedUniformBlocks = unchecked((uint)glConst.MAX_COMBINED_UNIFORM_BLOCKS), + MaxCombinedVertexUniformComponents = unchecked((uint)glConst.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS), + MaxComputeAtomicCounterBuffers = unchecked((uint)glConst.MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS), + MaxComputeAtomicCounters = unchecked((uint)glConst.MAX_COMPUTE_ATOMIC_COUNTERS), + MaxComputeShaderStorageBlocks = unchecked((uint)glConst.MAX_COMPUTE_SHADER_STORAGE_BLOCKS), + MaxComputeTextureImageUnits = unchecked((uint)glConst.MAX_COMPUTE_TEXTURE_IMAGE_UNITS), + MaxComputeUniformBlocks = unchecked((uint)glConst.MAX_COMPUTE_UNIFORM_BLOCKS), + MaxComputeUniformComponents = unchecked((uint)glConst.MAX_COMPUTE_UNIFORM_COMPONENTS), + MaxComputeWorkGroupCount = unchecked((uint)glConst.MAX_COMPUTE_WORK_GROUP_COUNT), + MaxComputeWorkGroupInvocations = unchecked((uint)glConst.MAX_COMPUTE_WORK_GROUP_INVOCATIONS), + MaxComputeWorkGroupSize = unchecked((uint)glConst.MAX_COMPUTE_WORK_GROUP_SIZE), + MaxCubeMapTextureSize = unchecked((uint)glConst.MAX_CUBE_MAP_TEXTURE_SIZE), + MaxDebugGroupStackDepth = unchecked((uint)glConst.MAX_DEBUG_GROUP_STACK_DEPTH), + MaxDepthTextureSamples = unchecked((uint)glConst.MAX_DEPTH_TEXTURE_SAMPLES), + MaxDrawBuffers = unchecked((uint)glConst.MAX_DRAW_BUFFERS), + MaxDualSourceDrawBuffers = unchecked((uint)glConst.MAX_DUAL_SOURCE_DRAW_BUFFERS), + MaxElementIndex = unchecked((uint)glConst.MAX_ELEMENT_INDEX), + MaxElementsIndices = unchecked((uint)glConst.MAX_ELEMENTS_INDICES), + MaxElementsVertices = unchecked((uint)glConst.MAX_ELEMENTS_VERTICES), + MaxFragmentAtomicCounters = unchecked((uint)glConst.MAX_FRAGMENT_ATOMIC_COUNTERS), + MaxFragmentInputComponents = unchecked((uint)glConst.MAX_FRAGMENT_INPUT_COMPONENTS), + MaxFragmentShaderStorageBlocks = unchecked((uint)glConst.MAX_FRAGMENT_SHADER_STORAGE_BLOCKS), + MaxFragmentUniformBlocks = unchecked((uint)glConst.MAX_FRAGMENT_UNIFORM_BLOCKS), + MaxFragmentUniformComponents = unchecked((uint)glConst.MAX_FRAGMENT_UNIFORM_COMPONENTS), + MaxFragmentUniformVectors = unchecked((uint)glConst.MAX_FRAGMENT_UNIFORM_VECTORS), + MaxFrameBufferHeight = unchecked((uint)glConst.MAX_FRAMEBUFFER_HEIGHT), + MaxFrameBufferLayers = unchecked((uint)glConst.MAX_FRAMEBUFFER_LAYERS), + MaxFrameBufferSamples = unchecked((uint)glConst.MAX_FRAMEBUFFER_SAMPLES), + MaxFrameBufferWidth = unchecked((uint)glConst.MAX_FRAMEBUFFER_WIDTH), + MaxGeometryAtomicCounters = unchecked((uint)glConst.MAX_GEOMETRY_ATOMIC_COUNTERS), + MaxGeometryInputComponents = unchecked((uint)glConst.MAX_GEOMETRY_INPUT_COMPONENTS), + MaxGeometryOutputComponents = unchecked((uint)glConst.MAX_GEOMETRY_OUTPUT_COMPONENTS), + MaxGeometryShaderStorageBlocks = unchecked((uint)glConst.MAX_GEOMETRY_SHADER_STORAGE_BLOCKS), + MaxGeometryTextureImageUnits = unchecked((uint)glConst.MAX_GEOMETRY_TEXTURE_IMAGE_UNITS), + MaxGeometryUniformBlocks = unchecked((uint)glConst.MAX_GEOMETRY_UNIFORM_BLOCKS), + MaxGeometryUniformComponents = unchecked((uint)glConst.MAX_GEOMETRY_UNIFORM_COMPONENTS), + MaxIntegerSamples = unchecked((uint)glConst.MAX_INTEGER_SAMPLES), + MaxLabelLength = unchecked((uint)glConst.MAX_LABEL_LENGTH), + MaxProgramTexelOffset = unchecked((uint)glConst.MAX_PROGRAM_TEXEL_OFFSET), + MaxRectangleTextureSize = unchecked((uint)glConst.MAX_RECTANGLE_TEXTURE_SIZE), + MaxRenderBufferSize = unchecked((uint)glConst.MAX_RENDERBUFFER_SIZE), + MaxSampleMaskWords = unchecked((uint)glConst.MAX_SAMPLE_MASK_WORDS), + MaxServerWaitTimeout = unchecked((uint)glConst.MAX_SERVER_WAIT_TIMEOUT), + MaxShaderStorageBufferBindings = unchecked((uint)glConst.MAX_SHADER_STORAGE_BUFFER_BINDINGS), + MaxTessControlAtomicCounters = unchecked((uint)glConst.MAX_TESS_CONTROL_ATOMIC_COUNTERS), + MaxTessControlShaderStorageBlocks = unchecked((uint)glConst.MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS), + MaxTessControlUniformBlocks = unchecked((uint)glConst.MAX_TESS_CONTROL_UNIFORM_BLOCKS), + MaxTessEvaluationAtomicCounters = unchecked((uint)glConst.MAX_TESS_EVALUATION_ATOMIC_COUNTERS), + MaxTessEvaluationShaderStorageBlocks = unchecked((uint)glConst.MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS), + MaxTessEvaluationUniformBlocks = unchecked((uint)glConst.MAX_TESS_EVALUATION_UNIFORM_BLOCKS), + MaxTextureBufferSize = unchecked((uint)glConst.MAX_TEXTURE_BUFFER_SIZE), + MaxTextureImageUnits = unchecked((uint)glConst.MAX_TEXTURE_IMAGE_UNITS), + MaxTextureLodBias = unchecked((uint)glConst.MAX_TEXTURE_LOD_BIAS), + MaxTextureSize = unchecked((uint)glConst.MAX_TEXTURE_SIZE), + MaxUniformBlockSize = unchecked((uint)glConst.MAX_UNIFORM_BLOCK_SIZE), + MaxUniformBufferBindings = unchecked((uint)glConst.MAX_UNIFORM_BUFFER_BINDINGS), + MaxUniformLocations = unchecked((uint)glConst.MAX_UNIFORM_LOCATIONS), + MaxVaryingComponents = unchecked((uint)glConst.MAX_VARYING_COMPONENTS), + MaxVaryingFloats = unchecked((uint)glConst.MAX_VARYING_FLOATS), + MaxVaryingVectors = unchecked((uint)glConst.MAX_VARYING_VECTORS), + MaxVertexAtomicCounters = unchecked((uint)glConst.MAX_VERTEX_ATOMIC_COUNTERS), + MaxVertexAttributeBindings = unchecked((uint)glConst.MAX_VERTEX_ATTRIB_BINDINGS), + MaxVertexAttributeRelativeOffset = unchecked((uint)glConst.MAX_VERTEX_ATTRIB_RELATIVE_OFFSET), + MaxVertexAttributes = unchecked((uint)glConst.MAX_VERTEX_ATTRIBS), + MaxVertexOutputComponents = unchecked((uint)glConst.MAX_VERTEX_OUTPUT_COMPONENTS), + MaxVertexShaderStorageBlocks = unchecked((uint)glConst.MAX_VERTEX_SHADER_STORAGE_BLOCKS), + MaxVertexTextureImageUnits = unchecked((uint)glConst.MAX_VERTEX_TEXTURE_IMAGE_UNITS), + MaxVertexUniformBlocks = unchecked((uint)glConst.MAX_VERTEX_UNIFORM_BLOCKS), + MaxVertexUniformComponents = unchecked((uint)glConst.MAX_VERTEX_UNIFORM_COMPONENTS), + MaxVertexUniformVectors = unchecked((uint)glConst.MAX_VERTEX_UNIFORM_VECTORS), + MaxViewportDims = unchecked((uint)glConst.MAX_VIEWPORT_DIMS), + MaxViewports = unchecked((uint)glConst.MAX_VIEWPORTS), + MinMapBufferAlignment = unchecked((uint)glConst.MIN_MAP_BUFFER_ALIGNMENT), + MinProgramTexelOffset = unchecked((uint)glConst.MIN_PROGRAM_TEXEL_OFFSET), + MinorVersion = unchecked((uint)glConst.MINOR_VERSION), + NumCompressedTextureFormats = unchecked((uint)glConst.NUM_COMPRESSED_TEXTURE_FORMATS), + NumExtensions = unchecked((uint)glConst.NUM_EXTENSIONS), + NumProgramBinaryFormats = unchecked((uint)glConst.NUM_PROGRAM_BINARY_FORMATS), + NumShaderBinaryFormats = unchecked((uint)glConst.NUM_SHADER_BINARY_FORMATS), + PackAlignment = unchecked((uint)glConst.PACK_ALIGNMENT), + PackImageHeight = unchecked((uint)glConst.PACK_IMAGE_HEIGHT), + PackLsbFirst = unchecked((uint)glConst.PACK_LSB_FIRST), + PackRowLength = unchecked((uint)glConst.PACK_ROW_LENGTH), + PackSkipImages = unchecked((uint)glConst.PACK_SKIP_IMAGES), + PackSkipPixels = unchecked((uint)glConst.PACK_SKIP_PIXELS), + PackSkipRows = unchecked((uint)glConst.PACK_SKIP_ROWS), + PackSwapBytes = unchecked((uint)glConst.PACK_SWAP_BYTES), + PixelPackBufferBinding = unchecked((uint)glConst.PIXEL_PACK_BUFFER_BINDING), + PixelUnpackBufferBinding = unchecked((uint)glConst.PIXEL_UNPACK_BUFFER_BINDING), + PointFadeThresholdSize = unchecked((uint)glConst.POINT_FADE_THRESHOLD_SIZE), + PointSize = unchecked((uint)glConst.POINT_SIZE), + PointSizeGranularity = unchecked((uint)glConst.POINT_SIZE_GRANULARITY), + PointSizeRange = unchecked((uint)glConst.POINT_SIZE_RANGE), + PolygonMode = unchecked((uint)glConst.POLYGON_MODE), + PolygonOffsetFactor = unchecked((uint)glConst.POLYGON_OFFSET_FACTOR), + PolygonOffsetFill = unchecked((uint)glConst.POLYGON_OFFSET_FILL), + PolygonOffsetLine = unchecked((uint)glConst.POLYGON_OFFSET_LINE), + PolygonOffsetPoint = unchecked((uint)glConst.POLYGON_OFFSET_POINT), + PolygonOffsetUnits = unchecked((uint)glConst.POLYGON_OFFSET_UNITS), + PolygonSmooth = unchecked((uint)glConst.POLYGON_SMOOTH), + PolygonSmoothHint = unchecked((uint)glConst.POLYGON_SMOOTH_HINT), + PrimitiveRestartIndex = unchecked((uint)glConst.PRIMITIVE_RESTART_INDEX), + ProgramBinaryFormats = unchecked((uint)glConst.PROGRAM_BINARY_FORMATS), + ProgramPipelineBinding = unchecked((uint)glConst.PROGRAM_PIPELINE_BINDING), + ProgramPointSize = unchecked((uint)glConst.PROGRAM_POINT_SIZE), + ProvokingVertex = unchecked((uint)glConst.PROVOKING_VERTEX), + ReadBuffer = unchecked((uint)glConst.READ_BUFFER), + ReadFrameBufferBinding = unchecked((uint)glConst.READ_FRAMEBUFFER_BINDING), + RenderBufferBinding = unchecked((uint)glConst.RENDERBUFFER_BINDING), + SampleBuffers = unchecked((uint)glConst.SAMPLE_BUFFERS), + SampleCoverageInvert = unchecked((uint)glConst.SAMPLE_COVERAGE_INVERT), + SampleCoverageValue = unchecked((uint)glConst.SAMPLE_COVERAGE_VALUE), + SamplerBinding = unchecked((uint)glConst.SAMPLER_BINDING), + Samples = unchecked((uint)glConst.SAMPLES), + ScissorBox = unchecked((uint)glConst.SCISSOR_BOX), + ScissorTest = unchecked((uint)glConst.SCISSOR_TEST), + ShaderBinaryFormats = unchecked((uint)glConst.SHADER_BINARY_FORMATS), + ShaderCompiler = unchecked((uint)glConst.SHADER_COMPILER), + ShaderStorageBufferBinding = unchecked((uint)glConst.SHADER_STORAGE_BUFFER_BINDING), + ShaderStorageBufferOffsetAlignment = unchecked((uint)glConst.SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT), + ShaderStorageBufferSize = unchecked((uint)glConst.SHADER_STORAGE_BUFFER_SIZE), + ShaderStorageBufferStart = unchecked((uint)glConst.SHADER_STORAGE_BUFFER_START), + SmoothLineWidthGranularity = unchecked((uint)glConst.SMOOTH_LINE_WIDTH_GRANULARITY), + SmoothLineWidthRange = unchecked((uint)glConst.SMOOTH_LINE_WIDTH_RANGE), + SmoothPointSizeGranularity = unchecked((uint)glConst.SMOOTH_POINT_SIZE_GRANULARITY), + SmoothPointSizeRange = unchecked((uint)glConst.SMOOTH_POINT_SIZE_RANGE), + StencilBackFail = unchecked((uint)glConst.STENCIL_BACK_FAIL), + StencilBackFunc = unchecked((uint)glConst.STENCIL_BACK_FUNC), + StencilBackPassDepthFail = unchecked((uint)glConst.STENCIL_BACK_PASS_DEPTH_FAIL), + StencilBackPassDepthPass = unchecked((uint)glConst.STENCIL_BACK_PASS_DEPTH_PASS), + StencilBackRef = unchecked((uint)glConst.STENCIL_BACK_REF), + StencilBackValueMask = unchecked((uint)glConst.STENCIL_BACK_VALUE_MASK), + StencilBackWritemask = unchecked((uint)glConst.STENCIL_BACK_WRITEMASK), + StencilClearValue = unchecked((uint)glConst.STENCIL_CLEAR_VALUE), + StencilFail = unchecked((uint)glConst.STENCIL_FAIL), + StencilFunc = unchecked((uint)glConst.STENCIL_FUNC), + StencilPassDepthFail = unchecked((uint)glConst.STENCIL_PASS_DEPTH_FAIL), + StencilPassDepthPass = unchecked((uint)glConst.STENCIL_PASS_DEPTH_PASS), + StencilRef = unchecked((uint)glConst.STENCIL_REF), + StencilTest = unchecked((uint)glConst.STENCIL_TEST), + StencilValueMask = unchecked((uint)glConst.STENCIL_VALUE_MASK), + StencilWritemask = unchecked((uint)glConst.STENCIL_WRITEMASK), + Stereo = unchecked((uint)glConst.STEREO), + SubpixelBits = unchecked((uint)glConst.SUBPIXEL_BITS), + Texture1D = unchecked((uint)glConst.TEXTURE_1D), + Texture2D = unchecked((uint)glConst.TEXTURE_2D), + TextureBinding1D = unchecked((uint)glConst.TEXTURE_BINDING_1D), + TextureBinding1DArray = unchecked((uint)glConst.TEXTURE_BINDING_1D_ARRAY), + TextureBinding2D = unchecked((uint)glConst.TEXTURE_BINDING_2D), + TextureBinding2DArray = unchecked((uint)glConst.TEXTURE_BINDING_2D_ARRAY), + TextureBinding2DMultisample = unchecked((uint)glConst.TEXTURE_BINDING_2D_MULTISAMPLE), + TextureBinding2DMultisampleArray = unchecked((uint)glConst.TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY), + TextureBinding3D = unchecked((uint)glConst.TEXTURE_BINDING_3D), + TextureBindingBuffer = unchecked((uint)glConst.TEXTURE_BINDING_BUFFER), + TextureBindingCubeMap = unchecked((uint)glConst.TEXTURE_BINDING_CUBE_MAP), + TextureBindingRectangle = unchecked((uint)glConst.TEXTURE_BINDING_RECTANGLE), + TextureBufferOffsetAlignment = unchecked((uint)glConst.TEXTURE_BUFFER_OFFSET_ALIGNMENT), + TextureCompressionHint = unchecked((uint)glConst.TEXTURE_COMPRESSION_HINT), + Timestamp = unchecked((uint)glConst.TIMESTAMP), + TransformFeedbackBufferBinding = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER_BINDING), + TransformFeedbackBufferSize = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER_SIZE), + TransformFeedbackBufferStart = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER_START), + UniformBufferBinding = unchecked((uint)glConst.UNIFORM_BUFFER_BINDING), + UniformBufferOffsetAlignment = unchecked((uint)glConst.UNIFORM_BUFFER_OFFSET_ALIGNMENT), + UniformBufferSize = unchecked((uint)glConst.UNIFORM_BUFFER_SIZE), + UniformBufferStart = unchecked((uint)glConst.UNIFORM_BUFFER_START), + UnpackAlignment = unchecked((uint)glConst.UNPACK_ALIGNMENT), + UnpackImageHeight = unchecked((uint)glConst.UNPACK_IMAGE_HEIGHT), + UnpackLsbFirst = unchecked((uint)glConst.UNPACK_LSB_FIRST), + UnpackRowLength = unchecked((uint)glConst.UNPACK_ROW_LENGTH), + UnpackSkipImages = unchecked((uint)glConst.UNPACK_SKIP_IMAGES), + UnpackSkipPixels = unchecked((uint)glConst.UNPACK_SKIP_PIXELS), + UnpackSkipRows = unchecked((uint)glConst.UNPACK_SKIP_ROWS), + UnpackSwapBytes = unchecked((uint)glConst.UNPACK_SWAP_BYTES), + VertexArray = unchecked((uint)glConst.VERTEX_ARRAY), + VertexArrayBinding = unchecked((uint)glConst.VERTEX_ARRAY_BINDING), + VertexBindingDivisor = unchecked((uint)glConst.VERTEX_BINDING_DIVISOR), + VertexBindingOffset = unchecked((uint)glConst.VERTEX_BINDING_OFFSET), + VertexBindingStride = unchecked((uint)glConst.VERTEX_BINDING_STRIDE), + Viewport = unchecked((uint)glConst.VIEWPORT), + ViewportBoundsRange = unchecked((uint)glConst.VIEWPORT_BOUNDS_RANGE), + ViewportIndexProvokingVertex = unchecked((uint)glConst.VIEWPORT_INDEX_PROVOKING_VERTEX), + ViewportSubpixelBits = unchecked((uint)glConst.VIEWPORT_SUBPIXEL_BITS), + } + + /// Native OpenGL group GetPointervPName. + public enum GetPointervPName : uint + { + DebugCallbackFunction = unchecked((uint)glConst.DEBUG_CALLBACK_FUNCTION), + DebugCallbackUserParam = unchecked((uint)glConst.DEBUG_CALLBACK_USER_PARAM), + } + + /// Native OpenGL group GetTextureParameter. + public enum GetTextureParameter : uint + { + TextureAlphaSize = unchecked((uint)glConst.TEXTURE_ALPHA_SIZE), + TextureBlueSize = unchecked((uint)glConst.TEXTURE_BLUE_SIZE), + TextureBorderColor = unchecked((uint)glConst.TEXTURE_BORDER_COLOR), + TextureGreenSize = unchecked((uint)glConst.TEXTURE_GREEN_SIZE), + TextureHeight = unchecked((uint)glConst.TEXTURE_HEIGHT), + TextureInternalFormat = unchecked((uint)glConst.TEXTURE_INTERNAL_FORMAT), + TextureMagFilter = unchecked((uint)glConst.TEXTURE_MAG_FILTER), + TextureMinFilter = unchecked((uint)glConst.TEXTURE_MIN_FILTER), + TextureRedSize = unchecked((uint)glConst.TEXTURE_RED_SIZE), + TextureWidth = unchecked((uint)glConst.TEXTURE_WIDTH), + TextureWrapS = unchecked((uint)glConst.TEXTURE_WRAP_S), + TextureWrapT = unchecked((uint)glConst.TEXTURE_WRAP_T), + } + + /// Native OpenGL group GraphicsResetStatus. + public enum GraphicsResetStatus : uint + { + GuiltyContextReset = unchecked((uint)glConst.GUILTY_CONTEXT_RESET), + InnocentContextReset = unchecked((uint)glConst.INNOCENT_CONTEXT_RESET), + NoError = unchecked((uint)glConst.NO_ERROR), + UnknownContextReset = unchecked((uint)glConst.UNKNOWN_CONTEXT_RESET), + } + + /// Native OpenGL group HintMode. + public enum HintMode : uint + { + DontCare = unchecked((uint)glConst.DONT_CARE), + Fastest = unchecked((uint)glConst.FASTEST), + Nicest = unchecked((uint)glConst.NICEST), + } + + /// Native OpenGL group HintTarget. + public enum HintTarget : uint + { + FragmentShaderDerivativeHint = unchecked((uint)glConst.FRAGMENT_SHADER_DERIVATIVE_HINT), + LineSmoothHint = unchecked((uint)glConst.LINE_SMOOTH_HINT), + PolygonSmoothHint = unchecked((uint)glConst.POLYGON_SMOOTH_HINT), + ProgramBinaryRetrievableHint = unchecked((uint)glConst.PROGRAM_BINARY_RETRIEVABLE_HINT), + TextureCompressionHint = unchecked((uint)glConst.TEXTURE_COMPRESSION_HINT), + } + + /// Native OpenGL group InternalFormat. + public enum InternalFormat : uint + { + CompressedR11Eac = unchecked((uint)glConst.COMPRESSED_R11_EAC), + CompressedRed = unchecked((uint)glConst.COMPRESSED_RED), + CompressedRedRgtc1 = unchecked((uint)glConst.COMPRESSED_RED_RGTC1), + CompressedRg = unchecked((uint)glConst.COMPRESSED_RG), + CompressedRg11Eac = unchecked((uint)glConst.COMPRESSED_RG11_EAC), + CompressedRgRgtc2 = unchecked((uint)glConst.COMPRESSED_RG_RGTC2), + CompressedRgb = unchecked((uint)glConst.COMPRESSED_RGB), + CompressedRgb8Etc2 = unchecked((uint)glConst.COMPRESSED_RGB8_ETC2), + CompressedRgb8PunchthroughAlpha1Etc2 = unchecked((uint)glConst.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2), + CompressedRgbBptcSignedFloat = unchecked((uint)glConst.COMPRESSED_RGB_BPTC_SIGNED_FLOAT), + CompressedRgbBptcUnsignedFloat = unchecked((uint)glConst.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT), + CompressedRgba = unchecked((uint)glConst.COMPRESSED_RGBA), + CompressedRgba8Etc2Eac = unchecked((uint)glConst.COMPRESSED_RGBA8_ETC2_EAC), + CompressedRgbaBptcUnorm = unchecked((uint)glConst.COMPRESSED_RGBA_BPTC_UNORM), + CompressedSignedR11Eac = unchecked((uint)glConst.COMPRESSED_SIGNED_R11_EAC), + CompressedSignedRedRgtc1 = unchecked((uint)glConst.COMPRESSED_SIGNED_RED_RGTC1), + CompressedSignedRg11Eac = unchecked((uint)glConst.COMPRESSED_SIGNED_RG11_EAC), + CompressedSignedRgRgtc2 = unchecked((uint)glConst.COMPRESSED_SIGNED_RG_RGTC2), + CompressedSrgb = unchecked((uint)glConst.COMPRESSED_SRGB), + CompressedSrgb8Alpha8Etc2Eac = unchecked((uint)glConst.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC), + CompressedSrgb8Etc2 = unchecked((uint)glConst.COMPRESSED_SRGB8_ETC2), + CompressedSrgb8PunchthroughAlpha1Etc2 = unchecked((uint)glConst.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2), + CompressedSrgbAlpha = unchecked((uint)glConst.COMPRESSED_SRGB_ALPHA), + CompressedSrgbAlphaBptcUnorm = unchecked((uint)glConst.COMPRESSED_SRGB_ALPHA_BPTC_UNORM), + Depth24Stencil8 = unchecked((uint)glConst.DEPTH24_STENCIL8), + Depth32fStencil8 = unchecked((uint)glConst.DEPTH32F_STENCIL8), + DepthComponent = unchecked((uint)glConst.DEPTH_COMPONENT), + DepthComponent16 = unchecked((uint)glConst.DEPTH_COMPONENT16), + DepthComponent24 = unchecked((uint)glConst.DEPTH_COMPONENT24), + DepthComponent32 = unchecked((uint)glConst.DEPTH_COMPONENT32), + DepthComponent32f = unchecked((uint)glConst.DEPTH_COMPONENT32F), + DepthStencil = unchecked((uint)glConst.DEPTH_STENCIL), + R11fG11fB10f = unchecked((uint)glConst.R11F_G11F_B10F), + R16 = unchecked((uint)glConst.R16), + R16Snorm = unchecked((uint)glConst.R16_SNORM), + R16f = unchecked((uint)glConst.R16F), + R16i = unchecked((uint)glConst.R16I), + R16ui = unchecked((uint)glConst.R16UI), + R32f = unchecked((uint)glConst.R32F), + R32i = unchecked((uint)glConst.R32I), + R32ui = unchecked((uint)glConst.R32UI), + R3G3B2 = unchecked((uint)glConst.R3_G3_B2), + R8 = unchecked((uint)glConst.R8), + R8Snorm = unchecked((uint)glConst.R8_SNORM), + R8i = unchecked((uint)glConst.R8I), + R8ui = unchecked((uint)glConst.R8UI), + Red = unchecked((uint)glConst.RED), + Rg = unchecked((uint)glConst.RG), + Rg16 = unchecked((uint)glConst.RG16), + Rg16Snorm = unchecked((uint)glConst.RG16_SNORM), + Rg16f = unchecked((uint)glConst.RG16F), + Rg16i = unchecked((uint)glConst.RG16I), + Rg16ui = unchecked((uint)glConst.RG16UI), + Rg32f = unchecked((uint)glConst.RG32F), + Rg32i = unchecked((uint)glConst.RG32I), + Rg32ui = unchecked((uint)glConst.RG32UI), + Rg8 = unchecked((uint)glConst.RG8), + Rg8Snorm = unchecked((uint)glConst.RG8_SNORM), + Rg8i = unchecked((uint)glConst.RG8I), + Rg8ui = unchecked((uint)glConst.RG8UI), + Rgb = unchecked((uint)glConst.RGB), + Rgb10 = unchecked((uint)glConst.RGB10), + Rgb10A2 = unchecked((uint)glConst.RGB10_A2), + Rgb10A2ui = unchecked((uint)glConst.RGB10_A2UI), + Rgb12 = unchecked((uint)glConst.RGB12), + Rgb16 = unchecked((uint)glConst.RGB16), + Rgb16Snorm = unchecked((uint)glConst.RGB16_SNORM), + Rgb16f = unchecked((uint)glConst.RGB16F), + Rgb16i = unchecked((uint)glConst.RGB16I), + Rgb16ui = unchecked((uint)glConst.RGB16UI), + Rgb32f = unchecked((uint)glConst.RGB32F), + Rgb32i = unchecked((uint)glConst.RGB32I), + Rgb32ui = unchecked((uint)glConst.RGB32UI), + Rgb4 = unchecked((uint)glConst.RGB4), + Rgb5 = unchecked((uint)glConst.RGB5), + Rgb565 = unchecked((uint)glConst.RGB565), + Rgb5A1 = unchecked((uint)glConst.RGB5_A1), + Rgb8 = unchecked((uint)glConst.RGB8), + Rgb8Snorm = unchecked((uint)glConst.RGB8_SNORM), + Rgb8i = unchecked((uint)glConst.RGB8I), + Rgb8ui = unchecked((uint)glConst.RGB8UI), + Rgb9E5 = unchecked((uint)glConst.RGB9_E5), + Rgba = unchecked((uint)glConst.RGBA), + Rgba12 = unchecked((uint)glConst.RGBA12), + Rgba16 = unchecked((uint)glConst.RGBA16), + Rgba16Snorm = unchecked((uint)glConst.RGBA16_SNORM), + Rgba16f = unchecked((uint)glConst.RGBA16F), + Rgba16i = unchecked((uint)glConst.RGBA16I), + Rgba16ui = unchecked((uint)glConst.RGBA16UI), + Rgba2 = unchecked((uint)glConst.RGBA2), + Rgba32f = unchecked((uint)glConst.RGBA32F), + Rgba32i = unchecked((uint)glConst.RGBA32I), + Rgba32ui = unchecked((uint)glConst.RGBA32UI), + Rgba4 = unchecked((uint)glConst.RGBA4), + Rgba8 = unchecked((uint)glConst.RGBA8), + Rgba8Snorm = unchecked((uint)glConst.RGBA8_SNORM), + Rgba8i = unchecked((uint)glConst.RGBA8I), + Rgba8ui = unchecked((uint)glConst.RGBA8UI), + Srgb = unchecked((uint)glConst.SRGB), + Srgb8 = unchecked((uint)glConst.SRGB8), + Srgb8Alpha8 = unchecked((uint)glConst.SRGB8_ALPHA8), + SrgbAlpha = unchecked((uint)glConst.SRGB_ALPHA), + StencilIndex = unchecked((uint)glConst.STENCIL_INDEX), + StencilIndex1 = unchecked((uint)glConst.STENCIL_INDEX1), + StencilIndex16 = unchecked((uint)glConst.STENCIL_INDEX16), + StencilIndex4 = unchecked((uint)glConst.STENCIL_INDEX4), + StencilIndex8 = unchecked((uint)glConst.STENCIL_INDEX8), + } + + /// Native OpenGL group InternalFormatPName. + public enum InternalFormatPName : uint + { + AutoGenerateMipmap = unchecked((uint)glConst.AUTO_GENERATE_MIPMAP), + ClearBuffer = unchecked((uint)glConst.CLEAR_BUFFER), + ClearTexture = unchecked((uint)glConst.CLEAR_TEXTURE), + ColorComponents = unchecked((uint)glConst.COLOR_COMPONENTS), + ColorEncoding = unchecked((uint)glConst.COLOR_ENCODING), + ColorRenderable = unchecked((uint)glConst.COLOR_RENDERABLE), + ComputeTexture = unchecked((uint)glConst.COMPUTE_TEXTURE), + DepthRenderable = unchecked((uint)glConst.DEPTH_RENDERABLE), + Filter = unchecked((uint)glConst.FILTER), + FragmentTexture = unchecked((uint)glConst.FRAGMENT_TEXTURE), + FrameBufferBlend = unchecked((uint)glConst.FRAMEBUFFER_BLEND), + FrameBufferRenderable = unchecked((uint)glConst.FRAMEBUFFER_RENDERABLE), + FrameBufferRenderableLayered = unchecked((uint)glConst.FRAMEBUFFER_RENDERABLE_LAYERED), + GeometryTexture = unchecked((uint)glConst.GEOMETRY_TEXTURE), + GetTextureImageFormat = unchecked((uint)glConst.GET_TEXTURE_IMAGE_FORMAT), + GetTextureImageType = unchecked((uint)glConst.GET_TEXTURE_IMAGE_TYPE), + ImageCompatibilityClass = unchecked((uint)glConst.IMAGE_COMPATIBILITY_CLASS), + ImageFormatCompatibilityType = unchecked((uint)glConst.IMAGE_FORMAT_COMPATIBILITY_TYPE), + ImagePixelFormat = unchecked((uint)glConst.IMAGE_PIXEL_FORMAT), + ImagePixelType = unchecked((uint)glConst.IMAGE_PIXEL_TYPE), + ImageTexelSize = unchecked((uint)glConst.IMAGE_TEXEL_SIZE), + InternalFormatAlphaSize = unchecked((uint)glConst.INTERNALFORMAT_ALPHA_SIZE), + InternalFormatAlphaType = unchecked((uint)glConst.INTERNALFORMAT_ALPHA_TYPE), + InternalFormatBlueSize = unchecked((uint)glConst.INTERNALFORMAT_BLUE_SIZE), + InternalFormatBlueType = unchecked((uint)glConst.INTERNALFORMAT_BLUE_TYPE), + InternalFormatDepthSize = unchecked((uint)glConst.INTERNALFORMAT_DEPTH_SIZE), + InternalFormatDepthType = unchecked((uint)glConst.INTERNALFORMAT_DEPTH_TYPE), + InternalFormatGreenSize = unchecked((uint)glConst.INTERNALFORMAT_GREEN_SIZE), + InternalFormatGreenType = unchecked((uint)glConst.INTERNALFORMAT_GREEN_TYPE), + InternalFormatPreferred = unchecked((uint)glConst.INTERNALFORMAT_PREFERRED), + InternalFormatRedSize = unchecked((uint)glConst.INTERNALFORMAT_RED_SIZE), + InternalFormatRedType = unchecked((uint)glConst.INTERNALFORMAT_RED_TYPE), + InternalFormatSharedSize = unchecked((uint)glConst.INTERNALFORMAT_SHARED_SIZE), + InternalFormatStencilSize = unchecked((uint)glConst.INTERNALFORMAT_STENCIL_SIZE), + InternalFormatStencilType = unchecked((uint)glConst.INTERNALFORMAT_STENCIL_TYPE), + InternalFormatSupported = unchecked((uint)glConst.INTERNALFORMAT_SUPPORTED), + MaxDepth = unchecked((uint)glConst.MAX_DEPTH), + MaxHeight = unchecked((uint)glConst.MAX_HEIGHT), + MaxLayers = unchecked((uint)glConst.MAX_LAYERS), + MaxWidth = unchecked((uint)glConst.MAX_WIDTH), + Mipmap = unchecked((uint)glConst.MIPMAP), + NumSampleCounts = unchecked((uint)glConst.NUM_SAMPLE_COUNTS), + ReadPixels = unchecked((uint)glConst.READ_PIXELS), + ReadPixelsFormat = unchecked((uint)glConst.READ_PIXELS_FORMAT), + ReadPixelsType = unchecked((uint)glConst.READ_PIXELS_TYPE), + Samples = unchecked((uint)glConst.SAMPLES), + ShaderImageAtomic = unchecked((uint)glConst.SHADER_IMAGE_ATOMIC), + ShaderImageLoad = unchecked((uint)glConst.SHADER_IMAGE_LOAD), + ShaderImageStore = unchecked((uint)glConst.SHADER_IMAGE_STORE), + SimultaneousTextureAndDepthTest = unchecked((uint)glConst.SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST), + SimultaneousTextureAndDepthWrite = unchecked((uint)glConst.SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE), + SimultaneousTextureAndStencilTest = unchecked((uint)glConst.SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST), + SimultaneousTextureAndStencilWrite = unchecked((uint)glConst.SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE), + SrgbRead = unchecked((uint)glConst.SRGB_READ), + SrgbWrite = unchecked((uint)glConst.SRGB_WRITE), + StencilRenderable = unchecked((uint)glConst.STENCIL_RENDERABLE), + TessControlTexture = unchecked((uint)glConst.TESS_CONTROL_TEXTURE), + TessEvaluationTexture = unchecked((uint)glConst.TESS_EVALUATION_TEXTURE), + TextureCompressed = unchecked((uint)glConst.TEXTURE_COMPRESSED), + TextureCompressedBlockHeight = unchecked((uint)glConst.TEXTURE_COMPRESSED_BLOCK_HEIGHT), + TextureCompressedBlockSize = unchecked((uint)glConst.TEXTURE_COMPRESSED_BLOCK_SIZE), + TextureCompressedBlockWidth = unchecked((uint)glConst.TEXTURE_COMPRESSED_BLOCK_WIDTH), + TextureGather = unchecked((uint)glConst.TEXTURE_GATHER), + TextureGatherShadow = unchecked((uint)glConst.TEXTURE_GATHER_SHADOW), + TextureImageFormat = unchecked((uint)glConst.TEXTURE_IMAGE_FORMAT), + TextureImageType = unchecked((uint)glConst.TEXTURE_IMAGE_TYPE), + TextureShadow = unchecked((uint)glConst.TEXTURE_SHADOW), + TextureView = unchecked((uint)glConst.TEXTURE_VIEW), + VertexTexture = unchecked((uint)glConst.VERTEX_TEXTURE), + ViewCompatibilityClass = unchecked((uint)glConst.VIEW_COMPATIBILITY_CLASS), + } + + /// Native OpenGL group InvalidateFramebufferAttachment. + public enum InvalidateFrameBufferAttachment : uint + { + Color = unchecked((uint)glConst.COLOR), + ColorAttachment0 = unchecked((uint)glConst.COLOR_ATTACHMENT0), + ColorAttachment1 = unchecked((uint)glConst.COLOR_ATTACHMENT1), + ColorAttachment10 = unchecked((uint)glConst.COLOR_ATTACHMENT10), + ColorAttachment11 = unchecked((uint)glConst.COLOR_ATTACHMENT11), + ColorAttachment12 = unchecked((uint)glConst.COLOR_ATTACHMENT12), + ColorAttachment13 = unchecked((uint)glConst.COLOR_ATTACHMENT13), + ColorAttachment14 = unchecked((uint)glConst.COLOR_ATTACHMENT14), + ColorAttachment15 = unchecked((uint)glConst.COLOR_ATTACHMENT15), + ColorAttachment16 = unchecked((uint)glConst.COLOR_ATTACHMENT16), + ColorAttachment17 = unchecked((uint)glConst.COLOR_ATTACHMENT17), + ColorAttachment18 = unchecked((uint)glConst.COLOR_ATTACHMENT18), + ColorAttachment19 = unchecked((uint)glConst.COLOR_ATTACHMENT19), + ColorAttachment2 = unchecked((uint)glConst.COLOR_ATTACHMENT2), + ColorAttachment20 = unchecked((uint)glConst.COLOR_ATTACHMENT20), + ColorAttachment21 = unchecked((uint)glConst.COLOR_ATTACHMENT21), + ColorAttachment22 = unchecked((uint)glConst.COLOR_ATTACHMENT22), + ColorAttachment23 = unchecked((uint)glConst.COLOR_ATTACHMENT23), + ColorAttachment24 = unchecked((uint)glConst.COLOR_ATTACHMENT24), + ColorAttachment25 = unchecked((uint)glConst.COLOR_ATTACHMENT25), + ColorAttachment26 = unchecked((uint)glConst.COLOR_ATTACHMENT26), + ColorAttachment27 = unchecked((uint)glConst.COLOR_ATTACHMENT27), + ColorAttachment28 = unchecked((uint)glConst.COLOR_ATTACHMENT28), + ColorAttachment29 = unchecked((uint)glConst.COLOR_ATTACHMENT29), + ColorAttachment3 = unchecked((uint)glConst.COLOR_ATTACHMENT3), + ColorAttachment30 = unchecked((uint)glConst.COLOR_ATTACHMENT30), + ColorAttachment31 = unchecked((uint)glConst.COLOR_ATTACHMENT31), + ColorAttachment4 = unchecked((uint)glConst.COLOR_ATTACHMENT4), + ColorAttachment5 = unchecked((uint)glConst.COLOR_ATTACHMENT5), + ColorAttachment6 = unchecked((uint)glConst.COLOR_ATTACHMENT6), + ColorAttachment7 = unchecked((uint)glConst.COLOR_ATTACHMENT7), + ColorAttachment8 = unchecked((uint)glConst.COLOR_ATTACHMENT8), + ColorAttachment9 = unchecked((uint)glConst.COLOR_ATTACHMENT9), + Depth = unchecked((uint)glConst.DEPTH), + DepthAttachment = unchecked((uint)glConst.DEPTH_ATTACHMENT), + DepthStencilAttachment = unchecked((uint)glConst.DEPTH_STENCIL_ATTACHMENT), + Stencil = unchecked((uint)glConst.STENCIL), + } + + /// Native OpenGL group LogicOp. + public enum LogicOp : uint + { + And = unchecked((uint)glConst.AND), + AndInverted = unchecked((uint)glConst.AND_INVERTED), + AndReverse = unchecked((uint)glConst.AND_REVERSE), + Clear = unchecked((uint)glConst.CLEAR), + Copy = unchecked((uint)glConst.COPY), + CopyInverted = unchecked((uint)glConst.COPY_INVERTED), + Equiv = unchecked((uint)glConst.EQUIV), + Invert = unchecked((uint)glConst.INVERT), + Nand = unchecked((uint)glConst.NAND), + Noop = unchecked((uint)glConst.NOOP), + Nor = unchecked((uint)glConst.NOR), + Or = unchecked((uint)glConst.OR), + OrInverted = unchecked((uint)glConst.OR_INVERTED), + OrReverse = unchecked((uint)glConst.OR_REVERSE), + Set = unchecked((uint)glConst.SET), + Xor = unchecked((uint)glConst.XOR), + } + + /// Native OpenGL group MapBufferAccessMask. + [System.Flags] + public enum MapBufferAccessMask : uint + { + None = 0u, + MapCoherentBit = unchecked((uint)glConst.MAP_COHERENT_BIT), + MapFlushExplicitBit = unchecked((uint)glConst.MAP_FLUSH_EXPLICIT_BIT), + MapInvalidateBufferBit = unchecked((uint)glConst.MAP_INVALIDATE_BUFFER_BIT), + MapInvalidateRangeBit = unchecked((uint)glConst.MAP_INVALIDATE_RANGE_BIT), + MapPersistentBit = unchecked((uint)glConst.MAP_PERSISTENT_BIT), + MapReadBit = unchecked((uint)glConst.MAP_READ_BIT), + MapUnsynchronizedBit = unchecked((uint)glConst.MAP_UNSYNCHRONIZED_BIT), + MapWriteBit = unchecked((uint)glConst.MAP_WRITE_BIT), + } + + /// Native OpenGL group MemoryBarrierMask. + [System.Flags] + public enum MemoryBarrierMask : uint + { + None = 0u, + AllBarrierBits = unchecked((uint)glConst.ALL_BARRIER_BITS), + AtomicCounterBarrierBit = unchecked((uint)glConst.ATOMIC_COUNTER_BARRIER_BIT), + BufferUpdateBarrierBit = unchecked((uint)glConst.BUFFER_UPDATE_BARRIER_BIT), + ClientMappedBufferBarrierBit = unchecked((uint)glConst.CLIENT_MAPPED_BUFFER_BARRIER_BIT), + CommandBarrierBit = unchecked((uint)glConst.COMMAND_BARRIER_BIT), + ElementArrayBarrierBit = unchecked((uint)glConst.ELEMENT_ARRAY_BARRIER_BIT), + FrameBufferBarrierBit = unchecked((uint)glConst.FRAMEBUFFER_BARRIER_BIT), + PixelBufferBarrierBit = unchecked((uint)glConst.PIXEL_BUFFER_BARRIER_BIT), + QueryBufferBarrierBit = unchecked((uint)glConst.QUERY_BUFFER_BARRIER_BIT), + ShaderImageAccessBarrierBit = unchecked((uint)glConst.SHADER_IMAGE_ACCESS_BARRIER_BIT), + ShaderStorageBarrierBit = unchecked((uint)glConst.SHADER_STORAGE_BARRIER_BIT), + TextureFetchBarrierBit = unchecked((uint)glConst.TEXTURE_FETCH_BARRIER_BIT), + TextureUpdateBarrierBit = unchecked((uint)glConst.TEXTURE_UPDATE_BARRIER_BIT), + TransformFeedbackBarrierBit = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BARRIER_BIT), + UniformBarrierBit = unchecked((uint)glConst.UNIFORM_BARRIER_BIT), + VertexAttributeArrayBarrierBit = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_BARRIER_BIT), + } + + /// Native OpenGL group ObjectIdentifier. + public enum ObjectIdentifier : uint + { + Buffer = unchecked((uint)glConst.BUFFER), + FrameBuffer = unchecked((uint)glConst.FRAMEBUFFER), + Program = unchecked((uint)glConst.PROGRAM), + ProgramPipeline = unchecked((uint)glConst.PROGRAM_PIPELINE), + Query = unchecked((uint)glConst.QUERY), + RenderBuffer = unchecked((uint)glConst.RENDERBUFFER), + Sampler = unchecked((uint)glConst.SAMPLER), + Shader = unchecked((uint)glConst.SHADER), + Texture = unchecked((uint)glConst.TEXTURE), + TransformFeedback = unchecked((uint)glConst.TRANSFORM_FEEDBACK), + VertexArray = unchecked((uint)glConst.VERTEX_ARRAY), + } + + /// Native OpenGL group PatchParameterName. + public enum PatchParameterName : uint + { + PatchDefaultInnerLevel = unchecked((uint)glConst.PATCH_DEFAULT_INNER_LEVEL), + PatchDefaultOuterLevel = unchecked((uint)glConst.PATCH_DEFAULT_OUTER_LEVEL), + PatchVertices = unchecked((uint)glConst.PATCH_VERTICES), + } + + /// Native OpenGL group PipelineParameterName. + public enum PipelineParameterName : uint + { + ActiveProgram = unchecked((uint)glConst.ACTIVE_PROGRAM), + FragmentShader = unchecked((uint)glConst.FRAGMENT_SHADER), + GeometryShader = unchecked((uint)glConst.GEOMETRY_SHADER), + InfoLogLength = unchecked((uint)glConst.INFO_LOG_LENGTH), + TessControlShader = unchecked((uint)glConst.TESS_CONTROL_SHADER), + TessEvaluationShader = unchecked((uint)glConst.TESS_EVALUATION_SHADER), + VertexShader = unchecked((uint)glConst.VERTEX_SHADER), + } + + /// Native OpenGL group PixelFormat. + public enum PixelFormat : uint + { + Alpha = unchecked((uint)glConst.ALPHA), + Bgr = unchecked((uint)glConst.BGR), + BgrInteger = unchecked((uint)glConst.BGR_INTEGER), + Bgra = unchecked((uint)glConst.BGRA), + BgraInteger = unchecked((uint)glConst.BGRA_INTEGER), + Blue = unchecked((uint)glConst.BLUE), + BlueInteger = unchecked((uint)glConst.BLUE_INTEGER), + DepthComponent = unchecked((uint)glConst.DEPTH_COMPONENT), + DepthStencil = unchecked((uint)glConst.DEPTH_STENCIL), + Green = unchecked((uint)glConst.GREEN), + GreenInteger = unchecked((uint)glConst.GREEN_INTEGER), + Red = unchecked((uint)glConst.RED), + RedInteger = unchecked((uint)glConst.RED_INTEGER), + Rg = unchecked((uint)glConst.RG), + RgInteger = unchecked((uint)glConst.RG_INTEGER), + Rgb = unchecked((uint)glConst.RGB), + RgbInteger = unchecked((uint)glConst.RGB_INTEGER), + Rgba = unchecked((uint)glConst.RGBA), + RgbaInteger = unchecked((uint)glConst.RGBA_INTEGER), + StencilIndex = unchecked((uint)glConst.STENCIL_INDEX), + UnsignedInt = unchecked((uint)glConst.UNSIGNED_INT), + UnsignedShort = unchecked((uint)glConst.UNSIGNED_SHORT), + } + + /// Native OpenGL group PixelStoreParameter. + public enum PixelStoreParameter : uint + { + PackAlignment = unchecked((uint)glConst.PACK_ALIGNMENT), + PackImageHeight = unchecked((uint)glConst.PACK_IMAGE_HEIGHT), + PackLsbFirst = unchecked((uint)glConst.PACK_LSB_FIRST), + PackRowLength = unchecked((uint)glConst.PACK_ROW_LENGTH), + PackSkipImages = unchecked((uint)glConst.PACK_SKIP_IMAGES), + PackSkipPixels = unchecked((uint)glConst.PACK_SKIP_PIXELS), + PackSkipRows = unchecked((uint)glConst.PACK_SKIP_ROWS), + PackSwapBytes = unchecked((uint)glConst.PACK_SWAP_BYTES), + UnpackAlignment = unchecked((uint)glConst.UNPACK_ALIGNMENT), + UnpackImageHeight = unchecked((uint)glConst.UNPACK_IMAGE_HEIGHT), + UnpackLsbFirst = unchecked((uint)glConst.UNPACK_LSB_FIRST), + UnpackRowLength = unchecked((uint)glConst.UNPACK_ROW_LENGTH), + UnpackSkipImages = unchecked((uint)glConst.UNPACK_SKIP_IMAGES), + UnpackSkipPixels = unchecked((uint)glConst.UNPACK_SKIP_PIXELS), + UnpackSkipRows = unchecked((uint)glConst.UNPACK_SKIP_ROWS), + UnpackSwapBytes = unchecked((uint)glConst.UNPACK_SWAP_BYTES), + } + + /// Native OpenGL group PixelType. + public enum PixelType : uint + { + Byte = unchecked((uint)glConst.BYTE), + Float = unchecked((uint)glConst.FLOAT), + Float32UnsignedInt248Rev = unchecked((uint)glConst.FLOAT_32_UNSIGNED_INT_24_8_REV), + HalfFloat = unchecked((uint)glConst.HALF_FLOAT), + Int = unchecked((uint)glConst.INT), + Short = unchecked((uint)glConst.SHORT), + UnsignedByte = unchecked((uint)glConst.UNSIGNED_BYTE), + UnsignedByte233Rev = unchecked((uint)glConst.UNSIGNED_BYTE_2_3_3_REV), + UnsignedByte332 = unchecked((uint)glConst.UNSIGNED_BYTE_3_3_2), + UnsignedInt = unchecked((uint)glConst.UNSIGNED_INT), + UnsignedInt1010102 = unchecked((uint)glConst.UNSIGNED_INT_10_10_10_2), + UnsignedInt10F11F11FRev = unchecked((uint)glConst.UNSIGNED_INT_10F_11F_11F_REV), + UnsignedInt2101010Rev = unchecked((uint)glConst.UNSIGNED_INT_2_10_10_10_REV), + UnsignedInt248 = unchecked((uint)glConst.UNSIGNED_INT_24_8), + UnsignedInt5999Rev = unchecked((uint)glConst.UNSIGNED_INT_5_9_9_9_REV), + UnsignedInt8888 = unchecked((uint)glConst.UNSIGNED_INT_8_8_8_8), + UnsignedInt8888Rev = unchecked((uint)glConst.UNSIGNED_INT_8_8_8_8_REV), + UnsignedShort = unchecked((uint)glConst.UNSIGNED_SHORT), + UnsignedShort1555Rev = unchecked((uint)glConst.UNSIGNED_SHORT_1_5_5_5_REV), + UnsignedShort4444 = unchecked((uint)glConst.UNSIGNED_SHORT_4_4_4_4), + UnsignedShort4444Rev = unchecked((uint)glConst.UNSIGNED_SHORT_4_4_4_4_REV), + UnsignedShort5551 = unchecked((uint)glConst.UNSIGNED_SHORT_5_5_5_1), + UnsignedShort565 = unchecked((uint)glConst.UNSIGNED_SHORT_5_6_5), + UnsignedShort565Rev = unchecked((uint)glConst.UNSIGNED_SHORT_5_6_5_REV), + } + + /// Native OpenGL group PointParameterNameARB. + public enum PointParameterName : uint + { + PointFadeThresholdSize = unchecked((uint)glConst.POINT_FADE_THRESHOLD_SIZE), + } + + /// Native OpenGL group PolygonMode. + public enum PolygonMode : uint + { + Fill = unchecked((uint)glConst.FILL), + Line = unchecked((uint)glConst.LINE), + Point = unchecked((uint)glConst.POINT), + } + + /// Native OpenGL group PrecisionType. + public enum PrecisionType : uint + { + HighFloat = unchecked((uint)glConst.HIGH_FLOAT), + HighInt = unchecked((uint)glConst.HIGH_INT), + LowFloat = unchecked((uint)glConst.LOW_FLOAT), + LowInt = unchecked((uint)glConst.LOW_INT), + MediumFloat = unchecked((uint)glConst.MEDIUM_FLOAT), + MediumInt = unchecked((uint)glConst.MEDIUM_INT), + } + + /// Native OpenGL group PrimitiveType. + public enum PrimitiveType : uint + { + LineLoop = unchecked((uint)glConst.LINE_LOOP), + LineStrip = unchecked((uint)glConst.LINE_STRIP), + LineStripAdjacency = unchecked((uint)glConst.LINE_STRIP_ADJACENCY), + Lines = unchecked((uint)glConst.LINES), + LinesAdjacency = unchecked((uint)glConst.LINES_ADJACENCY), + Patches = unchecked((uint)glConst.PATCHES), + Points = unchecked((uint)glConst.POINTS), + Quads = unchecked((uint)glConst.QUADS), + TriangleFan = unchecked((uint)glConst.TRIANGLE_FAN), + TriangleStrip = unchecked((uint)glConst.TRIANGLE_STRIP), + TriangleStripAdjacency = unchecked((uint)glConst.TRIANGLE_STRIP_ADJACENCY), + Triangles = unchecked((uint)glConst.TRIANGLES), + TrianglesAdjacency = unchecked((uint)glConst.TRIANGLES_ADJACENCY), + } + + /// Native OpenGL group ProgramInterface. + public enum ProgramInterface : uint + { + BufferVariable = unchecked((uint)glConst.BUFFER_VARIABLE), + ComputeSubroutine = unchecked((uint)glConst.COMPUTE_SUBROUTINE), + ComputeSubroutineUniform = unchecked((uint)glConst.COMPUTE_SUBROUTINE_UNIFORM), + FragmentSubroutine = unchecked((uint)glConst.FRAGMENT_SUBROUTINE), + FragmentSubroutineUniform = unchecked((uint)glConst.FRAGMENT_SUBROUTINE_UNIFORM), + GeometrySubroutine = unchecked((uint)glConst.GEOMETRY_SUBROUTINE), + GeometrySubroutineUniform = unchecked((uint)glConst.GEOMETRY_SUBROUTINE_UNIFORM), + ProgramInput = unchecked((uint)glConst.PROGRAM_INPUT), + ProgramOutput = unchecked((uint)glConst.PROGRAM_OUTPUT), + ShaderStorageBlock = unchecked((uint)glConst.SHADER_STORAGE_BLOCK), + TessControlSubroutine = unchecked((uint)glConst.TESS_CONTROL_SUBROUTINE), + TessControlSubroutineUniform = unchecked((uint)glConst.TESS_CONTROL_SUBROUTINE_UNIFORM), + TessEvaluationSubroutine = unchecked((uint)glConst.TESS_EVALUATION_SUBROUTINE), + TessEvaluationSubroutineUniform = unchecked((uint)glConst.TESS_EVALUATION_SUBROUTINE_UNIFORM), + TransformFeedbackBuffer = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER), + TransformFeedbackVarying = unchecked((uint)glConst.TRANSFORM_FEEDBACK_VARYING), + Uniform = unchecked((uint)glConst.UNIFORM), + UniformBlock = unchecked((uint)glConst.UNIFORM_BLOCK), + VertexSubroutine = unchecked((uint)glConst.VERTEX_SUBROUTINE), + VertexSubroutineUniform = unchecked((uint)glConst.VERTEX_SUBROUTINE_UNIFORM), + } + + /// Native OpenGL group ProgramInterfacePName. + public enum ProgramInterfacePName : uint + { + ActiveResources = unchecked((uint)glConst.ACTIVE_RESOURCES), + MaxNameLength = unchecked((uint)glConst.MAX_NAME_LENGTH), + MaxNumActiveVariables = unchecked((uint)glConst.MAX_NUM_ACTIVE_VARIABLES), + MaxNumCompatibleSubroutines = unchecked((uint)glConst.MAX_NUM_COMPATIBLE_SUBROUTINES), + } + + /// Native OpenGL group ProgramParameterPName. + public enum ProgramParameterPName : uint + { + ProgramBinaryRetrievableHint = unchecked((uint)glConst.PROGRAM_BINARY_RETRIEVABLE_HINT), + ProgramSeparable = unchecked((uint)glConst.PROGRAM_SEPARABLE), + } + + /// Native OpenGL group ProgramPropertyARB. + public enum ProgramProperty : uint + { + ActiveAtomicCounterBuffers = unchecked((uint)glConst.ACTIVE_ATOMIC_COUNTER_BUFFERS), + ActiveAttributeMaxLength = unchecked((uint)glConst.ACTIVE_ATTRIBUTE_MAX_LENGTH), + ActiveAttributes = unchecked((uint)glConst.ACTIVE_ATTRIBUTES), + ActiveUniformBlockMaxNameLength = unchecked((uint)glConst.ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH), + ActiveUniformBlocks = unchecked((uint)glConst.ACTIVE_UNIFORM_BLOCKS), + ActiveUniformMaxLength = unchecked((uint)glConst.ACTIVE_UNIFORM_MAX_LENGTH), + ActiveUniforms = unchecked((uint)glConst.ACTIVE_UNIFORMS), + AttachedShaders = unchecked((uint)glConst.ATTACHED_SHADERS), + ComputeWorkGroupSize = unchecked((uint)glConst.COMPUTE_WORK_GROUP_SIZE), + DeleteStatus = unchecked((uint)glConst.DELETE_STATUS), + GeometryInputType = unchecked((uint)glConst.GEOMETRY_INPUT_TYPE), + GeometryOutputType = unchecked((uint)glConst.GEOMETRY_OUTPUT_TYPE), + GeometryVerticesOut = unchecked((uint)glConst.GEOMETRY_VERTICES_OUT), + InfoLogLength = unchecked((uint)glConst.INFO_LOG_LENGTH), + LinkStatus = unchecked((uint)glConst.LINK_STATUS), + ProgramBinaryLength = unchecked((uint)glConst.PROGRAM_BINARY_LENGTH), + TransformFeedbackBufferMode = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER_MODE), + TransformFeedbackVaryingMaxLength = unchecked((uint)glConst.TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH), + TransformFeedbackVaryings = unchecked((uint)glConst.TRANSFORM_FEEDBACK_VARYINGS), + ValidateStatus = unchecked((uint)glConst.VALIDATE_STATUS), + } + + /// Native OpenGL group ProgramResourceProperty. + public enum ProgramResourceProperty : uint + { + ActiveVariables = unchecked((uint)glConst.ACTIVE_VARIABLES), + ArraySize = unchecked((uint)glConst.ARRAY_SIZE), + ArrayStride = unchecked((uint)glConst.ARRAY_STRIDE), + AtomicCounterBufferIndex = unchecked((uint)glConst.ATOMIC_COUNTER_BUFFER_INDEX), + BlockIndex = unchecked((uint)glConst.BLOCK_INDEX), + BufferBinding = unchecked((uint)glConst.BUFFER_BINDING), + BufferDataSize = unchecked((uint)glConst.BUFFER_DATA_SIZE), + CompatibleSubroutines = unchecked((uint)glConst.COMPATIBLE_SUBROUTINES), + IsPerPatch = unchecked((uint)glConst.IS_PER_PATCH), + IsRowMajor = unchecked((uint)glConst.IS_ROW_MAJOR), + Location = unchecked((uint)glConst.LOCATION), + LocationComponent = unchecked((uint)glConst.LOCATION_COMPONENT), + LocationIndex = unchecked((uint)glConst.LOCATION_INDEX), + MatrixStride = unchecked((uint)glConst.MATRIX_STRIDE), + NameLength = unchecked((uint)glConst.NAME_LENGTH), + NumActiveVariables = unchecked((uint)glConst.NUM_ACTIVE_VARIABLES), + NumCompatibleSubroutines = unchecked((uint)glConst.NUM_COMPATIBLE_SUBROUTINES), + Offset = unchecked((uint)glConst.OFFSET), + ReferencedByComputeShader = unchecked((uint)glConst.REFERENCED_BY_COMPUTE_SHADER), + ReferencedByFragmentShader = unchecked((uint)glConst.REFERENCED_BY_FRAGMENT_SHADER), + ReferencedByGeometryShader = unchecked((uint)glConst.REFERENCED_BY_GEOMETRY_SHADER), + ReferencedByTessControlShader = unchecked((uint)glConst.REFERENCED_BY_TESS_CONTROL_SHADER), + ReferencedByTessEvaluationShader = unchecked((uint)glConst.REFERENCED_BY_TESS_EVALUATION_SHADER), + ReferencedByVertexShader = unchecked((uint)glConst.REFERENCED_BY_VERTEX_SHADER), + TopLevelArraySize = unchecked((uint)glConst.TOP_LEVEL_ARRAY_SIZE), + TopLevelArrayStride = unchecked((uint)glConst.TOP_LEVEL_ARRAY_STRIDE), + TransformFeedbackBufferIndex = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER_INDEX), + TransformFeedbackBufferStride = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER_STRIDE), + Type = unchecked((uint)glConst.TYPE), + Uniform = unchecked((uint)glConst.UNIFORM), + } + + /// Native OpenGL group ProgramStagePName. + public enum ProgramStagePName : uint + { + ActiveSubroutineMaxLength = unchecked((uint)glConst.ACTIVE_SUBROUTINE_MAX_LENGTH), + ActiveSubroutineUniformLocations = unchecked((uint)glConst.ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS), + ActiveSubroutineUniformMaxLength = unchecked((uint)glConst.ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH), + ActiveSubroutineUniforms = unchecked((uint)glConst.ACTIVE_SUBROUTINE_UNIFORMS), + ActiveSubroutines = unchecked((uint)glConst.ACTIVE_SUBROUTINES), + } + + /// Native OpenGL group QueryCounterTarget. + public enum QueryCounterTarget : uint + { + Timestamp = unchecked((uint)glConst.TIMESTAMP), + } + + /// Native OpenGL group QueryObjectParameterName. + public enum QueryObjectParameterName : uint + { + QueryResult = unchecked((uint)glConst.QUERY_RESULT), + QueryResultAvailable = unchecked((uint)glConst.QUERY_RESULT_AVAILABLE), + QueryResultNoWait = unchecked((uint)glConst.QUERY_RESULT_NO_WAIT), + QueryTarget = unchecked((uint)glConst.QUERY_TARGET), + } + + /// Native OpenGL group QueryParameterName. + public enum QueryParameterName : uint + { + CurrentQuery = unchecked((uint)glConst.CURRENT_QUERY), + QueryCounterBits = unchecked((uint)glConst.QUERY_COUNTER_BITS), + } + + /// Native OpenGL group QueryTarget. + public enum QueryTarget : uint + { + AnySamplesPassed = unchecked((uint)glConst.ANY_SAMPLES_PASSED), + AnySamplesPassedConservative = unchecked((uint)glConst.ANY_SAMPLES_PASSED_CONSERVATIVE), + PrimitivesGenerated = unchecked((uint)glConst.PRIMITIVES_GENERATED), + PrimitivesSubmitted = unchecked((uint)glConst.PRIMITIVES_SUBMITTED), + SamplesPassed = unchecked((uint)glConst.SAMPLES_PASSED), + TimeElapsed = unchecked((uint)glConst.TIME_ELAPSED), + TransformFeedbackOverflow = unchecked((uint)glConst.TRANSFORM_FEEDBACK_OVERFLOW), + TransformFeedbackPrimitivesWritten = unchecked((uint)glConst.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN), + VertexShaderInvocations = unchecked((uint)glConst.VERTEX_SHADER_INVOCATIONS), + VerticesSubmitted = unchecked((uint)glConst.VERTICES_SUBMITTED), + } + + /// Native OpenGL group ReadBufferMode. + public enum ReadBufferMode : uint + { + Back = unchecked((uint)glConst.BACK), + BackLeft = unchecked((uint)glConst.BACK_LEFT), + BackRight = unchecked((uint)glConst.BACK_RIGHT), + ColorAttachment0 = unchecked((uint)glConst.COLOR_ATTACHMENT0), + ColorAttachment1 = unchecked((uint)glConst.COLOR_ATTACHMENT1), + ColorAttachment10 = unchecked((uint)glConst.COLOR_ATTACHMENT10), + ColorAttachment11 = unchecked((uint)glConst.COLOR_ATTACHMENT11), + ColorAttachment12 = unchecked((uint)glConst.COLOR_ATTACHMENT12), + ColorAttachment13 = unchecked((uint)glConst.COLOR_ATTACHMENT13), + ColorAttachment14 = unchecked((uint)glConst.COLOR_ATTACHMENT14), + ColorAttachment15 = unchecked((uint)glConst.COLOR_ATTACHMENT15), + ColorAttachment2 = unchecked((uint)glConst.COLOR_ATTACHMENT2), + ColorAttachment3 = unchecked((uint)glConst.COLOR_ATTACHMENT3), + ColorAttachment4 = unchecked((uint)glConst.COLOR_ATTACHMENT4), + ColorAttachment5 = unchecked((uint)glConst.COLOR_ATTACHMENT5), + ColorAttachment6 = unchecked((uint)glConst.COLOR_ATTACHMENT6), + ColorAttachment7 = unchecked((uint)glConst.COLOR_ATTACHMENT7), + ColorAttachment8 = unchecked((uint)glConst.COLOR_ATTACHMENT8), + ColorAttachment9 = unchecked((uint)glConst.COLOR_ATTACHMENT9), + Front = unchecked((uint)glConst.FRONT), + FrontLeft = unchecked((uint)glConst.FRONT_LEFT), + FrontRight = unchecked((uint)glConst.FRONT_RIGHT), + Left = unchecked((uint)glConst.LEFT), + None = unchecked((uint)glConst.NONE), + Right = unchecked((uint)glConst.RIGHT), + } + + /// Native OpenGL group RenderbufferParameterName. + public enum RenderBufferParameterName : uint + { + RenderBufferAlphaSize = unchecked((uint)glConst.RENDERBUFFER_ALPHA_SIZE), + RenderBufferBlueSize = unchecked((uint)glConst.RENDERBUFFER_BLUE_SIZE), + RenderBufferDepthSize = unchecked((uint)glConst.RENDERBUFFER_DEPTH_SIZE), + RenderBufferGreenSize = unchecked((uint)glConst.RENDERBUFFER_GREEN_SIZE), + RenderBufferHeight = unchecked((uint)glConst.RENDERBUFFER_HEIGHT), + RenderBufferInternalFormat = unchecked((uint)glConst.RENDERBUFFER_INTERNAL_FORMAT), + RenderBufferRedSize = unchecked((uint)glConst.RENDERBUFFER_RED_SIZE), + RenderBufferSamples = unchecked((uint)glConst.RENDERBUFFER_SAMPLES), + RenderBufferStencilSize = unchecked((uint)glConst.RENDERBUFFER_STENCIL_SIZE), + RenderBufferWidth = unchecked((uint)glConst.RENDERBUFFER_WIDTH), + } + + /// Native OpenGL group RenderbufferTarget. + public enum RenderBufferTarget : uint + { + RenderBuffer = unchecked((uint)glConst.RENDERBUFFER), + } + + /// Native OpenGL group SamplerParameterF. + public enum SamplerParameterF : uint + { + TextureBorderColor = unchecked((uint)glConst.TEXTURE_BORDER_COLOR), + TextureLodBias = unchecked((uint)glConst.TEXTURE_LOD_BIAS), + TextureMaxAnisotropy = unchecked((uint)glConst.TEXTURE_MAX_ANISOTROPY), + TextureMaxLod = unchecked((uint)glConst.TEXTURE_MAX_LOD), + TextureMinLod = unchecked((uint)glConst.TEXTURE_MIN_LOD), + } + + /// Native OpenGL group SamplerParameterI. + public enum SamplerParameterI : uint + { + TextureCompareFunc = unchecked((uint)glConst.TEXTURE_COMPARE_FUNC), + TextureCompareMode = unchecked((uint)glConst.TEXTURE_COMPARE_MODE), + TextureMagFilter = unchecked((uint)glConst.TEXTURE_MAG_FILTER), + TextureMinFilter = unchecked((uint)glConst.TEXTURE_MIN_FILTER), + TextureWrapR = unchecked((uint)glConst.TEXTURE_WRAP_R), + TextureWrapS = unchecked((uint)glConst.TEXTURE_WRAP_S), + TextureWrapT = unchecked((uint)glConst.TEXTURE_WRAP_T), + } + + /// Native OpenGL group ShaderBinaryFormat. + public enum ShaderBinaryFormat : uint + { + ShaderBinaryFormatSpirV = unchecked((uint)glConst.SHADER_BINARY_FORMAT_SPIR_V), + } + + /// Native OpenGL group ShaderParameterName. + public enum ShaderParameterName : uint + { + CompileStatus = unchecked((uint)glConst.COMPILE_STATUS), + DeleteStatus = unchecked((uint)glConst.DELETE_STATUS), + InfoLogLength = unchecked((uint)glConst.INFO_LOG_LENGTH), + ShaderSourceLength = unchecked((uint)glConst.SHADER_SOURCE_LENGTH), + ShaderType = unchecked((uint)glConst.SHADER_TYPE), + } + + /// Native OpenGL group ShaderType. + public enum ShaderType : uint + { + ComputeShader = unchecked((uint)glConst.COMPUTE_SHADER), + FragmentShader = unchecked((uint)glConst.FRAGMENT_SHADER), + GeometryShader = unchecked((uint)glConst.GEOMETRY_SHADER), + TessControlShader = unchecked((uint)glConst.TESS_CONTROL_SHADER), + TessEvaluationShader = unchecked((uint)glConst.TESS_EVALUATION_SHADER), + VertexShader = unchecked((uint)glConst.VERTEX_SHADER), + } + + /// Native OpenGL group SizedInternalFormat. + public enum SizedInternalFormat : uint + { + CompressedR11Eac = unchecked((uint)glConst.COMPRESSED_R11_EAC), + CompressedRedRgtc1 = unchecked((uint)glConst.COMPRESSED_RED_RGTC1), + CompressedRg11Eac = unchecked((uint)glConst.COMPRESSED_RG11_EAC), + CompressedRgRgtc2 = unchecked((uint)glConst.COMPRESSED_RG_RGTC2), + CompressedRgb8Etc2 = unchecked((uint)glConst.COMPRESSED_RGB8_ETC2), + CompressedRgb8PunchthroughAlpha1Etc2 = unchecked((uint)glConst.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2), + CompressedRgbBptcSignedFloat = unchecked((uint)glConst.COMPRESSED_RGB_BPTC_SIGNED_FLOAT), + CompressedRgbBptcUnsignedFloat = unchecked((uint)glConst.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT), + CompressedRgba8Etc2Eac = unchecked((uint)glConst.COMPRESSED_RGBA8_ETC2_EAC), + CompressedRgbaBptcUnorm = unchecked((uint)glConst.COMPRESSED_RGBA_BPTC_UNORM), + CompressedSignedR11Eac = unchecked((uint)glConst.COMPRESSED_SIGNED_R11_EAC), + CompressedSignedRedRgtc1 = unchecked((uint)glConst.COMPRESSED_SIGNED_RED_RGTC1), + CompressedSignedRg11Eac = unchecked((uint)glConst.COMPRESSED_SIGNED_RG11_EAC), + CompressedSignedRgRgtc2 = unchecked((uint)glConst.COMPRESSED_SIGNED_RG_RGTC2), + CompressedSrgb8Alpha8Etc2Eac = unchecked((uint)glConst.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC), + CompressedSrgb8Etc2 = unchecked((uint)glConst.COMPRESSED_SRGB8_ETC2), + CompressedSrgb8PunchthroughAlpha1Etc2 = unchecked((uint)glConst.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2), + CompressedSrgbAlphaBptcUnorm = unchecked((uint)glConst.COMPRESSED_SRGB_ALPHA_BPTC_UNORM), + Depth24Stencil8 = unchecked((uint)glConst.DEPTH24_STENCIL8), + Depth32fStencil8 = unchecked((uint)glConst.DEPTH32F_STENCIL8), + DepthComponent16 = unchecked((uint)glConst.DEPTH_COMPONENT16), + DepthComponent24 = unchecked((uint)glConst.DEPTH_COMPONENT24), + DepthComponent32 = unchecked((uint)glConst.DEPTH_COMPONENT32), + DepthComponent32f = unchecked((uint)glConst.DEPTH_COMPONENT32F), + R11fG11fB10f = unchecked((uint)glConst.R11F_G11F_B10F), + R16 = unchecked((uint)glConst.R16), + R16Snorm = unchecked((uint)glConst.R16_SNORM), + R16f = unchecked((uint)glConst.R16F), + R16i = unchecked((uint)glConst.R16I), + R16ui = unchecked((uint)glConst.R16UI), + R32f = unchecked((uint)glConst.R32F), + R32i = unchecked((uint)glConst.R32I), + R32ui = unchecked((uint)glConst.R32UI), + R3G3B2 = unchecked((uint)glConst.R3_G3_B2), + R8 = unchecked((uint)glConst.R8), + R8Snorm = unchecked((uint)glConst.R8_SNORM), + R8i = unchecked((uint)glConst.R8I), + R8ui = unchecked((uint)glConst.R8UI), + Rg16 = unchecked((uint)glConst.RG16), + Rg16Snorm = unchecked((uint)glConst.RG16_SNORM), + Rg16f = unchecked((uint)glConst.RG16F), + Rg16i = unchecked((uint)glConst.RG16I), + Rg16ui = unchecked((uint)glConst.RG16UI), + Rg32f = unchecked((uint)glConst.RG32F), + Rg32i = unchecked((uint)glConst.RG32I), + Rg32ui = unchecked((uint)glConst.RG32UI), + Rg8 = unchecked((uint)glConst.RG8), + Rg8Snorm = unchecked((uint)glConst.RG8_SNORM), + Rg8i = unchecked((uint)glConst.RG8I), + Rg8ui = unchecked((uint)glConst.RG8UI), + Rgb10 = unchecked((uint)glConst.RGB10), + Rgb10A2 = unchecked((uint)glConst.RGB10_A2), + Rgb10A2ui = unchecked((uint)glConst.RGB10_A2UI), + Rgb12 = unchecked((uint)glConst.RGB12), + Rgb16 = unchecked((uint)glConst.RGB16), + Rgb16Snorm = unchecked((uint)glConst.RGB16_SNORM), + Rgb16f = unchecked((uint)glConst.RGB16F), + Rgb16i = unchecked((uint)glConst.RGB16I), + Rgb16ui = unchecked((uint)glConst.RGB16UI), + Rgb32f = unchecked((uint)glConst.RGB32F), + Rgb32i = unchecked((uint)glConst.RGB32I), + Rgb32ui = unchecked((uint)glConst.RGB32UI), + Rgb4 = unchecked((uint)glConst.RGB4), + Rgb5 = unchecked((uint)glConst.RGB5), + Rgb565 = unchecked((uint)glConst.RGB565), + Rgb5A1 = unchecked((uint)glConst.RGB5_A1), + Rgb8 = unchecked((uint)glConst.RGB8), + Rgb8Snorm = unchecked((uint)glConst.RGB8_SNORM), + Rgb8i = unchecked((uint)glConst.RGB8I), + Rgb8ui = unchecked((uint)glConst.RGB8UI), + Rgb9E5 = unchecked((uint)glConst.RGB9_E5), + Rgba12 = unchecked((uint)glConst.RGBA12), + Rgba16 = unchecked((uint)glConst.RGBA16), + Rgba16Snorm = unchecked((uint)glConst.RGBA16_SNORM), + Rgba16f = unchecked((uint)glConst.RGBA16F), + Rgba16i = unchecked((uint)glConst.RGBA16I), + Rgba16ui = unchecked((uint)glConst.RGBA16UI), + Rgba2 = unchecked((uint)glConst.RGBA2), + Rgba32f = unchecked((uint)glConst.RGBA32F), + Rgba32i = unchecked((uint)glConst.RGBA32I), + Rgba32ui = unchecked((uint)glConst.RGBA32UI), + Rgba4 = unchecked((uint)glConst.RGBA4), + Rgba8 = unchecked((uint)glConst.RGBA8), + Rgba8Snorm = unchecked((uint)glConst.RGBA8_SNORM), + Rgba8i = unchecked((uint)glConst.RGBA8I), + Rgba8ui = unchecked((uint)glConst.RGBA8UI), + Srgb8 = unchecked((uint)glConst.SRGB8), + Srgb8Alpha8 = unchecked((uint)glConst.SRGB8_ALPHA8), + StencilIndex1 = unchecked((uint)glConst.STENCIL_INDEX1), + StencilIndex16 = unchecked((uint)glConst.STENCIL_INDEX16), + StencilIndex4 = unchecked((uint)glConst.STENCIL_INDEX4), + StencilIndex8 = unchecked((uint)glConst.STENCIL_INDEX8), + } + + /// Native OpenGL group StencilFunction. + public enum StencilFunction : uint + { + Always = unchecked((uint)glConst.ALWAYS), + Equal = unchecked((uint)glConst.EQUAL), + Gequal = unchecked((uint)glConst.GEQUAL), + Greater = unchecked((uint)glConst.GREATER), + Lequal = unchecked((uint)glConst.LEQUAL), + Less = unchecked((uint)glConst.LESS), + Never = unchecked((uint)glConst.NEVER), + Notequal = unchecked((uint)glConst.NOTEQUAL), + } + + /// Native OpenGL group StencilOp. + public enum StencilOp : uint + { + Decr = unchecked((uint)glConst.DECR), + DecrWrap = unchecked((uint)glConst.DECR_WRAP), + Incr = unchecked((uint)glConst.INCR), + IncrWrap = unchecked((uint)glConst.INCR_WRAP), + Invert = unchecked((uint)glConst.INVERT), + Keep = unchecked((uint)glConst.KEEP), + Replace = unchecked((uint)glConst.REPLACE), + Zero = unchecked((uint)glConst.ZERO), + } + + /// Native OpenGL group StringName. + public enum StringName : uint + { + Extensions = unchecked((uint)glConst.EXTENSIONS), + Renderer = unchecked((uint)glConst.RENDERER), + ShadingLanguageVersion = unchecked((uint)glConst.SHADING_LANGUAGE_VERSION), + Vendor = unchecked((uint)glConst.VENDOR), + Version = unchecked((uint)glConst.VERSION), + } + + /// Native OpenGL group SubroutineParameterName. + public enum SubroutineParameterName : uint + { + CompatibleSubroutines = unchecked((uint)glConst.COMPATIBLE_SUBROUTINES), + NumCompatibleSubroutines = unchecked((uint)glConst.NUM_COMPATIBLE_SUBROUTINES), + UniformNameLength = unchecked((uint)glConst.UNIFORM_NAME_LENGTH), + UniformSize = unchecked((uint)glConst.UNIFORM_SIZE), + } + + /// Native OpenGL group SyncBehaviorFlags. + [System.Flags] + public enum SyncBehaviorFlags : uint + { + None = unchecked((uint)glConst.NONE), + } + + /// Native OpenGL group SyncCondition. + public enum SyncCondition : uint + { + SyncGpuCommandsComplete = unchecked((uint)glConst.SYNC_GPU_COMMANDS_COMPLETE), + } + + /// Native OpenGL group SyncObjectMask. + [System.Flags] + public enum SyncObjectMask : uint + { + None = 0u, + SyncFlushCommandsBit = unchecked((uint)glConst.SYNC_FLUSH_COMMANDS_BIT), + } + + /// Native OpenGL group SyncParameterName. + public enum SyncParameterName : uint + { + ObjectType = unchecked((uint)glConst.OBJECT_TYPE), + SyncCondition = unchecked((uint)glConst.SYNC_CONDITION), + SyncFlags = unchecked((uint)glConst.SYNC_FLAGS), + SyncStatus = unchecked((uint)glConst.SYNC_STATUS), + } + + /// Native OpenGL group SyncStatus. + public enum SyncStatus : uint + { + AlreadySignaled = unchecked((uint)glConst.ALREADY_SIGNALED), + ConditionSatisfied = unchecked((uint)glConst.CONDITION_SATISFIED), + TimeoutExpired = unchecked((uint)glConst.TIMEOUT_EXPIRED), + WaitFailed = unchecked((uint)glConst.WAIT_FAILED), + } + + /// Native OpenGL group TextureParameterName. + public enum TextureParameterName : uint + { + DepthStencilTextureMode = unchecked((uint)glConst.DEPTH_STENCIL_TEXTURE_MODE), + TextureAlphaSize = unchecked((uint)glConst.TEXTURE_ALPHA_SIZE), + TextureBaseLevel = unchecked((uint)glConst.TEXTURE_BASE_LEVEL), + TextureBlueSize = unchecked((uint)glConst.TEXTURE_BLUE_SIZE), + TextureBorderColor = unchecked((uint)glConst.TEXTURE_BORDER_COLOR), + TextureCompareFunc = unchecked((uint)glConst.TEXTURE_COMPARE_FUNC), + TextureCompareMode = unchecked((uint)glConst.TEXTURE_COMPARE_MODE), + TextureGreenSize = unchecked((uint)glConst.TEXTURE_GREEN_SIZE), + TextureHeight = unchecked((uint)glConst.TEXTURE_HEIGHT), + TextureInternalFormat = unchecked((uint)glConst.TEXTURE_INTERNAL_FORMAT), + TextureLodBias = unchecked((uint)glConst.TEXTURE_LOD_BIAS), + TextureMagFilter = unchecked((uint)glConst.TEXTURE_MAG_FILTER), + TextureMaxAnisotropy = unchecked((uint)glConst.TEXTURE_MAX_ANISOTROPY), + TextureMaxLevel = unchecked((uint)glConst.TEXTURE_MAX_LEVEL), + TextureMaxLod = unchecked((uint)glConst.TEXTURE_MAX_LOD), + TextureMinFilter = unchecked((uint)glConst.TEXTURE_MIN_FILTER), + TextureMinLod = unchecked((uint)glConst.TEXTURE_MIN_LOD), + TextureRedSize = unchecked((uint)glConst.TEXTURE_RED_SIZE), + TextureSwizzleA = unchecked((uint)glConst.TEXTURE_SWIZZLE_A), + TextureSwizzleB = unchecked((uint)glConst.TEXTURE_SWIZZLE_B), + TextureSwizzleG = unchecked((uint)glConst.TEXTURE_SWIZZLE_G), + TextureSwizzleR = unchecked((uint)glConst.TEXTURE_SWIZZLE_R), + TextureSwizzleRgba = unchecked((uint)glConst.TEXTURE_SWIZZLE_RGBA), + TextureWidth = unchecked((uint)glConst.TEXTURE_WIDTH), + TextureWrapR = unchecked((uint)glConst.TEXTURE_WRAP_R), + TextureWrapS = unchecked((uint)glConst.TEXTURE_WRAP_S), + TextureWrapT = unchecked((uint)glConst.TEXTURE_WRAP_T), + } + + /// Native OpenGL group TextureTarget. + public enum TextureTarget : uint + { + ProxyTexture1D = unchecked((uint)glConst.PROXY_TEXTURE_1D), + ProxyTexture1DArray = unchecked((uint)glConst.PROXY_TEXTURE_1D_ARRAY), + ProxyTexture2D = unchecked((uint)glConst.PROXY_TEXTURE_2D), + ProxyTexture2DArray = unchecked((uint)glConst.PROXY_TEXTURE_2D_ARRAY), + ProxyTexture2DMultisample = unchecked((uint)glConst.PROXY_TEXTURE_2D_MULTISAMPLE), + ProxyTexture2DMultisampleArray = unchecked((uint)glConst.PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY), + ProxyTexture3D = unchecked((uint)glConst.PROXY_TEXTURE_3D), + ProxyTextureCubeMap = unchecked((uint)glConst.PROXY_TEXTURE_CUBE_MAP), + ProxyTextureCubeMapArray = unchecked((uint)glConst.PROXY_TEXTURE_CUBE_MAP_ARRAY), + ProxyTextureRectangle = unchecked((uint)glConst.PROXY_TEXTURE_RECTANGLE), + RenderBuffer = unchecked((uint)glConst.RENDERBUFFER), + Texture1D = unchecked((uint)glConst.TEXTURE_1D), + Texture1DArray = unchecked((uint)glConst.TEXTURE_1D_ARRAY), + Texture2D = unchecked((uint)glConst.TEXTURE_2D), + Texture2DArray = unchecked((uint)glConst.TEXTURE_2D_ARRAY), + Texture2DMultisample = unchecked((uint)glConst.TEXTURE_2D_MULTISAMPLE), + Texture2DMultisampleArray = unchecked((uint)glConst.TEXTURE_2D_MULTISAMPLE_ARRAY), + Texture3D = unchecked((uint)glConst.TEXTURE_3D), + TextureBuffer = unchecked((uint)glConst.TEXTURE_BUFFER), + TextureCubeMap = unchecked((uint)glConst.TEXTURE_CUBE_MAP), + TextureCubeMapArray = unchecked((uint)glConst.TEXTURE_CUBE_MAP_ARRAY), + TextureCubeMapNegativeX = unchecked((uint)glConst.TEXTURE_CUBE_MAP_NEGATIVE_X), + TextureCubeMapNegativeY = unchecked((uint)glConst.TEXTURE_CUBE_MAP_NEGATIVE_Y), + TextureCubeMapNegativeZ = unchecked((uint)glConst.TEXTURE_CUBE_MAP_NEGATIVE_Z), + TextureCubeMapPositiveX = unchecked((uint)glConst.TEXTURE_CUBE_MAP_POSITIVE_X), + TextureCubeMapPositiveY = unchecked((uint)glConst.TEXTURE_CUBE_MAP_POSITIVE_Y), + TextureCubeMapPositiveZ = unchecked((uint)glConst.TEXTURE_CUBE_MAP_POSITIVE_Z), + TextureRectangle = unchecked((uint)glConst.TEXTURE_RECTANGLE), + } + + /// Native OpenGL group TextureUnit. + public enum TextureUnit : uint + { + Texture0 = unchecked((uint)glConst.TEXTURE0), + Texture1 = unchecked((uint)glConst.TEXTURE1), + Texture10 = unchecked((uint)glConst.TEXTURE10), + Texture11 = unchecked((uint)glConst.TEXTURE11), + Texture12 = unchecked((uint)glConst.TEXTURE12), + Texture13 = unchecked((uint)glConst.TEXTURE13), + Texture14 = unchecked((uint)glConst.TEXTURE14), + Texture15 = unchecked((uint)glConst.TEXTURE15), + Texture16 = unchecked((uint)glConst.TEXTURE16), + Texture17 = unchecked((uint)glConst.TEXTURE17), + Texture18 = unchecked((uint)glConst.TEXTURE18), + Texture19 = unchecked((uint)glConst.TEXTURE19), + Texture2 = unchecked((uint)glConst.TEXTURE2), + Texture20 = unchecked((uint)glConst.TEXTURE20), + Texture21 = unchecked((uint)glConst.TEXTURE21), + Texture22 = unchecked((uint)glConst.TEXTURE22), + Texture23 = unchecked((uint)glConst.TEXTURE23), + Texture24 = unchecked((uint)glConst.TEXTURE24), + Texture25 = unchecked((uint)glConst.TEXTURE25), + Texture26 = unchecked((uint)glConst.TEXTURE26), + Texture27 = unchecked((uint)glConst.TEXTURE27), + Texture28 = unchecked((uint)glConst.TEXTURE28), + Texture29 = unchecked((uint)glConst.TEXTURE29), + Texture3 = unchecked((uint)glConst.TEXTURE3), + Texture30 = unchecked((uint)glConst.TEXTURE30), + Texture31 = unchecked((uint)glConst.TEXTURE31), + Texture4 = unchecked((uint)glConst.TEXTURE4), + Texture5 = unchecked((uint)glConst.TEXTURE5), + Texture6 = unchecked((uint)glConst.TEXTURE6), + Texture7 = unchecked((uint)glConst.TEXTURE7), + Texture8 = unchecked((uint)glConst.TEXTURE8), + Texture9 = unchecked((uint)glConst.TEXTURE9), + } + + /// Native OpenGL group TransformFeedbackBufferMode. + public enum TransformFeedbackBufferMode : uint + { + InterleavedAttributes = unchecked((uint)glConst.INTERLEAVED_ATTRIBS), + SeparateAttributes = unchecked((uint)glConst.SEPARATE_ATTRIBS), + } + + /// Native OpenGL group TransformFeedbackPName. + public enum TransformFeedbackPName : uint + { + TransformFeedbackActive = unchecked((uint)glConst.TRANSFORM_FEEDBACK_ACTIVE), + TransformFeedbackBufferBinding = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER_BINDING), + TransformFeedbackBufferSize = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER_SIZE), + TransformFeedbackBufferStart = unchecked((uint)glConst.TRANSFORM_FEEDBACK_BUFFER_START), + TransformFeedbackPaused = unchecked((uint)glConst.TRANSFORM_FEEDBACK_PAUSED), + } + + /// Native OpenGL group TriangleFace. + public enum TriangleFace : uint + { + Back = unchecked((uint)glConst.BACK), + Front = unchecked((uint)glConst.FRONT), + FrontAndBack = unchecked((uint)glConst.FRONT_AND_BACK), + } + + /// Native OpenGL group UniformBlockPName. + public enum UniformBlockPName : uint + { + UniformBlockActiveUniformIndices = unchecked((uint)glConst.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES), + UniformBlockActiveUniforms = unchecked((uint)glConst.UNIFORM_BLOCK_ACTIVE_UNIFORMS), + UniformBlockBinding = unchecked((uint)glConst.UNIFORM_BLOCK_BINDING), + UniformBlockDataSize = unchecked((uint)glConst.UNIFORM_BLOCK_DATA_SIZE), + UniformBlockNameLength = unchecked((uint)glConst.UNIFORM_BLOCK_NAME_LENGTH), + UniformBlockReferencedByComputeShader = unchecked((uint)glConst.UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER), + UniformBlockReferencedByFragmentShader = unchecked((uint)glConst.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER), + UniformBlockReferencedByGeometryShader = unchecked((uint)glConst.UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER), + UniformBlockReferencedByTessControlShader = unchecked((uint)glConst.UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER), + UniformBlockReferencedByTessEvaluationShader = unchecked((uint)glConst.UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER), + UniformBlockReferencedByVertexShader = unchecked((uint)glConst.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER), + } + + /// Native OpenGL group UniformPName. + public enum UniformPName : uint + { + UniformArrayStride = unchecked((uint)glConst.UNIFORM_ARRAY_STRIDE), + UniformAtomicCounterBufferIndex = unchecked((uint)glConst.UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX), + UniformBlockIndex = unchecked((uint)glConst.UNIFORM_BLOCK_INDEX), + UniformIsRowMajor = unchecked((uint)glConst.UNIFORM_IS_ROW_MAJOR), + UniformMatrixStride = unchecked((uint)glConst.UNIFORM_MATRIX_STRIDE), + UniformNameLength = unchecked((uint)glConst.UNIFORM_NAME_LENGTH), + UniformOffset = unchecked((uint)glConst.UNIFORM_OFFSET), + UniformSize = unchecked((uint)glConst.UNIFORM_SIZE), + UniformType = unchecked((uint)glConst.UNIFORM_TYPE), + } + + /// Native OpenGL group UniformType. + public enum UniformType : uint + { + Bool = unchecked((uint)glConst.BOOL), + BoolVec2 = unchecked((uint)glConst.BOOL_VEC2), + BoolVec3 = unchecked((uint)glConst.BOOL_VEC3), + BoolVec4 = unchecked((uint)glConst.BOOL_VEC4), + Double = unchecked((uint)glConst.DOUBLE), + DoubleMat2 = unchecked((uint)glConst.DOUBLE_MAT2), + DoubleMat2x3 = unchecked((uint)glConst.DOUBLE_MAT2x3), + DoubleMat2x4 = unchecked((uint)glConst.DOUBLE_MAT2x4), + DoubleMat3 = unchecked((uint)glConst.DOUBLE_MAT3), + DoubleMat3x2 = unchecked((uint)glConst.DOUBLE_MAT3x2), + DoubleMat3x4 = unchecked((uint)glConst.DOUBLE_MAT3x4), + DoubleMat4 = unchecked((uint)glConst.DOUBLE_MAT4), + DoubleMat4x2 = unchecked((uint)glConst.DOUBLE_MAT4x2), + DoubleMat4x3 = unchecked((uint)glConst.DOUBLE_MAT4x3), + DoubleVec2 = unchecked((uint)glConst.DOUBLE_VEC2), + DoubleVec3 = unchecked((uint)glConst.DOUBLE_VEC3), + DoubleVec4 = unchecked((uint)glConst.DOUBLE_VEC4), + Float = unchecked((uint)glConst.FLOAT), + FloatMat2 = unchecked((uint)glConst.FLOAT_MAT2), + FloatMat2x3 = unchecked((uint)glConst.FLOAT_MAT2x3), + FloatMat2x4 = unchecked((uint)glConst.FLOAT_MAT2x4), + FloatMat3 = unchecked((uint)glConst.FLOAT_MAT3), + FloatMat3x2 = unchecked((uint)glConst.FLOAT_MAT3x2), + FloatMat3x4 = unchecked((uint)glConst.FLOAT_MAT3x4), + FloatMat4 = unchecked((uint)glConst.FLOAT_MAT4), + FloatMat4x2 = unchecked((uint)glConst.FLOAT_MAT4x2), + FloatMat4x3 = unchecked((uint)glConst.FLOAT_MAT4x3), + FloatVec2 = unchecked((uint)glConst.FLOAT_VEC2), + FloatVec3 = unchecked((uint)glConst.FLOAT_VEC3), + FloatVec4 = unchecked((uint)glConst.FLOAT_VEC4), + Int = unchecked((uint)glConst.INT), + IntSampler1D = unchecked((uint)glConst.INT_SAMPLER_1D), + IntSampler1DArray = unchecked((uint)glConst.INT_SAMPLER_1D_ARRAY), + IntSampler2D = unchecked((uint)glConst.INT_SAMPLER_2D), + IntSampler2DArray = unchecked((uint)glConst.INT_SAMPLER_2D_ARRAY), + IntSampler2DMultisample = unchecked((uint)glConst.INT_SAMPLER_2D_MULTISAMPLE), + IntSampler2DMultisampleArray = unchecked((uint)glConst.INT_SAMPLER_2D_MULTISAMPLE_ARRAY), + IntSampler2DRect = unchecked((uint)glConst.INT_SAMPLER_2D_RECT), + IntSampler3D = unchecked((uint)glConst.INT_SAMPLER_3D), + IntSamplerBuffer = unchecked((uint)glConst.INT_SAMPLER_BUFFER), + IntSamplerCube = unchecked((uint)glConst.INT_SAMPLER_CUBE), + IntSamplerCubeMapArray = unchecked((uint)glConst.INT_SAMPLER_CUBE_MAP_ARRAY), + IntVec2 = unchecked((uint)glConst.INT_VEC2), + IntVec3 = unchecked((uint)glConst.INT_VEC3), + IntVec4 = unchecked((uint)glConst.INT_VEC4), + Sampler1D = unchecked((uint)glConst.SAMPLER_1D), + Sampler1DArray = unchecked((uint)glConst.SAMPLER_1D_ARRAY), + Sampler1DArrayShadow = unchecked((uint)glConst.SAMPLER_1D_ARRAY_SHADOW), + Sampler1DShadow = unchecked((uint)glConst.SAMPLER_1D_SHADOW), + Sampler2D = unchecked((uint)glConst.SAMPLER_2D), + Sampler2DArray = unchecked((uint)glConst.SAMPLER_2D_ARRAY), + Sampler2DArrayShadow = unchecked((uint)glConst.SAMPLER_2D_ARRAY_SHADOW), + Sampler2DMultisample = unchecked((uint)glConst.SAMPLER_2D_MULTISAMPLE), + Sampler2DMultisampleArray = unchecked((uint)glConst.SAMPLER_2D_MULTISAMPLE_ARRAY), + Sampler2DRect = unchecked((uint)glConst.SAMPLER_2D_RECT), + Sampler2DRectShadow = unchecked((uint)glConst.SAMPLER_2D_RECT_SHADOW), + Sampler2DShadow = unchecked((uint)glConst.SAMPLER_2D_SHADOW), + Sampler3D = unchecked((uint)glConst.SAMPLER_3D), + SamplerBuffer = unchecked((uint)glConst.SAMPLER_BUFFER), + SamplerCube = unchecked((uint)glConst.SAMPLER_CUBE), + SamplerCubeMapArray = unchecked((uint)glConst.SAMPLER_CUBE_MAP_ARRAY), + SamplerCubeMapArrayShadow = unchecked((uint)glConst.SAMPLER_CUBE_MAP_ARRAY_SHADOW), + SamplerCubeShadow = unchecked((uint)glConst.SAMPLER_CUBE_SHADOW), + UnsignedInt = unchecked((uint)glConst.UNSIGNED_INT), + UnsignedIntSampler1D = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_1D), + UnsignedIntSampler1DArray = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_1D_ARRAY), + UnsignedIntSampler2D = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D), + UnsignedIntSampler2DArray = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D_ARRAY), + UnsignedIntSampler2DMultisample = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE), + UnsignedIntSampler2DMultisampleArray = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY), + UnsignedIntSampler2DRect = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_2D_RECT), + UnsignedIntSampler3D = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_3D), + UnsignedIntSamplerBuffer = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_BUFFER), + UnsignedIntSamplerCube = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_CUBE), + UnsignedIntSamplerCubeMapArray = unchecked((uint)glConst.UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY), + UnsignedIntVec2 = unchecked((uint)glConst.UNSIGNED_INT_VEC2), + UnsignedIntVec3 = unchecked((uint)glConst.UNSIGNED_INT_VEC3), + UnsignedIntVec4 = unchecked((uint)glConst.UNSIGNED_INT_VEC4), + } + + /// Native OpenGL group UseProgramStageMask. + [System.Flags] + public enum UseProgramStageMask : uint + { + None = 0u, + AllShaderBits = unchecked((uint)glConst.ALL_SHADER_BITS), + ComputeShaderBit = unchecked((uint)glConst.COMPUTE_SHADER_BIT), + FragmentShaderBit = unchecked((uint)glConst.FRAGMENT_SHADER_BIT), + GeometryShaderBit = unchecked((uint)glConst.GEOMETRY_SHADER_BIT), + TessControlShaderBit = unchecked((uint)glConst.TESS_CONTROL_SHADER_BIT), + TessEvaluationShaderBit = unchecked((uint)glConst.TESS_EVALUATION_SHADER_BIT), + VertexShaderBit = unchecked((uint)glConst.VERTEX_SHADER_BIT), + } + + /// Native OpenGL group VertexArrayPName. + public enum VertexArrayPName : uint + { + VertexAttributeArrayDivisor = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_DIVISOR), + VertexAttributeArrayEnabled = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_ENABLED), + VertexAttributeArrayInteger = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_INTEGER), + VertexAttributeArrayLong = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_LONG), + VertexAttributeArrayNormalized = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_NORMALIZED), + VertexAttributeArraySize = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_SIZE), + VertexAttributeArrayStride = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_STRIDE), + VertexAttributeArrayType = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_TYPE), + VertexAttributeRelativeOffset = unchecked((uint)glConst.VERTEX_ATTRIB_RELATIVE_OFFSET), + } + + /// Native OpenGL group VertexAttribEnum. + public enum VertexAttributeEnum : uint + { + CurrentVertexAttribute = unchecked((uint)glConst.CURRENT_VERTEX_ATTRIB), + VertexAttributeArrayBufferBinding = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING), + VertexAttributeArrayDivisor = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_DIVISOR), + VertexAttributeArrayEnabled = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_ENABLED), + VertexAttributeArrayInteger = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_INTEGER), + VertexAttributeArrayNormalized = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_NORMALIZED), + VertexAttributeArraySize = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_SIZE), + VertexAttributeArrayStride = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_STRIDE), + VertexAttributeArrayType = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_TYPE), + } + + /// Native OpenGL group VertexAttribIType. + public enum VertexAttributeIType : uint + { + Byte = unchecked((uint)glConst.BYTE), + Int = unchecked((uint)glConst.INT), + Short = unchecked((uint)glConst.SHORT), + UnsignedByte = unchecked((uint)glConst.UNSIGNED_BYTE), + UnsignedInt = unchecked((uint)glConst.UNSIGNED_INT), + UnsignedShort = unchecked((uint)glConst.UNSIGNED_SHORT), + } + + /// Native OpenGL group VertexAttribLType. + public enum VertexAttributeLType : uint + { + Double = unchecked((uint)glConst.DOUBLE), + } + + /// Native OpenGL group VertexAttribPointerPropertyARB. + public enum VertexAttributePointerProperty : uint + { + VertexAttributeArrayPointer = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_POINTER), + } + + /// Native OpenGL group VertexAttribPointerType. + public enum VertexAttributePointerType : uint + { + Byte = unchecked((uint)glConst.BYTE), + Double = unchecked((uint)glConst.DOUBLE), + Fixed = unchecked((uint)glConst.FIXED), + Float = unchecked((uint)glConst.FLOAT), + HalfFloat = unchecked((uint)glConst.HALF_FLOAT), + Int = unchecked((uint)glConst.INT), + Int2101010Rev = unchecked((uint)glConst.INT_2_10_10_10_REV), + Short = unchecked((uint)glConst.SHORT), + UnsignedByte = unchecked((uint)glConst.UNSIGNED_BYTE), + UnsignedInt = unchecked((uint)glConst.UNSIGNED_INT), + UnsignedInt10F11F11FRev = unchecked((uint)glConst.UNSIGNED_INT_10F_11F_11F_REV), + UnsignedInt2101010Rev = unchecked((uint)glConst.UNSIGNED_INT_2_10_10_10_REV), + UnsignedShort = unchecked((uint)glConst.UNSIGNED_SHORT), + } + + /// Native OpenGL group VertexAttribPropertyARB. + public enum VertexAttributeProperty : uint + { + CurrentVertexAttribute = unchecked((uint)glConst.CURRENT_VERTEX_ATTRIB), + VertexAttributeArrayBufferBinding = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING), + VertexAttributeArrayDivisor = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_DIVISOR), + VertexAttributeArrayEnabled = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_ENABLED), + VertexAttributeArrayInteger = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_INTEGER), + VertexAttributeArrayLong = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_LONG), + VertexAttributeArrayNormalized = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_NORMALIZED), + VertexAttributeArraySize = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_SIZE), + VertexAttributeArrayStride = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_STRIDE), + VertexAttributeArrayType = unchecked((uint)glConst.VERTEX_ATTRIB_ARRAY_TYPE), + VertexAttributeBinding = unchecked((uint)glConst.VERTEX_ATTRIB_BINDING), + VertexAttributeRelativeOffset = unchecked((uint)glConst.VERTEX_ATTRIB_RELATIVE_OFFSET), + } + + /// Native OpenGL group VertexAttribType. + public enum VertexAttributeType : uint + { + Byte = unchecked((uint)glConst.BYTE), + Double = unchecked((uint)glConst.DOUBLE), + Fixed = unchecked((uint)glConst.FIXED), + Float = unchecked((uint)glConst.FLOAT), + HalfFloat = unchecked((uint)glConst.HALF_FLOAT), + Int = unchecked((uint)glConst.INT), + Int2101010Rev = unchecked((uint)glConst.INT_2_10_10_10_REV), + Short = unchecked((uint)glConst.SHORT), + UnsignedByte = unchecked((uint)glConst.UNSIGNED_BYTE), + UnsignedInt = unchecked((uint)glConst.UNSIGNED_INT), + UnsignedInt10F11F11FRev = unchecked((uint)glConst.UNSIGNED_INT_10F_11F_11F_REV), + UnsignedInt2101010Rev = unchecked((uint)glConst.UNSIGNED_INT_2_10_10_10_REV), + UnsignedShort = unchecked((uint)glConst.UNSIGNED_SHORT), + } + + /// Native OpenGL group VertexProvokingMode. + public enum VertexProvokingMode : uint + { + FirstVertexConvention = unchecked((uint)glConst.FIRST_VERTEX_CONVENTION), + LastVertexConvention = unchecked((uint)glConst.LAST_VERTEX_CONVENTION), + } + +} diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.Base.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.Base.g.cs index 4339f8ad..2842cb2d 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.Base.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.Base.g.cs @@ -1,10 +1,17 @@ +// ----------------------------------------------------------------------------- +// file="OpenGLFunction.Base" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL forwarding methods introduced through 3.2 and retained by the target core profile. // using StgSharp.Mathematics.Numeric.Graphics; -using StgSharp.Mathematics.Numeric.Graphics; + using System; using System.Runtime.CompilerServices; @@ -26,9 +33,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CullFace(uint mode) + public void CullFace(TriangleFace mode) { - __context->glCullFace(mode); + __context->glCullFace((uint)mode); } /// @@ -37,9 +44,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FrontFace(uint mode) + public void FrontFace(FrontFaceDirection mode) { - __context->glFrontFace(mode); + __context->glFrontFace((uint)mode); } /// @@ -48,9 +55,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Hint(uint target, uint mode) + public void Hint(HintTarget target, HintMode mode) { - __context->glHint(target, mode); + __context->glHint((uint)target, (uint)mode); } /// @@ -81,9 +88,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PolygonMode(uint face, uint mode) + public void PolygonMode(TriangleFace face, PolygonMode mode) { - __context->glPolygonMode(face, mode); + __context->glPolygonMode((uint)face, (uint)mode); } /// @@ -103,9 +110,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameter(uint target, uint pName, float param) + public void TextureParameter(TextureTarget target, TextureParameterName pName, float param) { - __context->glTexParameterf(target, pName, param); + __context->glTexParameterf((uint)target, (uint)pName, param); } /// @@ -114,9 +121,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameter(uint target, uint pName, float* @params) + public void TextureParameter(TextureTarget target, TextureParameterName pName, float* @params) { - __context->glTexParameterfv(target, pName, @params); + __context->glTexParameterfv((uint)target, (uint)pName, @params); } /// @@ -125,9 +132,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameter(uint target, uint pName, int param) + public void TextureParameter(TextureTarget target, TextureParameterName pName, int param) { - __context->glTexParameteri(target, pName, param); + __context->glTexParameteri((uint)target, (uint)pName, param); } /// @@ -136,9 +143,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameter(uint target, uint pName, int* @params) + public void TextureParameter(TextureTarget target, TextureParameterName pName, int* @params) { - __context->glTexParameteriv(target, pName, @params); + __context->glTexParameteriv((uint)target, (uint)pName, @params); } /// @@ -147,9 +154,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage1D(uint target, int level, int internalFormat, int width, int border, uint format, uint type, void* pixels) + public void TexImage1D(TextureTarget target, int level, int internalFormat, int width, int border, PixelFormat format, PixelType type, void* pixels) { - __context->glTexImage1D(target, level, internalFormat, width, border, format, type, pixels); + __context->glTexImage1D((uint)target, level, internalFormat, width, border, (uint)format, (uint)type, pixels); } /// @@ -158,9 +165,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage2D(uint target, int level, int internalFormat, int width, int height, int border, uint format, uint type, void* pixels) + public void TexImage2D(TextureTarget target, int level, int internalFormat, int width, int height, int border, PixelFormat format, PixelType type, void* pixels) { - __context->glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels); + __context->glTexImage2D((uint)target, level, internalFormat, width, height, border, (uint)format, (uint)type, pixels); } /// @@ -169,9 +176,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawBuffer(uint buf) + public void DrawBuffer(DrawBufferMode buf) { - __context->glDrawBuffer(buf); + __context->glDrawBuffer((uint)buf); } /// @@ -180,9 +187,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Clear(uint mask) + public void Clear(ClearBufferMask mask) { - __context->glClear(mask); + __context->glClear((uint)mask); } /// @@ -257,9 +264,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Disable(uint cap) + public void Disable(EnableCap cap) { - __context->glDisable(cap); + __context->glDisable((uint)cap); } /// @@ -268,9 +275,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enable(uint cap) + public void Enable(EnableCap cap) { - __context->glEnable(cap); + __context->glEnable((uint)cap); } /// @@ -301,9 +308,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendFunc(uint sfactor, uint dfactor) + public void BlendFunc(BlendingFactor sfactor, BlendingFactor dfactor) { - __context->glBlendFunc(sfactor, dfactor); + __context->glBlendFunc((uint)sfactor, (uint)dfactor); } /// @@ -312,9 +319,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void LogicOp(uint opcode) + public void LogicOp(LogicOp opcode) { - __context->glLogicOp(opcode); + __context->glLogicOp((uint)opcode); } /// @@ -323,9 +330,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilFunc(uint func, int @ref, uint mask) + public void StencilFunc(StencilFunction func, int @ref, uint mask) { - __context->glStencilFunc(func, @ref, mask); + __context->glStencilFunc((uint)func, @ref, mask); } /// @@ -334,9 +341,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilOp(uint fail, uint zfail, uint zpass) + public void StencilOp(StencilOp fail, StencilOp zfail, StencilOp zpass) { - __context->glStencilOp(fail, zfail, zpass); + __context->glStencilOp((uint)fail, (uint)zfail, (uint)zpass); } /// @@ -345,9 +352,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DepthFunc(uint func) + public void DepthFunc(DepthFunction func) { - __context->glDepthFunc(func); + __context->glDepthFunc((uint)func); } /// @@ -356,9 +363,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PixelStore(uint pName, float param) + public void PixelStore(PixelStoreParameter pName, float param) { - __context->glPixelStoref(pName, param); + __context->glPixelStoref((uint)pName, param); } /// @@ -367,9 +374,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PixelStore(uint pName, int param) + public void PixelStore(PixelStoreParameter pName, int param) { - __context->glPixelStorei(pName, param); + __context->glPixelStorei((uint)pName, param); } /// @@ -378,9 +385,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReadBuffer(uint src) + public void ReadBuffer(ReadBufferMode src) { - __context->glReadBuffer(src); + __context->glReadBuffer((uint)src); } /// @@ -389,9 +396,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReadPixels(int x, int y, int width, int height, uint format, uint type, void* pixels) + public void ReadPixels(int x, int y, int width, int height, PixelFormat format, PixelType type, void* pixels) { - __context->glReadPixels(x, y, width, height, format, type, pixels); + __context->glReadPixels(x, y, width, height, (uint)format, (uint)type, pixels); } /// @@ -400,11 +407,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint pName, Span values) + public void GetValue(GetPName pName, Span values) { fixed (byte* __value = values) { - __context->glGetBooleanv(pName, __value); + __context->glGetBooleanv((uint)pName, __value); } } @@ -414,11 +421,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint pName, Span values) + public void GetValue(GetPName pName, Span values) { fixed (double* __value = values) { - __context->glGetDoublev(pName, __value); + __context->glGetDoublev((uint)pName, __value); } } @@ -428,9 +435,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint GetError() + public ErrorCode GetError() { - return __context->glGetError(); + return (ErrorCode)__context->glGetError(); } /// @@ -439,11 +446,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint pName, Span values) + public void GetValue(GetPName pName, Span values) { fixed (float* __value = values) { - __context->glGetFloatv(pName, __value); + __context->glGetFloatv((uint)pName, __value); } } @@ -453,11 +460,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint pName, Span values) + public void GetValue(GetPName pName, Span values) { fixed (int* __value = values) { - __context->glGetIntegerv(pName, __value); + __context->glGetIntegerv((uint)pName, __value); } } @@ -467,9 +474,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte* GetString(uint name) + public byte* GetString(StringName name) { - return __context->glGetString(name); + return __context->glGetString((uint)name); } /// @@ -478,9 +485,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTexImage(uint target, int level, uint format, uint type, void* pixels) + public void GetTexImage(TextureTarget target, int level, PixelFormat format, PixelType type, void* pixels) { - __context->glGetTexImage(target, level, format, type, pixels); + __context->glGetTexImage((uint)target, level, (uint)format, (uint)type, pixels); } /// @@ -489,9 +496,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureParameter(uint target, uint pName, float* @params) + public void GetTextureParameter(TextureTarget target, GetTextureParameter pName, float* @params) { - __context->glGetTexParameterfv(target, pName, @params); + __context->glGetTexParameterfv((uint)target, (uint)pName, @params); } /// @@ -500,9 +507,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureParameter(uint target, uint pName, int* @params) + public void GetTextureParameter(TextureTarget target, GetTextureParameter pName, int* @params) { - __context->glGetTexParameteriv(target, pName, @params); + __context->glGetTexParameteriv((uint)target, (uint)pName, @params); } /// @@ -511,9 +518,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureLevelParameter(uint target, int level, uint pName, float* @params) + public void GetTextureLevelParameter(TextureTarget target, int level, GetTextureParameter pName, float* @params) { - __context->glGetTexLevelParameterfv(target, level, pName, @params); + __context->glGetTexLevelParameterfv((uint)target, level, (uint)pName, @params); } /// @@ -522,9 +529,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureLevelParameter(uint target, int level, uint pName, int* @params) + public void GetTextureLevelParameter(TextureTarget target, int level, GetTextureParameter pName, int* @params) { - __context->glGetTexLevelParameteriv(target, level, pName, @params); + __context->glGetTexLevelParameteriv((uint)target, level, (uint)pName, @params); } /// @@ -533,9 +540,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsEnabled(uint cap) + public byte IsEnabled(EnableCap cap) { - return __context->glIsEnabled(cap); + return __context->glIsEnabled((uint)cap); } /// @@ -566,9 +573,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawArrays(uint mode, int first, int count) + public void DrawArrays(PrimitiveType mode, int first, int count) { - __context->glDrawArrays(mode, first, count); + __context->glDrawArrays((uint)mode, first, count); } /// @@ -577,9 +584,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElements(uint mode, int count, uint type, void* indices) + public void DrawElements(PrimitiveType mode, int count, DrawElementsType type, void* indices) { - __context->glDrawElements(mode, count, type, indices); + __context->glDrawElements((uint)mode, count, (uint)type, indices); } /// @@ -588,9 +595,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetPointerv(uint pName, void** @params) + public void GetPointerv(GetPointervPName pName, void** @params) { - __context->glGetPointerv(pName, @params); + __context->glGetPointerv((uint)pName, @params); } /// @@ -610,9 +617,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexImage1D(uint target, int level, uint internalFormat, int x, int y, int width, int border) + public void CopyTexImage1D(TextureTarget target, int level, InternalFormat internalFormat, int x, int y, int width, int border) { - __context->glCopyTexImage1D(target, level, internalFormat, x, y, width, border); + __context->glCopyTexImage1D((uint)target, level, (uint)internalFormat, x, y, width, border); } /// @@ -621,9 +628,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexImage2D(uint target, int level, uint internalFormat, int x, int y, int width, int height, int border) + public void CopyTexImage2D(TextureTarget target, int level, InternalFormat internalFormat, int x, int y, int width, int height, int border) { - __context->glCopyTexImage2D(target, level, internalFormat, x, y, width, height, border); + __context->glCopyTexImage2D((uint)target, level, (uint)internalFormat, x, y, width, height, border); } /// @@ -632,9 +639,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexSubImage1D(uint target, int level, int xOffset, int x, int y, int width) + public void CopyTexSubImage1D(TextureTarget target, int level, int xOffset, int x, int y, int width) { - __context->glCopyTexSubImage1D(target, level, xOffset, x, y, width); + __context->glCopyTexSubImage1D((uint)target, level, xOffset, x, y, width); } /// @@ -643,9 +650,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexSubImage2D(uint target, int level, int xOffset, int yOffset, int x, int y, int width, int height) + public void CopyTexSubImage2D(TextureTarget target, int level, int xOffset, int yOffset, int x, int y, int width, int height) { - __context->glCopyTexSubImage2D(target, level, xOffset, yOffset, x, y, width, height); + __context->glCopyTexSubImage2D((uint)target, level, xOffset, yOffset, x, y, width, height); } /// @@ -654,9 +661,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexSubImage1D(uint target, int level, int xOffset, int width, uint format, uint type, void* pixels) + public void TexSubImage1D(TextureTarget target, int level, int xOffset, int width, PixelFormat format, PixelType type, void* pixels) { - __context->glTexSubImage1D(target, level, xOffset, width, format, type, pixels); + __context->glTexSubImage1D((uint)target, level, xOffset, width, (uint)format, (uint)type, pixels); } /// @@ -665,9 +672,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexSubImage2D(uint target, int level, int xOffset, int yOffset, int width, int height, uint format, uint type, void* pixels) + public void TexSubImage2D(TextureTarget target, int level, int xOffset, int yOffset, int width, int height, PixelFormat format, PixelType type, void* pixels) { - __context->glTexSubImage2D(target, level, xOffset, yOffset, width, height, format, type, pixels); + __context->glTexSubImage2D((uint)target, level, xOffset, yOffset, width, height, (uint)format, (uint)type, pixels); } /// @@ -676,9 +683,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindTexture(uint target, GlHandle texture) + public void BindTexture(TextureTarget target, GlHandle texture) { - __context->glBindTexture(target, texture.Value); + __context->glBindTexture((uint)target, texture.Value); } /// @@ -726,9 +733,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawRangeElements(uint mode, uint start, uint end, int count, uint type, void* indices) + public void DrawRangeElements(PrimitiveType mode, uint start, uint end, int count, DrawElementsType type, void* indices) { - __context->glDrawRangeElements(mode, start, end, count, type, indices); + __context->glDrawRangeElements((uint)mode, start, end, count, (uint)type, indices); } /// @@ -737,9 +744,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage3D(uint target, int level, int internalFormat, int width, int height, int depth, int border, uint format, uint type, void* pixels) + public void TexImage3D(TextureTarget target, int level, int internalFormat, int width, int height, int depth, int border, PixelFormat format, PixelType type, void* pixels) { - __context->glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels); + __context->glTexImage3D((uint)target, level, internalFormat, width, height, depth, border, (uint)format, (uint)type, pixels); } /// @@ -748,9 +755,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexSubImage3D(uint target, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, uint format, uint type, void* pixels) + public void TexSubImage3D(TextureTarget target, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, PixelFormat format, PixelType type, void* pixels) { - __context->glTexSubImage3D(target, level, xOffset, yOffset, zOffset, width, height, depth, format, type, pixels); + __context->glTexSubImage3D((uint)target, level, xOffset, yOffset, zOffset, width, height, depth, (uint)format, (uint)type, pixels); } /// @@ -759,9 +766,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexSubImage3D(uint target, int level, int xOffset, int yOffset, int zOffset, int x, int y, int width, int height) + public void CopyTexSubImage3D(TextureTarget target, int level, int xOffset, int yOffset, int zOffset, int x, int y, int width, int height) { - __context->glCopyTexSubImage3D(target, level, xOffset, yOffset, zOffset, x, y, width, height); + __context->glCopyTexSubImage3D((uint)target, level, xOffset, yOffset, zOffset, x, y, width, height); } /// @@ -770,9 +777,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ActiveTexture(uint texture) + public void ActiveTexture(TextureUnit texture) { - __context->glActiveTexture(texture); + __context->glActiveTexture((uint)texture); } /// @@ -792,9 +799,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexImage3D(uint target, int level, uint internalFormat, int width, int height, int depth, int border, int imageSize, void* data) + public void CompressedTexImage3D(TextureTarget target, int level, InternalFormat internalFormat, int width, int height, int depth, int border, int imageSize, void* data) { - __context->glCompressedTexImage3D(target, level, internalFormat, width, height, depth, border, imageSize, data); + __context->glCompressedTexImage3D((uint)target, level, (uint)internalFormat, width, height, depth, border, imageSize, data); } /// @@ -803,9 +810,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexImage2D(uint target, int level, uint internalFormat, int width, int height, int border, int imageSize, void* data) + public void CompressedTexImage2D(TextureTarget target, int level, InternalFormat internalFormat, int width, int height, int border, int imageSize, void* data) { - __context->glCompressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, data); + __context->glCompressedTexImage2D((uint)target, level, (uint)internalFormat, width, height, border, imageSize, data); } /// @@ -814,9 +821,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexImage1D(uint target, int level, uint internalFormat, int width, int border, int imageSize, void* data) + public void CompressedTexImage1D(TextureTarget target, int level, InternalFormat internalFormat, int width, int border, int imageSize, void* data) { - __context->glCompressedTexImage1D(target, level, internalFormat, width, border, imageSize, data); + __context->glCompressedTexImage1D((uint)target, level, (uint)internalFormat, width, border, imageSize, data); } /// @@ -825,9 +832,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexSubImage3D(uint target, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, uint format, int imageSize, void* data) + public void CompressedTexSubImage3D(TextureTarget target, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, InternalFormat format, int imageSize, void* data) { - __context->glCompressedTexSubImage3D(target, level, xOffset, yOffset, zOffset, width, height, depth, format, imageSize, data); + __context->glCompressedTexSubImage3D((uint)target, level, xOffset, yOffset, zOffset, width, height, depth, (uint)format, imageSize, data); } /// @@ -836,9 +843,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexSubImage2D(uint target, int level, int xOffset, int yOffset, int width, int height, uint format, int imageSize, void* data) + public void CompressedTexSubImage2D(TextureTarget target, int level, int xOffset, int yOffset, int width, int height, InternalFormat format, int imageSize, void* data) { - __context->glCompressedTexSubImage2D(target, level, xOffset, yOffset, width, height, format, imageSize, data); + __context->glCompressedTexSubImage2D((uint)target, level, xOffset, yOffset, width, height, (uint)format, imageSize, data); } /// @@ -847,9 +854,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexSubImage1D(uint target, int level, int xOffset, int width, uint format, int imageSize, void* data) + public void CompressedTexSubImage1D(TextureTarget target, int level, int xOffset, int width, InternalFormat format, int imageSize, void* data) { - __context->glCompressedTexSubImage1D(target, level, xOffset, width, format, imageSize, data); + __context->glCompressedTexSubImage1D((uint)target, level, xOffset, width, (uint)format, imageSize, data); } /// @@ -858,9 +865,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetCompressedTexImage(uint target, int level, void* img) + public void GetCompressedTexImage(TextureTarget target, int level, void* img) { - __context->glGetCompressedTexImage(target, level, img); + __context->glGetCompressedTexImage((uint)target, level, img); } /// @@ -869,9 +876,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendFuncSeparate(uint sfactorRGB, uint dfactorRGB, uint sfactorAlpha, uint dfactorAlpha) + public void BlendFuncSeparate(BlendingFactor sfactorRGB, BlendingFactor dfactorRGB, BlendingFactor sfactorAlpha, BlendingFactor dfactorAlpha) { - __context->glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); + __context->glBlendFuncSeparate((uint)sfactorRGB, (uint)dfactorRGB, (uint)sfactorAlpha, (uint)dfactorAlpha); } /// @@ -880,9 +887,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawArrays(uint mode, int* first, int* count, int drawcount) + public void MultiDrawArrays(PrimitiveType mode, int* first, int* count, int drawcount) { - __context->glMultiDrawArrays(mode, first, count, drawcount); + __context->glMultiDrawArrays((uint)mode, first, count, drawcount); } /// @@ -891,9 +898,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawElements(uint mode, int* count, uint type, void** indices, int drawcount) + public void MultiDrawElements(PrimitiveType mode, int* count, DrawElementsType type, void** indices, int drawcount) { - __context->glMultiDrawElements(mode, count, type, indices, drawcount); + __context->glMultiDrawElements((uint)mode, count, (uint)type, indices, drawcount); } /// @@ -902,9 +909,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PointParameter(uint pName, float param) + public void PointParameter(PointParameterName pName, float param) { - __context->glPointParameterf(pName, param); + __context->glPointParameterf((uint)pName, param); } /// @@ -913,9 +920,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PointParameter(uint pName, float* @params) + public void PointParameter(PointParameterName pName, float* @params) { - __context->glPointParameterfv(pName, @params); + __context->glPointParameterfv((uint)pName, @params); } /// @@ -924,9 +931,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PointParameter(uint pName, int param) + public void PointParameter(PointParameterName pName, int param) { - __context->glPointParameteri(pName, param); + __context->glPointParameteri((uint)pName, param); } /// @@ -935,9 +942,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PointParameter(uint pName, int* @params) + public void PointParameter(PointParameterName pName, int* @params) { - __context->glPointParameteriv(pName, @params); + __context->glPointParameteriv((uint)pName, @params); } /// @@ -957,9 +964,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendEquation(uint mode) + public void BlendEquation(BlendEquationMode mode) { - __context->glBlendEquation(mode); + __context->glBlendEquation((uint)mode); } /// @@ -1007,9 +1014,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BeginQuery(uint target, GlHandle id) + public void BeginQuery(QueryTarget target, GlHandle id) { - __context->glBeginQuery(target, id.Value); + __context->glBeginQuery((uint)target, id.Value); } /// @@ -1018,9 +1025,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void EndQuery(uint target) + public void EndQuery(QueryTarget target) { - __context->glEndQuery(target); + __context->glEndQuery((uint)target); } /// @@ -1029,9 +1036,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryiv(uint target, uint pName, int* @params) + public void GetQueryiv(QueryTarget target, QueryParameterName pName, int* @params) { - __context->glGetQueryiv(target, pName, @params); + __context->glGetQueryiv((uint)target, (uint)pName, @params); } /// @@ -1040,9 +1047,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryObject(GlHandle id, uint pName, int* @params) + public void GetQueryObject(GlHandle id, QueryObjectParameterName pName, int* @params) { - __context->glGetQueryObjectiv(id.Value, pName, @params); + __context->glGetQueryObjectiv(id.Value, (uint)pName, @params); } /// @@ -1051,9 +1058,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryObject(GlHandle id, uint pName, uint* @params) + public void GetQueryObject(GlHandle id, QueryObjectParameterName pName, uint* @params) { - __context->glGetQueryObjectuiv(id.Value, pName, @params); + __context->glGetQueryObjectuiv(id.Value, (uint)pName, @params); } /// @@ -1062,9 +1069,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBuffer(uint target, GlHandle buffer) + public void BindBuffer(BufferTarget target, GlHandle buffer) { - __context->glBindBuffer(target, buffer.Value); + __context->glBindBuffer((uint)target, buffer.Value); } /// @@ -1112,9 +1119,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BufferData(uint target, nint size, void* data, uint usage) + public void BufferData(BufferTarget target, nint size, void* data, BufferUsage usage) { - __context->glBufferData(target, size, data, usage); + __context->glBufferData((uint)target, size, data, (uint)usage); } /// @@ -1123,9 +1130,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BufferSubData(uint target, nint offset, nint size, void* data) + public void BufferSubData(BufferTarget target, nint offset, nint size, void* data) { - __context->glBufferSubData(target, offset, size, data); + __context->glBufferSubData((uint)target, offset, size, data); } /// @@ -1134,9 +1141,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBufferSubData(uint target, nint offset, nint size, void* data) + public void GetBufferSubData(BufferTarget target, nint offset, nint size, void* data) { - __context->glGetBufferSubData(target, offset, size, data); + __context->glGetBufferSubData((uint)target, offset, size, data); } /// @@ -1145,9 +1152,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void* MapBuffer(uint target, uint access) + public void* MapBuffer(BufferTarget target, BufferAccess access) { - return __context->glMapBuffer(target, access); + return __context->glMapBuffer((uint)target, (uint)access); } /// @@ -1156,9 +1163,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte UnmapBuffer(uint target) + public byte UnmapBuffer(BufferTarget target) { - return __context->glUnmapBuffer(target); + return __context->glUnmapBuffer((uint)target); } /// @@ -1167,9 +1174,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBufferParameter(uint target, uint pName, int* @params) + public void GetBufferParameter(BufferTarget target, BufferPName pName, int* @params) { - __context->glGetBufferParameteriv(target, pName, @params); + __context->glGetBufferParameteriv((uint)target, (uint)pName, @params); } /// @@ -1178,9 +1185,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBufferPointerv(uint target, uint pName, void** @params) + public void GetBufferPointerv(BufferTarget target, BufferPointerName pName, void** @params) { - __context->glGetBufferPointerv(target, pName, @params); + __context->glGetBufferPointerv((uint)target, (uint)pName, @params); } /// @@ -1189,9 +1196,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendEquationSeparate(uint modeRGB, uint modeAlpha) + public void BlendEquationSeparate(BlendEquationMode modeRGB, BlendEquationMode modeAlpha) { - __context->glBlendEquationSeparate(modeRGB, modeAlpha); + __context->glBlendEquationSeparate((uint)modeRGB, (uint)modeAlpha); } /// @@ -1200,9 +1207,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawBuffers(int n, uint* bufs) + public void DrawBuffers(int n, DrawBufferMode* bufs) { - __context->glDrawBuffers(n, bufs); + __context->glDrawBuffers(n, (uint*)bufs); } /// @@ -1211,9 +1218,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilOpSeparate(uint face, uint sfail, uint dpfail, uint dppass) + public void StencilOpSeparate(TriangleFace face, StencilOp sfail, StencilOp dpfail, StencilOp dppass) { - __context->glStencilOpSeparate(face, sfail, dpfail, dppass); + __context->glStencilOpSeparate((uint)face, (uint)sfail, (uint)dpfail, (uint)dppass); } /// @@ -1222,9 +1229,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilFuncSeparate(uint face, uint func, int @ref, uint mask) + public void StencilFuncSeparate(TriangleFace face, StencilFunction func, int @ref, uint mask) { - __context->glStencilFuncSeparate(face, func, @ref, mask); + __context->glStencilFuncSeparate((uint)face, (uint)func, @ref, mask); } /// @@ -1233,9 +1240,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilMaskSeparate(uint face, uint mask) + public void StencilMaskSeparate(TriangleFace face, uint mask) { - __context->glStencilMaskSeparate(face, mask); + __context->glStencilMaskSeparate((uint)face, mask); } /// @@ -1282,17 +1289,6 @@ namespace StgSharp.Graphics.OpenGL return GlHandle.Create(__context->glCreateProgram()); } - /// - /// Forwards to the native OpenGL entry point. - /// GLuint glCreateShader(GLenum type); - /// See docs.gl. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public GlHandle CreateShader(uint type) - { - return GlHandle.Create(__context->glCreateShader(type)); - } - /// /// Forwards to the native OpenGL entry point. /// void glDeleteProgram(GLuint program); @@ -1354,9 +1350,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveAttribute(GlHandle program, uint index, int bufSize, int* length, int* size, uint* type, byte* name) + public void GetActiveAttribute(GlHandle program, uint index, int bufSize, int* length, int* size, AttributeType* type, byte* name) { - __context->glGetActiveAttrib(program.Value, index, bufSize, length, size, type, name); + __context->glGetActiveAttrib(program.Value, index, bufSize, length, size, (uint*)type, name); } /// @@ -1365,9 +1361,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveUniform(GlHandle program, uint index, int bufSize, int* length, int* size, uint* type, byte* name) + public void GetActiveUniform(GlHandle program, uint index, int bufSize, int* length, int* size, UniformType* type, byte* name) { - __context->glGetActiveUniform(program.Value, index, bufSize, length, size, type, name); + __context->glGetActiveUniform(program.Value, index, bufSize, length, size, (uint*)type, name); } /// @@ -1401,9 +1397,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramiv(GlHandle program, uint pName, int* @params) + public void GetProgramiv(GlHandle program, ProgramProperty pName, int* @params) { - __context->glGetProgramiv(program.Value, pName, @params); + __context->glGetProgramiv(program.Value, (uint)pName, @params); } /// @@ -1423,9 +1419,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetShaderiv(GlHandle shader, uint pName, int* @params) + public void GetShaderiv(GlHandle shader, ShaderParameterName pName, int* @params) { - __context->glGetShaderiv(shader.Value, pName, @params); + __context->glGetShaderiv(shader.Value, (uint)pName, @params); } /// @@ -1489,9 +1485,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribute(uint index, uint pName, double* @params) + public void GetVertexAttribute(uint index, VertexAttributeProperty pName, double* @params) { - __context->glGetVertexAttribdv(index, pName, @params); + __context->glGetVertexAttribdv(index, (uint)pName, @params); } /// @@ -1500,9 +1496,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribute(uint index, uint pName, float* @params) + public void GetVertexAttribute(uint index, VertexAttributeProperty pName, float* @params) { - __context->glGetVertexAttribfv(index, pName, @params); + __context->glGetVertexAttribfv(index, (uint)pName, @params); } /// @@ -1511,9 +1507,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribute(uint index, uint pName, int* @params) + public void GetVertexAttribute(uint index, VertexAttributeProperty pName, int* @params) { - __context->glGetVertexAttribiv(index, pName, @params); + __context->glGetVertexAttribiv(index, (uint)pName, @params); } /// @@ -1522,9 +1518,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttributePointer(uint index, uint pName, void** pointer) + public void GetVertexAttributePointer(uint index, VertexAttributePointerProperty pName, void** pointer) { - __context->glGetVertexAttribPointerv(index, pName, pointer); + __context->glGetVertexAttribPointerv(index, (uint)pName, pointer); } /// @@ -1560,17 +1556,6 @@ namespace StgSharp.Graphics.OpenGL __context->glLinkProgram(program.Value); } - /// - /// Forwards to the native OpenGL entry point. - /// void glShaderSource(GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); - /// See docs.gl. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ShaderSource(GlHandle shader, int count, byte** @string, int* length) - { - __context->glShaderSource(shader.Value, count, @string, length); - } - /// /// Forwards to the native OpenGL entry point. /// void glUseProgram(GLuint program); @@ -2087,9 +2072,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttributePointer(uint index, int size, uint type, byte normalized, int stride, void* pointer) + public void VertexAttributePointer(uint index, int size, VertexAttributePointerType type, byte normalized, int stride, void* pointer) { - __context->glVertexAttribPointer(index, size, type, normalized, stride, pointer); + __context->glVertexAttribPointer(index, size, (uint)type, normalized, stride, pointer); } /// @@ -2109,11 +2094,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint target, uint index, Span values) + public void GetValue(BufferTarget target, uint index, Span values) { fixed (byte* __value = values) { - __context->glGetBooleani_v(target, index, __value); + __context->glGetBooleani_v((uint)target, index, __value); } } @@ -2123,11 +2108,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint target, uint index, Span values) + public void GetValue(GetPName target, uint index, Span values) { fixed (int* __value = values) { - __context->glGetIntegeri_v(target, index, __value); + __context->glGetIntegeri_v((uint)target, index, __value); } } @@ -2137,9 +2122,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enablei(uint target, uint index) + public void Enablei(EnableCap target, uint index) { - __context->glEnablei(target, index); + __context->glEnablei((uint)target, index); } /// @@ -2148,9 +2133,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Disablei(uint target, uint index) + public void Disablei(EnableCap target, uint index) { - __context->glDisablei(target, index); + __context->glDisablei((uint)target, index); } /// @@ -2159,9 +2144,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsEnabledi(uint target, uint index) + public byte IsEnabledi(EnableCap target, uint index) { - return __context->glIsEnabledi(target, index); + return __context->glIsEnabledi((uint)target, index); } /// @@ -2170,9 +2155,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BeginTransformFeedback(uint primitiveMode) + public void BeginTransformFeedback(PrimitiveType primitiveMode) { - __context->glBeginTransformFeedback(primitiveMode); + __context->glBeginTransformFeedback((uint)primitiveMode); } /// @@ -2192,9 +2177,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBufferRange(uint target, uint index, GlHandle buffer, nint offset, nint size) + public void BindBufferRange(BufferTarget target, uint index, GlHandle buffer, nint offset, nint size) { - __context->glBindBufferRange(target, index, buffer.Value, offset, size); + __context->glBindBufferRange((uint)target, index, buffer.Value, offset, size); } /// @@ -2203,9 +2188,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBufferBase(uint target, uint index, GlHandle buffer) + public void BindBufferBase(BufferTarget target, uint index, GlHandle buffer) { - __context->glBindBufferBase(target, index, buffer.Value); + __context->glBindBufferBase((uint)target, index, buffer.Value); } /// @@ -2214,9 +2199,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TransformFeedbackVaryings(GlHandle program, int count, byte** varyings, uint bufferMode) + public void TransformFeedbackVaryings(GlHandle program, int count, byte** varyings, TransformFeedbackBufferMode bufferMode) { - __context->glTransformFeedbackVaryings(program.Value, count, varyings, bufferMode); + __context->glTransformFeedbackVaryings(program.Value, count, varyings, (uint)bufferMode); } /// @@ -2225,9 +2210,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTransformFeedbackVarying(GlHandle program, uint index, int bufSize, int* length, int* size, uint* type, byte* name) + public void GetTransformFeedbackVarying(GlHandle program, uint index, int bufSize, int* length, int* size, AttributeType* type, byte* name) { - __context->glGetTransformFeedbackVarying(program.Value, index, bufSize, length, size, type, name); + __context->glGetTransformFeedbackVarying(program.Value, index, bufSize, length, size, (uint*)type, name); } /// @@ -2236,9 +2221,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClampColor(uint target, uint clamp) + public void ClampColor(ClampColorTarget target, ClampColorMode clamp) { - __context->glClampColor(target, clamp); + __context->glClampColor((uint)target, (uint)clamp); } /// @@ -2247,9 +2232,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BeginConditionalRender(uint id, uint mode) + public void BeginConditionalRender(uint id, ConditionalRenderMode mode) { - __context->glBeginConditionalRender(id, mode); + __context->glBeginConditionalRender(id, (uint)mode); } /// @@ -2269,9 +2254,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttributeIntegerPointer(uint index, int size, uint type, int stride, void* pointer) + public void VertexAttributeIntegerPointer(uint index, int size, VertexAttributeIType type, int stride, void* pointer) { - __context->glVertexAttribIPointer(index, size, type, stride, pointer); + __context->glVertexAttribIPointer(index, size, (uint)type, stride, pointer); } /// @@ -2280,9 +2265,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttributeInteger(uint index, uint pName, int* @params) + public void GetVertexAttributeInteger(uint index, VertexAttributeEnum pName, int* @params) { - __context->glGetVertexAttribIiv(index, pName, @params); + __context->glGetVertexAttribIiv(index, (uint)pName, @params); } /// @@ -2291,9 +2276,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttributeInteger(uint index, uint pName, uint* @params) + public void GetVertexAttributeInteger(uint index, VertexAttributeEnum pName, uint* @params) { - __context->glGetVertexAttribIuiv(index, pName, @params); + __context->glGetVertexAttribIuiv(index, (uint)pName, @params); } /// @@ -2572,9 +2557,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameterInteger(uint target, uint pName, int* @params) + public void TextureParameterInteger(TextureTarget target, TextureParameterName pName, int* @params) { - __context->glTexParameterIiv(target, pName, @params); + __context->glTexParameterIiv((uint)target, (uint)pName, @params); } /// @@ -2583,9 +2568,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameterInteger(uint target, uint pName, uint* @params) + public void TextureParameterInteger(TextureTarget target, TextureParameterName pName, uint* @params) { - __context->glTexParameterIuiv(target, pName, @params); + __context->glTexParameterIuiv((uint)target, (uint)pName, @params); } /// @@ -2594,9 +2579,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureParameterInteger(uint target, uint pName, int* @params) + public void GetTextureParameterInteger(TextureTarget target, GetTextureParameter pName, int* @params) { - __context->glGetTexParameterIiv(target, pName, @params); + __context->glGetTexParameterIiv((uint)target, (uint)pName, @params); } /// @@ -2605,9 +2590,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureParameterInteger(uint target, uint pName, uint* @params) + public void GetTextureParameterInteger(TextureTarget target, GetTextureParameter pName, uint* @params) { - __context->glGetTexParameterIuiv(target, pName, @params); + __context->glGetTexParameterIuiv((uint)target, (uint)pName, @params); } /// @@ -2616,9 +2601,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBuffer(uint buffer, int drawbuffer, int* value) + public void ClearBuffer(ClearBuffer buffer, int drawbuffer, int* value) { - __context->glClearBufferiv(buffer, drawbuffer, value); + __context->glClearBufferiv((uint)buffer, drawbuffer, value); } /// @@ -2627,9 +2612,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBuffer(uint buffer, int drawbuffer, uint* value) + public void ClearBuffer(ClearBuffer buffer, int drawbuffer, uint* value) { - __context->glClearBufferuiv(buffer, drawbuffer, value); + __context->glClearBufferuiv((uint)buffer, drawbuffer, value); } /// @@ -2638,9 +2623,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBuffer(uint buffer, int drawbuffer, float* value) + public void ClearBuffer(ClearBuffer buffer, int drawbuffer, float* value) { - __context->glClearBufferfv(buffer, drawbuffer, value); + __context->glClearBufferfv((uint)buffer, drawbuffer, value); } /// @@ -2649,9 +2634,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBuffer(uint buffer, int drawbuffer, float depth, int stencil) + public void ClearBuffer(ClearBuffer buffer, int drawbuffer, float depth, int stencil) { - __context->glClearBufferfi(buffer, drawbuffer, depth, stencil); + __context->glClearBufferfi((uint)buffer, drawbuffer, depth, stencil); } /// @@ -2660,9 +2645,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte* GetStringi(uint name, uint index) + public byte* GetStringi(StringName name, uint index) { - return __context->glGetStringi(name, index); + return __context->glGetStringi((uint)name, index); } /// @@ -2682,9 +2667,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindRenderBuffer(uint target, GlHandle renderBuffer) + public void BindRenderBuffer(RenderBufferTarget target, GlHandle renderBuffer) { - __context->glBindRenderbuffer(target, renderBuffer.Value); + __context->glBindRenderbuffer((uint)target, renderBuffer.Value); } /// @@ -2721,9 +2706,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void RenderBufferStorage(uint target, uint internalFormat, int width, int height) + public void RenderBufferStorage(RenderBufferTarget target, InternalFormat internalFormat, int width, int height) { - __context->glRenderbufferStorage(target, internalFormat, width, height); + __context->glRenderbufferStorage((uint)target, (uint)internalFormat, width, height); } /// @@ -2732,9 +2717,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetRenderBufferParameteriv(uint target, uint pName, int* @params) + public void GetRenderBufferParameteriv(RenderBufferTarget target, RenderBufferParameterName pName, int* @params) { - __context->glGetRenderbufferParameteriv(target, pName, @params); + __context->glGetRenderbufferParameteriv((uint)target, (uint)pName, @params); } /// @@ -2754,9 +2739,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindFrameBuffer(uint target, GlHandle frameBuffer) + public void BindFrameBuffer(FrameBufferTarget target, GlHandle frameBuffer) { - __context->glBindFramebuffer(target, frameBuffer.Value); + __context->glBindFramebuffer((uint)target, frameBuffer.Value); } /// @@ -2793,9 +2778,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint CheckFrameBufferStatus(uint target) + public FrameBufferStatus CheckFrameBufferStatus(FrameBufferTarget target) { - return __context->glCheckFramebufferStatus(target); + return (FrameBufferStatus)__context->glCheckFramebufferStatus((uint)target); } /// @@ -2804,9 +2789,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FrameBufferTexture1D(uint target, uint attachment, uint textarget, GlHandle texture, int level) + public void FrameBufferTexture1D(FrameBufferTarget target, FrameBufferAttachment attachment, TextureTarget textarget, GlHandle texture, int level) { - __context->glFramebufferTexture1D(target, attachment, textarget, texture.Value, level); + __context->glFramebufferTexture1D((uint)target, (uint)attachment, (uint)textarget, texture.Value, level); } /// @@ -2815,9 +2800,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FrameBufferTexture2D(uint target, uint attachment, uint textarget, GlHandle texture, int level) + public void FrameBufferTexture2D(FrameBufferTarget target, FrameBufferAttachment attachment, TextureTarget textarget, GlHandle texture, int level) { - __context->glFramebufferTexture2D(target, attachment, textarget, texture.Value, level); + __context->glFramebufferTexture2D((uint)target, (uint)attachment, (uint)textarget, texture.Value, level); } /// @@ -2826,9 +2811,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FrameBufferTexture3D(uint target, uint attachment, uint textarget, GlHandle texture, int level, int zOffset) + public void FrameBufferTexture3D(FrameBufferTarget target, FrameBufferAttachment attachment, TextureTarget textarget, GlHandle texture, int level, int zOffset) { - __context->glFramebufferTexture3D(target, attachment, textarget, texture.Value, level, zOffset); + __context->glFramebufferTexture3D((uint)target, (uint)attachment, (uint)textarget, texture.Value, level, zOffset); } /// @@ -2837,9 +2822,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FrameBufferRenderBuffer(uint target, uint attachment, uint renderBuffertarget, GlHandle renderBuffer) + public void FrameBufferRenderBuffer(FrameBufferTarget target, FrameBufferAttachment attachment, RenderBufferTarget renderBuffertarget, GlHandle renderBuffer) { - __context->glFramebufferRenderbuffer(target, attachment, renderBuffertarget, renderBuffer.Value); + __context->glFramebufferRenderbuffer((uint)target, (uint)attachment, (uint)renderBuffertarget, renderBuffer.Value); } /// @@ -2848,9 +2833,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetFrameBufferAttachmentParameteriv(uint target, uint attachment, uint pName, int* @params) + public void GetFrameBufferAttachmentParameteriv(FrameBufferTarget target, FrameBufferAttachment attachment, FrameBufferAttachmentParameterName pName, int* @params) { - __context->glGetFramebufferAttachmentParameteriv(target, attachment, pName, @params); + __context->glGetFramebufferAttachmentParameteriv((uint)target, (uint)attachment, (uint)pName, @params); } /// @@ -2859,9 +2844,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenerateMipmap(uint target) + public void GenerateMipmap(TextureTarget target) { - __context->glGenerateMipmap(target); + __context->glGenerateMipmap((uint)target); } /// @@ -2870,9 +2855,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlitFrameBuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, uint mask, uint filter) + public void BlitFrameBuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferMask mask, BlitFrameBufferFilter filter) { - __context->glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); + __context->glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, (uint)mask, (uint)filter); } /// @@ -2881,9 +2866,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void RenderBufferStorageMultisample(uint target, int samples, uint internalFormat, int width, int height) + public void RenderBufferStorageMultisample(RenderBufferTarget target, int samples, InternalFormat internalFormat, int width, int height) { - __context->glRenderbufferStorageMultisample(target, samples, internalFormat, width, height); + __context->glRenderbufferStorageMultisample((uint)target, samples, (uint)internalFormat, width, height); } /// @@ -2892,9 +2877,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FrameBufferTextureLayer(uint target, uint attachment, GlHandle texture, int level, int layer) + public void FrameBufferTextureLayer(FrameBufferTarget target, FrameBufferAttachment attachment, GlHandle texture, int level, int layer) { - __context->glFramebufferTextureLayer(target, attachment, texture.Value, level, layer); + __context->glFramebufferTextureLayer((uint)target, (uint)attachment, texture.Value, level, layer); } /// @@ -2903,9 +2888,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void* MapBufferRange(uint target, nint offset, nint length, uint access) + public void* MapBufferRange(BufferTarget target, nint offset, nint length, MapBufferAccessMask access) { - return __context->glMapBufferRange(target, offset, length, access); + return __context->glMapBufferRange((uint)target, offset, length, (uint)access); } /// @@ -2914,9 +2899,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FlushMappedBufferRange(uint target, nint offset, nint length) + public void FlushMappedBufferRange(BufferTarget target, nint offset, nint length) { - __context->glFlushMappedBufferRange(target, offset, length); + __context->glFlushMappedBufferRange((uint)target, offset, length); } /// @@ -2975,9 +2960,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawArraysInstanced(uint mode, int first, int count, int instancecount) + public void DrawArraysInstanced(PrimitiveType mode, int first, int count, int instancecount) { - __context->glDrawArraysInstanced(mode, first, count, instancecount); + __context->glDrawArraysInstanced((uint)mode, first, count, instancecount); } /// @@ -2986,9 +2971,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsInstanced(uint mode, int count, uint type, void* indices, int instancecount) + public void DrawElementsInstanced(PrimitiveType mode, int count, DrawElementsType type, void* indices, int instancecount) { - __context->glDrawElementsInstanced(mode, count, type, indices, instancecount); + __context->glDrawElementsInstanced((uint)mode, count, (uint)type, indices, instancecount); } /// @@ -2997,9 +2982,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexBuffer(uint target, uint internalFormat, GlHandle buffer) + public void TexBuffer(TextureTarget target, SizedInternalFormat internalFormat, GlHandle buffer) { - __context->glTexBuffer(target, internalFormat, buffer.Value); + __context->glTexBuffer((uint)target, (uint)internalFormat, buffer.Value); } /// @@ -3019,9 +3004,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyBufferSubData(uint readTarget, uint writeTarget, nint readOffset, nint writeOffset, nint size) + public void CopyBufferSubData(CopyBufferSubDataTarget readTarget, CopyBufferSubDataTarget writeTarget, nint readOffset, nint writeOffset, nint size) { - __context->glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); + __context->glCopyBufferSubData((uint)readTarget, (uint)writeTarget, readOffset, writeOffset, size); } /// @@ -3041,9 +3026,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveUniformsiv(GlHandle program, int uniformCount, uint* uniformIndices, uint pName, int* @params) + public void GetActiveUniformsiv(GlHandle program, int uniformCount, uint* uniformIndices, UniformPName pName, int* @params) { - __context->glGetActiveUniformsiv(program.Value, uniformCount, uniformIndices, pName, @params); + __context->glGetActiveUniformsiv(program.Value, uniformCount, uniformIndices, (uint)pName, @params); } /// @@ -3074,9 +3059,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveUniformBlockiv(GlHandle program, uint uniformBlockIndex, uint pName, int* @params) + public void GetActiveUniformBlockiv(GlHandle program, uint uniformBlockIndex, UniformBlockPName pName, int* @params) { - __context->glGetActiveUniformBlockiv(program.Value, uniformBlockIndex, pName, @params); + __context->glGetActiveUniformBlockiv(program.Value, uniformBlockIndex, (uint)pName, @params); } /// @@ -3107,9 +3092,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsBaseVertex(uint mode, int count, uint type, void* indices, int basevertex) + public void DrawElementsBaseVertex(PrimitiveType mode, int count, DrawElementsType type, void* indices, int basevertex) { - __context->glDrawElementsBaseVertex(mode, count, type, indices, basevertex); + __context->glDrawElementsBaseVertex((uint)mode, count, (uint)type, indices, basevertex); } /// @@ -3118,9 +3103,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawRangeElementsBaseVertex(uint mode, uint start, uint end, int count, uint type, void* indices, int basevertex) + public void DrawRangeElementsBaseVertex(PrimitiveType mode, uint start, uint end, int count, DrawElementsType type, void* indices, int basevertex) { - __context->glDrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex); + __context->glDrawRangeElementsBaseVertex((uint)mode, start, end, count, (uint)type, indices, basevertex); } /// @@ -3129,9 +3114,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsInstancedBaseVertex(uint mode, int count, uint type, void* indices, int instancecount, int basevertex) + public void DrawElementsInstancedBaseVertex(PrimitiveType mode, int count, DrawElementsType type, void* indices, int instancecount, int basevertex) { - __context->glDrawElementsInstancedBaseVertex(mode, count, type, indices, instancecount, basevertex); + __context->glDrawElementsInstancedBaseVertex((uint)mode, count, (uint)type, indices, instancecount, basevertex); } /// @@ -3140,9 +3125,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawElementsBaseVertex(uint mode, int* count, uint type, void** indices, int drawcount, int* basevertex) + public void MultiDrawElementsBaseVertex(PrimitiveType mode, int* count, DrawElementsType type, void** indices, int drawcount, int* basevertex) { - __context->glMultiDrawElementsBaseVertex(mode, count, type, indices, drawcount, basevertex); + __context->glMultiDrawElementsBaseVertex((uint)mode, count, (uint)type, indices, drawcount, basevertex); } /// @@ -3151,9 +3136,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProvokingVertex(uint mode) + public void ProvokingVertex(VertexProvokingMode mode) { - __context->glProvokingVertex(mode); + __context->glProvokingVertex((uint)mode); } /// @@ -3162,9 +3147,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void* FenceSync(uint condition, uint flags) + public void* FenceSync(SyncCondition condition, SyncBehaviorFlags flags) { - return __context->glFenceSync(condition, flags); + return __context->glFenceSync((uint)condition, (uint)flags); } /// @@ -3195,9 +3180,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint ClientWaitSync(void* sync, uint flags, ulong timeout) + public SyncStatus ClientWaitSync(void* sync, SyncObjectMask flags, ulong timeout) { - return __context->glClientWaitSync(sync, flags, timeout); + return (SyncStatus)__context->glClientWaitSync(sync, (uint)flags, timeout); } /// @@ -3206,9 +3191,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void WaitSync(void* sync, uint flags, ulong timeout) + public void WaitSync(void* sync, SyncBehaviorFlags flags, ulong timeout) { - __context->glWaitSync(sync, flags, timeout); + __context->glWaitSync(sync, (uint)flags, timeout); } /// @@ -3217,11 +3202,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint pName, Span values) + public void GetValue(GetPName pName, Span values) { fixed (long* __value = values) { - __context->glGetInteger64v(pName, __value); + __context->glGetInteger64v((uint)pName, __value); } } @@ -3231,9 +3216,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSynciv(void* sync, uint pName, int count, int* length, int* values) + public void GetSynciv(void* sync, SyncParameterName pName, int count, int* length, int* values) { - __context->glGetSynciv(sync, pName, count, length, values); + __context->glGetSynciv(sync, (uint)pName, count, length, values); } /// @@ -3242,11 +3227,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint target, uint index, Span values) + public void GetValue(GetPName target, uint index, Span values) { fixed (long* __value = values) { - __context->glGetInteger64i_v(target, index, __value); + __context->glGetInteger64i_v((uint)target, index, __value); } } @@ -3256,9 +3241,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBufferParameter(uint target, uint pName, long* @params) + public void GetBufferParameter(BufferTarget target, BufferPName pName, long* @params) { - __context->glGetBufferParameteri64v(target, pName, @params); + __context->glGetBufferParameteri64v((uint)target, (uint)pName, @params); } /// @@ -3267,9 +3252,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FrameBufferTexture(uint target, uint attachment, GlHandle texture, int level) + public void FrameBufferTexture(FrameBufferTarget target, FrameBufferAttachment attachment, GlHandle texture, int level) { - __context->glFramebufferTexture(target, attachment, texture.Value, level); + __context->glFramebufferTexture((uint)target, (uint)attachment, texture.Value, level); } /// @@ -3278,9 +3263,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage2DMultisample(uint target, int samples, uint internalFormat, int width, int height, byte fixedsamplelocations) + public void TexImage2DMultisample(TextureTarget target, int samples, InternalFormat internalFormat, int width, int height, byte fixedsamplelocations) { - __context->glTexImage2DMultisample(target, samples, internalFormat, width, height, fixedsamplelocations); + __context->glTexImage2DMultisample((uint)target, samples, (uint)internalFormat, width, height, fixedsamplelocations); } /// @@ -3289,9 +3274,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage3DMultisample(uint target, int samples, uint internalFormat, int width, int height, int depth, byte fixedsamplelocations) + public void TexImage3DMultisample(TextureTarget target, int samples, InternalFormat internalFormat, int width, int height, int depth, byte fixedsamplelocations) { - __context->glTexImage3DMultisample(target, samples, internalFormat, width, height, depth, fixedsamplelocations); + __context->glTexImage3DMultisample((uint)target, samples, (uint)internalFormat, width, height, depth, fixedsamplelocations); } /// @@ -3300,9 +3285,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetMultisamplefv(uint pName, uint index, float* val) + public void GetMultisamplefv(GetMultisamplePName pName, uint index, float* val) { - __context->glGetMultisamplefv(pName, index, val); + __context->glGetMultisamplefv((uint)pName, index, val); } /// diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v3_3.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v3_3.g.cs index b0ac7399..f7965deb 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v3_3.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v3_3.g.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------------- +// file="OpenGLFunction.v3_3" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL 3.3 core-profile forwarding methods. @@ -91,9 +98,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameter(GlHandle sampler, uint pName, int param) + public void SamplerParameter(GlHandle sampler, SamplerParameterI pName, int param) { - __context->glSamplerParameteri(sampler.Value, pName, param); + __context->glSamplerParameteri(sampler.Value, (uint)pName, param); } /// @@ -102,9 +109,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameter(GlHandle sampler, uint pName, int* param) + public void SamplerParameter(GlHandle sampler, SamplerParameterI pName, int* param) { - __context->glSamplerParameteriv(sampler.Value, pName, param); + __context->glSamplerParameteriv(sampler.Value, (uint)pName, param); } /// @@ -113,9 +120,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameter(GlHandle sampler, uint pName, float param) + public void SamplerParameter(GlHandle sampler, SamplerParameterF pName, float param) { - __context->glSamplerParameterf(sampler.Value, pName, param); + __context->glSamplerParameterf(sampler.Value, (uint)pName, param); } /// @@ -124,9 +131,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameter(GlHandle sampler, uint pName, float* param) + public void SamplerParameter(GlHandle sampler, SamplerParameterF pName, float* param) { - __context->glSamplerParameterfv(sampler.Value, pName, param); + __context->glSamplerParameterfv(sampler.Value, (uint)pName, param); } /// @@ -135,9 +142,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameterInteger(GlHandle sampler, uint pName, int* param) + public void SamplerParameterInteger(GlHandle sampler, SamplerParameterI pName, int* param) { - __context->glSamplerParameterIiv(sampler.Value, pName, param); + __context->glSamplerParameterIiv(sampler.Value, (uint)pName, param); } /// @@ -146,9 +153,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameterInteger(GlHandle sampler, uint pName, uint* param) + public void SamplerParameterInteger(GlHandle sampler, SamplerParameterI pName, uint* param) { - __context->glSamplerParameterIuiv(sampler.Value, pName, param); + __context->glSamplerParameterIuiv(sampler.Value, (uint)pName, param); } /// @@ -157,9 +164,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSamplerParameter(GlHandle sampler, uint pName, int* @params) + public void GetSamplerParameter(GlHandle sampler, SamplerParameterI pName, int* @params) { - __context->glGetSamplerParameteriv(sampler.Value, pName, @params); + __context->glGetSamplerParameteriv(sampler.Value, (uint)pName, @params); } /// @@ -168,9 +175,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSamplerParameterInteger(GlHandle sampler, uint pName, int* @params) + public void GetSamplerParameterInteger(GlHandle sampler, SamplerParameterI pName, int* @params) { - __context->glGetSamplerParameterIiv(sampler.Value, pName, @params); + __context->glGetSamplerParameterIiv(sampler.Value, (uint)pName, @params); } /// @@ -179,9 +186,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSamplerParameter(GlHandle sampler, uint pName, float* @params) + public void GetSamplerParameter(GlHandle sampler, SamplerParameterF pName, float* @params) { - __context->glGetSamplerParameterfv(sampler.Value, pName, @params); + __context->glGetSamplerParameterfv(sampler.Value, (uint)pName, @params); } /// @@ -190,9 +197,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSamplerParameterInteger(GlHandle sampler, uint pName, uint* @params) + public void GetSamplerParameterInteger(GlHandle sampler, SamplerParameterI pName, uint* @params) { - __context->glGetSamplerParameterIuiv(sampler.Value, pName, @params); + __context->glGetSamplerParameterIuiv(sampler.Value, (uint)pName, @params); } /// @@ -201,9 +208,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void QueryCounter(GlHandle id, uint target) + public void QueryCounter(GlHandle id, QueryCounterTarget target) { - __context->glQueryCounter(id.Value, target); + __context->glQueryCounter(id.Value, (uint)target); } /// @@ -212,9 +219,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryObject(GlHandle id, uint pName, long* @params) + public void GetQueryObject(GlHandle id, QueryObjectParameterName pName, long* @params) { - __context->glGetQueryObjecti64v(id.Value, pName, @params); + __context->glGetQueryObjecti64v(id.Value, (uint)pName, @params); } /// @@ -223,9 +230,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryObject(GlHandle id, uint pName, ulong* @params) + public void GetQueryObject(GlHandle id, QueryObjectParameterName pName, ulong* @params) { - __context->glGetQueryObjectui64v(id.Value, pName, @params); + __context->glGetQueryObjectui64v(id.Value, (uint)pName, @params); } /// @@ -245,9 +252,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttributePacked1(uint index, uint type, byte normalized, uint value) + public void VertexAttributePacked1(uint index, VertexAttributePointerType type, byte normalized, uint value) { - __context->glVertexAttribP1ui(index, type, normalized, value); + __context->glVertexAttribP1ui(index, (uint)type, normalized, value); } /// @@ -256,9 +263,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttributePacked2(uint index, uint type, byte normalized, uint value) + public void VertexAttributePacked2(uint index, VertexAttributePointerType type, byte normalized, uint value) { - __context->glVertexAttribP2ui(index, type, normalized, value); + __context->glVertexAttribP2ui(index, (uint)type, normalized, value); } /// @@ -267,9 +274,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttributePacked3(uint index, uint type, byte normalized, uint value) + public void VertexAttributePacked3(uint index, VertexAttributePointerType type, byte normalized, uint value) { - __context->glVertexAttribP3ui(index, type, normalized, value); + __context->glVertexAttribP3ui(index, (uint)type, normalized, value); } /// @@ -278,9 +285,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttributePacked4(uint index, uint type, byte normalized, uint value) + public void VertexAttributePacked4(uint index, VertexAttributePointerType type, byte normalized, uint value) { - __context->glVertexAttribP4ui(index, type, normalized, value); + __context->glVertexAttribP4ui(index, (uint)type, normalized, value); } } diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_0.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_0.g.cs index 60268a59..cefbd70d 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_0.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_0.g.cs @@ -1,10 +1,17 @@ +// ----------------------------------------------------------------------------- +// file="OpenGLFunction.v4_0" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL 4.0 core-profile forwarding methods. // using StgSharp.Mathematics.Numeric.Graphics; -using StgSharp.Mathematics.Numeric.Graphics; + using System; using System.Runtime.CompilerServices; @@ -30,9 +37,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendEquationi(uint buf, uint mode) + public void BlendEquationi(uint buf, BlendEquationMode mode) { - __context->glBlendEquationi(buf, mode); + __context->glBlendEquationi(buf, (uint)mode); } /// @@ -41,9 +48,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendEquationSeparatei(uint buf, uint modeRGB, uint modeAlpha) + public void BlendEquationSeparatei(uint buf, BlendEquationMode modeRGB, BlendEquationMode modeAlpha) { - __context->glBlendEquationSeparatei(buf, modeRGB, modeAlpha); + __context->glBlendEquationSeparatei(buf, (uint)modeRGB, (uint)modeAlpha); } /// @@ -52,9 +59,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendFunci(uint buf, uint src, uint dst) + public void BlendFunci(uint buf, BlendingFactor src, BlendingFactor dst) { - __context->glBlendFunci(buf, src, dst); + __context->glBlendFunci(buf, (uint)src, (uint)dst); } /// @@ -63,9 +70,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendFuncSeparatei(uint buf, uint srcRGB, uint dstRGB, uint srcAlpha, uint dstAlpha) + public void BlendFuncSeparatei(uint buf, BlendingFactor srcRGB, BlendingFactor dstRGB, BlendingFactor srcAlpha, BlendingFactor dstAlpha) { - __context->glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); + __context->glBlendFuncSeparatei(buf, (uint)srcRGB, (uint)dstRGB, (uint)srcAlpha, (uint)dstAlpha); } /// @@ -74,9 +81,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawArraysIndirect(uint mode, void* indirect) + public void DrawArraysIndirect(PrimitiveType mode, void* indirect) { - __context->glDrawArraysIndirect(mode, indirect); + __context->glDrawArraysIndirect((uint)mode, indirect); } /// @@ -85,9 +92,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsIndirect(uint mode, uint type, void* indirect) + public void DrawElementsIndirect(PrimitiveType mode, DrawElementsType type, void* indirect) { - __context->glDrawElementsIndirect(mode, type, indirect); + __context->glDrawElementsIndirect((uint)mode, (uint)type, indirect); } /// @@ -212,9 +219,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int GetSubroutineUniformLocation(GlHandle program, uint shadertype, byte* name) + public int GetSubroutineUniformLocation(GlHandle program, ShaderType shadertype, byte* name) { - return __context->glGetSubroutineUniformLocation(program.Value, shadertype, name); + return __context->glGetSubroutineUniformLocation(program.Value, (uint)shadertype, name); } /// @@ -223,9 +230,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint GetSubroutineIndex(GlHandle program, uint shadertype, byte* name) + public uint GetSubroutineIndex(GlHandle program, ShaderType shadertype, byte* name) { - return __context->glGetSubroutineIndex(program.Value, shadertype, name); + return __context->glGetSubroutineIndex(program.Value, (uint)shadertype, name); } /// @@ -234,9 +241,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveSubroutineUniformiv(GlHandle program, uint shadertype, uint index, uint pName, int* values) + public void GetActiveSubroutineUniformiv(GlHandle program, ShaderType shadertype, uint index, SubroutineParameterName pName, int* values) { - __context->glGetActiveSubroutineUniformiv(program.Value, shadertype, index, pName, values); + __context->glGetActiveSubroutineUniformiv(program.Value, (uint)shadertype, index, (uint)pName, values); } /// @@ -245,9 +252,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveSubroutineUniformName(GlHandle program, uint shadertype, uint index, int bufSize, int* length, byte* name) + public void GetActiveSubroutineUniformName(GlHandle program, ShaderType shadertype, uint index, int bufSize, int* length, byte* name) { - __context->glGetActiveSubroutineUniformName(program.Value, shadertype, index, bufSize, length, name); + __context->glGetActiveSubroutineUniformName(program.Value, (uint)shadertype, index, bufSize, length, name); } /// @@ -256,9 +263,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveSubroutineName(GlHandle program, uint shadertype, uint index, int bufSize, int* length, byte* name) + public void GetActiveSubroutineName(GlHandle program, ShaderType shadertype, uint index, int bufSize, int* length, byte* name) { - __context->glGetActiveSubroutineName(program.Value, shadertype, index, bufSize, length, name); + __context->glGetActiveSubroutineName(program.Value, (uint)shadertype, index, bufSize, length, name); } /// @@ -267,9 +274,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformSubroutinesuiv(uint shadertype, int count, uint* indices) + public void UniformSubroutinesuiv(ShaderType shadertype, int count, uint* indices) { - __context->glUniformSubroutinesuiv(shadertype, count, indices); + __context->glUniformSubroutinesuiv((uint)shadertype, count, indices); } /// @@ -278,9 +285,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetUniformSubroutineuiv(uint shadertype, int location, uint* @params) + public void GetUniformSubroutineuiv(ShaderType shadertype, int location, uint* @params) { - __context->glGetUniformSubroutineuiv(shadertype, location, @params); + __context->glGetUniformSubroutineuiv((uint)shadertype, location, @params); } /// @@ -289,9 +296,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramStageiv(GlHandle program, uint shadertype, uint pName, int* values) + public void GetProgramStageiv(GlHandle program, ShaderType shadertype, ProgramStagePName pName, int* values) { - __context->glGetProgramStageiv(program.Value, shadertype, pName, values); + __context->glGetProgramStageiv(program.Value, (uint)shadertype, (uint)pName, values); } /// @@ -300,9 +307,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PatchParameter(uint pName, int value) + public void PatchParameter(PatchParameterName pName, int value) { - __context->glPatchParameteri(pName, value); + __context->glPatchParameteri((uint)pName, value); } /// @@ -311,9 +318,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PatchParameter(uint pName, float* values) + public void PatchParameter(PatchParameterName pName, float* values) { - __context->glPatchParameterfv(pName, values); + __context->glPatchParameterfv((uint)pName, values); } /// @@ -322,9 +329,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindTransformFeedback(uint target, GlHandle id) + public void BindTransformFeedback(BindTransformFeedbackTarget target, GlHandle id) { - __context->glBindTransformFeedback(target, id.Value); + __context->glBindTransformFeedback((uint)target, id.Value); } /// @@ -394,9 +401,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawTransformFeedback(uint mode, GlHandle id) + public void DrawTransformFeedback(PrimitiveType mode, GlHandle id) { - __context->glDrawTransformFeedback(mode, id.Value); + __context->glDrawTransformFeedback((uint)mode, id.Value); } /// @@ -405,9 +412,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawTransformFeedbackStream(uint mode, GlHandle id, uint stream) + public void DrawTransformFeedbackStream(PrimitiveType mode, GlHandle id, uint stream) { - __context->glDrawTransformFeedbackStream(mode, id.Value, stream); + __context->glDrawTransformFeedbackStream((uint)mode, id.Value, stream); } /// @@ -416,9 +423,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BeginQueryIndexed(uint target, uint index, GlHandle id) + public void BeginQueryIndexed(QueryTarget target, uint index, GlHandle id) { - __context->glBeginQueryIndexed(target, index, id.Value); + __context->glBeginQueryIndexed((uint)target, index, id.Value); } /// @@ -427,9 +434,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void EndQueryIndexed(uint target, uint index) + public void EndQueryIndexed(QueryTarget target, uint index) { - __context->glEndQueryIndexed(target, index); + __context->glEndQueryIndexed((uint)target, index); } /// @@ -438,9 +445,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryIndexediv(uint target, uint index, uint pName, int* @params) + public void GetQueryIndexediv(QueryTarget target, uint index, QueryParameterName pName, int* @params) { - __context->glGetQueryIndexediv(target, index, pName, @params); + __context->glGetQueryIndexediv((uint)target, index, (uint)pName, @params); } } diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_1.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_1.g.cs index d07a698b..f2e1475a 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_1.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_1.g.cs @@ -1,10 +1,17 @@ +// ----------------------------------------------------------------------------- +// file="OpenGLFunction.v4_1" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL 4.1 core-profile forwarding methods. // using StgSharp.Mathematics.Numeric.Graphics; -using StgSharp.Mathematics.Numeric.Graphics; + using System; using System.Runtime.CompilerServices; @@ -30,11 +37,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ShaderBinary(ReadOnlySpan shaders, uint binaryFormat, void* binary, int length) + public void ShaderBinary(ReadOnlySpan shaders, ShaderBinaryFormat binaryFormat, void* binary, int length) { fixed (GlHandle* __shaders = shaders) { - __context->glShaderBinary(shaders.Length, (uint*)__shaders, binaryFormat, binary, length); + __context->glShaderBinary(shaders.Length, (uint*)__shaders, (uint)binaryFormat, binary, length); } } @@ -44,9 +51,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetShaderPrecisionFormat(uint shadertype, uint precisiontype, int* range, int* precision) + public void GetShaderPrecisionFormat(ShaderType shadertype, PrecisionType precisiontype, int* range, int* precision) { - __context->glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); + __context->glGetShaderPrecisionFormat((uint)shadertype, (uint)precisiontype, range, precision); } /// @@ -99,9 +106,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramParameteri(GlHandle program, uint pName, int value) + public void ProgramParameteri(GlHandle program, ProgramParameterPName pName, int value) { - __context->glProgramParameteri(program.Value, pName, value); + __context->glProgramParameteri(program.Value, (uint)pName, value); } /// @@ -110,9 +117,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UseProgramStages(GlHandle pipeline, uint stages, GlHandle program) + public void UseProgramStages(GlHandle pipeline, UseProgramStageMask stages, GlHandle program) { - __context->glUseProgramStages(pipeline.Value, stages, program.Value); + __context->glUseProgramStages(pipeline.Value, (uint)stages, program.Value); } /// @@ -132,9 +139,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public GlHandle CreateShaderProgramv(uint type, int count, byte** strings) + public GlHandle CreateShaderProgramv(ShaderType type, int count, byte** strings) { - return GlHandle.Create(__context->glCreateShaderProgramv(type, count, strings)); + return GlHandle.Create(__context->glCreateShaderProgramv((uint)type, count, strings)); } /// @@ -193,9 +200,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramPipelineiv(GlHandle pipeline, uint pName, int* @params) + public void GetProgramPipelineiv(GlHandle pipeline, PipelineParameterName pName, int* @params) { - __context->glGetProgramPipelineiv(pipeline.Value, pName, @params); + __context->glGetProgramPipelineiv(pipeline.Value, (uint)pName, @params); } /// @@ -715,9 +722,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttributeDoublePointer(uint index, int size, uint type, int stride, void* pointer) + public void VertexAttributeDoublePointer(uint index, int size, VertexAttributeLType type, int stride, void* pointer) { - __context->glVertexAttribLPointer(index, size, type, stride, pointer); + __context->glVertexAttribLPointer(index, size, (uint)type, stride, pointer); } /// @@ -726,9 +733,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttributeDouble(uint index, uint pName, double* @params) + public void GetVertexAttributeDouble(uint index, VertexAttributeEnum pName, double* @params) { - __context->glGetVertexAttribLdv(index, pName, @params); + __context->glGetVertexAttribLdv(index, (uint)pName, @params); } /// @@ -825,11 +832,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint target, uint index, Span values) + public void GetValue(GetPName target, uint index, Span values) { fixed (float* __value = values) { - __context->glGetFloati_v(target, index, __value); + __context->glGetFloati_v((uint)target, index, __value); } } @@ -839,11 +846,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetValue(uint target, uint index, Span values) + public void GetValue(GetPName target, uint index, Span values) { fixed (double* __value = values) { - __context->glGetDoublei_v(target, index, __value); + __context->glGetDoublei_v((uint)target, index, __value); } } diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_2.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_2.g.cs index 163b466c..d4197866 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_2.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_2.g.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------------- +// file="OpenGLFunction.v4_2" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL 4.2 core-profile forwarding methods. @@ -19,9 +26,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawArraysInstancedBaseInstance(uint mode, int first, int count, int instancecount, uint baseinstance) + public void DrawArraysInstancedBaseInstance(PrimitiveType mode, int first, int count, int instancecount, uint baseinstance) { - __context->glDrawArraysInstancedBaseInstance(mode, first, count, instancecount, baseinstance); + __context->glDrawArraysInstancedBaseInstance((uint)mode, first, count, instancecount, baseinstance); } /// @@ -30,9 +37,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsInstancedBaseInstance(uint mode, int count, uint type, void* indices, int instancecount, uint baseinstance) + public void DrawElementsInstancedBaseInstance(PrimitiveType mode, int count, DrawElementsType type, void* indices, int instancecount, uint baseinstance) { - __context->glDrawElementsInstancedBaseInstance(mode, count, type, indices, instancecount, baseinstance); + __context->glDrawElementsInstancedBaseInstance((uint)mode, count, (uint)type, indices, instancecount, baseinstance); } /// @@ -41,9 +48,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsInstancedBaseVertexBaseInstance(uint mode, int count, uint type, void* indices, int instancecount, int basevertex, uint baseinstance) + public void DrawElementsInstancedBaseVertexBaseInstance(PrimitiveType mode, int count, DrawElementsType type, void* indices, int instancecount, int basevertex, uint baseinstance) { - __context->glDrawElementsInstancedBaseVertexBaseInstance(mode, count, type, indices, instancecount, basevertex, baseinstance); + __context->glDrawElementsInstancedBaseVertexBaseInstance((uint)mode, count, (uint)type, indices, instancecount, basevertex, baseinstance); } /// @@ -52,9 +59,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetInternalFormat(uint target, uint internalFormat, uint pName, int count, int* @params) + public void GetInternalFormat(TextureTarget target, InternalFormat internalFormat, InternalFormatPName pName, int count, int* @params) { - __context->glGetInternalformativ(target, internalFormat, pName, count, @params); + __context->glGetInternalformativ((uint)target, (uint)internalFormat, (uint)pName, count, @params); } /// @@ -63,9 +70,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveAtomicCounterBufferiv(GlHandle program, uint bufferIndex, uint pName, int* @params) + public void GetActiveAtomicCounterBufferiv(GlHandle program, uint bufferIndex, AtomicCounterBufferPName pName, int* @params) { - __context->glGetActiveAtomicCounterBufferiv(program.Value, bufferIndex, pName, @params); + __context->glGetActiveAtomicCounterBufferiv(program.Value, bufferIndex, (uint)pName, @params); } /// @@ -74,9 +81,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindImageTexture(uint unit, GlHandle texture, int level, byte layered, int layer, uint access, uint format) + public void BindImageTexture(uint unit, GlHandle texture, int level, byte layered, int layer, BufferAccess access, InternalFormat format) { - __context->glBindImageTexture(unit, texture.Value, level, layered, layer, access, format); + __context->glBindImageTexture(unit, texture.Value, level, layered, layer, (uint)access, (uint)format); } /// @@ -85,9 +92,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MemoryBarrier(uint barriers) + public void MemoryBarrier(MemoryBarrierMask barriers) { - __context->glMemoryBarrier(barriers); + __context->glMemoryBarrier((uint)barriers); } /// @@ -96,9 +103,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexStorage1D(uint target, int levels, uint internalFormat, int width) + public void TexStorage1D(TextureTarget target, int levels, SizedInternalFormat internalFormat, int width) { - __context->glTexStorage1D(target, levels, internalFormat, width); + __context->glTexStorage1D((uint)target, levels, (uint)internalFormat, width); } /// @@ -107,9 +114,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexStorage2D(uint target, int levels, uint internalFormat, int width, int height) + public void TexStorage2D(TextureTarget target, int levels, SizedInternalFormat internalFormat, int width, int height) { - __context->glTexStorage2D(target, levels, internalFormat, width, height); + __context->glTexStorage2D((uint)target, levels, (uint)internalFormat, width, height); } /// @@ -118,9 +125,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexStorage3D(uint target, int levels, uint internalFormat, int width, int height, int depth) + public void TexStorage3D(TextureTarget target, int levels, SizedInternalFormat internalFormat, int width, int height, int depth) { - __context->glTexStorage3D(target, levels, internalFormat, width, height, depth); + __context->glTexStorage3D((uint)target, levels, (uint)internalFormat, width, height, depth); } /// @@ -129,9 +136,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawTransformFeedbackInstanced(uint mode, GlHandle id, int instancecount) + public void DrawTransformFeedbackInstanced(PrimitiveType mode, GlHandle id, int instancecount) { - __context->glDrawTransformFeedbackInstanced(mode, id.Value, instancecount); + __context->glDrawTransformFeedbackInstanced((uint)mode, id.Value, instancecount); } /// @@ -140,9 +147,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawTransformFeedbackStreamInstanced(uint mode, GlHandle id, uint stream, int instancecount) + public void DrawTransformFeedbackStreamInstanced(PrimitiveType mode, GlHandle id, uint stream, int instancecount) { - __context->glDrawTransformFeedbackStreamInstanced(mode, id.Value, stream, instancecount); + __context->glDrawTransformFeedbackStreamInstanced((uint)mode, id.Value, stream, instancecount); } } diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_3.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_3.g.cs index b4075d08..9ff05565 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_3.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_3.g.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------------- +// file="OpenGLFunction.v4_3" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL 4.3 core-profile forwarding methods. @@ -19,9 +26,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -30,9 +37,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -63,9 +70,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -74,9 +81,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -85,9 +92,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -96,9 +103,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -151,9 +158,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -162,9 +169,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -173,9 +180,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -184,9 +191,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -195,9 +202,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -206,9 +213,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -217,9 +224,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -228,9 +235,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -239,9 +246,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -250,9 +257,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -272,9 +279,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -283,9 +290,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -294,9 +301,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -305,9 +312,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -327,9 +334,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -338,9 +345,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -349,9 +356,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -382,9 +389,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -393,9 +400,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -415,9 +422,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -426,9 +433,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -448,9 +455,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// @@ -459,9 +466,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [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); } /// diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_4.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_4.g.cs index 8e753cfa..bde86c3b 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_4.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_4.g.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------------- +// file="OpenGLFunction.v4_4" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL 4.4 core-profile forwarding methods. @@ -19,9 +26,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BufferStorage(uint target, nint size, void* data, uint flags) + public void BufferStorage(BufferStorageTarget target, nint size, void* data, BufferStorageMask flags) { - __context->glBufferStorage(target, size, data, flags); + __context->glBufferStorage((uint)target, size, data, (uint)flags); } /// @@ -30,9 +37,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearTexImage(GlHandle texture, int level, uint format, uint type, void* data) + public void ClearTexImage(GlHandle texture, int level, PixelFormat format, PixelType type, void* data) { - __context->glClearTexImage(texture.Value, level, format, type, data); + __context->glClearTexImage(texture.Value, level, (uint)format, (uint)type, data); } /// @@ -41,9 +48,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearTexSubImage(GlHandle texture, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, uint format, uint type, void* data) + public void ClearTexSubImage(GlHandle texture, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, PixelFormat format, PixelType type, void* data) { - __context->glClearTexSubImage(texture.Value, level, xOffset, yOffset, zOffset, width, height, depth, format, type, data); + __context->glClearTexSubImage(texture.Value, level, xOffset, yOffset, zOffset, width, height, depth, (uint)format, (uint)type, data); } /// @@ -52,11 +59,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBuffersBase(uint target, uint first, ReadOnlySpan buffers) + public void BindBuffersBase(BufferTarget target, uint first, ReadOnlySpan buffers) { fixed (GlHandle* __buffers = buffers) { - __context->glBindBuffersBase(target, first, buffers.Length, (uint*)__buffers); + __context->glBindBuffersBase((uint)target, first, buffers.Length, (uint*)__buffers); } } @@ -66,11 +73,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBuffersRange(uint target, uint first, ReadOnlySpan buffers, nint* offsets, nint* sizes) + public void BindBuffersRange(BufferTarget target, uint first, ReadOnlySpan buffers, nint* offsets, nint* sizes) { fixed (GlHandle* __buffers = buffers) { - __context->glBindBuffersRange(target, first, buffers.Length, (uint*)__buffers, offsets, sizes); + __context->glBindBuffersRange((uint)target, first, buffers.Length, (uint*)__buffers, offsets, sizes); } } diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_5.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_5.g.cs index 0b5c849a..962edc55 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_5.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_5.g.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------------- +// file="OpenGLFunction.v4_5" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL 4.5 core-profile forwarding methods. @@ -19,9 +26,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClipControl(uint origin, uint depth) + public void ClipControl(ClipControlOrigin origin, ClipControlDepth depth) { - __context->glClipControl(origin, depth); + __context->glClipControl((uint)origin, (uint)depth); } /// @@ -66,9 +73,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTransformFeedbackiv(GlHandle xfb, uint pName, int* param) + public void GetTransformFeedbackiv(GlHandle xfb, TransformFeedbackPName pName, int* param) { - __context->glGetTransformFeedbackiv(xfb.Value, pName, param); + __context->glGetTransformFeedbackiv(xfb.Value, (uint)pName, param); } /// @@ -77,9 +84,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTransformFeedbacki_v(GlHandle xfb, uint pName, uint index, int* param) + public void GetTransformFeedbacki_v(GlHandle xfb, TransformFeedbackPName pName, uint index, int* param) { - __context->glGetTransformFeedbacki_v(xfb.Value, pName, index, param); + __context->glGetTransformFeedbacki_v(xfb.Value, (uint)pName, index, param); } /// @@ -88,9 +95,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTransformFeedbacki64_v(GlHandle xfb, uint pName, uint index, long* param) + public void GetTransformFeedbacki64_v(GlHandle xfb, TransformFeedbackPName pName, uint index, long* param) { - __context->glGetTransformFeedbacki64_v(xfb.Value, pName, index, param); + __context->glGetTransformFeedbacki64_v(xfb.Value, (uint)pName, index, param); } /// @@ -113,9 +120,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedBufferStorage(GlHandle buffer, nint size, void* data, uint flags) + public void NamedBufferStorage(GlHandle buffer, nint size, void* data, BufferStorageMask flags) { - __context->glNamedBufferStorage(buffer.Value, size, data, flags); + __context->glNamedBufferStorage(buffer.Value, size, data, (uint)flags); } /// @@ -124,9 +131,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedBufferData(GlHandle buffer, nint size, void* data, uint usage) + public void NamedBufferData(GlHandle buffer, nint size, void* data, BufferUsage usage) { - __context->glNamedBufferData(buffer.Value, size, data, usage); + __context->glNamedBufferData(buffer.Value, size, data, (uint)usage); } /// @@ -157,9 +164,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedBufferData(GlHandle buffer, uint internalFormat, uint format, uint type, void* data) + public void ClearNamedBufferData(GlHandle buffer, SizedInternalFormat internalFormat, PixelFormat format, PixelType type, void* data) { - __context->glClearNamedBufferData(buffer.Value, internalFormat, format, type, data); + __context->glClearNamedBufferData(buffer.Value, (uint)internalFormat, (uint)format, (uint)type, data); } /// @@ -168,9 +175,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedBufferSubData(GlHandle buffer, uint internalFormat, nint offset, nint size, uint format, uint type, void* data) + public void ClearNamedBufferSubData(GlHandle buffer, SizedInternalFormat internalFormat, nint offset, nint size, PixelFormat format, PixelType type, void* data) { - __context->glClearNamedBufferSubData(buffer.Value, internalFormat, offset, size, format, type, data); + __context->glClearNamedBufferSubData(buffer.Value, (uint)internalFormat, offset, size, (uint)format, (uint)type, data); } /// @@ -179,9 +186,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void* MapNamedBuffer(GlHandle buffer, uint access) + public void* MapNamedBuffer(GlHandle buffer, BufferAccess access) { - return __context->glMapNamedBuffer(buffer.Value, access); + return __context->glMapNamedBuffer(buffer.Value, (uint)access); } /// @@ -190,9 +197,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void* MapNamedBufferRange(GlHandle buffer, nint offset, nint length, uint access) + public void* MapNamedBufferRange(GlHandle buffer, nint offset, nint length, MapBufferAccessMask access) { - return __context->glMapNamedBufferRange(buffer.Value, offset, length, access); + return __context->glMapNamedBufferRange(buffer.Value, offset, length, (uint)access); } /// @@ -223,9 +230,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedBufferParameter(GlHandle buffer, uint pName, int* @params) + public void GetNamedBufferParameter(GlHandle buffer, BufferPName pName, int* @params) { - __context->glGetNamedBufferParameteriv(buffer.Value, pName, @params); + __context->glGetNamedBufferParameteriv(buffer.Value, (uint)pName, @params); } /// @@ -234,9 +241,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedBufferParameter(GlHandle buffer, uint pName, long* @params) + public void GetNamedBufferParameter(GlHandle buffer, BufferPName pName, long* @params) { - __context->glGetNamedBufferParameteri64v(buffer.Value, pName, @params); + __context->glGetNamedBufferParameteri64v(buffer.Value, (uint)pName, @params); } /// @@ -245,9 +252,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedBufferPointerv(GlHandle buffer, uint pName, void** @params) + public void GetNamedBufferPointerv(GlHandle buffer, BufferPointerName pName, void** @params) { - __context->glGetNamedBufferPointerv(buffer.Value, pName, @params); + __context->glGetNamedBufferPointerv(buffer.Value, (uint)pName, @params); } /// @@ -281,9 +288,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFrameBufferRenderBuffer(GlHandle frameBuffer, uint attachment, uint renderBuffertarget, GlHandle renderBuffer) + public void NamedFrameBufferRenderBuffer(GlHandle frameBuffer, FrameBufferAttachment attachment, RenderBufferTarget renderBuffertarget, GlHandle renderBuffer) { - __context->glNamedFramebufferRenderbuffer(frameBuffer.Value, attachment, renderBuffertarget, renderBuffer.Value); + __context->glNamedFramebufferRenderbuffer(frameBuffer.Value, (uint)attachment, (uint)renderBuffertarget, renderBuffer.Value); } /// @@ -292,9 +299,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFrameBufferParameteri(GlHandle frameBuffer, uint pName, int param) + public void NamedFrameBufferParameteri(GlHandle frameBuffer, FrameBufferParameterName pName, int param) { - __context->glNamedFramebufferParameteri(frameBuffer.Value, pName, param); + __context->glNamedFramebufferParameteri(frameBuffer.Value, (uint)pName, param); } /// @@ -303,9 +310,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFrameBufferTexture(GlHandle frameBuffer, uint attachment, GlHandle texture, int level) + public void NamedFrameBufferTexture(GlHandle frameBuffer, FrameBufferAttachment attachment, GlHandle texture, int level) { - __context->glNamedFramebufferTexture(frameBuffer.Value, attachment, texture.Value, level); + __context->glNamedFramebufferTexture(frameBuffer.Value, (uint)attachment, texture.Value, level); } /// @@ -314,9 +321,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFrameBufferTextureLayer(GlHandle frameBuffer, uint attachment, GlHandle texture, int level, int layer) + public void NamedFrameBufferTextureLayer(GlHandle frameBuffer, FrameBufferAttachment attachment, GlHandle texture, int level, int layer) { - __context->glNamedFramebufferTextureLayer(frameBuffer.Value, attachment, texture.Value, level, layer); + __context->glNamedFramebufferTextureLayer(frameBuffer.Value, (uint)attachment, texture.Value, level, layer); } /// @@ -325,9 +332,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFrameBufferDrawBuffer(GlHandle frameBuffer, uint buf) + public void NamedFrameBufferDrawBuffer(GlHandle frameBuffer, ColorBuffer buf) { - __context->glNamedFramebufferDrawBuffer(frameBuffer.Value, buf); + __context->glNamedFramebufferDrawBuffer(frameBuffer.Value, (uint)buf); } /// @@ -336,9 +343,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFrameBufferDrawBuffers(GlHandle frameBuffer, int n, uint* bufs) + public void NamedFrameBufferDrawBuffers(GlHandle frameBuffer, int n, ColorBuffer* bufs) { - __context->glNamedFramebufferDrawBuffers(frameBuffer.Value, n, bufs); + __context->glNamedFramebufferDrawBuffers(frameBuffer.Value, n, (uint*)bufs); } /// @@ -347,9 +354,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFrameBufferReadBuffer(GlHandle frameBuffer, uint src) + public void NamedFrameBufferReadBuffer(GlHandle frameBuffer, ColorBuffer src) { - __context->glNamedFramebufferReadBuffer(frameBuffer.Value, src); + __context->glNamedFramebufferReadBuffer(frameBuffer.Value, (uint)src); } /// @@ -358,9 +365,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateNamedFrameBufferData(GlHandle frameBuffer, int numAttachments, uint* attachments) + public void InvalidateNamedFrameBufferData(GlHandle frameBuffer, int numAttachments, FrameBufferAttachment* attachments) { - __context->glInvalidateNamedFramebufferData(frameBuffer.Value, numAttachments, attachments); + __context->glInvalidateNamedFramebufferData(frameBuffer.Value, numAttachments, (uint*)attachments); } /// @@ -369,9 +376,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateNamedFrameBufferSubData(GlHandle frameBuffer, int numAttachments, uint* attachments, int x, int y, int width, int height) + public void InvalidateNamedFrameBufferSubData(GlHandle frameBuffer, int numAttachments, FrameBufferAttachment* attachments, int x, int y, int width, int height) { - __context->glInvalidateNamedFramebufferSubData(frameBuffer.Value, numAttachments, attachments, x, y, width, height); + __context->glInvalidateNamedFramebufferSubData(frameBuffer.Value, numAttachments, (uint*)attachments, x, y, width, height); } /// @@ -380,9 +387,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedFrameBuffer(GlHandle frameBuffer, uint buffer, int drawbuffer, int* value) + public void ClearNamedFrameBuffer(GlHandle frameBuffer, ClearBuffer buffer, int drawbuffer, int* value) { - __context->glClearNamedFramebufferiv(frameBuffer.Value, buffer, drawbuffer, value); + __context->glClearNamedFramebufferiv(frameBuffer.Value, (uint)buffer, drawbuffer, value); } /// @@ -391,9 +398,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedFrameBuffer(GlHandle frameBuffer, uint buffer, int drawbuffer, uint* value) + public void ClearNamedFrameBuffer(GlHandle frameBuffer, ClearBuffer buffer, int drawbuffer, uint* value) { - __context->glClearNamedFramebufferuiv(frameBuffer.Value, buffer, drawbuffer, value); + __context->glClearNamedFramebufferuiv(frameBuffer.Value, (uint)buffer, drawbuffer, value); } /// @@ -402,9 +409,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedFrameBuffer(GlHandle frameBuffer, uint buffer, int drawbuffer, float* value) + public void ClearNamedFrameBuffer(GlHandle frameBuffer, ClearBuffer buffer, int drawbuffer, float* value) { - __context->glClearNamedFramebufferfv(frameBuffer.Value, buffer, drawbuffer, value); + __context->glClearNamedFramebufferfv(frameBuffer.Value, (uint)buffer, drawbuffer, value); } /// @@ -413,9 +420,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedFrameBuffer(GlHandle frameBuffer, uint buffer, int drawbuffer, float depth, int stencil) + public void ClearNamedFrameBuffer(GlHandle frameBuffer, ClearBuffer buffer, int drawbuffer, float depth, int stencil) { - __context->glClearNamedFramebufferfi(frameBuffer.Value, buffer, drawbuffer, depth, stencil); + __context->glClearNamedFramebufferfi(frameBuffer.Value, (uint)buffer, drawbuffer, depth, stencil); } /// @@ -424,9 +431,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlitNamedFrameBuffer(GlHandle readFrameBuffer, GlHandle drawFrameBuffer, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, uint mask, uint filter) + public void BlitNamedFrameBuffer(GlHandle readFrameBuffer, GlHandle drawFrameBuffer, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferMask mask, BlitFrameBufferFilter filter) { - __context->glBlitNamedFramebuffer(readFrameBuffer.Value, drawFrameBuffer.Value, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); + __context->glBlitNamedFramebuffer(readFrameBuffer.Value, drawFrameBuffer.Value, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, (uint)mask, (uint)filter); } /// @@ -435,9 +442,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint CheckNamedFrameBufferStatus(GlHandle frameBuffer, uint target) + public FrameBufferStatus CheckNamedFrameBufferStatus(GlHandle frameBuffer, FrameBufferTarget target) { - return __context->glCheckNamedFramebufferStatus(frameBuffer.Value, target); + return (FrameBufferStatus)__context->glCheckNamedFramebufferStatus(frameBuffer.Value, (uint)target); } /// @@ -446,9 +453,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedFrameBufferParameteriv(GlHandle frameBuffer, uint pName, int* param) + public void GetNamedFrameBufferParameteriv(GlHandle frameBuffer, GetFrameBufferParameter pName, int* param) { - __context->glGetNamedFramebufferParameteriv(frameBuffer.Value, pName, param); + __context->glGetNamedFramebufferParameteriv(frameBuffer.Value, (uint)pName, param); } /// @@ -457,9 +464,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedFrameBufferAttachmentParameteriv(GlHandle frameBuffer, uint attachment, uint pName, int* @params) + public void GetNamedFrameBufferAttachmentParameteriv(GlHandle frameBuffer, FrameBufferAttachment attachment, FrameBufferAttachmentParameterName pName, int* @params) { - __context->glGetNamedFramebufferAttachmentParameteriv(frameBuffer.Value, attachment, pName, @params); + __context->glGetNamedFramebufferAttachmentParameteriv(frameBuffer.Value, (uint)attachment, (uint)pName, @params); } /// @@ -482,9 +489,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedRenderBufferStorage(GlHandle renderBuffer, uint internalFormat, int width, int height) + public void NamedRenderBufferStorage(GlHandle renderBuffer, InternalFormat internalFormat, int width, int height) { - __context->glNamedRenderbufferStorage(renderBuffer.Value, internalFormat, width, height); + __context->glNamedRenderbufferStorage(renderBuffer.Value, (uint)internalFormat, width, height); } /// @@ -493,9 +500,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedRenderBufferStorageMultisample(GlHandle renderBuffer, int samples, uint internalFormat, int width, int height) + public void NamedRenderBufferStorageMultisample(GlHandle renderBuffer, int samples, InternalFormat internalFormat, int width, int height) { - __context->glNamedRenderbufferStorageMultisample(renderBuffer.Value, samples, internalFormat, width, height); + __context->glNamedRenderbufferStorageMultisample(renderBuffer.Value, samples, (uint)internalFormat, width, height); } /// @@ -504,9 +511,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedRenderBufferParameteriv(GlHandle renderBuffer, uint pName, int* @params) + public void GetNamedRenderBufferParameteriv(GlHandle renderBuffer, RenderBufferParameterName pName, int* @params) { - __context->glGetNamedRenderbufferParameteriv(renderBuffer.Value, pName, @params); + __context->glGetNamedRenderbufferParameteriv(renderBuffer.Value, (uint)pName, @params); } /// @@ -515,11 +522,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateTextures(uint target, Span textures) + public void CreateTextures(TextureTarget target, Span textures) { fixed (GlHandle* __textures = textures) { - __context->glCreateTextures(target, textures.Length, (uint*)__textures); + __context->glCreateTextures((uint)target, textures.Length, (uint*)__textures); } } @@ -529,9 +536,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureBuffer(GlHandle texture, uint internalFormat, GlHandle buffer) + public void TextureBuffer(GlHandle texture, SizedInternalFormat internalFormat, GlHandle buffer) { - __context->glTextureBuffer(texture.Value, internalFormat, buffer.Value); + __context->glTextureBuffer(texture.Value, (uint)internalFormat, buffer.Value); } /// @@ -540,9 +547,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureBufferRange(GlHandle texture, uint internalFormat, GlHandle buffer, nint offset, nint size) + public void TextureBufferRange(GlHandle texture, SizedInternalFormat internalFormat, GlHandle buffer, nint offset, nint size) { - __context->glTextureBufferRange(texture.Value, internalFormat, buffer.Value, offset, size); + __context->glTextureBufferRange(texture.Value, (uint)internalFormat, buffer.Value, offset, size); } /// @@ -551,9 +558,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage1D(GlHandle texture, int levels, uint internalFormat, int width) + public void TextureStorage1D(GlHandle texture, int levels, SizedInternalFormat internalFormat, int width) { - __context->glTextureStorage1D(texture.Value, levels, internalFormat, width); + __context->glTextureStorage1D(texture.Value, levels, (uint)internalFormat, width); } /// @@ -562,9 +569,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage2D(GlHandle texture, int levels, uint internalFormat, int width, int height) + public void TextureStorage2D(GlHandle texture, int levels, SizedInternalFormat internalFormat, int width, int height) { - __context->glTextureStorage2D(texture.Value, levels, internalFormat, width, height); + __context->glTextureStorage2D(texture.Value, levels, (uint)internalFormat, width, height); } /// @@ -573,9 +580,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage3D(GlHandle texture, int levels, uint internalFormat, int width, int height, int depth) + public void TextureStorage3D(GlHandle texture, int levels, SizedInternalFormat internalFormat, int width, int height, int depth) { - __context->glTextureStorage3D(texture.Value, levels, internalFormat, width, height, depth); + __context->glTextureStorage3D(texture.Value, levels, (uint)internalFormat, width, height, depth); } /// @@ -584,9 +591,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage2DMultisample(GlHandle texture, int samples, uint internalFormat, int width, int height, byte fixedsamplelocations) + public void TextureStorage2DMultisample(GlHandle texture, int samples, SizedInternalFormat internalFormat, int width, int height, byte fixedsamplelocations) { - __context->glTextureStorage2DMultisample(texture.Value, samples, internalFormat, width, height, fixedsamplelocations); + __context->glTextureStorage2DMultisample(texture.Value, samples, (uint)internalFormat, width, height, fixedsamplelocations); } /// @@ -595,9 +602,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage3DMultisample(GlHandle texture, int samples, uint internalFormat, int width, int height, int depth, byte fixedsamplelocations) + public void TextureStorage3DMultisample(GlHandle texture, int samples, SizedInternalFormat internalFormat, int width, int height, int depth, byte fixedsamplelocations) { - __context->glTextureStorage3DMultisample(texture.Value, samples, internalFormat, width, height, depth, fixedsamplelocations); + __context->glTextureStorage3DMultisample(texture.Value, samples, (uint)internalFormat, width, height, depth, fixedsamplelocations); } /// @@ -606,9 +613,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureSubImage1D(GlHandle texture, int level, int xOffset, int width, uint format, uint type, void* pixels) + public void TextureSubImage1D(GlHandle texture, int level, int xOffset, int width, PixelFormat format, PixelType type, void* pixels) { - __context->glTextureSubImage1D(texture.Value, level, xOffset, width, format, type, pixels); + __context->glTextureSubImage1D(texture.Value, level, xOffset, width, (uint)format, (uint)type, pixels); } /// @@ -617,9 +624,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureSubImage2D(GlHandle texture, int level, int xOffset, int yOffset, int width, int height, uint format, uint type, void* pixels) + public void TextureSubImage2D(GlHandle texture, int level, int xOffset, int yOffset, int width, int height, PixelFormat format, PixelType type, void* pixels) { - __context->glTextureSubImage2D(texture.Value, level, xOffset, yOffset, width, height, format, type, pixels); + __context->glTextureSubImage2D(texture.Value, level, xOffset, yOffset, width, height, (uint)format, (uint)type, pixels); } /// @@ -628,9 +635,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureSubImage3D(GlHandle texture, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, uint format, uint type, void* pixels) + public void TextureSubImage3D(GlHandle texture, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, PixelFormat format, PixelType type, void* pixels) { - __context->glTextureSubImage3D(texture.Value, level, xOffset, yOffset, zOffset, width, height, depth, format, type, pixels); + __context->glTextureSubImage3D(texture.Value, level, xOffset, yOffset, zOffset, width, height, depth, (uint)format, (uint)type, pixels); } /// @@ -639,9 +646,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTextureSubImage1D(GlHandle texture, int level, int xOffset, int width, uint format, int imageSize, void* data) + public void CompressedTextureSubImage1D(GlHandle texture, int level, int xOffset, int width, InternalFormat format, int imageSize, void* data) { - __context->glCompressedTextureSubImage1D(texture.Value, level, xOffset, width, format, imageSize, data); + __context->glCompressedTextureSubImage1D(texture.Value, level, xOffset, width, (uint)format, imageSize, data); } /// @@ -650,9 +657,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTextureSubImage2D(GlHandle texture, int level, int xOffset, int yOffset, int width, int height, uint format, int imageSize, void* data) + public void CompressedTextureSubImage2D(GlHandle texture, int level, int xOffset, int yOffset, int width, int height, InternalFormat format, int imageSize, void* data) { - __context->glCompressedTextureSubImage2D(texture.Value, level, xOffset, yOffset, width, height, format, imageSize, data); + __context->glCompressedTextureSubImage2D(texture.Value, level, xOffset, yOffset, width, height, (uint)format, imageSize, data); } /// @@ -661,9 +668,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTextureSubImage3D(GlHandle texture, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, uint format, int imageSize, void* data) + public void CompressedTextureSubImage3D(GlHandle texture, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, InternalFormat format, int imageSize, void* data) { - __context->glCompressedTextureSubImage3D(texture.Value, level, xOffset, yOffset, zOffset, width, height, depth, format, imageSize, data); + __context->glCompressedTextureSubImage3D(texture.Value, level, xOffset, yOffset, zOffset, width, height, depth, (uint)format, imageSize, data); } /// @@ -705,9 +712,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedTextureParameter(GlHandle texture, uint pName, float param) + public void NamedTextureParameter(GlHandle texture, TextureParameterName pName, float param) { - __context->glTextureParameterf(texture.Value, pName, param); + __context->glTextureParameterf(texture.Value, (uint)pName, param); } /// @@ -716,9 +723,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedTextureParameter(GlHandle texture, uint pName, float* param) + public void NamedTextureParameter(GlHandle texture, TextureParameterName pName, float* param) { - __context->glTextureParameterfv(texture.Value, pName, param); + __context->glTextureParameterfv(texture.Value, (uint)pName, param); } /// @@ -727,9 +734,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedTextureParameter(GlHandle texture, uint pName, int param) + public void NamedTextureParameter(GlHandle texture, TextureParameterName pName, int param) { - __context->glTextureParameteri(texture.Value, pName, param); + __context->glTextureParameteri(texture.Value, (uint)pName, param); } /// @@ -738,9 +745,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedTextureParameterInteger(GlHandle texture, uint pName, int* @params) + public void NamedTextureParameterInteger(GlHandle texture, TextureParameterName pName, int* @params) { - __context->glTextureParameterIiv(texture.Value, pName, @params); + __context->glTextureParameterIiv(texture.Value, (uint)pName, @params); } /// @@ -749,9 +756,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedTextureParameterInteger(GlHandle texture, uint pName, uint* @params) + public void NamedTextureParameterInteger(GlHandle texture, TextureParameterName pName, uint* @params) { - __context->glTextureParameterIuiv(texture.Value, pName, @params); + __context->glTextureParameterIuiv(texture.Value, (uint)pName, @params); } /// @@ -760,9 +767,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedTextureParameter(GlHandle texture, uint pName, int* param) + public void NamedTextureParameter(GlHandle texture, TextureParameterName pName, int* param) { - __context->glTextureParameteriv(texture.Value, pName, param); + __context->glTextureParameteriv(texture.Value, (uint)pName, param); } /// @@ -793,9 +800,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureImage(GlHandle texture, int level, uint format, uint type, int bufSize, void* pixels) + public void GetTextureImage(GlHandle texture, int level, PixelFormat format, PixelType type, int bufSize, void* pixels) { - __context->glGetTextureImage(texture.Value, level, format, type, bufSize, pixels); + __context->glGetTextureImage(texture.Value, level, (uint)format, (uint)type, bufSize, pixels); } /// @@ -815,9 +822,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedTextureLevelParameter(GlHandle texture, int level, uint pName, float* @params) + public void GetNamedTextureLevelParameter(GlHandle texture, int level, GetTextureParameter pName, float* @params) { - __context->glGetTextureLevelParameterfv(texture.Value, level, pName, @params); + __context->glGetTextureLevelParameterfv(texture.Value, level, (uint)pName, @params); } /// @@ -826,9 +833,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedTextureLevelParameter(GlHandle texture, int level, uint pName, int* @params) + public void GetNamedTextureLevelParameter(GlHandle texture, int level, GetTextureParameter pName, int* @params) { - __context->glGetTextureLevelParameteriv(texture.Value, level, pName, @params); + __context->glGetTextureLevelParameteriv(texture.Value, level, (uint)pName, @params); } /// @@ -837,9 +844,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedTextureParameter(GlHandle texture, uint pName, float* @params) + public void GetNamedTextureParameter(GlHandle texture, GetTextureParameter pName, float* @params) { - __context->glGetTextureParameterfv(texture.Value, pName, @params); + __context->glGetTextureParameterfv(texture.Value, (uint)pName, @params); } /// @@ -848,9 +855,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedTextureParameterInteger(GlHandle texture, uint pName, int* @params) + public void GetNamedTextureParameterInteger(GlHandle texture, GetTextureParameter pName, int* @params) { - __context->glGetTextureParameterIiv(texture.Value, pName, @params); + __context->glGetTextureParameterIiv(texture.Value, (uint)pName, @params); } /// @@ -859,9 +866,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedTextureParameterInteger(GlHandle texture, uint pName, uint* @params) + public void GetNamedTextureParameterInteger(GlHandle texture, GetTextureParameter pName, uint* @params) { - __context->glGetTextureParameterIuiv(texture.Value, pName, @params); + __context->glGetTextureParameterIuiv(texture.Value, (uint)pName, @params); } /// @@ -870,9 +877,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedTextureParameter(GlHandle texture, uint pName, int* @params) + public void GetNamedTextureParameter(GlHandle texture, GetTextureParameter pName, int* @params) { - __context->glGetTextureParameteriv(texture.Value, pName, @params); + __context->glGetTextureParameteriv(texture.Value, (uint)pName, @params); } /// @@ -964,9 +971,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayAttributeFormat(GlHandle vertexArray, uint attributeIndex, int size, uint type, byte normalized, uint relativeOffset) + public void VertexArrayAttributeFormat(GlHandle vertexArray, uint attributeIndex, int size, VertexAttributeType type, byte normalized, uint relativeOffset) { - __context->glVertexArrayAttribFormat(vertexArray.Value, attributeIndex, size, type, normalized, relativeOffset); + __context->glVertexArrayAttribFormat(vertexArray.Value, attributeIndex, size, (uint)type, normalized, relativeOffset); } /// @@ -975,9 +982,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayAttributeIntegerFormat(GlHandle vertexArray, uint attributeIndex, int size, uint type, uint relativeOffset) + public void VertexArrayAttributeIntegerFormat(GlHandle vertexArray, uint attributeIndex, int size, VertexAttributeIType type, uint relativeOffset) { - __context->glVertexArrayAttribIFormat(vertexArray.Value, attributeIndex, size, type, relativeOffset); + __context->glVertexArrayAttribIFormat(vertexArray.Value, attributeIndex, size, (uint)type, relativeOffset); } /// @@ -986,9 +993,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayAttributeDoubleFormat(GlHandle vertexArray, uint attributeIndex, int size, uint type, uint relativeOffset) + public void VertexArrayAttributeDoubleFormat(GlHandle vertexArray, uint attributeIndex, int size, VertexAttributeLType type, uint relativeOffset) { - __context->glVertexArrayAttribLFormat(vertexArray.Value, attributeIndex, size, type, relativeOffset); + __context->glVertexArrayAttribLFormat(vertexArray.Value, attributeIndex, size, (uint)type, relativeOffset); } /// @@ -1008,9 +1015,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexArrayiv(GlHandle vertexArray, uint pName, int* param) + public void GetVertexArrayiv(GlHandle vertexArray, VertexArrayPName pName, int* param) { - __context->glGetVertexArrayiv(vertexArray.Value, pName, param); + __context->glGetVertexArrayiv(vertexArray.Value, (uint)pName, param); } /// @@ -1019,9 +1026,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexArrayIndexediv(GlHandle vertexArray, uint index, uint pName, int* param) + public void GetVertexArrayIndexediv(GlHandle vertexArray, uint index, VertexArrayPName pName, int* param) { - __context->glGetVertexArrayIndexediv(vertexArray.Value, index, pName, param); + __context->glGetVertexArrayIndexediv(vertexArray.Value, index, (uint)pName, param); } /// @@ -1030,9 +1037,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexArrayIndexed64iv(GlHandle vertexArray, uint index, uint pName, long* param) + public void GetVertexArrayIndexed64iv(GlHandle vertexArray, uint index, VertexArrayPName pName, long* param) { - __context->glGetVertexArrayIndexed64iv(vertexArray.Value, index, pName, param); + __context->glGetVertexArrayIndexed64iv(vertexArray.Value, index, (uint)pName, param); } /// @@ -1069,11 +1076,11 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateQueries(uint target, Span ids) + public void CreateQueries(QueryTarget target, Span ids) { fixed (GlHandle* __ids = ids) { - __context->glCreateQueries(target, ids.Length, (uint*)__ids); + __context->glCreateQueries((uint)target, ids.Length, (uint*)__ids); } } @@ -1083,9 +1090,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryBufferObjecti64v(GlHandle id, GlHandle buffer, uint pName, nint offset) + public void GetQueryBufferObjecti64v(GlHandle id, GlHandle buffer, QueryObjectParameterName pName, nint offset) { - __context->glGetQueryBufferObjecti64v(id.Value, buffer.Value, pName, offset); + __context->glGetQueryBufferObjecti64v(id.Value, buffer.Value, (uint)pName, offset); } /// @@ -1094,9 +1101,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryBufferObjectiv(GlHandle id, GlHandle buffer, uint pName, nint offset) + public void GetQueryBufferObjectiv(GlHandle id, GlHandle buffer, QueryObjectParameterName pName, nint offset) { - __context->glGetQueryBufferObjectiv(id.Value, buffer.Value, pName, offset); + __context->glGetQueryBufferObjectiv(id.Value, buffer.Value, (uint)pName, offset); } /// @@ -1105,9 +1112,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryBufferObjectui64v(GlHandle id, GlHandle buffer, uint pName, nint offset) + public void GetQueryBufferObjectui64v(GlHandle id, GlHandle buffer, QueryObjectParameterName pName, nint offset) { - __context->glGetQueryBufferObjectui64v(id.Value, buffer.Value, pName, offset); + __context->glGetQueryBufferObjectui64v(id.Value, buffer.Value, (uint)pName, offset); } /// @@ -1116,9 +1123,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryBufferObjectuiv(GlHandle id, GlHandle buffer, uint pName, nint offset) + public void GetQueryBufferObjectuiv(GlHandle id, GlHandle buffer, QueryObjectParameterName pName, nint offset) { - __context->glGetQueryBufferObjectuiv(id.Value, buffer.Value, pName, offset); + __context->glGetQueryBufferObjectuiv(id.Value, buffer.Value, (uint)pName, offset); } /// @@ -1127,9 +1134,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MemoryBarrierByRegion(uint barriers) + public void MemoryBarrierByRegion(MemoryBarrierMask barriers) { - __context->glMemoryBarrierByRegion(barriers); + __context->glMemoryBarrierByRegion((uint)barriers); } /// @@ -1138,9 +1145,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureSubImage(GlHandle texture, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, uint format, uint type, int bufSize, void* pixels) + public void GetTextureSubImage(GlHandle texture, int level, int xOffset, int yOffset, int zOffset, int width, int height, int depth, PixelFormat format, PixelType type, int bufSize, void* pixels) { - __context->glGetTextureSubImage(texture.Value, level, xOffset, yOffset, zOffset, width, height, depth, format, type, bufSize, pixels); + __context->glGetTextureSubImage(texture.Value, level, xOffset, yOffset, zOffset, width, height, depth, (uint)format, (uint)type, bufSize, pixels); } /// @@ -1160,9 +1167,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint GetGraphicsResetStatus() + public GraphicsResetStatus GetGraphicsResetStatus() { - return __context->glGetGraphicsResetStatus(); + return (GraphicsResetStatus)__context->glGetGraphicsResetStatus(); } /// @@ -1171,9 +1178,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetnCompressedTexImage(uint target, int lod, int bufSize, void* pixels) + public void GetnCompressedTexImage(TextureTarget target, int lod, int bufSize, void* pixels) { - __context->glGetnCompressedTexImage(target, lod, bufSize, pixels); + __context->glGetnCompressedTexImage((uint)target, lod, bufSize, pixels); } /// @@ -1182,9 +1189,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetnTexImage(uint target, int level, uint format, uint type, int bufSize, void* pixels) + public void GetnTexImage(TextureTarget target, int level, PixelFormat format, PixelType type, int bufSize, void* pixels) { - __context->glGetnTexImage(target, level, format, type, bufSize, pixels); + __context->glGetnTexImage((uint)target, level, (uint)format, (uint)type, bufSize, pixels); } /// @@ -1237,9 +1244,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReadnPixels(int x, int y, int width, int height, uint format, uint type, int bufSize, void* data) + public void ReadnPixels(int x, int y, int width, int height, PixelFormat format, PixelType type, int bufSize, void* data) { - __context->glReadnPixels(x, y, width, height, format, type, bufSize, data); + __context->glReadnPixels(x, y, width, height, (uint)format, (uint)type, bufSize, data); } /// diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_6.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_6.g.cs index dc06a560..acbf64de 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_6.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenGLFunction.v4_6.g.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------------- +// file="OpenGLFunction.v4_6" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL 4.6 core-profile forwarding methods. @@ -30,9 +37,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawArraysIndirectCount(uint mode, void* indirect, nint drawcount, int maxdrawcount, int stride) + public void MultiDrawArraysIndirectCount(PrimitiveType mode, void* indirect, nint drawcount, int maxdrawcount, int stride) { - __context->glMultiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride); + __context->glMultiDrawArraysIndirectCount((uint)mode, indirect, drawcount, maxdrawcount, stride); } /// @@ -41,9 +48,9 @@ namespace StgSharp.Graphics.OpenGL /// See docs.gl. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawElementsIndirectCount(uint mode, uint type, void* indirect, nint drawcount, int maxdrawcount, int stride) + public void MultiDrawElementsIndirectCount(PrimitiveType mode, DrawElementsType type, void* indirect, nint drawcount, int maxdrawcount, int stride) { - __context->glMultiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, stride); + __context->glMultiDrawElementsIndirectCount((uint)mode, (uint)type, indirect, drawcount, maxdrawcount, stride); } /// diff --git a/src/StgSharp.Graphics/OpenGL/Generated/OpenglContext.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/OpenglContext.g.cs index 6bc90278..42d949fd 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/OpenglContext.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/OpenglContext.g.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------------- +// file="OpenglContext" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL core function pointer table. diff --git a/src/StgSharp.Graphics/OpenGL/Generated/glContextShadow.g.cs b/src/StgSharp.Graphics/OpenGL/Generated/glContextShadow.g.cs index 098da3e1..7629bee9 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/glContextShadow.g.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/glContextShadow.g.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------------- +// file="glContextShadow" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Native-address shadow of the OpenGL function pointer table. diff --git a/src/StgSharp.Graphics/OpenGL/Generated/glconst.cs b/src/StgSharp.Graphics/OpenGL/Generated/glconst.cs index c6b1e300..3493daa6 100644 --- a/src/StgSharp.Graphics/OpenGL/Generated/glconst.cs +++ b/src/StgSharp.Graphics/OpenGL/Generated/glconst.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------------- +// file="glconst" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + // // Generated by StgSharp.GenerateGL. // Desktop OpenGL constants. diff --git a/src/StgSharp.Graphics/OpenGL/ShaderEdit/Shader.cs b/src/StgSharp.Graphics/OpenGL/Shader.cs similarity index 61% rename from src/StgSharp.Graphics/OpenGL/ShaderEdit/Shader.cs rename to src/StgSharp.Graphics/OpenGL/Shader.cs index 715ef378..ea36280f 100644 --- a/src/StgSharp.Graphics/OpenGL/ShaderEdit/Shader.cs +++ b/src/StgSharp.Graphics/OpenGL/Shader.cs @@ -12,27 +12,30 @@ namespace StgSharp.Graphics.OpenGL /// /// A set of OpenGL shader handles with their common stage type. /// - public sealed record Shader + public sealed class Shader { + private readonly GlHandle[] _handles; + public Shader( - GlHandle[] handles, + ReadOnlySpan handles, ShaderType type ) { - ArgumentNullException.ThrowIfNull(handles); - Handles = handles; + _handles = handles.ToArray(); Type = type; } - public int Count => Handles.Length; + public GlHandle this[ + int index + ] => _handles[index]; - public GlHandle[] Handles { get; } + public int Count => _handles.Length; + + public ReadOnlySpan Handles => _handles; public ShaderType Type { get; } - public GlHandle this[int index] => Handles[index]; - } public enum ShaderStatus : int @@ -45,5 +48,7 @@ namespace StgSharp.Graphics.OpenGL /// /// An OpenGL shader-program handle. /// - public readonly record struct ShaderProgram(GlHandle Handle); + public readonly record struct ShaderProgram( + GlHandle Handle + ); } diff --git a/src/StgSharp.Graphics/OpenGL/ShaderEdit/Uniform.cs b/src/StgSharp.Graphics/OpenGL/ShaderEdit/Uniform.cs deleted file mode 100644 index 93218315..00000000 --- a/src/StgSharp.Graphics/OpenGL/ShaderEdit/Uniform.cs +++ /dev/null @@ -1,68 +0,0 @@ -// ----------------------------------------------------------------------------- -// file="Uniform" -// Project: StgSharp -// Copyright (c) Nitload. -// SPDX-License-Identifier: MIT -// ----------------------------------------------------------------------------- - -namespace StgSharp.Graphics.OpenGL -{ - public abstract class Uniform - { - - internal readonly GlHandle id; - - protected Uniform( - GlHandle handle - ) - { - id = handle; - } - - public GlHandle Handle => id; - - } - - public sealed class Uniform : Uniform where T : unmanaged - { - - public Uniform( - GlHandle handle - ) - : base(handle) { } - - } - - public sealed class Uniform : Uniform where T : unmanaged where U : struct - { - - public Uniform( - GlHandle handle - ) - : base(handle) { } - - } - - public sealed class Uniform : Uniform where T : unmanaged where U : struct - where V : struct - { - - public Uniform( - GlHandle handle - ) - : base(handle) { } - - } - - public sealed class Uniform : Uniform where T : unmanaged where U : struct - where V : struct - where W : struct - { - - public Uniform( - GlHandle handle - ) - : base(handle) { } - - } -} diff --git a/src/StgSharp.Graphics/OpenGL/glApiManager.cs b/src/StgSharp.Graphics/OpenGL/glApiManager.cs index f3c3a3ab..69840f58 100644 --- a/src/StgSharp.Graphics/OpenGL/glApiManager.cs +++ b/src/StgSharp.Graphics/OpenGL/glApiManager.cs @@ -57,13 +57,13 @@ namespace StgSharp.Graphics.OpenGL return; } - delegate*, IntPtr> loader = &GraphicFramework.glfwGetProcAddress; + delegate* , IntPtr> loader = &GraphicFramework.glfwGetProcAddress; IntPtr getString = GraphicFramework.glfwGetProcAddress("glGetString"u8); if (getString == IntPtr.Zero) { throw new NotSupportedException("Cannot load glGetString from the current context."); } - context->glGetString = (delegate*)getString; + context->glGetString = (delegate* unmanaged[Cdecl])getString; byte* versionPointer = context->glGetString(GlVersion); if (versionPointer == null) { throw new NotSupportedException("The current context did not report an OpenGL version."); diff --git a/src/StgSharp.Graphics/OpenGL/glEnum.cs b/src/StgSharp.Graphics/OpenGL/glEnum.cs deleted file mode 100644 index 342b93f2..00000000 --- a/src/StgSharp.Graphics/OpenGL/glEnum.cs +++ /dev/null @@ -1,204 +0,0 @@ -// ----------------------------------------------------------------------------- -// file="glEnum" -// Project: StgSharp -// Copyright (c) Nitload. -// SPDX-License-Identifier: MIT -// ----------------------------------------------------------------------------- - -using System.Runtime.CompilerServices; - -namespace StgSharp.Graphics.OpenGL -{ - public enum PixelChannelLayout - { - - UByte = glConst.UNSIGNED_BYTE, - Byte = glConst.BYTE, - UShort = glConst.UNSIGNED_SHORT, - Short = glConst.SHORT, - UInt = glConst.UNSIGNED_INT, - Int = glConst.INT, - Float = glConst.FLOAT, - UByte332 = glConst.UNSIGNED_BYTE_3_3_2, - UByte233Rev = glConst.UNSIGNED_BYTE_2_3_3_REV, - UShort565 = glConst.UNSIGNED_SHORT_5_6_5, - UShort565Rev = glConst.UNSIGNED_SHORT_5_6_5_REV, - UShort4444 = glConst.UNSIGNED_SHORT_4_4_4_4, - UShort4444Rev = glConst.UNSIGNED_SHORT_4_4_4_4_REV, - UShort5551 = glConst.UNSIGNED_SHORT_5_5_5_1, - UShort1555Rev = glConst.UNSIGNED_SHORT_1_5_5_5_REV, - UInt8888 = glConst.UNSIGNED_INT_8_8_8_8, - UInt8888Rev = glConst.UNSIGNED_INT_8_8_8_8_REV, - UInt1010102 = glConst.UNSIGNED_INT_10_10_10_2, - UInt2101010Rev = glConst.UNSIGNED_INT_2_10_10_10_REV - - } - - public enum FaceMode - { - - Point = glConst.POINT, - Line = glConst.LINE, - Fill = glConst.FILL - - } - - public enum FrameBufferStatus - { - - Complete = glConst.FRAMEBUFFER_COMPLETE, // GL_FRAMEBUFFER_COMPLETE - IncompleteAttachment = glConst.FRAMEBUFFER_INCOMPLETE_ATTACHMENT, // GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT - IncompleteMissingAttachment = glConst.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT, // GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT - IncompleteDrawBuffer = glConst.FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER, // GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER - IncompleteReadBuffer = glConst.FRAMEBUFFER_INCOMPLETE_READ_BUFFER, // GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER - Unsupported = glConst.FRAMEBUFFER_UNSUPPORTED, // GL_FRAMEBUFFER_UNSUPPORTED - IncompleteMultiSample = glConst.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE, // GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE - IncompleteLayerTargets = glConst.FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS // GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS - - } - - public enum FrameBufferChannel - { - - STENCIL_INDEX = glConst.STENCIL_INDEX, - DEPTH_COMPONENT = glConst.DEPTH_COMPONENT, - DEPTH_STENCIL = glConst.DEPTH_STENCIL, - RED = glConst.RED, - GREEN = glConst.GREEN, - BLUE = glConst.BLUE, - RGB = glConst.RGB, - BGR = glConst.BGR, - RGBA = glConst.RGBA, - BGRA = glConst.BGRA - - } - - public enum FrameBufferAttachment - { - - Color = glConst.COLOR_ATTACHMENT0, - Depth = glConst.DEPTH_ATTACHMENT, - Stencil = glConst.STENCIL_ATTACHMENT, - DepthAndStencil = glConst.DEPTH_STENCIL_ATTACHMENT, - - } - - public enum Texture2DTarget - { - - Texture2D = glConst.TEXTURE_2D, - ProxyTexture2D = glConst.PROXY_TEXTURE_2D, - Texture1DArray = glConst.TEXTURE_1D_ARRAY, - ProxyTexture1DArray = glConst.PROXY_TEXTURE_1D_ARRAY, - TextureRectangle = glConst.TEXTURE_RECTANGLE, - ProxyTextureRectangle = glConst.PROXY_TEXTURE_RECTANGLE, - TextureCubeMapPositiveX = glConst.TEXTURE_CUBE_MAP_POSITIVE_X, - TextureCubeMapNegativeX = glConst.TEXTURE_CUBE_MAP_NEGATIVE_X, - TextureCubeMapPositiveY = glConst.TEXTURE_CUBE_MAP_POSITIVE_Y, - TextureCubeMapNegativeY = glConst.TEXTURE_CUBE_MAP_NEGATIVE_Y, - TextureCubeMapPositiveZ = glConst.TEXTURE_CUBE_MAP_POSITIVE_Z, - TextureCubeMapNegativeZ = glConst.TEXTURE_CUBE_MAP_NEGATIVE_Z, - ProxyTextureCubeMap = glConst.PROXY_TEXTURE_CUBE_MAP - - } - - public enum RenderBufferInternalFormat : uint - { - - RGBA8 = glConst.RGBA8, - Depth24_Stencil8 = glConst.DEPTH24_STENCIL8, - - } - - public enum glOperation : uint - { - - StencilTest = glConst.STENCIL_TEST, - DepthTest = glConst.DEPTH_TEST, - PolygonOffsetFill = glConst.POLYGON_OFFSET_FILL, - PolygonOffsetLine = glConst.POLYGON_OFFSET_LINE, - PolygonOffsetPoint = glConst.POLYGON_OFFSET_POINT, - - } - - #pragma warning disable CA1008 - public enum ShaderType : int - #pragma warning restore CA1008 - { - - Fragment = glConst.FRAGMENT_SHADER, - Vertex = glConst.VERTEX_SHADER, - Compute = glConst.COMPUTE_SHADER, - Geometry = glConst.GEOMETRY_SHADER, - - } - - #pragma warning disable CA1008 - public enum BufferType : int - #pragma warning restore CA1008 - { - - ArrayBuffer = glConst.ARRAY_BUFFER, - ElementArrayBuffer = glConst.ELEMENT_ARRAY_BUFFER, - AtomicCounterBuffer = glConst.ATOMIC_COUNTER_BUFFER, - CopyHeadBuffer = glConst.COPY_READ_BUFFER, - COPY_WRITE_BUFFER = glConst.COPY_WRITE_BUFFER, - DISPATCH_INDIRECT_BUFFER = glConst.DISPATCH_INDIRECT_BUFFER, - DRAW_INDIRECT_BUFFER = glConst.DRAW_INDIRECT_BUFFER, - PIXEL_PACK_BUFFER = glConst.PIXEL_PACK_BUFFER, - PIXEL_UNPACK_BUFFER = glConst.PIXEL_UNPACK_BUFFER, - QUERY_BUFFER = glConst.QUERY_BUFFER, - ShaderStorageBuffer = glConst.SHADER_STORAGE_BUFFER, - TEXTURE_BUFFER = glConst.TEXTURE_BUFFER, - TRANSFORM_FEEDBACK_BUFFER = glConst.TRANSFORM_FEEDBACK_BUFFER, - UNIFORM_BUFFER = glConst.UNIFORM_BUFFER, - - } - - #pragma warning disable CA1008 - public enum BufferUsage : int - #pragma warning restore CA1008 - { - - StreamDraw = 0x88E0, - StreamRead = 0x88E1, - StreamCopy = 0x88E2, - StaticDraw = 0x88E4, - StaticRead = 0x88E5, - StaticCopy = 0x88E6, - DynamicDraw = 0x88E8, - DynamicRead = 0x88E9, - DynamicCopy = 0x88EA - - } - - public enum MaskBufferBit - { - - COLOR = glConst.COLOR_BUFFER_BIT, - DEPTH = glConst.DEPTH_BUFFER_BIT, - STENCIL = glConst.STENCIL_BUFFER_BIT, - - } - - public enum GeometryType : uint - { - - POINTS = 0x0000, - LINES = 0x0001, - LINE_LOOP = 0x0002, - LINE_STRIP = 0x0003, - TRIANGLES = 0x0004, - TRIANGLE_STRIP = 0x0005, - TRIANGLE_FAN = 0x0006 - - } - - public enum TextureFiltering - { - - Nearest = 0x2600, - Linear = 0x2601 - - } -} diff --git a/src/StgSharp.Graphics/OpenGL/glHandle.cs b/src/StgSharp.Graphics/OpenGL/glHandle.cs index 70be7b38..dd77e32e 100644 --- a/src/StgSharp.Graphics/OpenGL/glHandle.cs +++ b/src/StgSharp.Graphics/OpenGL/glHandle.cs @@ -23,13 +23,11 @@ namespace StgSharp.Graphics.OpenGL public struct GlHandle { - [FieldOffset(0)] internal int SignedValue; [FieldOffset(0)] internal uint Value; public GlHandle() { Unsafe.SkipInit(out Value); - Unsafe.SkipInit(out SignedValue); Unsafe.SkipInit(out this); } @@ -49,16 +47,5 @@ namespace StgSharp.Graphics.OpenGL }; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static GlHandle CreateSigned( - int value - ) - { - return new GlHandle - { - SignedValue = value - }; - } - } -} \ No newline at end of file +} diff --git a/src/StgSharp.Graphics/PlainGeometryMesh.cs b/src/StgSharp.Graphics/PlainGeometryMesh.cs index 889d8c89..1fcfebbb 100644 --- a/src/StgSharp.Graphics/PlainGeometryMesh.cs +++ b/src/StgSharp.Graphics/PlainGeometryMesh.cs @@ -8,35 +8,17 @@ using StgSharp.Geometries; using StgSharp.Mathematics; using StgSharp.Mathematics.Numeric.Graphics; -using StgSharp.Mathematics.Numeric.Graphics; using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; namespace StgSharp.Graphics { public class PlainGeometryMesh { - private PlainGeometry _shape; - private TextureProvider _texture; - - public PlainGeometryMesh( - [NotNull] PlainGeometry shape, - [NotNull] TextureProvider texture - ) - { - if (shape.VertexCount > texture.TextureCoordinate.Length) { - throw new ArgumentException( - paramName:nameof(texture), - message:"Amount of texture coordination is too less"); - } - _texture = texture; - _shape = shape; - } + private readonly PlainGeometry _shape; + private readonly Vec2[] _textureCoordinates; + private readonly Image _textureImage; public PlainGeometryMesh( PlainGeometry shape, @@ -45,6 +27,7 @@ namespace StgSharp.Graphics ) { ArgumentNullException.ThrowIfNull(shape); + ArgumentNullException.ThrowIfNull(texture); ArgumentNullException.ThrowIfNull(texCoord); if (shape.VertexCount > texCoord.Length) { @@ -52,27 +35,25 @@ namespace StgSharp.Graphics paramName:nameof(texCoord), message:"Amount of texture coordination is too less"); } - _texture = new TextureProvider(texture, texCoord); + _shape = shape; + _textureImage = texture; + _textureCoordinates = texCoord; } public Vec4[] VertexArray => _shape.VertexStream; - public Image TextureImage - { - get => _texture.Image; - internal set => _texture.Image = value; - } + public Image TextureImage => _textureImage; public ReadOnlySpan MeshIndices => _shape.VertexIndices; public ReadOnlySpan TextureCoord => MemoryMarshal.Cast( - _texture.TextureCoordinate); + _textureCoordinates); public PlainGeometryMesh Resize( PlainGeometry newShape ) { - return new PlainGeometryMesh(newShape, _texture); + return new PlainGeometryMesh(newShape, _textureImage, _textureCoordinates); } } diff --git a/src/StgSharp.Graphics/RenderStream.cs b/src/StgSharp.Graphics/RenderStream.cs index 16fa7a2c..55942a8d 100644 --- a/src/StgSharp.Graphics/RenderStream.cs +++ b/src/StgSharp.Graphics/RenderStream.cs @@ -27,7 +27,7 @@ namespace StgSharp.Graphics private Camera nativeCamera; - private protected ViewPort primeArgs; + private protected ViewSurface primeArgs; internal TimeSpanProvider _timeProvider; public (int width, int height) Size => (Width, Height); @@ -46,7 +46,7 @@ namespace StgSharp.Graphics public string Name => primeArgs.Name; - public ViewPort BindedViewPortContext + public ViewSurface BindedViewPortContext { get => primeArgs; internal set => primeArgs = value; @@ -138,7 +138,7 @@ namespace StgSharp.Graphics #region internal operation public void Initialize( - ViewPort v, + ViewSurface v, TimeSpanProvider timeProvider ) { diff --git a/src/StgSharp.Graphics/TextureProvider.cs b/src/StgSharp.Graphics/TextureProvider.cs deleted file mode 100644 index 11d87eb4..00000000 --- a/src/StgSharp.Graphics/TextureProvider.cs +++ /dev/null @@ -1,53 +0,0 @@ -// ----------------------------------------------------------------------------- -// file="TextureProvider" -// Project: StgSharp -// Copyright (c) Nitload. -// SPDX-License-Identifier: MIT -// ----------------------------------------------------------------------------- - -using StgSharp.Mathematics.Numeric.Graphics; -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Graphics -{ - public class TextureProvider - { - - private Vec2[] _texCoord; - private Image _image; - - public TextureProvider( - Image image, - Vec2[] coord - ) - { - ArgumentNullException.ThrowIfNull(image); - ArgumentNullException.ThrowIfNull(coord); - - _image = image; - _texCoord = coord; - } - - public ref Vec2 this[ - int index - ] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => ref _texCoord[index]; - } - - public Image Image - { - get => _image; - set - { - ArgumentNullException.ThrowIfNull(value); - _image = value; - } - } - - public Span TextureCoordinate => new Span(_texCoord); - - } -} diff --git a/src/StgSharp.Graphics/ViewPort.cs b/src/StgSharp.Graphics/ViewSurface.cs similarity index 94% rename from src/StgSharp.Graphics/ViewPort.cs rename to src/StgSharp.Graphics/ViewSurface.cs index 598396de..ef3fec01 100644 --- a/src/StgSharp.Graphics/ViewPort.cs +++ b/src/StgSharp.Graphics/ViewSurface.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------------- -// file="ViewPort" +// file="ViewSurface" // Project: StgSharp // Copyright (c) Nitload. // SPDX-License-Identifier: MIT @@ -15,13 +15,13 @@ using System.Threading; namespace StgSharp.Graphics { - public class ViewPort + public class ViewSurface { - private static readonly ConcurrentDictionary _handleToViewPortIndex = []; + private static readonly ConcurrentDictionary _handleToViewPortIndex = []; private int _width, _height, _newWidth, _newHeight; - internal unsafe ViewPort() + internal unsafe ViewSurface() { _newHeight = 600; _newWidth = 800; @@ -38,7 +38,7 @@ namespace StgSharp.Graphics _ = _handleToViewPortIndex.TryAdd(ViewPortHandle, this); } - public unsafe ViewPort( + public unsafe ViewSurface( int width, int height, string name, @@ -87,7 +87,7 @@ namespace StgSharp.Graphics [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool GetExistedViewPort( IntPtr handle, - out ViewPort port + out ViewSurface port ) { return _handleToViewPortIndex.TryGetValue(handle, out port); diff --git a/src/StgSharp.Graphics/frameworkSyncContext.cs b/src/StgSharp.Graphics/frameworkSyncContext.cs deleted file mode 100644 index d838be67..00000000 --- a/src/StgSharp.Graphics/frameworkSyncContext.cs +++ /dev/null @@ -1,60 +0,0 @@ -// ----------------------------------------------------------------------------- -// file="frameworkSyncContext" -// Project: StgSharp -// Copyright (c) Nitload. -// SPDX-License-Identifier: MIT -// ----------------------------------------------------------------------------- - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace StgSharp.Threading -{ - public class FrameworkSyncContext : SynchronizationContext - { - - private readonly BlockingCollection _syncContexts = []; - private readonly Thread _mainThread = Thread.CurrentThread; - - public FrameworkSyncContext() - { - _mainThread = Thread.CurrentThread; - } - - public static FrameworkSyncContext MainThreadContext - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get; - } = new FrameworkSyncContext(); - - public override void Post( - SendOrPostCallback d, - object state - ) - { - _syncContexts.Add(d); - } - - public override void Send( - SendOrPostCallback d, - object state - ) - { - if (Thread.CurrentThread == _mainThread) - { - d(state); - } else - { - Post(d, state); - } - } - - } -} diff --git a/src/StgSharp.Mathematics/Geometries/GeometryOperation/GeometryOperation.cs b/src/StgSharp.Mathematics/Geometries/GeometryOperation/GeometryOperation.cs index 28ac605b..449bdda2 100644 --- a/src/StgSharp.Mathematics/Geometries/GeometryOperation/GeometryOperation.cs +++ b/src/StgSharp.Mathematics/Geometries/GeometryOperation/GeometryOperation.cs @@ -14,9 +14,9 @@ using System.Runtime.InteropServices; namespace StgSharp.Geometries { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate Vec3 GeometryMotionDelegate( - TimeSpanProvider timeSource, - out float rotation + public delegate Vec3 GeometryMotionDelegate( + TimeSpanProvider timeSource, + out float rotation ); public class GeometryMotion @@ -38,7 +38,7 @@ namespace StgSharp.Geometries time = timeSource; if (motionDelegate == null) { - handle = (IntPtr)(delegate*)&defaultMotion; + handle = (IntPtr)(delegate*>)&defaultMotion; movement = defaultMotion; } else if (motionDelegate.Method.IsStatic) { @@ -58,15 +58,15 @@ namespace StgSharp.Geometries public static GeometryMotion DefaultMotion => new GeometryMotion(true, null, null); public unsafe void RunMotion( - ref Vec3 coord, + ref Vec3 coord, ref float rotation ) { float rot; - Vec3 vec; + Vec3 vec; if (sourceIsStatic) { - vec = ((delegate* unmanaged[Cdecl])handle)( + vec = ((delegate* unmanaged[Cdecl]>)handle)( time, out rot); } else { @@ -84,13 +84,13 @@ namespace StgSharp.Geometries } } - private static Vec3 defaultMotion( - TimeSpanProvider provider, - out float rotation + private static Vec3 defaultMotion( + TimeSpanProvider provider, + out float rotation ) { rotation = 0; - return Vec3.Zero; + return Vec3.Zero; } }//------------------------------- End of Class ------------------------------- diff --git a/src/StgSharp.Mathematics/Geometries/IInstancing.cs b/src/StgSharp.Mathematics/Geometries/IInstancing.cs index 55ca288f..8772f3ec 100644 --- a/src/StgSharp.Mathematics/Geometries/IInstancing.cs +++ b/src/StgSharp.Mathematics/Geometries/IInstancing.cs @@ -21,14 +21,14 @@ namespace StgSharp.Geometries public interface IInstancing { - public float Rotation { get => GlobalBuffer.CoordAndRotationList[BufferId].W; set - { - Vec4 temp = GlobalBuffer.CoordAndRotationList[ - BufferId]; - temp.W = value; - GlobalBuffer.CoordAndRotationList[ - BufferId] = temp; - } } + public float Rotation // + { get => GlobalBuffer.CoordAndRotationList[BufferId].W; // + set + { + Vec4 temp = GlobalBuffer.CoordAndRotationList[BufferId]; + temp.W = value; + GlobalBuffer.CoordAndRotationList[BufferId] = temp; + } } public float Scale { get => GlobalBuffer.ScalingList[BufferId]; set => GlobalBuffer.ScalingList[BufferId] = value; } @@ -39,14 +39,14 @@ namespace StgSharp.Geometries public int BufferId { get; internal set; } - public Vec3 CenterPositionGlobal { get; internal set; } + public Vec3 CenterPositionGlobal { get; internal set; } - public Vec3 Coord { get => GlobalBuffer.CoordAndRotationList[BufferId].XYZ; set => GlobalBuffer.CoordAndRotationList[BufferId] = - new Vec4(value.reg); } + public Vec3 Coord { get => GlobalBuffer.CoordAndRotationList[BufferId].XYZ; set => GlobalBuffer.CoordAndRotationList[BufferId] = + new Vec4(value.reg); } public void Move() { - (Vec3 coord, float rotation) = (Coord, Rotation); + (Vec3 coord, float rotation) = (Coord, Rotation); Motion.RunMotion(ref coord, ref rotation); (Coord, Rotation) = (coord, rotation); } diff --git a/src/StgSharp.Mathematics/Geometries/IInstancingBuffer.cs b/src/StgSharp.Mathematics/Geometries/IInstancingBuffer.cs index 2db0d9f1..91d4d1de 100644 --- a/src/StgSharp.Mathematics/Geometries/IInstancingBuffer.cs +++ b/src/StgSharp.Mathematics/Geometries/IInstancingBuffer.cs @@ -17,7 +17,7 @@ namespace StgSharp.Geometries public interface IInstancingBuffer { - public Span CoordAndRotationSpan { get; } + public Span> CoordAndRotationSpan { get; } public Span ScalingSpan { get; } @@ -25,7 +25,7 @@ namespace StgSharp.Geometries internal List InstanceList { get; } - internal List CoordAndRotationList { get; } + internal List> CoordAndRotationList { get; } internal List ScalingList { get; } diff --git a/src/StgSharp.Mathematics/Numeric/Graphics/GraphicsMatrix.cs b/src/StgSharp.Mathematics/Numeric/Graphics/GraphicsMatrix.cs index ebc5f901..3fe27eb2 100644 --- a/src/StgSharp.Mathematics/Numeric/Graphics/GraphicsMatrix.cs +++ b/src/StgSharp.Mathematics/Numeric/Graphics/GraphicsMatrix.cs @@ -252,7 +252,7 @@ namespace StgSharp.Mathematics.Numeric.Graphics internal struct Column { - private Vec4 value; + private Vec4 value; } diff --git a/src/StgSharp.Mathematics/Numeric/Graphics/Vec4_T.cs b/src/StgSharp.Mathematics/Numeric/Graphics/Vec4_T.cs index 616958f9..3b07ac6a 100644 --- a/src/StgSharp.Mathematics/Numeric/Graphics/Vec4_T.cs +++ b/src/StgSharp.Mathematics/Numeric/Graphics/Vec4_T.cs @@ -17,15 +17,19 @@ namespace StgSharp.Mathematics.Numeric.Graphics /// A four-dimensional numeric vector. /// [StructLayout(LayoutKind.Sequential, Pack = 16)] - public struct Vec4 : IUnmanagedVector> where T: unmanaged, INumber + public struct Vec4 : IUnmanagedVector> where T : unmanaged, INumber { + public T W; + public T X; public T Y; public T Z; - public T W; - public Vec4(Vec3 v3, T w) + public Vec4( + Vec3 v3, + T w + ) { X = v3.X; Y = v3.Y; @@ -33,7 +37,12 @@ namespace StgSharp.Mathematics.Numeric.Graphics W = w; } - public Vec4(T x, T y, T z, T w) + public Vec4( + T x, + T y, + T z, + T w + ) { X = x; Y = y; @@ -43,7 +52,7 @@ namespace StgSharp.Mathematics.Numeric.Graphics public Vec2 XY { - readonly get => new(X, Y); + get => Unsafe.As>(ref X); set { X = value.X; @@ -53,7 +62,7 @@ namespace StgSharp.Mathematics.Numeric.Graphics public Vec3 XYZ { - readonly get => new(X, Y, Z); + get => Unsafe.As>(ref X); set { T w = W; @@ -67,13 +76,23 @@ namespace StgSharp.Mathematics.Numeric.Graphics public static Vec4 Zero => new(T.Zero, T.Zero, T.Zero, T.Zero); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 Add(Vec4 left, Vec4 right) + public static Vec4 Add( + Vec4 left, + Vec4 right + ) { return left + right; } + public ReadOnlySpan AsSpan() + { + return MemoryMarshal.CreateReadOnlySpan(ref X, 4); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly T Dot(Vec4 right) + public readonly T Dot( + Vec4 right + ) { if (Unsafe.SizeOf() == 4) { @@ -88,17 +107,16 @@ namespace StgSharp.Mathematics.Numeric.Graphics throw GraphicVector.ThrowUnsupportedTypeException(); } - public ReadOnlySpan AsSpan() - { - return MemoryMarshal.CreateReadOnlySpan(ref X, 4); - } - - public override bool Equals(object? obj) + public override bool Equals( + object? obj + ) { return (obj is Vec4 v) && (v == this); } - public static Vec4 FromSpan(ReadOnlySpan span) + public static Vec4 FromSpan( + ReadOnlySpan span + ) { if (span.Length < 4) { throw new ArgumentException("Span length must be at least 4.", nameof(span)); @@ -122,7 +140,10 @@ namespace StgSharp.Mathematics.Numeric.Graphics } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator -(Vec4 left, Vec4 right) + public static Vec4 operator -( + Vec4 left, + Vec4 right + ) { if (Unsafe.SizeOf() == 4) { return Vec4.FromVector128Unsafe(left.AsVector128Unsafe() - right.AsVector128Unsafe()); @@ -133,13 +154,19 @@ namespace StgSharp.Mathematics.Numeric.Graphics throw GraphicVector.ThrowUnsupportedTypeException(); } - public static bool operator !=(Vec4 left, Vec4 right) + public static bool operator !=( + Vec4 left, + Vec4 right + ) { return !(left == right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator *(Vec4 vector, T scalar) + public static Vec4 operator *( + Vec4 vector, + T scalar + ) { if (Unsafe.SizeOf() == 4) { return Vec4.FromVector128Unsafe(vector.AsVector128Unsafe() * Vector128.Create(scalar)); @@ -151,19 +178,28 @@ namespace StgSharp.Mathematics.Numeric.Graphics } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator *(T scalar, Vec4 vector) + public static Vec4 operator *( + T scalar, + Vec4 vector + ) { return vector * scalar; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T operator *(Vec4 left, Vec4 right) + public static T operator *( + Vec4 left, + Vec4 right + ) { return left.Dot(right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator /(Vec4 vector, T scalar) + public static Vec4 operator /( + Vec4 vector, + T scalar + ) { if (Unsafe.SizeOf() == 4) { return Vec4.FromVector128Unsafe(vector.AsVector128Unsafe() / Vector128.Create(scalar)); @@ -175,7 +211,10 @@ namespace StgSharp.Mathematics.Numeric.Graphics } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator +(Vec4 left, Vec4 right) + public static Vec4 operator +( + Vec4 left, + Vec4 right + ) { if (Unsafe.SizeOf() == 4) { return Vec4.FromVector128Unsafe(left.AsVector128Unsafe() + right.AsVector128Unsafe()); @@ -186,7 +225,10 @@ namespace StgSharp.Mathematics.Numeric.Graphics throw GraphicVector.ThrowUnsupportedTypeException(); } - public static bool operator ==(Vec4 left, Vec4 right) + public static bool operator ==( + Vec4 left, + Vec4 right + ) { if (Unsafe.SizeOf() == 4) { return left.AsVector128Unsafe() == right.AsVector128Unsafe(); diff --git a/src/StgSharp.Mathematics/Numeric/Graphics/Vector.GetLength.cs b/src/StgSharp.Mathematics/Numeric/Graphics/Vector.GetLength.cs index cae9f16b..55c6595d 100644 --- a/src/StgSharp.Mathematics/Numeric/Graphics/Vector.GetLength.cs +++ b/src/StgSharp.Mathematics/Numeric/Graphics/Vector.GetLength.cs @@ -5,13 +5,14 @@ // SPDX-License-Identifier: MIT // ----------------------------------------------------------------------------- -using StgSharp.Mathematics.Numeric.Graphics; +using System.Runtime.CompilerServices; namespace StgSharp.Mathematics.Numeric.Graphics { public static unsafe partial class Linear { + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T GetLength( this Vec3 vec ) where T : unmanaged, INumber, IRootFunctions @@ -19,6 +20,7 @@ namespace StgSharp.Mathematics.Numeric.Graphics return T.Sqrt(vec.Dot(vec)); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T GetLength( this Vec2 vec ) where T : unmanaged, INumber, IRootFunctions @@ -26,6 +28,7 @@ namespace StgSharp.Mathematics.Numeric.Graphics return T.Sqrt(vec.Dot(vec)); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T GetLength( this Vec4 vec ) where T : unmanaged, INumber, IRootFunctions @@ -33,29 +36,101 @@ namespace StgSharp.Mathematics.Numeric.Graphics return T.Sqrt(vec.Dot(vec)); } - public static float GetLength(this Vec2 vec) => Vec2.ConvertToSingle(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float GetLength( + this Vec2 vec + ) + { + return Vec2.ConvertToSingle(vec).GetLength(); + } - public static float GetLength(this Vec2 vec) => Vec2.ConvertToSingle(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float GetLength( + this Vec2 vec + ) + { + return Vec2.ConvertToSingle(vec).GetLength(); + } - public static double GetLength(this Vec2 vec) => Vec2.ConvertToDouble(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double GetLength( + this Vec2 vec + ) + { + return Vec2.ConvertToDouble(vec).GetLength(); + } - public static double GetLength(this Vec2 vec) => Vec2.ConvertToDouble(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double GetLength( + this Vec2 vec + ) + { + return Vec2.ConvertToDouble(vec).GetLength(); + } - public static float GetLength(this Vec3 vec) => Vec3.ConvertToSingle(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float GetLength( + this Vec3 vec + ) + { + return Vec3.ConvertToSingle(vec).GetLength(); + } - public static float GetLength(this Vec3 vec) => Vec3.ConvertToSingle(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float GetLength( + this Vec3 vec + ) + { + return Vec3.ConvertToSingle(vec).GetLength(); + } - public static double GetLength(this Vec3 vec) => Vec3.ConvertToDouble(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double GetLength( + this Vec3 vec + ) + { + return Vec3.ConvertToDouble(vec).GetLength(); + } - public static double GetLength(this Vec3 vec) => Vec3.ConvertToDouble(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double GetLength( + this Vec3 vec + ) + { + return Vec3.ConvertToDouble(vec).GetLength(); + } - public static float GetLength(this Vec4 vec) => Vec4.ConvertToSingle(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float GetLength( + this Vec4 vec + ) + { + return Vec4.ConvertToSingle(vec).GetLength(); + } - public static float GetLength(this Vec4 vec) => Vec4.ConvertToSingle(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float GetLength( + this Vec4 vec + ) + { + return Vec4.ConvertToSingle(vec).GetLength(); + } - public static double GetLength(this Vec4 vec) => Vec4.ConvertToDouble(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double GetLength( + this Vec4 vec + ) + { + return Vec4.ConvertToDouble(vec).GetLength(); + } - public static double GetLength(this Vec4 vec) => Vec4.ConvertToDouble(vec).GetLength(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double GetLength( + this Vec4 vec + ) + { + return Vec4.ConvertToDouble(vec).GetLength(); + } } } diff --git a/src/StgSharp.Mathematics/Numeric/Graphics/Vector.Normalize.cs b/src/StgSharp.Mathematics/Numeric/Graphics/Vector.Normalize.cs index 491efb72..85871b8f 100644 --- a/src/StgSharp.Mathematics/Numeric/Graphics/Vector.Normalize.cs +++ b/src/StgSharp.Mathematics/Numeric/Graphics/Vector.Normalize.cs @@ -14,46 +14,112 @@ namespace StgSharp.Mathematics.Numeric.Graphics { [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec2 Normalize(this Vec2 vec) where T: unmanaged, INumber, IRootFunctions + public static Vec2 Normalize( + this Vec2 vec + ) where T : unmanaged, INumber, IRootFunctions { return vec / T.Sqrt(vec.Dot(vec)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 Normalize(this Vec3 vec) where T: unmanaged, INumber, IRootFunctions + public static Vec3 Normalize( + this Vec3 vec + ) where T : unmanaged, INumber, IRootFunctions { return vec / T.Sqrt(vec.Dot(vec)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 Normalize(this Vec4 vec) where T: unmanaged, INumber, IRootFunctions + public static Vec4 Normalize( + this Vec4 vec + ) where T : unmanaged, INumber, IRootFunctions { return vec / T.Sqrt(vec.Dot(vec)); } - public static Vec2 Normalize(this Vec2 vec) => Vec2.ConvertToSingle(vec).Normalize(); + public static Vec2 Normalize( + this Vec2 vec + ) + { + return Vec2.ConvertToSingle(vec).Normalize(); + } - public static Vec2 Normalize(this Vec2 vec) => Vec2.ConvertToSingle(vec).Normalize(); + public static Vec2 Normalize( + this Vec2 vec + ) + { + return Vec2.ConvertToSingle(vec).Normalize(); + } - public static Vec2 Normalize(this Vec2 vec) => Vec2.ConvertToDouble(vec).Normalize(); + public static Vec2 Normalize( + this Vec2 vec + ) + { + return Vec2.ConvertToDouble(vec).Normalize(); + } - public static Vec2 Normalize(this Vec2 vec) => Vec2.ConvertToDouble(vec).Normalize(); + public static Vec2 Normalize( + this Vec2 vec + ) + { + return Vec2.ConvertToDouble(vec).Normalize(); + } - public static Vec3 Normalize(this Vec3 vec) => Vec3.ConvertToSingle(vec).Normalize(); + public static Vec3 Normalize( + this Vec3 vec + ) + { + return Vec3.ConvertToSingle(vec).Normalize(); + } - public static Vec3 Normalize(this Vec3 vec) => Vec3.ConvertToSingle(vec).Normalize(); + public static Vec3 Normalize( + this Vec3 vec + ) + { + return Vec3.ConvertToSingle(vec).Normalize(); + } - public static Vec3 Normalize(this Vec3 vec) => Vec3.ConvertToDouble(vec).Normalize(); + public static Vec3 Normalize( + this Vec3 vec + ) + { + return Vec3.ConvertToDouble(vec).Normalize(); + } - public static Vec3 Normalize(this Vec3 vec) => Vec3.ConvertToDouble(vec).Normalize(); + public static Vec3 Normalize( + this Vec3 vec + ) + { + return Vec3.ConvertToDouble(vec).Normalize(); + } - public static Vec4 Normalize(this Vec4 vec) => Vec4.ConvertToSingle(vec).Normalize(); + public static Vec4 Normalize( + this Vec4 vec + ) + { + return Vec4.ConvertToSingle(vec).Normalize(); + } - public static Vec4 Normalize(this Vec4 vec) => Vec4.ConvertToSingle(vec).Normalize(); + public static Vec4 Normalize( + this Vec4 vec + ) + { + return Vec4.ConvertToSingle(vec).Normalize(); + } - public static Vec4 Normalize(this Vec4 vec) => Vec4.ConvertToDouble(vec).Normalize(); + public static Vec4 Normalize( + this Vec4 vec + ) + { + return Vec4.ConvertToDouble(vec).Normalize(); + } - public static Vec4 Normalize(this Vec4 vec) => Vec4.ConvertToDouble(vec).Normalize(); + public static Vec4 Normalize( + this Vec4 vec + ) + { + return Vec4.ConvertToDouble(vec).Normalize(); + } } } diff --git a/src/StgSharp.Mathematics/Numeric/Graphics/Vector.Orthogonalize.cs b/src/StgSharp.Mathematics/Numeric/Graphics/Vector.Orthogonalize.cs index 6c0ed424..f315dbbe 100644 --- a/src/StgSharp.Mathematics/Numeric/Graphics/Vector.Orthogonalize.cs +++ b/src/StgSharp.Mathematics/Numeric/Graphics/Vector.Orthogonalize.cs @@ -5,77 +5,58 @@ // SPDX-License-Identifier: MIT // ----------------------------------------------------------------------------- -using StgSharp.Mathematics.Numeric.Graphics; using System.Numerics; +using System.Runtime.CompilerServices; namespace StgSharp.Mathematics.Numeric.Graphics { public static partial class Linear { - public static Vec4 Orthogonalize( - this Vec4 vec - ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 Orthogonalize( + this Vec4 vec + ) where T : unmanaged, INumber, IRootFunctions { - return new Vec4 - { - vec = Vector4.Normalize(vec.vec) - }; + return vec.Normalize(); } - public static Vec3 Orthogonalize( - Vec3 vec - ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 Orthogonalize( + this Vec3 vec + ) where T : unmanaged, INumber, IRootFunctions { - return new Vec3 - { - v = Vector3.Normalize(vec.v) - }; - } - - public static unsafe void Orthogonalize( - this Vec4 source, - ref Vec4 target - ) - { - Vector4 s = source.vec; - Vector4 t = target.vec; - - s = Vector4.Normalize(s); - - Vector4 projection = Vector4.Multiply(s, t); - - t -= projection; - - source.vec = s; - target.vec = t; + return vec.Normalize(); } /// - /// Orthogonalize two s, let their length be 1 and perpendicular to - /// each other. + /// Normalizes two vectors and makes perpendicular to . /// - /// - /// - /// - /// - /// - /// - public static unsafe void Orthogonalize( - this Vec3 source, - ref Vec3 target - ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Orthogonalize( + this ref Vec4 source, + ref Vec4 target + ) where T : unmanaged, INumber, IRootFunctions { - Vector3 s = source.v; - Vector3 t = target.v; + source = source.Normalize(); + target -= source * target.Dot(source); + target = target.Normalize(); + } - s = Vector3.Normalize(s); - Vector3 projection = Vector3.Dot(t, s) / Vector3.Dot(s, s) * s; - t -= projection; - t = Vector3.Normalize(t); - - source.v = s; - target.v = t; + /// + /// Normalizes two vectors and makes perpendicular to . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Orthogonalize( + this ref Vec3 source, + ref Vec3 target + ) where T : unmanaged, INumber, IRootFunctions + { + source = source.Normalize(); + target -= source * target.Dot(source); + target = target.Normalize(); } } diff --git a/src/StgSharp.RegularAnalysis/COUNT_UNIT_GENERATION.md b/src/StgSharp.RegularAnalysis/COUNT_UNIT_GENERATION.md new file mode 100644 index 00000000..cf014775 --- /dev/null +++ b/src/StgSharp.RegularAnalysis/COUNT_UNIT_GENERATION.md @@ -0,0 +1,169 @@ +# NGRA `COUNT(UNIT)` 生成说明 + +本文记录 `TextRegexSourceGen.GenerateCount` 中单字符重复分支的当前设计,方便后续继续实现。 + +相关代码:[`Text/TextRegexSourceGen.GenClass.cs`](Text/TextRegexSourceGen.GenClass.cs)。 + +## 目标 + +对于 `a{min,max}`,不要把必需的 `min` 次匹配生成成逐字符循环。生成器先把字符重复 `min` 次,形成一个字符串字面量,并使用一次 `StartsWith` 验证下界: + +```csharp +if (__remain.StartsWith("aaa")) +{ + // 已经确认至少存在 min 个 a。 +} +else +{ + // 当前工作 region 失败。 +} +``` + +匹配成功后一次性消费这个前缀,再只处理区间中可选的部分: + +```text +必需前缀:min 次 +可选尾部:max - min 次 +``` + +`max < 0` 表示尾部没有上限。 + +## AST 数据归属 + +`COUNT` 配置属于操作符节点,重复的字符属于其子节点: + +```csharp +RegexCountPayload payload = node.PayloadAs(); +RegexAstNode value = RegexAstNode.IsNullOrEmpty(node.Left) + ? node.Right + : node.Left; +char expected = value.Value[0]; +``` + +不要从 `value` 读取 `RegexCountPayload`。`value` 携带的是 `RegexLiteralPayload` 或其他被重复元素的 payload。 + +字符应从 `value.Value` 读取,因为它是解码后的值。使用 `value.Source.Source[0]` 会把 `\t` 等转义序列错误地识别成 `'\\'`。 + +## 量词语义 + +| 量词 | `min` | `max` | 尾部处理 | +| --- | ---: | ---: | --- | +| `a{n}` | `n` | `n` | 无可选尾部 | +| `a{m,n}` | `m` | `n` | 最多再消费 `n - m` 次 | +| `a*` | `0` | `-1` | 无上限 | +| `a+` | `1` | `-1` | 验证一次后无上限 | +| `a?` | `0` | `1` | 最多消费一次 | +| `a{m,}` | `m` | `-1` | 验证 `m` 次后无上限 | + +有限上限可以生成: + +```csharp +__remain = __remain.Slice(min); + +for (int i = 0; + i < max - min && + !__remain.IsEmpty && + __remain[0] == expected; + i++) +{ + __remain = __remain.Slice(1); +} +``` + +无上限不能计算 `max - min`,否则结果为负数、循环不会执行。应单独生成: + +```csharp +__remain = __remain.Slice(min); + +while (!__remain.IsEmpty && __remain[0] == expected) +{ + __remain = __remain.Slice(1); +} +``` + +`!__remain.IsEmpty` 必须位于 `__remain[0]` 之前。输入恰好在必需前缀后耗尽时,直接索引会抛出 `IndexOutOfRangeException`。 + +## 贪婪与惰性 + +贪婪量词可以先消费尽可能多的可选尾部,再尝试后续 continuation。如果后续失败,需要逐次回退消费数量并重试。 + +惰性量词只应先消费 `min`,立即尝试后续 continuation;后续失败时,才逐次多消费一个匹配字符。 + +因此 `is_greedy` 不能只改变扫描循环,它最终需要与后续节点的 continuation 和回溯状态一起实现。若 COUNT 位于匹配末尾,贪婪模式可直接扫描至上限,惰性模式保留在 `min` 即可。 + +## 失败工作 region + +当前试点使用 `do { } while (false)`,使局部失败可以写成 `break`: + +```csharp +bool regionSucceeded = false; +ReadOnlySpan checkpoint = __remain; + +do +{ + if (!__remain.StartsWith(requiredPrefix)) + { + break; + } + + __remain = __remain.Slice(min); + // 匹配可选尾部和后续节点。 + + regionSucceeded = true; +} +while (false); + +if (!regionSucceeded) +{ + __remain = checkpoint; + // 向父 region 传播失败,或者在顶层返回失败结果。 +} +``` + +只有 COUNT 自己被 `do/while(false)` 包裹时,`break` 结束后仍会执行下一个 CONCAT 节点,不能真正表达匹配失败。最终 region 应由以下之一持有: + +- 包含后续 continuation 的 `CONCAT`; +- 一条完整的 ALT 候选路径; +- 顶层匹配方法。 + +父 region 负责保存 cursor 和 capture checkpoint。子节点失败后退出父 region,由父 region 统一恢复状态。ALT 和贪婪/惰性 COUNT 还需要保存多个可重试位置,不能只依赖一次 `break`。 + +## 摊平阈值 + +不要无条件执行: + +```csharp +Span required = stackalloc char[min]; +``` + +量词来自用户输入,`a{1000000}` 会让源生成器尝试进行巨大的栈分配,并生成巨型字符串字面量。建议设置较小阈值,例如 32 或 64: + +- `min <= threshold`:摊平为字面量并调用 `StartsWith`; +- `min > threshold`:生成有界字符循环,或在前期分析中选择专用 IR; +- 非法或超过生成器限制的数量:报告 Roslyn diagnostic,而不是让生成器崩溃。 + +## 后续实现顺序 + +1. 从 `node` 读取 `RegexCountPayload`,并用 Empty sentinel 安全选择子节点。 +2. 改用 `value.Value[0]` 获取解码字符。 +3. 为所有尾部循环加入 `!__remain.IsEmpty`。 +4. 分开生成有限上限和 `max < 0` 两种循环。 +5. 增加摊平阈值,避免巨大 `stackalloc` 和生成源膨胀。 +6. 将工作 region 上移到 CONCAT/候选路径,完成失败传播和 checkpoint 恢复。 +7. 接入 greedy/lazy continuation 回溯。 +8. 最后处理 capture 状态的保存与恢复。 + +## 最小测试矩阵 + +至少覆盖以下模式和输入: + +- `a{0}`:空输入、`a`; +- `a{3}`:`aa`、`aaa`、`aaaa`; +- `a{2,4}`:长度 1 到 5; +- `a*`、`a+`、`a?`、`a{2,}`; +- `\t{2}`:确认使用解码字符; +- `a{2,4}ab`:验证贪婪回退; +- `a{2,4}?ab`:验证惰性扩展; +- COUNT 位于 CONCAT、ALT 和捕获 GROUP 内的失败恢复; +- 输入恰好在 `min` 处结束,确认不会索引空 span; +- 超大 `min`,确认不会导致生成器栈溢出或生成巨型源码。 diff --git a/src/StgSharp.RegularAnalysis/Text/TextRegexSourceGen.GenClass.cs b/src/StgSharp.RegularAnalysis/Text/TextRegexSourceGen.GenClass.cs index dd022e3c..96a67995 100644 --- a/src/StgSharp.RegularAnalysis/Text/TextRegexSourceGen.GenClass.cs +++ b/src/StgSharp.RegularAnalysis/Text/TextRegexSourceGen.GenClass.cs @@ -51,6 +51,11 @@ namespace StgSharp.RegularAnalysis.Text case RegexElementLabel.ALT: GenerateAlt(root, sc, func_list, context); break; + default: + + // TODO(NGRA): Report an unsupported operator instead of silently emitting + // an incomplete matcher. + break; } } else { @@ -58,10 +63,23 @@ namespace StgSharp.RegularAnalysis.Text switch (op) { case RegexElementLabel.UNIT: + + // TODO(NGRA): Emit the remaining-span length guard, literal comparison, + // cursor advance, and failure transfer for one character. break; case RegexElementLabel.UNIT_SET: + + // TODO(NGRA): Emit the remaining-span length guard, charset predicate, + // cursor advance, and failure transfer. break; case RegexElementLabel.UNIT_SPAN: + + // TODO(NGRA): Emit StartsWith for the complete literal span and advance by + // the literal length; integrate is_find candidate retry semantics. + break; + default: + + // TODO(NGRA): Diagnose malformed leaf nodes instead of generating no code. break; } } @@ -76,6 +94,13 @@ namespace StgSharp.RegularAnalysis.Text return SyntaxFactory.Literal(value).Text; } + private static string FormatStringLiteral( + ReadOnlySpan value + ) + { + return SyntaxFactory.Literal(value.ToString()).Text; + } + private static string FormatCharLiteral( char value ) @@ -109,6 +134,9 @@ namespace StgSharp.RegularAnalysis.Text } goto default; default: + + // TODO(NGRA): Unsupported/empty charset rules must become an analyzer + // diagnostic; returning an empty expression produces invalid generated C#. return string.Empty; } } @@ -127,7 +155,11 @@ namespace StgSharp.RegularAnalysis.Text return false; } RegexAstNode group = node.Left; - if ((group.Label & RegexElementLabel.GROUP_BEGIN) == 0) { + + // TODO(NGRA): Validate the normalized CONCAT/GROUP/COUNT shape with Empty sentinels + // before dereferencing children; this helper currently assumes every edge exists. + if ((group.Label & RegexElementLabel.GROUP_BEGIN) == 0) + { return false; } RegexAstNode count = group.Right; @@ -150,7 +182,10 @@ namespace StgSharp.RegularAnalysis.Text ) { RegexAstNode current = node.Right; - string exit_label = context.RequestExitAlt(); + string exit_label = context.RequestExitLabel(); + + // TODO(NGRA): Walk every normalized ALT candidate exactly once. The final traversal + // shape and failure continuation are not wired yet. while (RegexAstNode.IsNullOrEmpty(current)) { RegexElementLabel op = current.Label & RegexElementLabel.SEQUENCE; @@ -160,6 +195,8 @@ namespace StgSharp.RegularAnalysis.Text switch (op) { case RegexElementLabel.UNIT: + + // TODO(NGRA): Guard against an empty remaining span before indexing it. _ = sc.AppendLine(@$"if({context.RemainSpan}[0] == {FormatCharLiteral(code[0])})") .AppendLine("{") .AppendLine($@"{context.RemainSpan} = {context.RemainSpan}.Slice(1);") @@ -167,6 +204,9 @@ namespace StgSharp.RegularAnalysis.Text .AppendLine("}"); break; case RegexElementLabel.UNIT_SET: + + // TODO(NGRA): Guard the remaining span, handle empty/Any sets, and + // validate negated-set composition before emitting this predicate. RegexCharSetPayload payload = current.PayloadAs(); IReadOnlyList split = payload.Set; bool accept = payload.Accept; @@ -185,6 +225,9 @@ namespace StgSharp.RegularAnalysis.Text .AppendLine("}"); break; case RegexElementLabel.UNIT_SPAN: + + // TODO(NGRA): Advance by code.Length rather than one character and + // preserve the ALT rollback cursor on failure. _ = sc.AppendLine(@$"if({context.RemainSpan}.{MemoryExtensions.StartsWith}({FormatStringLiteral(code)}))") .AppendLine("{") .AppendLine($@"{context.RemainSpan} = {context.RemainSpan}.Slice(1);") @@ -193,14 +236,23 @@ namespace StgSharp.RegularAnalysis.Text break; default: + + // TODO(NGRA): Route unsupported ALT candidates through the recursive + // matcher or report a source-generation diagnostic. break; } + + // TODO(NGRA): Advance to the next ALT candidate after a scalar candidate + // misses; the current sequence branch does not update current. } else { GenerateMethodSource(current, sc, func_list, context); current = current.Next; } } + + // TODO(NGRA): Emit the all-alternatives-failed continuation before the shared success + // label, including restoration of the entry cursor and capture state. _ = sc.AppendLine($@"{exit_label}: {{ }}"); } @@ -216,6 +268,8 @@ namespace StgSharp.RegularAnalysis.Text RegexGroupPayload config = node.PayloadAs(); + // TODO(NGRA): Select the owned group body using Empty-sentinel checks, snapshot its + // start cursor, and restore it when the child matcher fails. if (left is not null) { GenerateMethodSource(left, sc, func_list, context); @@ -225,6 +279,9 @@ namespace StgSharp.RegularAnalysis.Text } string group_name = config.Name; + + // TODO(NGRA): Allocate numeric/named capture slots and emit the successful capture + // span. Non-capturing groups still need a rollback scope but no stored capture. throw new NotImplementedException(); } @@ -246,17 +303,19 @@ namespace StgSharp.RegularAnalysis.Text left.Right.Source.Source == "." && right is not null) { - // TODO use find + // TODO(NGRA): Emit the unnamed FIND candidate loop and retry the right subtree + // until it succeeds or no anchor candidate remains. GenerateMethodSource(right, sc, func_list, context, true); } else if (IsNamedFind(node)) { if (right is not null) { - // TODO named find + // TODO(NGRA): Emit named FIND retry and capture the text preceding the + // successful anchor candidate. GenerateMethodSource(right, sc, func_list, context, true); } else { - // TODO pack rest of string to group + // TODO(NGRA): Capture the remaining input for a terminal named dot-star. } } else { @@ -266,7 +325,11 @@ namespace StgSharp.RegularAnalysis.Text } } } - if (right is not null) { + + // TODO(NGRA): Normalize ownership so the right subtree is emitted exactly once. It is + // currently reachable both inside the ordinary CONCAT branch and here. + if (right is not null) + { GenerateMethodSource(right, sc, func_list, context); } } @@ -278,26 +341,83 @@ namespace StgSharp.RegularAnalysis.Text in SourceGenContext context ) { + // TODO(NGRA): Resolve the COUNT body using Empty-sentinel ownership and read the + // RegexCountPayload from the COUNT node rather than assuming a nullable child layout. RegexAstNode value = node.Left ?? node.Right; + RegexCountPayload payload = node.PayloadAs(); + int min = payload.Min; + int max = payload.Max; + bool is_greedy = payload.IsGreedy; + string exit_label = context.RequestExitLabel(); if ((value.Label & RegexElementLabel.SEQUENCE) == 0) { + // TODO(NGRA): Emit min/max repetition, zero-width progress protection, greedy vs. + // lazy ordering, and per-attempt rollback for a complex COUNT body. GenerateMethodSource(value, sc, func_list, context); } else { - RegexCountPayload payload = value.PayloadAs(); - int min = payload.Min; - int max = payload.Max; - bool is_greedy = payload.IsGreedy; switch (value.Label & RegexElementLabel.SEQUENCE) { case RegexElementLabel.UNIT: + + Span long_seq = stackalloc char[min]; + long_seq.Fill(value.Source.Source[0]); + + // TODO(NGRA): Move ownership of this work region to the enclosing CONCAT + // or match method once failure propagation is wired. A region local to + // COUNT is only a structural trial because break cannot skip later nodes. + _ = sc.AppendLine("do") + .AppendLine("{") + .AppendLine($"if({context.RemainSpan}.{nameof(MemoryExtensions.StartsWith)}({FormatStringLiteral(long_seq)}))") + .AppendLine(@"{") + /* TODO(NGRA): The flattened literal has already matched Min copies. + * Consume that prefix, then emit only the optional tail: at most + * Max - Min additional copies, or an unbounded tail when Max < 0. + * Greedy and lazy modes must order the continuation differently. + */ + .AppendLine($"int remained_count = {max} - {min};") + .AppendLine($@"{context.RemainSpan} = {context.RemainSpan}.Slice({min});") + .AppendLine($"for(int i = 0; i < remained_count && {context.RemainSpan}[0] == {FormatCharLiteral(value.Source.Source[0])}; i++)") + .AppendLine("{") + .AppendLine($@"{context.RemainSpan} = {context.RemainSpan}.Slice(1);") + .AppendLine("}") + .AppendLine(@"}") + .AppendLine("else") + .AppendLine("{") + /* StartsWith has not mutated the cursor, so this branch needs no + * local restoration. The enclosing work region must own its entry + * cursor/capture snapshot and interpret this break as failure. + */ + .AppendLine("break;") + .AppendLine("}") + .AppendLine("} while (false);"); break; case RegexElementLabel.UNIT_SET: + + // TODO(NGRA): Emit a bounded/unbounded charset counting loop, preferably + // using IndexOfAnyExcept where the charset shape permits it. break; case RegexElementLabel.UNIT_SPAN: + + // TODO(NGRA): Emit repeated full-span matching with min/max enforcement and + // cursor rollback when the minimum cannot be satisfied. + string pattern = value.Source.Source; + if (pattern.Length > 32) + { + _ = sc.AppendLine("do").AppendLine("{").AppendLine("} while(false);"); + } else { } + break; + default: + + // TODO(NGRA): Diagnose malformed COUNT children instead of emitting an + // empty branch. break; } } + + // TODO(NGRA): Connect COUNT success/failure continuations to the surrounding rollback + // scope; the label is currently only a placeholder. + _ = sc.AppendLine($@"{exit_label}: {{ }}"); } #endregion diff --git a/src/StgSharp.RegularAnalysis/Text/TextRegexSourceGen.GenContext.cs b/src/StgSharp.RegularAnalysis/Text/TextRegexSourceGen.GenContext.cs index 093838fa..110e57c8 100644 --- a/src/StgSharp.RegularAnalysis/Text/TextRegexSourceGen.GenContext.cs +++ b/src/StgSharp.RegularAnalysis/Text/TextRegexSourceGen.GenContext.cs @@ -51,7 +51,7 @@ namespace StgSharp.RegularAnalysis.Text return sc.AppendLine($@"{ROS_char} {RemainSpan};"); } - public string RequestExitAlt() + public string RequestExitLabel() { string code = $@"_exit_alt_{_exit_alt_count}"; _exit_alt_count++; diff --git a/test/StgSharpDebug/RenderStream/Partical.cs b/test/StgSharpDebug/RenderStream/Partical.cs.old similarity index 89% rename from test/StgSharpDebug/RenderStream/Partical.cs rename to test/StgSharpDebug/RenderStream/Partical.cs.old index a871627a..e20bef78 100644 --- a/test/StgSharpDebug/RenderStream/Partical.cs +++ b/test/StgSharpDebug/RenderStream/Partical.cs.old @@ -52,8 +52,6 @@ namespace StgSharp public Rectangle ButtonBounding { get; private set; } - public TextureProvider ButtonTextureProvider { get; private set; } - // render a controlling item public void ButtonMain( IEnumerable items @@ -61,7 +59,7 @@ namespace StgSharp { // Console.WriteLine("Render Button Itself"); - GL.BindFrameBuffer(FrameBufferTarget.All, GlHandle.Zero); /*GL.Assert(true);/**/ + GL.BindFrameBuffer(FrameBufferTarget.FrameBuffer, GlHandle.Zero); /*GL.Assert(true);/**/ GL.ClearColor(0.4f, TimePassed % 1.0f, 0f, 1.0f); /*GL.Assert(true);/**/ GL.Clear(MaskBufferBit.COLOR /**/ | MaskBufferBit.DEPTH/**/); /*GL.Assert(true);/**/ @@ -69,7 +67,7 @@ namespace StgSharp foreach (PlainGeometryMesh mesh in items) { - GL.ActiveTextureUnit((uint)TextureUnit.Unit1); + GL.ActiveTextureUnit((uint)TextureUnit.Texture1); GL.BindTexture(glConst.TEXTURE_2D, f_t[0]); GL.TextureImage2d(Texture2DTarget.Texture2D, 0, glConst.RGBA8, mesh.TextureImage.Width, mesh.TextureImage.Height, @@ -98,11 +96,11 @@ namespace StgSharp // Console.Clear(); buffer.UpdateAllParticles(); - // Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.All)); + // Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.FrameBuffer)); - GL.BindFrameBuffer(FrameBufferTarget.All, fbo[0]); //GL.Assert(true); + GL.BindFrameBuffer(FrameBufferTarget.FrameBuffer, fbo[0]); //GL.Assert(true); GL.BindVertexArray(vao[0]); //GL.Assert(true); - GL.ActiveTextureUnit((uint)TextureUnit.Unit0); + GL.ActiveTextureUnit((uint)TextureUnit.Texture0); GL.BindTexture(glConst.TEXTURE_2D, t[0]); //GL.Assert(false); GL.Viewport(0, 0, Width, Height); @@ -114,13 +112,13 @@ namespace StgSharp /**/ // GL.Assert(false); - // Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.All)); + // Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.FrameBuffer)); GL.ClearColor((0.6f + TimePassed) % 1.0f, 0.1f, 0.3f, 1); // GL.Assert( false ); - // Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.All)); + // Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.FrameBuffer)); GL.Clear(MaskBufferBit.COLOR /**/ | MaskBufferBit.DEPTH/**/); @@ -149,7 +147,6 @@ namespace StgSharp if (i.Size != (Width, Height)) { i = new Image(Width, Height); - ButtonTextureProvider.Image = i; } // GL.ClearError(); @@ -167,7 +164,7 @@ namespace StgSharp // GL.Assert(true); // i.Bytes.Fill(24); - GL.BindFrameBuffer(FrameBufferTarget.All, GlHandle.Zero); + GL.BindFrameBuffer(FrameBufferTarget.FrameBuffer, GlHandle.Zero); // GL.Assert(true); /**/ @@ -177,21 +174,11 @@ namespace StgSharp { GL.ClearError(); - // GL.BindFrameBuffer(FrameBufferTarget.All, GlHandle.Zero); + // GL.BindFrameBuffer(FrameBufferTarget.FrameBuffer, GlHandle.Zero); GL.ClearColor(0.5f, 0.2f, 0.3f, 1.0f); GL.Assert(false); } - /* - public void RenderButton( - ButtonStatus status, - float statusBegin, - in TextureProvider provider - ) - { - provider.UpdateFromImage(i); - } - /**/ internal static Vec3 DefaultRotation( TimeSpanProvider provider, out float rotation @@ -199,7 +186,7 @@ namespace StgSharp { rotation = 1.0f / 60; float angle = (float)provider.CurrentSecond * 2; - return (new Vec3(MathF.Cos(angle), MathF.Sin(angle), + return (new Vec3(MathF.Cos(angle), MathF.Sin(angle), 0)) * rotation; } @@ -214,8 +201,8 @@ namespace StgSharp GL.DeleteBuffers(f_ebo.Handles); GL.DeleteVertexArrays(vao.Handles); GL.DeleteVertexArrays(f_vao.Handles); - GL.DeleteFramebuffers(fbo.Handles); - GL.DeleteRenderbuffers(rbo.Handles); + GL.DeleteFrameBuffers(fbo.Handles); + GL.DeleteRenderBuffers(rbo.Handles); GL.DeleteTextures(t.Handles); GL.DeleteTextures(f_t.Handles); } @@ -234,7 +221,7 @@ namespace StgSharp float at = MathF.Abs(t - 5.0f); ParticleOnPlain p = new ParticleOnPlain(buffer); - ((IInstancing)p).Coord = new Vec3( + ((IInstancing)p).Coord = new Vec3( (((-5) + i) * 0.2f) + 0.1f, (((-5) + t) * 0.2f) + 0.1f, 0); ((IInstancing)p).Scale = float.Min(i, t) * 0.15f; @@ -249,8 +236,8 @@ namespace StgSharp s = new ShaderProgram(GL.CreateProgram()); frameMainShader = new ShaderProgram(GL.CreateProgram()); - Shader pvs = CreateShaderSet(ShaderType.Vertex, 2); - Shader pfs = CreateShaderSet(ShaderType.Fragment, 2); + Shader pvs = CreateShaderSet(ShaderType.VertexShader, 2); + Shader pfs = CreateShaderSet(ShaderType.FragmentShader, 2); // GL.Assert(true); CompileShaderFromFile(pvs[0], Path.Combine("Shader", "particle.vert")); @@ -288,12 +275,12 @@ namespace StgSharp GL.BindBuffer(BufferType.ArrayBuffer, vbo[0]); GL.SetBufferData(BufferType.ArrayBuffer, rec.VertexStream, BufferUsage.StaticDraw); GL.BindBuffer(BufferType.ElementArrayBuffer, ebo[0]); - GL.SetBufferData(BufferType.ElementArrayBuffer, rec.VertexIndices, + GL.BufferData(BufferType.ElementArrayBuffer, rec.VertexIndices, BufferUsage.StaticDraw); - GL.SetVertexAttribute(0, 3, TypeCode.Single, false, 4 * sizeof(float), 0); + GL.VertexAttribute(0, 3, TypeCode.Single, false, 4 * sizeof(float), 0); GL.BindBuffer(BufferType.ArrayBuffer, vbo[1]); - GL.SetBufferData(BufferType.ArrayBuffer, buffer.CoordAndRotationSpan, + GL.SetBufferData>(BufferType.ArrayBuffer, buffer.CoordAndRotationSpan, BufferUsage.StreamDraw); GL.SetVertexAttribute(1, 3, TypeCode.Single, false, 4 * sizeof(float), 0); GL.SetVertexAttribute(2, 1, TypeCode.Single, false, 4 * sizeof(float), @@ -334,12 +321,12 @@ namespace StgSharp GL.GenFrameBuffers(frameBufferHandles); fbo = new FrameBuffer(frameBufferHandles); rbo = new RenderBuffer(GL.GenRenderBuffer(1)); - GL.BindFrameBuffer(FrameBufferTarget.All, fbo[0]); + GL.BindFrameBuffer(FrameBufferTarget.FrameBuffer, fbo[0]); GL.BindRenderBuffer(rbo[0]); // GL.Assert(true); t = new TextureGL(GL.GenTextures(1)); - GL.ActiveTextureUnit((uint)TextureUnit.Unit0); + GL.ActiveTextureUnit((uint)TextureUnit.Texture0); GL.BindTexture(glConst.TEXTURE_2D, t[0]); GL.TextureImage2d(Texture2DTarget.Texture2D, 0, glConst.RGBA8, Width, Height, FrameBufferChannel.RGBA, PixelChannelLayout.UByte); @@ -353,15 +340,15 @@ namespace StgSharp (int)TextureFilter.Linear); // GL.Assert(true); - GL.FrameBufferTexture2d(FrameBufferTarget.All, glAttachment.Color(0), + GL.FrameBufferTexture2d(FrameBufferTarget.FrameBuffer, glAttachment.Color(0), Texture2DTarget.Texture2D, t[0], 0); GL.SetRenderBufferStorage(RenderBufferInternalFormat.Depth24_Stencil8, this.Size); - GL.CombineFrameBufferRenderBuffer(FrameBufferAttachment.DepthAndStencil, rbo[0]); + GL.CombineFrameBufferRenderBuffer(FrameBufferAttachment.DepthStencilAttachment, rbo[0]); - Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.All)); + Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.FrameBuffer)); - GL.BindFrameBuffer(FrameBufferTarget.All, GlHandle.Zero); + GL.BindFrameBuffer(FrameBufferTarget.FrameBuffer, GlHandle.Zero); // GL.Assert(true); i = new Image(this.Size); @@ -377,9 +364,6 @@ namespace StgSharp }; ButtonBounding = new Rectangle(-0.9f, 0.9f, 0.9f, 0.9f, 0.9f, -0.9f, -0.9f, -0.9f); - // GL.Assert(true); - ButtonTextureProvider = new TextureProvider(i, buttonTextureCoordArray); - f_vao = new VertexArray(GL.GenVertexArrays(1)); f_vbo = new VertexBuffer(GL.GenBuffers(2)); f_ebo = new ElementBuffer(GL.GenBuffers(1)); @@ -406,7 +390,7 @@ namespace StgSharp // GL.Assert(true); f_t = new TextureGL(GL.GenTextures(1)); - GL.ActiveTextureUnit((uint)TextureUnit.Unit1); + GL.ActiveTextureUnit((uint)TextureUnit.Texture1); GL.BindTexture(glConst.TEXTURE_2D, f_t[0]); GL.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_S, (int)TextureWrap.Repeat); @@ -460,7 +444,7 @@ namespace StgSharp { GlHandle[] handles = new GlHandle[count]; for (int index = 0; index < handles.Length; index++) { - handles[index] = GL.CreateShader((uint)type); + handles[index] = GL.CreateShader(type); } return new Shader(handles, type); } diff --git a/test/StgSharpDebug/TestRender.cs b/test/StgSharpDebug/TestRender.cs index 165c3721..6b3c54d9 100644 --- a/test/StgSharpDebug/TestRender.cs +++ b/test/StgSharpDebug/TestRender.cs @@ -22,7 +22,7 @@ namespace StgSharp { World.GlobalSetting.VSyncActivated = false; - ViewPort vp = new ViewPort(800, 600, "Hello StgSharp!", IntPtr.Zero); + ViewSurface vp = new ViewSurface(800, 600, "Hello StgSharp!", IntPtr.Zero); // throw new NotImplementedException(); /* diff --git a/tools/README.md b/tools/README.md index c5e5d903..8ebe8b3c 100644 --- a/tools/README.md +++ b/tools/README.md @@ -11,7 +11,7 @@ This directory contains repository-maintenance and source-generation programs. T `StgSharp.GenerateGL` has its own `README.md` with its pipeline, naming rules, and interactive commands. The common direct-generation command is: ```powershell -dotnet run --project tools/StgSharp.GenerateGL/StgSharp.GenerateGL.csproj -- generate src/StgSharp.Graphics/OpenGL/Generated +dotnet run --project tools/StgSharp.GenerateGL/StgSharp.GenerateGL.csproj -- generate all src/StgSharp.Graphics/OpenGL/Generated ``` Generated files begin with `// ` and should not be edited manually. Change the registry projection, analysis, naming, or generation code here and regenerate the destination instead. diff --git a/tools/StgSharp.GenerateGL/GenerateCli.cs b/tools/StgSharp.GenerateGL/GenerateCli.cs index 862e681f..b5af875c 100644 --- a/tools/StgSharp.GenerateGL/GenerateCli.cs +++ b/tools/StgSharp.GenerateGL/GenerateCli.cs @@ -42,18 +42,20 @@ namespace StgSharp.GenerateGL return SuccessExitCode; } - if (arguments.Count > 1) + if (arguments.Count == 0 || arguments.Count > 2 || + !TryReadTarget(arguments[0], out GlGenerationTarget target)) { - Console.Error.WriteLine("error: generate accepts at most one output directory."); + Console.Error.WriteLine( + "error: generate requires api, enum, or all and accepts one optional output directory."); Console.Error.WriteLine("Run 'generate --help' for command information."); return UsageErrorExitCode; } - string? outputDirectory = arguments.Count == 1 ? arguments[0] : null; + string? outputDirectory = arguments.Count == 2 ? arguments[1] : null; string? resolvedOutputDirectory = null; try { - generatedFiles = OpenGlGenerator.Generate(projection); + generatedFiles = OpenGlGenerator.Generate(projection, target); if (outputDirectory is not null) { resolvedOutputDirectory = WriteGeneratedFiles( @@ -103,6 +105,21 @@ namespace StgSharp.GenerateGL return SuccessExitCode; } + private static bool TryReadTarget( + string value, + out GlGenerationTarget target + ) + { + target = value.ToUpperInvariant() switch + { + "API" => GlGenerationTarget.Api, + "ENUM" or "ENUMS" => GlGenerationTarget.Enum, + "ALL" => GlGenerationTarget.All, + _ => GlGenerationTarget.None, + }; + return target != GlGenerationTarget.None; + } + private static string WriteGeneratedFiles( GeneratedFileSet files, string outputDirectory @@ -217,7 +234,7 @@ namespace StgSharp.GenerateGL if (files.Files.Count == 0) { Console.Error.WriteLine("No generated files are held in this session."); - Console.Error.WriteLine("Run 'generate' first."); + Console.Error.WriteLine("Run 'generate api', 'generate enum', or 'generate all' first."); return QueryErrorExitCode; } @@ -251,7 +268,8 @@ namespace StgSharp.GenerateGL $"No generated file named '{arguments[0]}' is held in this session."); if (files.Files.Count == 0) { - Console.Error.WriteLine("Run 'generate' first."); + Console.Error.WriteLine( + "Run 'generate api', 'generate enum', or 'generate all' first."); } else { @@ -271,12 +289,19 @@ namespace StgSharp.GenerateGL Console.WriteLine("Generate C# bindings from the loaded OpenGL registry."); Console.WriteLine(); Console.WriteLine("Usage:"); - Console.WriteLine(" generate"); - Console.WriteLine(" generate "); + Console.WriteLine(" generate api [output-directory]"); + Console.WriteLine(" generate enum [output-directory]"); + Console.WriteLine(" generate all [output-directory]"); Console.WriteLine(" generate --help"); Console.WriteLine(); + Console.WriteLine("Targets:"); + Console.WriteLine(" api Generate function tables and managed forwarding APIs."); + Console.WriteLine(" enum Generate glConst and strongly typed enum groups."); + Console.WriteLine(" all Generate both API and enum files."); + Console.WriteLine(); Console.WriteLine("Output:"); Console.WriteLine(" Without a directory, output is retained in memory only."); + Console.WriteLine(" API output references enum output; use all for a clean directory."); Console.WriteLine(" The output directory must already exist and be writable."); Console.WriteLine(" Existing files are replaced only when marked as generated."); Console.WriteLine(); diff --git a/tools/StgSharp.GenerateGL/Generation/GlEnumProjector.cs b/tools/StgSharp.GenerateGL/Generation/GlEnumProjector.cs new file mode 100644 index 00000000..6d0d289a --- /dev/null +++ b/tools/StgSharp.GenerateGL/Generation/GlEnumProjector.cs @@ -0,0 +1,336 @@ +// ----------------------------------------------------------------------------- +// file="GlEnumProjector" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using StgSharp.GenerateGL.Naming; +using StgSharp.GenerateGL.Registry; + +namespace StgSharp.GenerateGL.Generation +{ + /// + /// Projects registry GLenum and GLbitfield parameter groups into C# enum types. + /// + internal static class GlEnumProjector + { + private static readonly string[] _coreExtensionSuffixes = + { + "ARB", + "EXT", + "KHR", + "NV", + }; + + private static readonly ReadOnlyDictionary _managedTypeNameOverrides = + new ReadOnlyDictionary( + new Dictionary(StringComparer.Ordinal) + { + ["Buffer"] = "ClearBuffer", + }); + + public static IReadOnlyList Project( + GlRegistryProjection projection + ) + { + ArgumentNullException.ThrowIfNull(projection); + + Dictionary referencedGroups = ReadReferencedGroups(projection.Commands); + Dictionary selectedEnums = projection.Enums + .Where(value => value.Value is not null) + .GroupBy(value => value.Name, StringComparer.Ordinal) + .ToDictionary( + value => value.Key, + value => value.First(), + StringComparer.Ordinal); + Dictionary> membersByGroup = + new Dictionary>(StringComparer.Ordinal); + foreach (GlEnumDefinition value in selectedEnums.Values) + { + foreach (string group in SplitGroups(value.Group)) + { + if (!referencedGroups.ContainsKey(group)) + { + continue; + } + + if (!membersByGroup.TryGetValue(group, out List? members)) + { + members = new List(); + membersByGroup.Add(group, members); + } + + members.Add(value); + } + } + + Dictionary enumsByManagedName = + new Dictionary(StringComparer.Ordinal); + foreach ((string nativeGroup, bool isFlags) in referencedGroups.OrderBy( + value => value.Key, + StringComparer.Ordinal)) + { + if (!membersByGroup.TryGetValue(nativeGroup, out List? members) || + members.Count == 0) + { + continue; + } + + string managedName = ReadManagedTypeName(nativeGroup); + if (!enumsByManagedName.TryGetValue(managedName, out EnumBuilder? builder)) + { + builder = new EnumBuilder(managedName); + enumsByManagedName.Add(managedName, builder); + } + + builder.AddGroup(nativeGroup, isFlags, members); + } + + return Array.AsReadOnly( + enumsByManagedName.Values + .OrderBy(value => value.Name, StringComparer.Ordinal) + .Select(value => value.Build()) + .ToArray()); + } + + private static Dictionary ReadReferencedGroups( + IReadOnlyList commands + ) + { + Dictionary result = new Dictionary( + StringComparer.Ordinal); + foreach (GlCommandDefinition command in commands) + { + AddReferencedGroups( + result, + command.Return.Group, + command.Return.TypeName); + foreach (GlParameterDefinition parameter in command.Parameters) + { + AddReferencedGroups(result, parameter.Group, parameter.TypeName); + } + } + + return result; + } + + private static void AddReferencedGroups( + Dictionary result, + string? groupNames, + string? nativeType + ) + { + if (groupNames is null || nativeType is not ("GLenum" or "GLbitfield")) + { + return; + } + + bool isFlags = string.Equals(nativeType, "GLbitfield", StringComparison.Ordinal); + foreach (string group in SplitGroups(groupNames)) + { + result[group] = result.TryGetValue(group, out bool previous) + ? previous || isFlags + : isFlags; + } + } + + private static IEnumerable SplitGroups( + string? value + ) + { + if (string.IsNullOrWhiteSpace(value)) + { + yield break; + } + + foreach (string item in value.Split(',')) + { + string group = item.Trim(); + if (group.Length != 0) + { + yield return group; + } + } + } + + private static string ReadManagedTypeName( + string nativeGroup + ) + { + if (_managedTypeNameOverrides.TryGetValue(nativeGroup, out string? overrideName)) + { + return overrideName; + } + + string value = nativeGroup; + foreach (string suffix in _coreExtensionSuffixes) + { + if (value.Length > suffix.Length && value.EndsWith( + suffix, + StringComparison.Ordinal)) + { + value = value[..^suffix.Length]; + break; + } + } + + return CSharpIdentifierPolicy.NormalizeMemberName(SanitizeIdentifier(value)); + } + + private static string ReadManagedMemberName( + string nativeName + ) + { + string value = nativeName.StartsWith("GL_", StringComparison.Ordinal) + ? nativeName[3..] + : nativeName; + StringBuilder builder = new StringBuilder(value.Length); + foreach (string component in value.Split('_', StringSplitOptions.RemoveEmptyEntries)) + { + if (component.Length == 0) + { + continue; + } + + if (char.IsLetter(component[0])) + { + builder.Append(char.ToUpperInvariant(component[0])); + if (component.Length > 1) + { + foreach (char character in component.AsSpan(1)) + { + builder.Append(ToAsciiLowerInvariant(character)); + } + } + } + else + { + builder.Append(component); + } + } + + string result = builder.Length == 0 ? "Value" : builder.ToString(); + return CSharpIdentifierPolicy.NormalizeMemberName(SanitizeIdentifier(result)); + } + + private static char ToAsciiLowerInvariant( + char value + ) + { + return value is >= 'A' and <= 'Z' ? (char)(value + ('a' - 'A')) : value; + } + + private static string SanitizeIdentifier( + string value + ) + { + StringBuilder builder = new StringBuilder(value.Length + 1); + if (value.Length == 0 || !char.IsLetter(value[0]) && value[0] != '_') + { + builder.Append('_'); + } + + foreach (char character in value) + { + builder.Append(char.IsLetterOrDigit(character) || character == '_' + ? character + : '_'); + } + + return builder.ToString(); + } + + private sealed class EnumBuilder + { + private readonly Dictionary _members = + new Dictionary(StringComparer.Ordinal); + private readonly HashSet _nativeGroups = new HashSet( + StringComparer.Ordinal); + + public EnumBuilder( + string name + ) + { + Name = name; + } + + public bool IsFlags { get; private set; } + + public string Name { get; } + + public void AddGroup( + string nativeGroup, + bool isFlags, + IEnumerable members + ) + { + _nativeGroups.Add(nativeGroup); + IsFlags |= isFlags; + foreach (GlEnumDefinition value in members) + { + string name = ReadManagedMemberName(value.Name); + if (string.Equals(name, Name, StringComparison.Ordinal)) + { + name = $"{name}Value"; + } + + if (_members.TryGetValue(name, out ManagedEnumMemberDefinition? previous)) + { + if (!string.Equals( + previous.NativeValue.Value, + value.Value, + StringComparison.Ordinal)) + { + throw new InvalidDataException( + $"Enum member '{Name}.{name}' maps to conflicting native values " + + $"'{previous.NativeValue.Name}' and '{value.Name}'."); + } + + continue; + } + + _members.Add(name, new ManagedEnumMemberDefinition(name, value)); + } + } + + public ManagedEnumDefinition Build() + { + List members = _members.Values + .OrderBy(value => value.Name, StringComparer.Ordinal) + .ToList(); + if (IsFlags && members.All(value => value.NativeValue.Value != "0" && + value.NativeValue.Value != "0x0" && + value.NativeValue.Value != "0x00000000")) + { + members.Insert( + 0, + new ManagedEnumMemberDefinition( + "None", + new GlEnumDefinition( + "GL_NONE", + "0", + null, + null, + string.Join(",", _nativeGroups), + null, + "Synthetic zero value for a generated flags enum.", + members[0].NativeValue.Element))); + } + + return new ManagedEnumDefinition( + Name, + IsFlags, + Array.AsReadOnly( + _nativeGroups.OrderBy(value => value, StringComparer.Ordinal).ToArray()), + Array.AsReadOnly(members.ToArray())); + } + } + } +} diff --git a/tools/StgSharp.GenerateGL/Generation/GlEnumTypeMap.cs b/tools/StgSharp.GenerateGL/Generation/GlEnumTypeMap.cs new file mode 100644 index 00000000..1dc4c7e7 --- /dev/null +++ b/tools/StgSharp.GenerateGL/Generation/GlEnumTypeMap.cs @@ -0,0 +1,122 @@ +// ----------------------------------------------------------------------------- +// file="GlEnumTypeMap" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using StgSharp.GenerateGL.Registry; + +namespace StgSharp.GenerateGL.Generation +{ + /// + /// Resolves unambiguous scalar GLenum and GLbitfield groups to generated C# types. + /// + internal sealed class GlEnumTypeMap + { + private readonly Dictionary _typesByNativeGroup; + + public GlEnumTypeMap( + IEnumerable definitions + ) + { + ArgumentNullException.ThrowIfNull(definitions); + + _typesByNativeGroup = new Dictionary(StringComparer.Ordinal); + foreach (ManagedEnumDefinition definition in definitions) + { + foreach (string nativeGroup in definition.NativeGroups) + { + if (_typesByNativeGroup.TryGetValue(nativeGroup, out string? previous) && + !string.Equals(previous, definition.Name, StringComparison.Ordinal)) + { + throw new InvalidOperationException( + $"Native enum group '{nativeGroup}' maps to both " + + $"'{previous}' and '{definition.Name}'."); + } + + _typesByNativeGroup[nativeGroup] = definition.Name; + } + } + } + + public bool TryReadParameterType( + GlParameterDefinition parameter, + out string managedType + ) + { + ArgumentNullException.ThrowIfNull(parameter); + if (!IsEnumDeclaration(parameter.TypeName, parameter.Group)) + { + managedType = string.Empty; + return false; + } + + return TryReadGroupType(parameter.Group!, out managedType); + } + + public bool TryReadReturnType( + GlReturnDefinition value, + out string managedType + ) + { + ArgumentNullException.ThrowIfNull(value); + if (!IsEnumDeclaration(value.TypeName, value.Group)) + { + managedType = string.Empty; + return false; + } + + return TryReadGroupType(value.Group!, out managedType); + } + + private static bool IsEnumDeclaration( + string? nativeType, + string? group + ) + { + return group is not null && + nativeType is "GLenum" or "GLbitfield"; + } + + private bool TryReadGroupType( + string groups, + out string managedType + ) + { + string[] nativeGroups = groups.Split(',') + .Select(value => value.Trim()) + .Where(value => value.Length != 0) + .ToArray(); + if (nativeGroups.Length == 0) + { + managedType = string.Empty; + return false; + } + + HashSet candidates = new HashSet(StringComparer.Ordinal); + foreach (string nativeGroup in nativeGroups) + { + if (!_typesByNativeGroup.TryGetValue(nativeGroup, out string? candidate)) + { + managedType = string.Empty; + return false; + } + + candidates.Add(candidate); + } + + if (candidates.Count == 1) + { + managedType = candidates.First(); + return true; + } + + managedType = string.Empty; + return false; + } + } +} diff --git a/tools/StgSharp.GenerateGL/Generation/GlGenerationTarget.cs b/tools/StgSharp.GenerateGL/Generation/GlGenerationTarget.cs new file mode 100644 index 00000000..d15f081a --- /dev/null +++ b/tools/StgSharp.GenerateGL/Generation/GlGenerationTarget.cs @@ -0,0 +1,20 @@ +// ----------------------------------------------------------------------------- +// file="GlGenerationTarget" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + +using System; + +namespace StgSharp.GenerateGL.Generation +{ + [Flags] + internal enum GlGenerationTarget + { + None = 0, + Api = 1, + Enum = 2, + All = Api | Enum, + } +} diff --git a/tools/StgSharp.GenerateGL/Generation/GlManagedApiSuppressionFilter.cs b/tools/StgSharp.GenerateGL/Generation/GlManagedApiSuppressionFilter.cs new file mode 100644 index 00000000..7f147428 --- /dev/null +++ b/tools/StgSharp.GenerateGL/Generation/GlManagedApiSuppressionFilter.cs @@ -0,0 +1,44 @@ +// ----------------------------------------------------------------------------- +// file="GlManagedApiSuppressionFilter" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using StgSharp.GenerateGL.Registry; + +namespace StgSharp.GenerateGL.Generation +{ + /// + /// Omits raw managed forwards for commands that have safer handwritten public APIs. + /// + internal sealed class GlManagedApiSuppressionFilter : IGlApiFilter + { + + private static readonly HashSet _suppressedCommands = new HashSet( + new[] + { + "glCreateShader", + "glShaderSource", + }, + StringComparer.Ordinal); + + public IReadOnlyList Apply( + GlCommandDefinition command, + IReadOnlyList methods, + GlEquivalentTypeMapper typeMapper + ) + { + ArgumentNullException.ThrowIfNull(command); + ArgumentNullException.ThrowIfNull(methods); + ArgumentNullException.ThrowIfNull(typeMapper); + + return _suppressedCommands.Contains(command.Name) + ? Array.Empty() + : methods; + } + + } +} diff --git a/tools/StgSharp.GenerateGL/Generation/ManagedApiModel.cs b/tools/StgSharp.GenerateGL/Generation/ManagedApiModel.cs index 34fa606d..9427bc38 100644 --- a/tools/StgSharp.GenerateGL/Generation/ManagedApiModel.cs +++ b/tools/StgSharp.GenerateGL/Generation/ManagedApiModel.cs @@ -17,6 +17,7 @@ namespace StgSharp.GenerateGL.Generation GlCommandDefinition NativeCommand, ManagedInvocation Invocation, bool WrapHandleReturn = false, + bool IsEnumReturn = false, string? DocumentationPage = null ); @@ -25,7 +26,8 @@ namespace StgSharp.GenerateGL.Generation string Name, GlParameterDefinition? NativeParameter = null, bool IsHandle = false, - bool IsHandleSpan = false + bool IsHandleSpan = false, + bool IsEnum = false ); internal abstract record ManagedInvocation; diff --git a/tools/StgSharp.GenerateGL/Generation/ManagedApiPlanner.cs b/tools/StgSharp.GenerateGL/Generation/ManagedApiPlanner.cs index 250c0d7d..3991e9f5 100644 --- a/tools/StgSharp.GenerateGL/Generation/ManagedApiPlanner.cs +++ b/tools/StgSharp.GenerateGL/Generation/ManagedApiPlanner.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using StgSharp.GenerateGL.Analysis; using StgSharp.GenerateGL.Naming; @@ -20,21 +21,26 @@ namespace StgSharp.GenerateGL.Generation private readonly IReadOnlyList _filters = Array.AsReadOnly( new IGlApiFilter[] { + new GlManagedApiSuppressionFilter(), new GlOverloadApiFilter(), new GlGetValueApiFilter(), new GlHandleApiFilter(), }); private readonly GlEquivalentTypeMapper _typeMapper; + private readonly GlEnumTypeMap _enumTypeMap; private readonly GlManagedApiNamePolicy _namePolicy; public ManagedApiPlanner( GlEquivalentTypeMapper typeMapper, - GlFunctionFamilyAnalysis familyAnalysis + GlFunctionFamilyAnalysis familyAnalysis, + GlEnumTypeMap enumTypeMap ) { ArgumentNullException.ThrowIfNull(typeMapper); ArgumentNullException.ThrowIfNull(familyAnalysis); + ArgumentNullException.ThrowIfNull(enumTypeMap); _typeMapper = typeMapper; + _enumTypeMap = enumTypeMap; _namePolicy = new GlManagedApiNamePolicy(familyAnalysis); } @@ -57,6 +63,8 @@ namespace StgSharp.GenerateGL.Generation methods = filter.Apply(command, methods, _typeMapper); } + methods = ApplyEnumTypes(command, methods); + result.AddRange( methods.Select( method => method with @@ -77,6 +85,77 @@ namespace StgSharp.GenerateGL.Generation return Array.AsReadOnly(result.ToArray()); } + private ReadOnlyCollection ApplyEnumTypes( + GlCommandDefinition command, + IReadOnlyList methods + ) + { + bool hasEnumReturn = _enumTypeMap.TryReadReturnType( + command.Return, + out string enumReturnType); + return Array.AsReadOnly( + methods.Select( + method => ConvertEnumReturn(method, hasEnumReturn, enumReturnType)).ToArray()); + } + + private ManagedMethodDefinition ConvertEnumReturn( + ManagedMethodDefinition method, + bool hasEnumReturn, + string enumReturnType + ) + { + string returnType = string.Empty; + bool isEnumReturn = hasEnumReturn && TryReplaceNativeEnumType( + method.ReturnType, + enumReturnType, + out returnType); + return method with + { + ReturnType = isEnumReturn ? returnType : method.ReturnType, + IsEnumReturn = isEnumReturn, + Parameters = Array.AsReadOnly( + method.Parameters.Select(ConvertEnumParameter).ToArray()), + }; + } + + private ManagedParameterDefinition ConvertEnumParameter( + ManagedParameterDefinition parameter + ) + { + if (parameter.NativeParameter is null || + !_enumTypeMap.TryReadParameterType( + parameter.NativeParameter, + out string enumType) || + !TryReplaceNativeEnumType(parameter.Type, enumType, out string convertedType)) + { + return parameter; + } + + return parameter with + { + Type = convertedType, + IsEnum = true, + }; + } + + private static bool TryReplaceNativeEnumType( + string nativeType, + string enumType, + out string convertedType + ) + { + const string nativeBaseType = "uint"; + if (!nativeType.StartsWith(nativeBaseType, StringComparison.Ordinal) || + nativeType.AsSpan(nativeBaseType.Length).ContainsAnyExcept('*')) + { + convertedType = string.Empty; + return false; + } + + convertedType = enumType + nativeType[nativeBaseType.Length..]; + return true; + } + public static void Validate( IEnumerable methods ) diff --git a/tools/StgSharp.GenerateGL/Generation/ManagedEnumModel.cs b/tools/StgSharp.GenerateGL/Generation/ManagedEnumModel.cs new file mode 100644 index 00000000..a0af98f2 --- /dev/null +++ b/tools/StgSharp.GenerateGL/Generation/ManagedEnumModel.cs @@ -0,0 +1,24 @@ +// ----------------------------------------------------------------------------- +// file="ManagedEnumModel" +// Project: StgSharp +// Copyright (c) Nitload. +// SPDX-License-Identifier: MIT +// ----------------------------------------------------------------------------- + +using System.Collections.Generic; +using StgSharp.GenerateGL.Registry; + +namespace StgSharp.GenerateGL.Generation +{ + internal sealed record ManagedEnumDefinition( + string Name, + bool IsFlags, + IReadOnlyList NativeGroups, + IReadOnlyList Members + ); + + internal sealed record ManagedEnumMemberDefinition( + string Name, + GlEnumDefinition NativeValue + ); +} diff --git a/tools/StgSharp.GenerateGL/Generation/OpenGlGenerator.cs b/tools/StgSharp.GenerateGL/Generation/OpenGlGenerator.cs index 94c47ed4..40dc9334 100644 --- a/tools/StgSharp.GenerateGL/Generation/OpenGlGenerator.cs +++ b/tools/StgSharp.GenerateGL/Generation/OpenGlGenerator.cs @@ -42,59 +42,76 @@ namespace StgSharp.GenerateGL.Generation StringComparer.Ordinal); public static GeneratedFileSet Generate( - GlRegistryProjection projection + GlRegistryProjection projection, + GlGenerationTarget target = GlGenerationTarget.All ) { ArgumentNullException.ThrowIfNull(projection); + if (target == GlGenerationTarget.None || (target & ~GlGenerationTarget.All) != 0) + { + throw new ArgumentOutOfRangeException(nameof(target)); + } - IReadOnlyList commandGroups = ReadCoreCommandGroups(projection); - IReadOnlyList commands = Array.AsReadOnly( - commandGroups.SelectMany(value => value.Commands).ToArray()); - GlEquivalentTypeMapper typeMapper = new GlEquivalentTypeMapper(projection.Source); - GlFunctionFamilyAnalysis familyAnalysis = GlFunctionFamilyAnalyzer.Analyze(projection); - ManagedApiPlanner apiPlanner = new ManagedApiPlanner(typeMapper, familyAnalysis); - IReadOnlyList managedMethods = apiPlanner.Plan(commands); - Dictionary> methodsByCommand = - managedMethods.GroupBy(value => value.NativeCommand.Name, StringComparer.Ordinal) - .ToDictionary( - value => value.Key, - value => (IReadOnlyList)Array.AsReadOnly( - value.ToArray()), - StringComparer.Ordinal); - List managedGroups = commandGroups.Select( - group => new ManagedCommandGroup( - group, - Array.AsReadOnly( - group.Commands.SelectMany( - command => methodsByCommand.TryGetValue( - command.Name, - out IReadOnlyList? methods) - ? methods - : Array.Empty()) - .ToArray()))).ToList(); - ManagedApiPlanner.Validate( - managedGroups.SelectMany(value => value.Methods)); - List files = new List + IReadOnlyList enums = GlEnumProjector.Project(projection); + GlEnumTypeMap enumTypeMap = new GlEnumTypeMap(enums); + List files = new List(); + if ((target & GlGenerationTarget.Enum) != 0) { - new GeneratedFile("glconst.cs", GenerateConstants(projection.Enums)), - new GeneratedFile( + files.Add(new GeneratedFile("glconst.cs", GenerateConstants(projection.Enums))); + files.Add(new GeneratedFile("GlEnums.g.cs", GenerateEnums(enums))); + } + + if ((target & GlGenerationTarget.Api) != 0) + { + IReadOnlyList commandGroups = ReadCoreCommandGroups(projection); + IReadOnlyList commands = Array.AsReadOnly( + commandGroups.SelectMany(value => value.Commands).ToArray()); + GlEquivalentTypeMapper typeMapper = new GlEquivalentTypeMapper(projection.Source); + GlFunctionFamilyAnalysis familyAnalysis = GlFunctionFamilyAnalyzer.Analyze(projection); + ManagedApiPlanner apiPlanner = new ManagedApiPlanner( + typeMapper, + familyAnalysis, + enumTypeMap); + IReadOnlyList managedMethods = apiPlanner.Plan(commands); + Dictionary> methodsByCommand = + managedMethods.GroupBy(value => value.NativeCommand.Name, StringComparer.Ordinal) + .ToDictionary( + value => value.Key, + value => (IReadOnlyList)Array.AsReadOnly( + value.ToArray()), + StringComparer.Ordinal); + List managedGroups = commandGroups.Select( + group => new ManagedCommandGroup( + group, + Array.AsReadOnly( + group.Commands.SelectMany( + command => methodsByCommand.TryGetValue( + command.Name, + out IReadOnlyList? methods) + ? methods + : Array.Empty()) + .ToArray()))).ToList(); + ManagedApiPlanner.Validate( + managedGroups.SelectMany(value => value.Methods)); + files.Add(new GeneratedFile( "OpenglContext.g.cs", - GenerateContext(commands, typeMapper)), - new GeneratedFile( + GenerateContext(commands, typeMapper))); + files.Add(new GeneratedFile( "glContextShadow.g.cs", - GenerateContextShadow(commands)), - }; - for (int index = 0; index < managedGroups.Count; index++) - { - ManagedCommandGroup managedGroup = managedGroups[index]; - GlCommandGroup group = managedGroup.Source; - files.Add( - new GeneratedFile( - group.FileName, - GenerateFunctions( - managedGroup.Methods, - group.Description, - index == 0))); + GenerateContextShadow(commands))); + for (int index = 0; index < managedGroups.Count; index++) + { + ManagedCommandGroup managedGroup = managedGroups[index]; + GlCommandGroup group = managedGroup.Source; + files.Add( + new GeneratedFile( + group.FileName, + GenerateFunctions( + managedGroup.Methods, + group.FileName, + group.Description, + index == 0))); + } } return new GeneratedFileSet(files); @@ -184,7 +201,7 @@ namespace StgSharp.GenerateGL.Generation ) { StringBuilder builder = new StringBuilder(512 * 1024); - AppendGeneratedHeader(builder, "Desktop OpenGL constants"); + AppendGeneratedHeader(builder, "glconst.cs", "Desktop OpenGL constants"); builder.Append("namespace StgSharp.Graphics.OpenGL\n"); builder.Append("{\n"); builder.Append(" public static class glConst\n"); @@ -227,6 +244,60 @@ namespace StgSharp.GenerateGL.Generation return builder.ToString(); } + private static string GenerateEnums( + IReadOnlyList enums + ) + { + StringBuilder builder = new StringBuilder(512 * 1024); + AppendGeneratedHeader( + builder, + "GlEnums.g.cs", + "Strongly typed desktop OpenGL enum groups"); + builder.Append("namespace StgSharp.Graphics.OpenGL\n"); + builder.Append("{\n"); + foreach (ManagedEnumDefinition value in enums) + { + builder.Append(" /// Native OpenGL group"); + builder.Append(value.NativeGroups.Count == 1 ? " " : "s "); + builder.Append(string.Join(", ", value.NativeGroups)); + builder.Append(".\n"); + if (value.IsFlags) + { + builder.Append(" [System.Flags]\n"); + } + + builder.Append(" public enum "); + builder.Append(value.Name); + builder.Append(" : uint\n"); + builder.Append(" {\n"); + foreach (ManagedEnumMemberDefinition member in value.Members) + { + builder.Append(" "); + builder.Append(member.Name); + builder.Append(" = "); + if (member.NativeValue.Name == "GL_NONE" && + member.NativeValue.Comment == + "Synthetic zero value for a generated flags enum.") + { + builder.Append("0u"); + } + else + { + builder.Append("unchecked((uint)glConst."); + builder.Append(ReadConstantName(member.NativeValue.Name)); + builder.Append(')'); + } + + builder.Append(",\n"); + } + + builder.Append(" }\n\n"); + } + + builder.Append("}\n"); + return builder.ToString(); + } + private static ConstantExpression ReadConstantExpression( GlEnumDefinition value ) @@ -329,7 +400,10 @@ namespace StgSharp.GenerateGL.Generation ) { StringBuilder builder = new StringBuilder(128 * 1024); - AppendGeneratedHeader(builder, "Desktop OpenGL core function pointer table"); + AppendGeneratedHeader( + builder, + "OpenglContext.g.cs", + "Desktop OpenGL core function pointer table"); builder.Append("namespace StgSharp.Graphics.OpenGL\n"); builder.Append("{\n"); builder.Append(" [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]\n"); @@ -360,7 +434,10 @@ namespace StgSharp.GenerateGL.Generation ) { StringBuilder builder = new StringBuilder(64 * 1024); - AppendGeneratedHeader(builder, "Native-address shadow of the OpenGL function pointer table"); + AppendGeneratedHeader( + builder, + "glContextShadow.g.cs", + "Native-address shadow of the OpenGL function pointer table"); builder.Append("namespace StgSharp.Graphics.OpenGL\n"); builder.Append("{\n"); builder.Append(" [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]\n"); @@ -389,13 +466,14 @@ namespace StgSharp.GenerateGL.Generation private static string GenerateFunctions( IReadOnlyList methods, + string outputFileName, string description, bool includeContextState ) { StringBuilder builder = new StringBuilder(512 * 1024); - AppendGeneratedHeader(builder, description); - builder.Append("using StgSharp.Mathematics.Graphics;\n\n"); + AppendGeneratedHeader(builder, outputFileName, description); + builder.Append("using StgSharp.Mathematics.Numeric.Graphics;\n\n"); builder.Append("using System;\n"); builder.Append("using System.Runtime.CompilerServices;\n\n"); builder.Append("namespace StgSharp.Graphics.OpenGL\n"); @@ -572,6 +650,12 @@ namespace StgSharp.GenerateGL.Generation { builder.Append("return GlHandle.Create("); } + else if (method.IsEnumReturn) + { + builder.Append("return ("); + builder.Append(method.ReturnType); + builder.Append(')'); + } else if (method.ReturnType != "void") { builder.Append("return "); @@ -719,7 +803,14 @@ namespace StgSharp.GenerateGL.Generation ManagedParameterDefinition parameter = method.Parameters[ parameterArgument.ParameterIndex]; string parameterName = EscapeIdentifier(parameter.Name); - if (!parameter.IsHandle) + if (parameter.IsEnum) + { + builder.Append("(uint"); + builder.Append('*', parameter.Type.Count(value => value == '*')); + builder.Append(')'); + builder.Append(parameterName); + } + else if (!parameter.IsHandle) { builder.Append(parameterName); } @@ -769,9 +860,18 @@ namespace StgSharp.GenerateGL.Generation private static void AppendGeneratedHeader( StringBuilder builder, + string outputFileName, string description ) { + builder.Append("// -----------------------------------------------------------------------------\n"); + builder.Append("// file=\""); + builder.Append(ReadGeneratedFileName(outputFileName)); + builder.Append("\"\n"); + builder.Append("// Project: StgSharp\n"); + builder.Append("// Copyright (c) Nitload.\n"); + builder.Append("// SPDX-License-Identifier: MIT\n"); + builder.Append("// -----------------------------------------------------------------------------\n\n"); builder.Append("// \n"); builder.Append("// Generated by StgSharp.GenerateGL.\n"); builder.Append("// "); @@ -780,6 +880,22 @@ namespace StgSharp.GenerateGL.Generation builder.Append("// \n\n"); } + private static string ReadGeneratedFileName( + string outputFileName + ) + { + const string generatedExtension = ".g.cs"; + const string sourceExtension = ".cs"; + if (outputFileName.EndsWith(generatedExtension, StringComparison.Ordinal)) + { + return outputFileName[..^generatedExtension.Length]; + } + + return outputFileName.EndsWith(sourceExtension, StringComparison.Ordinal) + ? outputFileName[..^sourceExtension.Length] + : outputFileName; + } + private sealed record ConstantExpression( string Type, string Literal diff --git a/tools/StgSharp.GenerateGL/README.md b/tools/StgSharp.GenerateGL/README.md index 9cbd999a..3d21a65b 100644 --- a/tools/StgSharp.GenerateGL/README.md +++ b/tools/StgSharp.GenerateGL/README.md @@ -21,7 +21,7 @@ show command glBindBuffer target summary families list Vertex families show VertexAttributeP -generate +generate all list files preview OpenGLFunction.v4_1.g.cs ``` @@ -29,9 +29,21 @@ preview OpenGLFunction.v4_1.g.cs Generate directly into an existing directory: ```powershell -dotnet run --project tools/StgSharp.GenerateGL/StgSharp.GenerateGL.csproj -- generate src/StgSharp.Graphics/OpenGL/Generated +dotnet run --project tools/StgSharp.GenerateGL/StgSharp.GenerateGL.csproj -- generate all src/StgSharp.Graphics/OpenGL/Generated ``` +Generation targets are explicit: + +```text +generate api [output-directory] # function tables and managed forwarding APIs +generate enum [output-directory] # glConst and strongly typed enum groups +generate all [output-directory] # both sets +``` + +The API files reference the generated enum types. Use `generate all` for a clean output +directory; use `generate api` when refreshing an output tree that already contains the enum +files. + Without a directory, `generate` retains its output in the current CLI session. With a directory: - the directory must already exist and be writable; @@ -47,6 +59,7 @@ Use a directory dedicated to generated source files. gl.xml -> lossless XML and registry models -> desktop OpenGL 4.6 Core projection + -> GLenum/GLbitfield semantic group projection -> function-family and scalar/vector relation analysis -> managed API filters -> C# naming and signature validation @@ -59,6 +72,7 @@ The target projection removes GLES and ARB/NV/EXT extension entry points. It ret Generated files: - `glconst.cs`: core constants; +- `GlEnums.g.cs`: strongly typed enum groups referenced by Core Profile parameters and return values; - `OpenglContext.g.cs`: the function-pointer table with native names and ABI types; - `glContextShadow.g.cs`: an identically ordered `nint` table used while loading native entry points; - `OpenGLFunction.Base.g.cs`: APIs introduced through OpenGL 3.2 and retained in the target profile; @@ -134,6 +148,10 @@ Renaming never changes the native target. For example, `VertexAttributeInteger(. ## Type rules - `gl.xml` typedefs map to equivalent C# ABI types; the generator does not emit separate type aliases; +- `GLenum` and `GLbitfield` declarations with one unambiguous registry group use the generated enum type in public APIs; +- enum pointers preserve their pointer shape (for example, `GLenum*` becomes `DebugSource*`) and are cast back to the native `uint*` representation at the forwarding boundary; +- enum return values are converted from the native `uint` representation before being returned; +- declarations with missing or conflicting enum group metadata remain on their ABI type; - a `GLuint` is converted to `GlHandle` only when object class and parameter semantics identify it as an object handle; - handle arrays use `Span` or `ReadOnlySpan`; - `OpenGLFunction` stores an `OpenglContext*` and forwards through `__context->glFunction(...)`; @@ -141,6 +159,8 @@ Renaming never changes the native target. For example, `VertexAttributeInteger(. A `T*` alone does not determine whether a managed API should use `Span`, `ReadOnlySpan`, `out T`, or a return value. Future pointer improvements should be implemented as family-specific filters validated with `len`, parameter direction, and OpenGL state semantics. +Raw managed forwards are omitted when a safer handwritten public API owns the command. In particular, `glShaderSource` remains in `OpenglContext` for ABI loading, while `OpenGLFunction` exposes the handwritten `ReadOnlySpan` and `string` overloads instead of a generated `byte**` signature. + ## Documentation comments Every generated public method contains: diff --git a/tools/StgSharp.GenerateGL/XmlCli.cs b/tools/StgSharp.GenerateGL/XmlCli.cs index 4050f9ad..0bf03c2f 100644 --- a/tools/StgSharp.GenerateGL/XmlCli.cs +++ b/tools/StgSharp.GenerateGL/XmlCli.cs @@ -1437,7 +1437,7 @@ namespace StgSharp.GenerateGL Console.WriteLine(" StgSharp.GenerateGL [--xml ] show " + "[--showcount ]"); Console.WriteLine( - " StgSharp.GenerateGL [--xml ] generate [output-directory]"); + " StgSharp.GenerateGL [--xml ] generate [output-directory]"); Console.WriteLine(" StgSharp.GenerateGL [--xml ] target summary"); Console.WriteLine(" StgSharp.GenerateGL [--xml ] families "); Console.WriteLine(" StgSharp.GenerateGL [--xml ] list files"); @@ -1456,9 +1456,9 @@ namespace StgSharp.GenerateGL Console.WriteLine(" StgSharp.GenerateGL show extension GL_KHR_debug"); Console.WriteLine(" StgSharp.GenerateGL target summary"); Console.WriteLine(" StgSharp.GenerateGL families show VertexAttribP"); - Console.WriteLine(" StgSharp.GenerateGL generate"); + Console.WriteLine(" StgSharp.GenerateGL generate all"); Console.WriteLine( - " StgSharp.GenerateGL generate src/StgSharp.Graphics/OpenGL/Generated"); + " StgSharp.GenerateGL generate all src/StgSharp.Graphics/OpenGL/Generated"); Console.WriteLine(" StgSharp.GenerateGL list files"); Console.WriteLine(" StgSharp.GenerateGL preview glconst.cs"); Console.WriteLine(" StgSharp.GenerateGL xml tree --depth 1");