From a798ab07f17fa1aec7a522a3ecddce1e8bcdf3fc Mon Sep 17 00:00:00 2001 From: Youmu Liu <105042599+Nitload-NSI@users.noreply.github.com> Date: Fri, 27 Feb 2026 17:09:13 +0800 Subject: [PATCH] arrange of proj structure --- .../Controlling/Controls/BattleField.cs | 4 +- .../Controlling/Controls/ButtonGroup.cs | 4 +- .../Controls/CharacterIndexImage.cs | 4 +- .../Controlling/Controls/ControllingIntem.cs | 4 +- .../Controlling/Controls/DecorationBox.cs | 4 +- .../Controlling/Controls/MarkingLable.cs | 4 +- .../Controlling/Controls/TriggerButton.cs | 4 +- StgSharp.Common/Counter.cs | 114 - StgSharp.Common/Data/GlobalData/root.cs | 39 - StgSharp.Common/Data/SSD/Area.cs | 44 - StgSharp.Common/Data/SSD/DataHead.cs | 77 - StgSharp.Common/Data/SSD/DataSegment.cs | 186 - StgSharp.Common/Data/SSD/SSD.cs | 64 - StgSharp.Common/Data/SSD/SSDVirtualFolder.cs | 77 - StgSharp.Common/Data/Serialize/Define.cs | 38 - .../Data/Serialize/ISSDSerializable.cs | 103 - .../Coordination/CoordinationBase.cs | 4 +- .../Coordination/PlainCoordinate.cs | 4 +- .../Coordination/SpaceCoordinate.cs | 4 +- .../GeometryOperation/GeometryOperation.cs | 4 +- StgSharp.Common/Geometries/IGeometry.cs | 4 +- StgSharp.Common/Geometries/IInstancing.cs | 4 +- .../Geometries/IInstancingBuffer.cs | 4 +- .../PlainGeometry/Define/GeometryOperation.cs | 4 +- .../PlainGeometry/Define/IPlainEntity.cs | 4 +- .../PlainGeometry/Define/ParticleOnPlain.cs | 4 +- .../PlainGeometry/Define/PlainGeometry.cs | 4 +- .../Define/PlainInstancingBuffer.cs | 4 +- .../Geometries/PlainGeometry/Parallelogram.cs | 4 +- .../Geometries/PlainGeometry/Plain.cs | 4 +- .../Geometries/PlainGeometry/Polygon4.cs | 32 +- .../Geometries/PlainGeometry/Polygon5.cs | 4 +- .../Geometries/PlainGeometry/Polygon6.cs | 4 +- .../Geometries/PlainGeometry/Rectangle.cs | 4 +- .../Geometries/PlainGeometry/Triangle.cs | 4 +- StgSharp.Common/Geometries/Point.cs | 19 +- .../SpaceGeometry/TriangulatedSurface.cs | 4 +- StgSharp.Common/Global.cs | 63 +- StgSharp.Common/Graphics/IGraphicAPIs.cs | 40 - StgSharp.Common/Internal/DefaultLog.cs | 24 +- .../Internal/Graphic/BuiltinShader.cs | 97 - StgSharp.Common/Internal/StructDefine.cs | 944 -- .../MVVM/OpenGLControllingItemRender.cs | 54 - StgSharp.Common/MVVM/ViewModel/ViewModel.cs | 2 +- .../Mathematics/Linear/ElementType.cs | 76 - StgSharp.Common/Stg/Bullet.cs | 2 +- StgSharp.Common/Stg/CollisionTexture.cs | 2 +- StgSharp.Common/StgSharp.Common.csproj | 4 + .../Internal}/ColumnSet2.cs | 186 +- .../Internal}/ColumnSet3.cs | 166 +- .../Internal}/ColumnSet4.cs | 202 +- .../Internal}/IntrinsicContext.cs | 200 +- .../Internal}/SIMDID.cs | 102 +- .../Internal}/intrinsicContextProvider.cs | 159 +- .../Numeric/Graphics}/Matrix44.cs | 525 +- .../Numeric/Graphics}/Vec2.cs | 324 +- .../Numeric/Graphics}/Vec3.cs | 524 +- .../Numeric/Graphics}/Vec4.cs | 461 +- .../Numeric/Graphics}/Vector.Cross.cs | 98 +- .../Numeric/Graphics}/Vector.GetAngle.cs | 94 +- .../Numeric/Graphics}/Vector.GetLength.cs | 92 +- .../Numeric/Graphics}/Vector.Normalize.cs | 164 +- .../Numeric/Graphics}/Vector.Orthogonalize.cs | 184 +- .../Numeric}/Linear/CoordinationNaming.md | 176 +- .../Numeric}/Linear/Cordination.cs | 76 +- .../Numeric}/Linear/IUnmanagedVector.cs | 92 +- .../Numeric}/Linear/Matrix.Create.cs | 202 +- .../Numeric}/Linear/Matrix.cs | 408 +- .../Numeric}/Linear/MatrixIndex.cs | 140 +- .../Numeric}/Linear/MatrixMetadata.cs | 504 +- .../Numeric}/Linear/MatrixStorage.cs | 144 +- .../Numeric/MatrixCompute.Float.cs | 10 +- .../Numeric/MatrixCompute.double.cs | 10 +- .../Numeric/MatrixParallelTaskPackage.cs | 147 - .../{ => Runtime}/MatrixParallel.Await.cs | 292 +- .../MatrixParallel.AwaitingQueue.cs | 312 +- .../{ => Runtime}/MatrixParallel.Publish.cs | 160 +- .../Numeric/{ => Runtime}/MatrixParallel.cs | 264 +- .../{ => Runtime}/MatrixParallelQueue.cs | 6 +- .../Numeric/Runtime/MatrixParallelTask.cs | 132 +- .../{ => Runtime}/MatrixParallelThread.Fma.cs | 42 +- .../MatrixParallelThread.Model.cs | 4 +- .../{ => Runtime}/MatrixParallelThread.cs | 338 +- .../{ => Runtime}/MatrixParallelWrap.cs | 244 +- .../{ => Runtime}/MatrixTaskFactory.cs | 236 +- .../Numeric}/Scalar/ACos.cs | 214 +- .../Numeric}/Scalar/ASin.cs | 238 +- .../Numeric}/Scalar/ATan.cs | 232 +- .../Numeric}/Scalar/BasicOps.cs | 132 +- .../Numeric}/Scalar/Compare.cs | 128 +- .../Numeric}/Scalar/Cos.cs | 114 +- .../Numeric}/Scalar/Ctor.cs | 104 +- .../Numeric}/Scalar/Exp.cs | 218 +- .../Numeric}/Scalar/Factorial.cs | 136 +- .../Numeric}/Scalar/Function.cs | 62 +- .../Numeric}/Scalar/Log.cs | 160 +- .../Numeric}/Scalar/Pow.cs | 242 +- .../Numeric}/Scalar/Random.cs | 252 +- .../Numeric}/Scalar/SignOf.cs | 130 +- .../Numeric}/Scalar/Sin.cs | 94 +- .../Numeric}/Scalar/Sqrt.cs | 148 +- .../Numeric}/Scalar/Tan.cs | 86 +- StgSharp.Model/Step/Items/StepTriple.cs | 2 +- StgSharp.Model/Step/Items/StepVertex.cs | 2 +- StgSharp.Model/Step/StepDataParser.cs | 4 +- StgSharp.Native/StgSharp.Native.vcxproj | 1 - .../StgSharp.Native.vcxproj.filters | 3 - StgSharp.Native/sn-head/sn_intrinsic.h | 88 +- StgSharp.Native/sn-head/sn_matkernel.h | 3 +- StgSharp.Native/sn-head/sn_task_expand.h | 0 StgSharp.Native/sn-src/load_intrinsic.x86.c | 12 - StgSharp.Native/sn-src/m.fma.x86.c | 36 +- StgSharp.Native/sn-src/m.fma_tile.x86.c | 10 +- StgSharpDebug/RenderStream/Partical.cs | 2 +- StgSharpDevelop.sln | 14 + .../CPUanimation/IImageProvider.cs | 80 +- .../CPUanimation/ImageHelper.cs | 166 +- .../Graphic => StgsSharp.Graphics}/Camera.cs | 612 +- .../Define/BufferObjectBase.cs | 172 +- .../FrameworkConstant.cs | 672 +- .../Graphics => StgsSharp.Graphics}/Image.cs | 396 +- .../ImageInfo.cs | 324 +- .../OpenGL/Buffer/AutoTexture.cs | 320 +- .../OpenGL/Buffer/EBO.cs | 160 +- .../OpenGL/Buffer/FBO.cs | 230 +- .../OpenGL/Buffer/GLBufferObjectBase.cs | 100 +- .../OpenGL/Buffer/RBO.cs | 134 +- .../OpenGL/Buffer/TextureGL.cs | 620 +- .../OpenGL/Buffer/VAO.cs | 170 +- .../OpenGL/Buffer/VBO.cs | 360 +- .../OpenGL/ShaderEdit/IglConvertable.cs | 130 +- .../OpenGL/ShaderEdit/Shader.cs | 634 +- .../OpenGL/ShaderEdit/Uniform.cs | 448 +- .../OpenGL/glApiManager.Const.cs | 1370 +-- .../OpenGL/glApiManager.Load.cs | 3222 +++--- .../OpenGL/glApiManager.cs | 6860 ++++++------- .../OpenGL/glConst.cs | 9126 ++++++++--------- .../OpenGL/glContext.cs | 1390 +-- .../OpenGL/glContextShadow.cs | 1396 +-- .../OpenGL/glEnum.cs | 448 +- .../OpenGL/glException.cs | 196 +- .../OpenGL/glFunction.SourceManager.cs | 182 +- .../OpenGL/glFunction.cs | 1634 +-- .../OpenGL/glFunction.v3_3.cs | 7578 +++++++------- .../OpenGL/glFunction.v4_0.cs | 1088 +- .../OpenGL/glFunction.v4_1.cs | 2210 ++-- .../OpenGL/glFunction.v4_2.cs | 380 +- .../OpenGL/glFunction.v4_3.cs | 1168 +-- .../OpenGL/glFunction.v4_4.cs | 358 +- .../OpenGL/glFunction.v4_5.cs | 2710 ++--- .../OpenGL/glFunction.v4_6.cs | 204 +- .../OpenGL/glHandle.cs | 166 +- .../OpenGL/glRenderObjectGenrator.cs | 238 +- .../OpenGL/glRenderStream.ThreadSecurity.cs | 92 +- .../OpenGL/glRenderStream.cs | 394 +- .../OpenGL/glType.cs | 220 +- .../Graphics => StgsSharp.Graphics}/Pixels.cs | 166 +- .../PlainGeometryMesh.cs | 193 +- .../RenderStream.cs | 517 +- .../ShaderEdit/ShaderGenerator.cs | 404 +- .../ShaderEdit/ShaderStruct.cs | 192 +- StgsSharp.Graphics/StgsSharp.Graphics.csproj | 33 + .../TexturePipeline.cs | 128 +- .../TextureProvider.cs | 181 +- StgsSharp.Graphics/ViewPort.cs | 132 + .../Vulkan/vkEnum.cs | 152 +- .../Vulkan/vkHandle.cs | 96 +- .../framework.cs | 218 +- .../frameworkSyncContext.cs | 148 +- .../Graphic => StgsSharp.Graphics}/gl.cs | 218 +- .../Graphic => StgsSharp.Graphics}/glfw.cs | 2203 ++-- StgsSharp.Graphics/glfw.dtruct.cs | 108 + .../glfw.function.cs | 320 +- 173 files changed, 32304 insertions(+), 33955 deletions(-) delete mode 100644 StgSharp.Common/Counter.cs delete mode 100644 StgSharp.Common/Data/GlobalData/root.cs delete mode 100644 StgSharp.Common/Data/SSD/Area.cs delete mode 100644 StgSharp.Common/Data/SSD/DataHead.cs delete mode 100644 StgSharp.Common/Data/SSD/DataSegment.cs delete mode 100644 StgSharp.Common/Data/SSD/SSD.cs delete mode 100644 StgSharp.Common/Data/SSD/SSDVirtualFolder.cs delete mode 100644 StgSharp.Common/Data/Serialize/Define.cs delete mode 100644 StgSharp.Common/Data/Serialize/ISSDSerializable.cs delete mode 100644 StgSharp.Common/Graphics/IGraphicAPIs.cs delete mode 100644 StgSharp.Common/Internal/Graphic/BuiltinShader.cs delete mode 100644 StgSharp.Common/Internal/StructDefine.cs delete mode 100644 StgSharp.Common/MVVM/OpenGLControllingItemRender.cs delete mode 100644 StgSharp.Common/Mathematics/Linear/ElementType.cs rename {StgSharp.Common/Internal/Intrinsic => StgSharp.Mathematics/Internal}/ColumnSet2.cs (81%) rename {StgSharp.Common/Internal/Intrinsic => StgSharp.Mathematics/Internal}/ColumnSet3.cs (93%) rename {StgSharp.Common/Internal/Intrinsic => StgSharp.Mathematics/Internal}/ColumnSet4.cs (93%) rename {StgSharp.Common/Internal/Intrinsic => StgSharp.Mathematics/Internal}/IntrinsicContext.cs (52%) rename {StgSharp.Common/Internal/Intrinsic => StgSharp.Mathematics/Internal}/SIMDID.cs (91%) rename {StgSharp.Common/Internal/Intrinsic => StgSharp.Mathematics/Internal}/intrinsicContextProvider.cs (56%) rename {StgSharp.Common/Mathematics/Graphic => StgSharp.Mathematics/Numeric/Graphics}/Matrix44.cs (96%) rename {StgSharp.Common/Mathematics/Graphic => StgSharp.Mathematics/Numeric/Graphics}/Vec2.cs (94%) rename {StgSharp.Common/Mathematics/Graphic => StgSharp.Mathematics/Numeric/Graphics}/Vec3.cs (71%) rename {StgSharp.Common/Mathematics/Graphic => StgSharp.Mathematics/Numeric/Graphics}/Vec4.cs (76%) rename {StgSharp.Common/Mathematics/Graphic => StgSharp.Mathematics/Numeric/Graphics}/Vector.Cross.cs (90%) rename {StgSharp.Common/Mathematics/Graphic => StgSharp.Mathematics/Numeric/Graphics}/Vector.GetAngle.cs (90%) rename {StgSharp.Common/Mathematics/Graphic => StgSharp.Mathematics/Numeric/Graphics}/Vector.GetLength.cs (89%) rename {StgSharp.Common/Mathematics/Graphic => StgSharp.Mathematics/Numeric/Graphics}/Vector.Normalize.cs (91%) rename {StgSharp.Common/Mathematics/Graphic => StgSharp.Mathematics/Numeric/Graphics}/Vector.Orthogonalize.cs (92%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Linear/CoordinationNaming.md (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Linear/Cordination.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Linear/IUnmanagedVector.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Linear/Matrix.Create.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Linear/Matrix.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Linear/MatrixIndex.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Linear/MatrixMetadata.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Linear/MatrixStorage.cs (97%) delete mode 100644 StgSharp.Mathematics/Numeric/MatrixParallelTaskPackage.cs rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixParallel.Await.cs (97%) rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixParallel.AwaitingQueue.cs (97%) rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixParallel.Publish.cs (96%) rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixParallel.cs (96%) rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixParallelQueue.cs (93%) rename StgSharp.Common/Data/SSD/SSDraw.cs => StgSharp.Mathematics/Numeric/Runtime/MatrixParallelTask.cs (56%) rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixParallelThread.Fma.cs (61%) rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixParallelThread.Model.cs (96%) rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixParallelThread.cs (95%) rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixParallelWrap.cs (97%) rename StgSharp.Mathematics/Numeric/{ => Runtime}/MatrixTaskFactory.cs (84%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/ACos.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/ASin.cs (96%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/ATan.cs (96%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/BasicOps.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Compare.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Cos.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Ctor.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Exp.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Factorial.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Function.cs (98%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Log.cs (98%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Pow.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Random.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/SignOf.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Sin.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Sqrt.cs (97%) rename {StgSharp.Common/Mathematics => StgSharp.Mathematics/Numeric}/Scalar/Tan.cs (97%) create mode 100644 StgSharp.Native/sn-head/sn_task_expand.h rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/CPUanimation/IImageProvider.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/CPUanimation/ImageHelper.cs (97%) rename {StgSharp.Common/Mathematics/Graphic => StgsSharp.Graphics}/Camera.cs (95%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/Define/BufferObjectBase.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/FrameworkConstant.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/Image.cs (86%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/ImageInfo.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/Buffer/AutoTexture.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/Buffer/EBO.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/Buffer/FBO.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/Buffer/GLBufferObjectBase.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/Buffer/RBO.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/Buffer/TextureGL.cs (96%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/Buffer/VAO.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/Buffer/VBO.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/ShaderEdit/IglConvertable.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/ShaderEdit/Shader.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/ShaderEdit/Uniform.cs (96%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glApiManager.Const.cs (98%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glApiManager.Load.cs (98%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glApiManager.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glConst.cs (98%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glContext.cs (98%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glContextShadow.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glEnum.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glException.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.SourceManager.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.v3_3.cs (96%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.v4_0.cs (96%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.v4_1.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.v4_2.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.v4_3.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.v4_4.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.v4_5.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glFunction.v4_6.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glHandle.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glRenderObjectGenrator.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glRenderStream.ThreadSecurity.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glRenderStream.cs (96%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/OpenGL/glType.cs (96%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/Pixels.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/PlainGeometryMesh.cs (86%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/RenderStream.cs (86%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/ShaderEdit/ShaderGenerator.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/ShaderEdit/ShaderStruct.cs (97%) create mode 100644 StgsSharp.Graphics/StgsSharp.Graphics.csproj rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/TexturePipeline.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/TextureProvider.cs (84%) create mode 100644 StgsSharp.Graphics/ViewPort.cs rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/Vulkan/vkEnum.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/Vulkan/vkHandle.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/framework.cs (97%) rename {StgSharp.Common/Graphics => StgsSharp.Graphics}/frameworkSyncContext.cs (97%) rename {StgSharp.Common/Internal/Graphic => StgsSharp.Graphics}/gl.cs (78%) rename {StgSharp.Common/Internal/Graphic => StgsSharp.Graphics}/glfw.cs (96%) create mode 100644 StgsSharp.Graphics/glfw.dtruct.cs rename {StgSharp.Common/Internal/Graphic => StgsSharp.Graphics}/glfw.function.cs (98%) diff --git a/StgSharp.Common/Controlling/Controls/BattleField.cs b/StgSharp.Common/Controlling/Controls/BattleField.cs index 12f2542b..79e1228f 100644 --- a/StgSharp.Common/Controlling/Controls/BattleField.cs +++ b/StgSharp.Common/Controlling/Controls/BattleField.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="BattleField" // Project: StgSharp @@ -29,7 +29,7 @@ using StgSharp.Geometries; using StgSharp.Graphics; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Controlling/Controls/ButtonGroup.cs b/StgSharp.Common/Controlling/Controls/ButtonGroup.cs index 5aaa6179..4682497d 100644 --- a/StgSharp.Common/Controlling/Controls/ButtonGroup.cs +++ b/StgSharp.Common/Controlling/Controls/ButtonGroup.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="ButtonGroup" // Project: StgSharp @@ -28,7 +28,7 @@ using StgSharp.Geometries; using StgSharp.Graphics; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Controlling/Controls/CharacterIndexImage.cs b/StgSharp.Common/Controlling/Controls/CharacterIndexImage.cs index 420df6af..7b931551 100644 --- a/StgSharp.Common/Controlling/Controls/CharacterIndexImage.cs +++ b/StgSharp.Common/Controlling/Controls/CharacterIndexImage.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="CharacterIndexImage" // Project: StgSharp @@ -28,7 +28,7 @@ using StgSharp.Geometries; using StgSharp.Graphics; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections; diff --git a/StgSharp.Common/Controlling/Controls/ControllingIntem.cs b/StgSharp.Common/Controlling/Controls/ControllingIntem.cs index 270f3683..419cd434 100644 --- a/StgSharp.Common/Controlling/Controls/ControllingIntem.cs +++ b/StgSharp.Common/Controlling/Controls/ControllingIntem.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="ControllingIntem" // Project: StgSharp @@ -27,7 +27,7 @@ // ----------------------------------------------------------------------- using StgSharp.Geometries; using StgSharp.Graphics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections; diff --git a/StgSharp.Common/Controlling/Controls/DecorationBox.cs b/StgSharp.Common/Controlling/Controls/DecorationBox.cs index 0f5e9ef4..8911bd38 100644 --- a/StgSharp.Common/Controlling/Controls/DecorationBox.cs +++ b/StgSharp.Common/Controlling/Controls/DecorationBox.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="DecorationBox.cs" // Project: StgSharp @@ -30,7 +30,7 @@ // ----------------------------------------------------------------------- using StgSharp.Geometries; using StgSharp.Graphics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Controlling/Controls/MarkingLable.cs b/StgSharp.Common/Controlling/Controls/MarkingLable.cs index a13e1624..06bb347b 100644 --- a/StgSharp.Common/Controlling/Controls/MarkingLable.cs +++ b/StgSharp.Common/Controlling/Controls/MarkingLable.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="MarkingLable" // Project: StgSharp @@ -29,7 +29,7 @@ using StgSharp.Controls; using StgSharp.Geometries; using StgSharp.Graphics; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using StgSharp.Timing; using System; diff --git a/StgSharp.Common/Controlling/Controls/TriggerButton.cs b/StgSharp.Common/Controlling/Controls/TriggerButton.cs index 2ad54175..58af321b 100644 --- a/StgSharp.Common/Controlling/Controls/TriggerButton.cs +++ b/StgSharp.Common/Controlling/Controls/TriggerButton.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="TriggerButton" // Project: StgSharp @@ -29,7 +29,7 @@ using StgSharp.Controls; using StgSharp.Geometries; using StgSharp.Graphics; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Counter.cs b/StgSharp.Common/Counter.cs deleted file mode 100644 index aaf36c39..00000000 --- a/StgSharp.Common/Counter.cs +++ /dev/null @@ -1,114 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Counter" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Numerics; - -namespace StgSharp -{ - public class Counter where T: unmanaged, INumber - { - - internal dynamic _value; - internal readonly T _defaultDecrement; - - internal readonly T _defaultIncrement; - internal readonly T _defaultValue; - - public Counter(T defaultValue, T defaultIncrement, T defaultDecrement) - { - _value = defaultValue; - _defaultValue = defaultValue; - _defaultIncrement = defaultIncrement; - _defaultDecrement = defaultDecrement; - } - - public T DecrementSpan => _defaultDecrement; - - public T IncrementSpan => _defaultIncrement; - - public T CurrentSpan => _value - _defaultValue; - - public T Value - { - get => _value; - set => _value = value; - } - - public void Add(T value) - { - _value += value; - } - - public void QuickAdd() - { - _value += _defaultIncrement; - } - - public void QuickSub() - { - _value -= _defaultDecrement; - } - - public void Reset() - { - _value = _defaultValue; - } - - public void Sub(T value) - { - _value -= value; - } - - public override string ToString() - { - return Value.ToString() ?? string.Empty; - } - - public static Counter operator --(Counter counter) - { - counter?.QuickSub(); - return counter; - } - - public static Counter operator ++(Counter counter) - { - counter?.QuickAdd(); - return counter; - } - - public static implicit operator T(Counter counter) - { - return counter switch - { - null => T.Zero, - _ => counter.Value - }; - } - - } -} \ No newline at end of file diff --git a/StgSharp.Common/Data/GlobalData/root.cs b/StgSharp.Common/Data/GlobalData/root.cs deleted file mode 100644 index f15bbfd1..00000000 --- a/StgSharp.Common/Data/GlobalData/root.cs +++ /dev/null @@ -1,39 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="root" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Internal; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp -{ - public static unsafe partial class World { }//------------------ end of class --------------------- -} diff --git a/StgSharp.Common/Data/SSD/Area.cs b/StgSharp.Common/Data/SSD/Area.cs deleted file mode 100644 index ceb3c0af..00000000 --- a/StgSharp.Common/Data/SSD/Area.cs +++ /dev/null @@ -1,44 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Area" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Internal.FileIO; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Internal -{ - /// - /// An independent storage area, used as the only folder type in root folder. Contains several - /// files reference as virtual disc. Data is actually stored in s in certain RAID mode. - /// - public partial class Area { } -} diff --git a/StgSharp.Common/Data/SSD/DataHead.cs b/StgSharp.Common/Data/SSD/DataHead.cs deleted file mode 100644 index d798ab0f..00000000 --- a/StgSharp.Common/Data/SSD/DataHead.cs +++ /dev/null @@ -1,77 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="DataHead" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; - -using System; -using System.Numerics; -using System.Runtime.InteropServices; - -namespace StgSharp.Internal -{ - [StructLayout(LayoutKind.Explicit, Size = 16)] - public struct SSDSegmentHead - { - - [FieldOffset(12)] internal byte size; - - [FieldOffset(0)] internal M128 data; - [FieldOffset(13)] public byte selfDefine_1; - [FieldOffset(14)] public byte selfDefine_2; - [FieldOffset(15)] public byte selfDefine_3; - - [FieldOffset(0)] public int globalID; - [FieldOffset(4)] public int nextID; - [FieldOffset(8)] public int previousHash; - - public int Size - { - get => ((int)size) + 1; - set - { - if ((value > 256) || (value < 0)) { - throw new ArgumentOutOfRangeException(); - } - size = (byte)(value - 1); - } - } - - public unsafe byte[] GetBytes() - { - byte[] ret = new byte[16]; - fixed (M128* vptr = &data) - { - byte* bptr = (byte*)vptr; - for (int i = 0; i < 15; i++) { - ret[i] = *bptr; - } - } - return ret; - } - - } -} diff --git a/StgSharp.Common/Data/SSD/DataSegment.cs b/StgSharp.Common/Data/SSD/DataSegment.cs deleted file mode 100644 index 67e4449a..00000000 --- a/StgSharp.Common/Data/SSD/DataSegment.cs +++ /dev/null @@ -1,186 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="DataSegment" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.HighPerformance; -using StgSharp.Internal.Intrinsic; - -using StgSharp.Mathematics; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Internal -{ - [StructLayout(LayoutKind.Explicit, Size = World.ssdSegmentLength * 16)] - public unsafe struct SSDSegment : IComparable, IComparable - { - - [FieldOffset(16)] public fixed byte Data[16 * (World.ssdSegmentLength - 1)]; - [FieldOffset(12)] public int DataHash; - [FieldOffset(8)] public int PreviousHash; - [FieldOffset(0 * 16)] public SSDSegmentHead Head; - - public SSDSegment(int previousHash) - { - this.PreviousHash = previousHash; - } - - public byte this[int index] - { - get - { - if (index > (16 * (World.ssdSegmentLength - 1)) - 1) { - throw new IndexOutOfRangeException(); - } - return Data[index]; - } - - set - { - if (index > (16 * (World.ssdSegmentLength - 1)) - 1) { - throw new IndexOutOfRangeException(); - } - Data[index] = value; - } - } - - public int ID - { - get { return Head.globalID; } - set { Head.globalID = value; } - } - - public short Size => Head.size; - - public void FillRandomBytes(int begin) - { - if (begin > 255) { - return; - } - for (int i = begin; i < 255; i++) { - Data[i] = Scalar.Random(); - } - } - - public static SSDSegment FromStream(byte[] stream) - { - if (stream.Length != 16 * World.ssdSegmentLength) { - throw new ArgumentException(); - } - SSDSegment ret = new SSDSegment(); - fixed (byte* bptr = stream) - { - ret.Head.data = *(M128*)bptr; - for (int i = 1; i < World.ssdSegmentLength; i++) { - ret.WriteData(i - 1, *(M128*)(bptr + (16 * i))); - } - } - return ret; - } - - public byte[] GetBytes() - { - byte[] ret = new byte[16 * World.ssdSegmentLength]; - fixed (M128* mptr = &Head.data) - { - fixed (byte* aptr = ret) - { - Vector4* vsptr = (Vector4*)mptr; - Vector4* vtptr = (Vector4*)aptr; - for (int i = 0; i < 18; i++) { - *(vtptr + i) = *(vsptr + i); - } - } - } - - return ret; - } - - public int GetDataHash() - { - Vector4 v = Vector4.One; - fixed (M128* mptr = &Head.data) - { - Vector4* vptr = (Vector4*)mptr; - for (int i = 0; i < World.ssdSegmentLength - 1; i += 1) { - v += (*vptr) * 31; - } - } - M128 m = new M128(v); - DataHash = m.Vec.GetHashCode(); - return DataHash; - } - - public override int GetHashCode() - { - int ret = 17; - fixed (M128* mptr = &Head.data) - { - Vector4* vptr = (Vector4*)mptr; - for (int i = 0; i < World.ssdSegmentLength; i++) { - ret = (ret + (*vptr).GetHashCode()) * 31; - } - } - return ret; - } - - public unsafe T ReadData(int index) where T: unmanaged - { - fixed (byte* bptr = Data) - { - T* tptr = (T*)bptr; - return *(tptr + index); - } - } - - public unsafe void WriteData(int index, T value) where T: unmanaged - { - fixed (byte* bptr = Data) - { - T* tptr = (T*)bptr; - *(tptr + index) = value; - } - } - - int IComparable.CompareTo(int other) - { - return ID.CompareTo(other); - } - - int IComparable.CompareTo(SSDSegment other) - { - return ID.CompareTo(other.ID); - } - - } -} diff --git a/StgSharp.Common/Data/SSD/SSD.cs b/StgSharp.Common/Data/SSD/SSD.cs deleted file mode 100644 index 9522f83a..00000000 --- a/StgSharp.Common/Data/SSD/SSD.cs +++ /dev/null @@ -1,64 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="SSD" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Internal.FileIO; - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace StgSharp.Internal -{ - public partial class SSD - { - - private Dictionary fileList; - - private FileStream file; - private SSDrawHead head; - - public SSD() - { - fileList = new Dictionary(); - } - - public SSD(FileStream fileStream) - { - fileList = new Dictionary(); - file = fileStream; - } - - public static SSD FromFile(string fileRoute) - { - return new SSD(new FileStream(fileRoute, FileMode.Open, FileAccess.Read)) - { - }; - } - - } -} diff --git a/StgSharp.Common/Data/SSD/SSDVirtualFolder.cs b/StgSharp.Common/Data/SSD/SSDVirtualFolder.cs deleted file mode 100644 index 6b299a5f..00000000 --- a/StgSharp.Common/Data/SSD/SSDVirtualFolder.cs +++ /dev/null @@ -1,77 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="SSDVirtualFolder" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Internal.FileIO; - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Internal -{ - public class SSDFolder : ISSDSerializable - { - - internal Dictionary folders; - internal int _folderID; - internal string _name; - - internal SSDFolder() - { - folders = new Dictionary(); - } - - internal SSDFolder(string name) - { - if (name == "root") { - throw new ArgumentException( - "Name cannot be root," + "it is preserved for root file indexer."); - } - if (name == "default") { - throw new ArgumentException( - "Name cannot be default," + "it is preserved for default file id provider."); - } - _name = name; - folders = new Dictionary(); - } - - public SerializableTypeCode SSDTypeCode => SerializableTypeCode.VirtualFolder; - - public void FromBytes(byte[] stream) - { - throw new NotImplementedException(); - } - - // TODO TOUGH TO Get Bytes from virtual folders - public byte[] GetBytes() - { - throw new NotImplementedException(); - } - - } -} diff --git a/StgSharp.Common/Data/Serialize/Define.cs b/StgSharp.Common/Data/Serialize/Define.cs deleted file mode 100644 index 3d25f595..00000000 --- a/StgSharp.Common/Data/Serialize/Define.cs +++ /dev/null @@ -1,38 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Define" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Internal -{ - /// - /// A class contains a sets of methods to serialize several types - /// - public static partial class Serializer { } -} diff --git a/StgSharp.Common/Data/Serialize/ISSDSerializable.cs b/StgSharp.Common/Data/Serialize/ISSDSerializable.cs deleted file mode 100644 index aecbdbd2..00000000 --- a/StgSharp.Common/Data/Serialize/ISSDSerializable.cs +++ /dev/null @@ -1,103 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ISSDSerializable" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Internal -{ - public interface ISSDSerializable - { - - public SerializableTypeCode SSDTypeCode { get; } - - public byte[] GetBytes(); - - internal void FromBytes(byte[] stream); - - } - - public enum SerializableTypeCode - { - - Unknown = 0, - IndexTable = 1, - PixelImage = 2, - VectorImage = 3, - Audio = 4, - Shader = 5, - Text = 6, - RawData = 7, - VirtualFolder = int.MaxValue, - - } - - public static partial class Serializer - { - - public static T Deserialize(byte[] stream) where T: ISSDSerializable - { - T serializableObject = Activator.CreateInstance(); - serializableObject.FromBytes(stream); - return serializableObject; - } - - public static string GetNameTail(SerializableTypeCode typeCode) - { - switch (typeCode) - { - case SerializableTypeCode.IndexTable: - return "_idt"; - case SerializableTypeCode.PixelImage: - return "_pim"; - case SerializableTypeCode.VectorImage: - return "_vim"; - case SerializableTypeCode.Audio: - return "_wav"; - case SerializableTypeCode.Shader: - return "_gls"; - case SerializableTypeCode.Text: - return "_txt"; - case SerializableTypeCode.RawData: - return "_raw"; - case SerializableTypeCode.VirtualFolder: - return "_fod"; - default: - throw new ArgumentException("Unknown file type"); - } - } - - public static byte[] Serialize(ISSDSerializable serializableObject) - { - return serializableObject.GetBytes(); - } - - } -} \ No newline at end of file diff --git a/StgSharp.Common/Geometries/Coordination/CoordinationBase.cs b/StgSharp.Common/Geometries/Coordination/CoordinationBase.cs index d5d697d8..3abdf960 100644 --- a/StgSharp.Common/Geometries/Coordination/CoordinationBase.cs +++ b/StgSharp.Common/Geometries/Coordination/CoordinationBase.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="CoordinationBase" // Project: StgSharp @@ -25,7 +25,7 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System.Runtime.CompilerServices; diff --git a/StgSharp.Common/Geometries/Coordination/PlainCoordinate.cs b/StgSharp.Common/Geometries/Coordination/PlainCoordinate.cs index b1dca8ae..ba8cccc2 100644 --- a/StgSharp.Common/Geometries/Coordination/PlainCoordinate.cs +++ b/StgSharp.Common/Geometries/Coordination/PlainCoordinate.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="PlainCoordinate" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Geometries/Coordination/SpaceCoordinate.cs b/StgSharp.Common/Geometries/Coordination/SpaceCoordinate.cs index 8d4837ff..d23ee741 100644 --- a/StgSharp.Common/Geometries/Coordination/SpaceCoordinate.cs +++ b/StgSharp.Common/Geometries/Coordination/SpaceCoordinate.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="SpaceCoordinate" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Geometries/GeometryOperation/GeometryOperation.cs b/StgSharp.Common/Geometries/GeometryOperation/GeometryOperation.cs index 202e2e93..154f5741 100644 --- a/StgSharp.Common/Geometries/GeometryOperation/GeometryOperation.cs +++ b/StgSharp.Common/Geometries/GeometryOperation/GeometryOperation.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="GeometryOperation" // Project: StgSharp @@ -25,7 +25,7 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using StgSharp.Timing; using System; diff --git a/StgSharp.Common/Geometries/IGeometry.cs b/StgSharp.Common/Geometries/IGeometry.cs index b6373a76..8839fa78 100644 --- a/StgSharp.Common/Geometries/IGeometry.cs +++ b/StgSharp.Common/Geometries/IGeometry.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="IGeometry" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Geometries/IInstancing.cs b/StgSharp.Common/Geometries/IInstancing.cs index 7ae4db25..092d6d4f 100644 --- a/StgSharp.Common/Geometries/IInstancing.cs +++ b/StgSharp.Common/Geometries/IInstancing.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="IInstancing" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Geometries/IInstancingBuffer.cs b/StgSharp.Common/Geometries/IInstancingBuffer.cs index 4810346f..765cb66c 100644 --- a/StgSharp.Common/Geometries/IInstancingBuffer.cs +++ b/StgSharp.Common/Geometries/IInstancingBuffer.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="IInstancingBuffer" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/GeometryOperation.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/GeometryOperation.cs index dddfd67d..b21d366e 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/GeometryOperation.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/GeometryOperation.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="GeometryOperation" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System.Runtime.CompilerServices; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/IPlainEntity.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/IPlainEntity.cs index bf3ec992..87bf1328 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/IPlainEntity.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/IPlainEntity.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="IPlainEntity" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/ParticleOnPlain.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/ParticleOnPlain.cs index 800fc0a3..d0edd04c 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/ParticleOnPlain.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/ParticleOnPlain.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="ParticleOnPlain" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/PlainGeometry.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/PlainGeometry.cs index c51a6e3b..d7d57787 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/PlainGeometry.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/PlainGeometry.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="PlainGeometry" // Project: StgSharp @@ -27,7 +27,7 @@ // ----------------------------------------------------------------------- using StgSharp.Graphics; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.ComponentModel; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs index a1ae65a3..7eb977cb 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="PlainInstancingBuffer" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using StgSharp.Mathematics.Numeric; using System; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Parallelogram.cs b/StgSharp.Common/Geometries/PlainGeometry/Parallelogram.cs index 6e4a7599..69de23a0 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Parallelogram.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Parallelogram.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="Parallelogram" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Plain.cs b/StgSharp.Common/Geometries/PlainGeometry/Plain.cs index 489c292f..ac803474 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Plain.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Plain.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="Plain" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System.Numerics; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Polygon4.cs b/StgSharp.Common/Geometries/PlainGeometry/Polygon4.cs index 5b382e15..fffbe3d6 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Polygon4.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Polygon4.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="Polygon4" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Numerics; @@ -51,7 +51,9 @@ namespace StgSharp.Geometries vertexMat = new Vec4[4]; } - internal Polygon4(Vec4[] rawCoord) + internal Polygon4( + Vec4[] rawCoord + ) : base(PlainCoordinate.StandardPlainCoordination) { if (rawCoord.Length != 4) { @@ -60,7 +62,12 @@ namespace StgSharp.Geometries vertexMat = rawCoord; } - public Polygon4(Point topLeft, Point topRight, Point bottomRight, Point bottomLeft) + public Polygon4( + Point topLeft, + Point topRight, + Point bottomRight, + Point bottomLeft + ) : base(PlainCoordinate.StandardPlainCoordination) { this[0] = topLeft; @@ -75,7 +82,8 @@ namespace StgSharp.Geometries Point topLeft, Point topRight, Point bottomRight, - Point bottomLeft) + Point bottomLeft + ) : base(coordinate) { this[0] = topLeft; @@ -84,7 +92,16 @@ namespace StgSharp.Geometries this[3] = bottomLeft; } - public Polygon4(float v0x, float v0y, float v1x, float v1y, float v2x, float v2y, float v3x, float v3y) + public Polygon4( + float v0x, + float v0y, + float v1x, + float v1y, + float v2x, + float v2y, + float v3x, + float v3y + ) : base(PlainCoordinate.StandardPlainCoordination) { vertexMat = new Vec4[4]; @@ -104,7 +121,8 @@ namespace StgSharp.Geometries float v2x, float v2y, float v3x, - float v3y) + float v3y + ) : base(coordination) { vertexMat = new Vec4[4]; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Polygon5.cs b/StgSharp.Common/Geometries/PlainGeometry/Polygon5.cs index a77bd5c1..f9d0d4de 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Polygon5.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Polygon5.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="Polygon5" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Numerics; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Polygon6.cs b/StgSharp.Common/Geometries/PlainGeometry/Polygon6.cs index 0b776c66..509a32d2 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Polygon6.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Polygon6.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="Polygon6" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Numerics; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Rectangle.cs b/StgSharp.Common/Geometries/PlainGeometry/Rectangle.cs index be60eb42..125669c2 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Rectangle.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Rectangle.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="Rectangle" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Numerics; diff --git a/StgSharp.Common/Geometries/PlainGeometry/Triangle.cs b/StgSharp.Common/Geometries/PlainGeometry/Triangle.cs index 00570932..c26e5778 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Triangle.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Triangle.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="Triangle" // Project: StgSharp @@ -27,7 +27,7 @@ // ----------------------------------------------------------------------- using StgSharp.Graphics; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Numerics; diff --git a/StgSharp.Common/Geometries/Point.cs b/StgSharp.Common/Geometries/Point.cs index 77966d36..ae270da8 100644 --- a/StgSharp.Common/Geometries/Point.cs +++ b/StgSharp.Common/Geometries/Point.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="Point" // Project: StgSharp @@ -25,8 +25,7 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; @@ -43,19 +42,27 @@ namespace StgSharp.Geometries [FieldOffset(0)] private Vec3 coord; [FieldOffset(0)] internal Vector4 coordVec; - internal Point(Vec4 vector) + internal Point( + Vec4 vector + ) { coordVec = vector.vec; coordVec.W = 1; } - public Point(Vec3 coord) + public Point( + Vec3 coord + ) { Coord = coord; coordVec.W = 1; } - public Point(float x, float y, float z) + public Point( + float x, + float y, + float z + ) { coordVec = new Vector4(x, y, z, 1); } diff --git a/StgSharp.Common/Geometries/SpaceGeometry/TriangulatedSurface.cs b/StgSharp.Common/Geometries/SpaceGeometry/TriangulatedSurface.cs index 35ec13ec..63775487 100644 --- a/StgSharp.Common/Geometries/SpaceGeometry/TriangulatedSurface.cs +++ b/StgSharp.Common/Geometries/SpaceGeometry/TriangulatedSurface.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="TriangulatedSurface" // Project: StgSharp @@ -27,7 +27,7 @@ // ----------------------------------------------------------------------- using StgSharp.HighPerformance; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; using System.Collections.Generic; diff --git a/StgSharp.Common/Global.cs b/StgSharp.Common/Global.cs index 99d614d5..32b3f1a0 100644 --- a/StgSharp.Common/Global.cs +++ b/StgSharp.Common/Global.cs @@ -26,7 +26,6 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- global using StgSharp.Internal; -global using StgSharp.Internal.Intrinsic; global using System.Diagnostics.CodeAnalysis; @@ -34,65 +33,5 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("StgSharp.Mathematics")] [assembly: InternalsVisibleTo("StgSharp.RegularAnalysis")] +[assembly: InternalsVisibleTo("StgSharp.Graphics")] [assembly: InternalsVisibleTo("StgSharpDebug")] - -[assembly: SuppressMessage( - "Design", - "CA1008:枚举应具有零值", - Justification = "<挂起>", - Scope = "type", - Target = "~T:StgSharp.Graphics.OpenGL.ShaderStatus")] -[assembly: SuppressMessage( - "Naming", - "CA1715:标识符应具有正确的前缀", - Justification = "<挂起>", - Scope = "member", - Target = "~M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``2(System.String)~StgSharp.Graphics.OpenGL.Uniform{``0,``1}")] -[assembly: SuppressMessage( - "Naming", - "CA1715:标识符应具有正确的前缀", - Justification = "<挂起>", - Scope = "member", - Target = "~M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``3(System.String)~StgSharp.Graphics.OpenGL.Uniform{``0,``1,``2}")] -[assembly: SuppressMessage( - "Naming", - "CA1715:标识符应具有正确的前缀", - Justification = "<挂起>", - Scope = "member", - Target = "~M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``4(System.String)~StgSharp.Graphics.OpenGL.Uniform{``0,``1,``2,``3}")] -[assembly: SuppressMessage( - "Naming", - "CA1715:标识符应具有正确的前缀", - Justification = "<挂起>", - Scope = "type", - Target = "~T:StgSharp.Graphics.OpenGL.Uniform`4")] -[assembly: SuppressMessage( - "Design", - "CA1043:将整型或字符串参数用于索引器", - Justification = "<挂起>", - Scope = "member", - Target = "~P:StgSharp.MVVM.ViewBase.IViewResponder`1.Item(StgSharp.Controlling.UsrActivity.ITrigger)")] -[assembly: SuppressMessage( - "Design", - "CA1043:将整型或字符串参数用于索引器", - Justification = "<挂起>", - Scope = "member", - Target = "~P:StgSharp.MVVM.ViewBase.ViewResponder`1.Item(StgSharp.Controlling.UsrActivity.ITrigger)")] -[assembly: SuppressMessage( - "Performance", - "CA1864:首选 \"IDictionary.TryAdd(TKey, TValue)\" 方法", - Justification = "<挂起>", - Scope = "member", - Target = "~P:StgSharp.MVVM.ViewBase.ViewRender`1.Item(System.String)")] -[assembly: SuppressMessage( - "Design", - "CA1033:接口方法应可由子类型调用", - Justification = "<挂起>", - Scope = "member", - Target = "~P:StgSharp.Collections.IBidirectionalDictionary`2.System#Collections#Generic#IDictionary#Keys")] -[assembly: SuppressMessage( - "Design", - "CA1033:接口方法应可由子类型调用", - Justification = "<挂起>", - Scope = "member", - Target = "~P:StgSharp.Collections.IBidirectionalDictionary`2.System#Collections#Generic#IDictionary#Values")] diff --git a/StgSharp.Common/Graphics/IGraphicAPIs.cs b/StgSharp.Common/Graphics/IGraphicAPIs.cs deleted file mode 100644 index 72be1aa4..00000000 --- a/StgSharp.Common/Graphics/IGraphicAPIs.cs +++ /dev/null @@ -1,40 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="IGraphicAPIs" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Graphics -{ - public interface IGraphicAPIs - { - - public IntPtr GraphicApiPackageHandle { get; } - - } -} diff --git a/StgSharp.Common/Internal/DefaultLog.cs b/StgSharp.Common/Internal/DefaultLog.cs index 55e48a16..202de945 100644 --- a/StgSharp.Common/Internal/DefaultLog.cs +++ b/StgSharp.Common/Internal/DefaultLog.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="DefaultLog" // Project: StgSharp @@ -25,10 +25,7 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; - using System; -using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Threading; @@ -47,7 +44,9 @@ namespace StgSharp.Internal internal static SemaphoreSlim logSyncSemaphore = new(1, 1); - internal static void InternalAppendLog(string log) + internal static void InternalAppendLog( + string log + ) { if (!File.Exists(Native.LogPath)) { @@ -60,7 +59,10 @@ namespace StgSharp.Internal } } - internal static void InternalWriteLog(string logLine, LogType logType) + internal static void InternalWriteLog( + string logLine, + LogType logType + ) { if (logType < _currentLogLevel) { return; @@ -87,7 +89,11 @@ namespace StgSharp.Internal } } - internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType) + internal static void InternalWriteLog( + string beforeTime, + string logLine, + LogType logType + ) { logSyncSemaphore.Wait(); if (!File.Exists(Native.LogPath)) @@ -104,7 +110,9 @@ namespace StgSharp.Internal _ = logSyncSemaphore.Release(1); } - internal static void SetLogLevel(LogType logLevel) + internal static void SetLogLevel( + LogType logLevel + ) { _currentLogLevel = logLevel; } diff --git a/StgSharp.Common/Internal/Graphic/BuiltinShader.cs b/StgSharp.Common/Internal/Graphic/BuiltinShader.cs deleted file mode 100644 index f58b5a1f..00000000 --- a/StgSharp.Common/Internal/Graphic/BuiltinShader.cs +++ /dev/null @@ -1,97 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="InternalResource" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Internal -{ - internal static class BuiltInShader - { - - #region ControllingItemRender - - internal const string ControlItemRenderVertexShader = """ - - - - """; - - #endregion - - #region CollisionTexture - - internal static ReadOnlySpan CollisionTextureVertexShader => """ - #version 430 core - layout(location = 0) in vec2 localCollisionCoord; - layout(location = 1) in vec2 spaceCoord; - layout(location = 2) in float rotation; - layout(location = 3) in float scaling; - - uniform vec2 target; - uniform mat2 projection; - - void main() - { - mat2 scaling = mat2( - scaling,0, - 0,scaling ); - - mat2 rotation = mat2( - cos(rotation),-sin(rotation), - sin(rotation),cos(rotation) ); - - vec2 realCoord = (rotation * scaling * localCollisionCoord) + spaceCoord - target; - realCoord = projection * realCoord; - float dist = distance(realCoord, vec2(0,0)); - float angle = atan(realCoord.y, realCoord.x); - gl_Position = vec4(angle, realCoord.y, dist, 1); - } - """u8; - - internal static ReadOnlySpan CollisionTextureFragmentShader => """ - #version 430 core - out vec4 Color; - - uniform float range; - void main() - { - float dist = gl_FragCoord.z; - if(dist > range) - { - discard; - } - dist /= range; - gl_FragDepth = min(dist, gl_FragDepth); - Color = vec4(dist,0,0,1); - } - """u8; - - #endregion - } -} diff --git a/StgSharp.Common/Internal/StructDefine.cs b/StgSharp.Common/Internal/StructDefine.cs deleted file mode 100644 index d5c6f7be..00000000 --- a/StgSharp.Common/Internal/StructDefine.cs +++ /dev/null @@ -1,944 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="StructDefine" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Graphics.OpenGL; - -using System; -using System.Runtime.InteropServices; - -/**/ - -namespace StgSharp.Internal -{ - // rename types in style of GLFW - - using GLFWbool = Boolean; - - // strucs defined in GLFW3.h - - #region GLFW3 struct - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct glfwContext - { - - private delegate* extensionSupported; - private delegate*, void> getProcAddress; - - /* - void (* makeCurrent) (glfwWindow*); - void (* swapBuffers) (glfwWindow*); - void (* swapInterval) (int); - int (* extensionSupported) (const byte*); - delegate*(*getProcAddress)(const byte*); - void (* destroy) (glfwWindow*); - */ - - private delegate* makeCurrent; - private delegate* swapBuffer; - private delegate* swapInterval; - private GLFWbool forward, debug, noerror; - - private int client; - private int major, minor, revision; - private int profile; - private int release; - private int robustness; - private int source; - private IntPtr destroy; - - // PFNGLGETINTEGERVPROC GetIntegerv; - private IntPtr GetIntegerv; - - // PFNGLGETSTRINGPROC GetString; - private IntPtr GetString; - - // PFNGLGETSTRINGIPROC GetStringi; - private IntPtr GetStringi; - - internal struct egl - { - - private void* client; - - /* - EGLConfig config; - EGLContext handle; - EGLSurface surface; - */ - private void* config; - private void* handle; - private void* surface; - - } - - internal struct osmesa - { - - private void* buffer; - - // OSMesaContext handle; - private void* handle; - private int height; - - private int width; - - } - - // This is defined in platform.h - // GLFW_PLATFORM_CONTEXT_STATE - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct glfwVideomode - { - /*! The refresh rate, in Hz, of the video mode. - */ - - private int refreshRate; - /*! The bit depth of the blue channel of the video mode. - */ - public int blueBits; - /*! The bit depth of the green channel of the video mode. - */ - public int greenBits; - /*! The height, in screen coordinates, of the video mode. - */ - public int height; - /*! The bit depth of the red channel of the video mode. - */ - public int redBits; - - /*! The width, in screen coordinates, of the video mode. - */ - public int width; - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct glfwGammaramp - { - /*! An array of value describing the response of the blue channel. - */ - - private ushort* blue; - /*! An array of value describing the response of the green channel. - */ - private ushort* green; - - /*! An array of value describing the response of the red channel. - */ - private ushort* red; - /*! The number of elements in each array. - */ - private uint size; - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWimage - { - /*! The pixel _data of this image, arranged left-to-right, top-to-bottom. - */ - - private byte* pixels; - - /*! The height, in pixels, of this image. - */ - private int height; - /*! The width, in pixels, of this image. - */ - private int width; - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWgamepadstate - { - /*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS` - * or `GLFW_RELEASE`. - */ - - public fixed byte buttons[15]; - - /*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0 - * to 1.0 inclusive. - */ - public fixed float axes[6]; - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWallocator - { - - private void* user; - - // GLFWallocatefun allocate; - private IntPtr allocate; - - // GLFWdeallocatefun deallocate; - private IntPtr deallocate; - - // GLFWreallocatefun reallocate; - private IntPtr reallocate; - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct glfwMonitor - { - - private glfwVideomode* modes; - - private glfwWindow* window; - - private fixed byte name[128]; - private glfwGammaramp currentRamp; - - private glfwGammaramp originalRamp; - private glfwVideomode currentMode; - private int modeCount; - - private int width, height; - private IntPtr userPointer; - - public glfwMonitor() { } - - public unsafe string Name - { - get - { - fixed (byte* cptr = name) { - return Marshal.PtrToStringAnsi((IntPtr)cptr); - } - } - } - - } - - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct glfwWindow - { - - private glfwWindow* next; - private void* userPointer; - private bool rawMouseMotion; - private Callbacks callbacks; - - // Virtual cursor position when cursor is disabled - private double virtualCursorPosX, virtualCursorPosY; - private int autoIconify; - private int cursorMode; - private int decorated; - private int doublebuffer; - private int floating; - private int focusOnShow; - private int lockKeyMods; - private int maxwidth, maxheight; - - private int minwidth, minheight; - private int mousePassthrough; - private int numer, denom; - - // Window settings and state - private int resizable; - private int shouldClose; - - private int stickyKeys; - private int stickyMouseButtons; - private IntPtr cursor; // _GLFWcursor* cursor; - // glfwVideomode videoMode; // 根据GLFWvidmode的定义转换 - private IntPtr monitor; // _GLFWmonitor* monitor; - public fixed byte keys[FrameworkConstant.KEY_LAST + 1]; - public fixed byte mouseButtons[FrameworkConstant.MOUSE_BUTTON_LAST + 1]; - - // _GLFWcontext viewPortDisplay; // 根据_GLFWcontext的定义转换 - - // Callbacks are represented as IntPtr since we don't need the actual function pointers in C# - internal struct Callbacks - { - - internal IntPtr character; - internal IntPtr charmods; - internal IntPtr close; - internal IntPtr cursorEnter; - internal IntPtr cursorPos; - internal IntPtr drop; - internal IntPtr fbsize; - internal IntPtr focus; - internal IntPtr iconify; - internal IntPtr key; - internal IntPtr maximize; - internal IntPtr mouseButton; - internal IntPtr pos; - internal IntPtr refresh; - internal IntPtr scale; - internal IntPtr scroll; - internal IntPtr size; - - } - - // GLFW_PLATFORM_WINDOW_STATE platformWindowState; - } - - [StructLayout(LayoutKind.Sequential)] - public struct GLFWwindowCallback { } - - [StructLayout(LayoutKind.Sequential)] - public struct GLFWcursor - { - - // GLFWcursor* next; - private IntPtr next; - - // This is defined in platform.h - // not completed in tranformation - // GLFW_PLATFORM_CURSOR_STATE; - } - - /* - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWerror - { - //GLFWerror* next; - IntPtr next; - int code; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)glConst.GLFW_MESSAGE_SIZE)] - byte[] description = new byte[glConst.GLFW_MESSAGE_SIZE]; - - public GLFWerror() - { - } - } - */ - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWinitconfig - { - - private GLFWbool hatButtons; - - private int angleType; - private int platformID; - - // PFN_vkGetInstanceProcAddr vulkanLoader; - private IntPtr vulkanLoader; - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWwndconfig - { - - private byte* title; - - private GLFWbool autoIconify; - private GLFWbool centerCursor; - private GLFWbool decorated; - private GLFWbool floating; - private GLFWbool focused; - private GLFWbool focusOnShow; - private GLFWbool maximized; - private GLFWbool mousePassthrough; - private GLFWbool resizable; - private GLFWbool scaleToMonitor; - private GLFWbool visible; - private int height; - private int width; - - private int xpos; - private int ypos; - - internal Ns ns = new Ns(); - - internal Win32 win32 = new Win32(); - - internal Wl wl = new Wl(); - - internal X11 x11 = new X11(); - - public GLFWwndconfig() { } - - internal struct Ns - { - - private GLFWbool retina = false; - public fixed byte frameName[256]; - - public Ns() { } - - } - - internal struct X11 - { - - public fixed byte className[256]; - public fixed byte instanceName[256]; - - public X11() { } - - } - - internal struct Win32 - { - - private GLFWbool keymenu; - - } - - internal struct Wl - { - - public fixed byte appId[256]; - - public Wl() { } - - } - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWctxconfig - { - - private GLFWbool debug; - private GLFWbool forward; - private GLFWbool noerror; - - private int client; - private int major; - private int minor; - private int profile; - private int release; - private int robustness; - private int source; - - // glfwWindow* share; - private IntPtr share; - - internal Nsgl nsgl = new Nsgl(); - - public GLFWctxconfig() { } - - internal struct Nsgl - { - - private GLFWbool offline; - - } - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWfbconfig - { - - private GLFWbool doublebuffer; - private GLFWbool sRGB; - private GLFWbool stereo; - private GLFWbool transparent; - - private int accumAlphaBits; - private int accumBlueBits; - private int accumGreenBits; - private int accumRedBits; - private int alphaBits; - private int auxBuffers; - private int blueBits; - private int depthBits; - private int greenBits; - - private int redBits; - private int samples; - private int stencilBits; - private uintptr_t handle; - - } - - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct GLFWlibrary - { - - [MarshalAs(UnmanagedType.ByValArray, SizeConst = FrameworkConstant.JOYSTICK_LAST + 1)] - private GLFWjoystick[] joysticks = new GLFWjoystick[FrameworkConstant.JOYSTICK_LAST + 1]; - - private GLFWallocator allocator; - - private GLFWbool initialized; - - private GLFWbool joysticksInitialized; - private GLFWls contextSlot; - - private GLFWls errorSlot; - private GLFWmutex errorLock; - - private GLFWplatform platform; - - private int mappingCount; - - private int monitorCount; - - // GLFWcursor* cursorListHead; - private IntPtr cursorListHead; - - // GLFWerror* errorListHead; - private IntPtr errorListHead; - - // GLFWmapping* mappings; - private IntPtr mappings; - - // GLFWmonitor** monitors; - private IntPtr monitors; - - // glfwWindow* windowListHead; - private IntPtr windowListHead; - - internal Callbacks callbacks = new Callbacks(); - - internal Egl egl = new Egl(); - - internal Hints hints = new Hints(); - - internal Osmesa osmesa = new Osmesa(); - - public GLFWlibrary() { } - - internal unsafe struct Hints - { - - private GLFWctxconfig context; - private GLFWfbconfig framebuffer; - - private GLFWinitconfig init; - private GLFWwndconfig window; - private int refreshRate; - - } - - internal unsafe struct timer - { - - private ulong offset; - - // This is defined in platform.h - - // not transformed function defination - // GLFW_PLATFORM_LIBRARY_TIMER_STATE - } - - internal unsafe struct Egl - { - - internal void* display; - - internal void* handle; - - internal bool ANGLE_platform_angle; - internal bool ANGLE_platform_angle_d3d; - internal bool ANGLE_platform_angle_metal; - internal bool ANGLE_platform_angle_opengl; - internal bool ANGLE_platform_angle_vulkan; - internal bool EXT_client_extensions; - internal bool EXT_platform_base; - internal bool EXT_platform_wayland; - internal bool EXT_platform_x11; - internal bool EXT_present_opaque; - internal bool KHR_colorSpace; - internal bool KHR_context_flush_control; - - internal bool KHR_create_context; - internal bool KHR_create_context_no_error; - internal bool KHR_get_all_proc_addresses; - internal bool prefix; - internal int major, minor; - - internal int platform; - internal IntPtr BindAPI; - internal IntPtr CreateContext; - internal IntPtr CreatePlatformWindowSurfaceEXT; - internal IntPtr CreateWindowSurface; - internal IntPtr DestroyContext; - internal IntPtr DestroySurface; - - internal IntPtr GetConfigAttrib; - internal IntPtr GetConfigs; - internal IntPtr GetDisplay; - internal IntPtr GetError; - - internal IntPtr GetPlatformDisplayEXT; - internal IntPtr GetProcAddress; - internal IntPtr Initialize; - internal IntPtr MakeCurrent; - internal IntPtr QueryString; - internal IntPtr SwapBuffers; - internal IntPtr SwapInterval; - internal IntPtr Terminate; - - } - - internal unsafe struct Osmesa - { - - private void* handle; - - private IntPtr CreateContextAttribs; - - private IntPtr CreateContextExt; - private IntPtr DestroyContext; - private IntPtr GetColorBuffer; - private IntPtr GetDepthBuffer; - private IntPtr GetProcAddress; - private IntPtr MakeCurrent; - - } - - internal unsafe struct vk - { - - private void* handle; - - private GLFWbool available; - private GLFWbool EXT_metal_surface; - private GLFWbool KHR_surface; - private GLFWbool KHR_wayland_surface; - private GLFWbool KHR_win32_surface; - private GLFWbool KHR_xcb_surface; - private GLFWbool KHR_xlib_surface; - private GLFWbool MVK_macos_surface; - private IntPtr GetInstanceProcAddr; - private fixed ulong extensions[2]; - - public vk() { } - - } - - internal unsafe struct Callbacks - { - - private IntPtr joystick; - - private IntPtr monitor; - - } - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWmapelement - { - - private byte index; - - private byte type; - - private sbyte axisOffset; - private sbyte axisScale; - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWmapping - { - - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - private GLFWmapelement[] axes = new GLFWmapelement[6]; - - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)] - private GLFWmapelement[] buttons = new GLFWmapelement[15]; - private fixed byte guid[33]; - - private fixed byte name[128]; - - public GLFWmapping() { } - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWjoystick - { - - private float* axes; - private byte* buttons; - private byte* hats; - private void* userPointer; - private fixed byte guid[33]; - private fixed byte name[128]; - - private GLFWbool allocated; - private GLFWbool connected; - private int axisCount; - private int buttonCount; - private int hatCount; - - // GLFWmapping* mapping; - private IntPtr mapping; - - // This is defined in platform.h - // not completed in transforming - // GLFW_PLATFORM_JOYSTICK_STATE; - - public GLFWjoystick() { } - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWls - { - - // This is defined in platform.h - - // GLFW_PLATFORM_TLS_STATE - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWplatform - { - - private int platformID; - - // init - // GLFWbool(*init)(void); - private IntPtr init; - - // void (* terminate) (void); - private IntPtr terminate; - internal IntPtr createCursor; - internal IntPtr createStandardCursor; - - // window - internal IntPtr createWindow; - internal IntPtr destroyCursor; - - internal IntPtr destroyWindow; - internal IntPtr focusWindow; - internal IntPtr framebufferTransparent; - - // monitor - internal IntPtr freeMonitor; - internal IntPtr getClipboardString; - - internal IntPtr getEGLNativeDisplay; - internal IntPtr getEGLNativeWindow; - - // EGL - // EGLenum(*getEGLPlatform)(EGLint**); - // EGLNativeDisplayType(*getEGLNativeDisplay)(void); - // EGLNativeWindowType(*getEGLNativeWindow)(glfwWindow*); - internal IntPtr getEGLPlatform; - internal IntPtr getFramebufferSize; - internal IntPtr getGammaRamp; - internal IntPtr getKeyScancode; - internal IntPtr getMappingName; - internal IntPtr getMonitorContentScale; - - internal IntPtr getMonitorPos; - internal IntPtr getMonitorWorkarea; - - // vulkan - // void (* getRequiredInstanceExtensions) (byte**); - // GLFWbool(*getPhysicalDevicePresentationSupport)(VkInstance, VkPhysicalDevice, uint32_t); - // VkResult(*createWindowSurface)(VkInstance, glfwWindow*,const VkAllocationCallbacks*, VkSurfaceKHR*); - internal IntPtr getRequiredInstanceExtensions; - internal IntPtr getScancodeName; - internal IntPtr getVideoMode; - internal IntPtr getVideoModes; - internal IntPtr getWindowContentScale; - internal IntPtr getWindowFrameSize; - internal IntPtr getWindowOpacity; - internal IntPtr getWindowPos; - internal IntPtr getWindowSize; - internal IntPtr GLFWwindow; - internal IntPtr hideWindow; - internal IntPtr iconifyWindow; - internal IntPtr initJoysticks; - internal IntPtr maximizeWindow; - internal IntPtr pollEvents; - internal IntPtr pollJoystick; - internal IntPtr postEmptyEvent; - internal IntPtr rawMouseMotionSupported; - internal IntPtr requestWindowAttention; - internal IntPtr restoreWindow; - internal IntPtr setClipboardString; - internal IntPtr setCursor; - internal IntPtr setCursorMode; - - #region input - - /* void (* getCursorPos) (glfwWindow*, double*, double*); - void (* setCursorPos) (glfwWindow*, double, double); - void (* setCursorMode) (glfwWindow*, int); - void (* setRawMouseMotion) (glfwWindow*, GLFWbool); - GLFWbool(*rawMouseMotionSupported)(void); - GLFWbool(*createCursor)(GLFWcursor*,const GLFWimage*,int,int); - GLFWbool(*createStandardCursor)(GLFWcursor*, int); - void (* destroyCursor) (GLFWcursor*); - void (* setCursor) (glfwWindow*, GLFWcursor*); - const byte* (*getScancodeName)(int); - int (* getKeyScancode) (int); - void (* setClipboardString) (const byte*); - const byte* (*getClipboardString)(void); - GLFWbool(*initJoysticks)(void); - void (* terminateJoysticks) (void); - GLFWbool(*pollJoystick)(GLFWjoystick*, int); - const byte* (*getMappingName)(void); - void (* updateGamepadGUID) (byte*); - // monitor - void (* freeMonitor) (GLFWmonitor*); - void (* getMonitorPos) (GLFWmonitor*, int*, int*); - void (* getMonitorContentScale) (GLFWmonitor*, float*, float*); - void (* getMonitorWorkarea) (GLFWmonitor*, int*, int*, int*, int*); - glfwVideomode* (* getVideoModes) (GLFWmonitor*, int*); - void (* getVideoMode) (GLFWmonitor*, glfwVideomode*); - GLFWbool(*getGammaRamp)(GLFWmonitor*, glfwGammaramp*); - void (* setGammaRamp) (GLFWmonitor*,const glfwGammaramp*); - // window - GLFWbool(*createWindow)(glfwWindow*,const GLFWwndconfig*,const GLFWctxconfig*,const GLFWfbconfig*); - void (* destroyWindow) (glfwWindow*); - void (* setWindowTitle) (glfwWindow*,const byte*); - void (* setWindowIcon) (glfwWindow*, int,const GLFWimage*); - void (* getWindowPos) (glfwWindow*, int*, int*); - void (* setWindowPos) (glfwWindow*, int, int); - void (* getWindowSize) (glfwWindow*, int*, int*); - void (* setWindowSize) (glfwWindow*, int, int); - void (* setWindowSizeLimits) (glfwWindow*, int, int, int, int); - void (* setWindowAspectRatio) (glfwWindow*, int, int); - void (* getFramebufferSize) (glfwWindow*, int*, int*); - void (* getWindowFrameSize) (glfwWindow*, int*, int*, int*, int*); - void (* getWindowContentScale) (glfwWindow*, float*, float*); - void (* iconifyWindow) (glfwWindow*); - void (* restoreWindow) (glfwWindow*); - void (* maximizeWindow) (glfwWindow*); - void (* showWindow) (glfwWindow*); - void (* hideWindow) (glfwWindow*); - void (* requestWindowAttention) (glfwWindow*); - void (* focusWindow) (glfwWindow*); - void (* setWindowMonitor) (glfwWindow*, GLFWmonitor*, int, int, int, int, int); - GLFWbool(*windowFocused)(glfwWindow*); - GLFWbool(*windowIconified)(glfwWindow*); - GLFWbool(*windowVisible)(glfwWindow*); - GLFWbool(*windowMaximized)(glfwWindow*); - GLFWbool(*windowHovered)(glfwWindow*); - GLFWbool(*framebufferTransparent)(glfwWindow*); - float (* getWindowOpacity) (glfwWindow*); - void (* setWindowResizable) (glfwWindow*, GLFWbool); - void (* setWindowDecorated) (glfwWindow*, GLFWbool); - void (* setWindowFloating) (glfwWindow*, GLFWbool); - void (* setWindowOpacity) (glfwWindow*, float); - void (* setWindowMousePassthrough) (glfwWindow*, GLFWbool); - void (* pollEvents) (void); - void (* waitEvents) (void); - void (* waitEventsTimeout) (double); - void (* postEmptyEvent) (void); - */ - - #endregion - - internal IntPtr setCursorPos; - internal IntPtr setGammaRamp; - internal IntPtr setRawMouseMotion; - internal IntPtr setWindowAspectRatio; - internal IntPtr setWindowDecorated; - internal IntPtr setWindowFloating; - internal IntPtr setWindowIcon; - internal IntPtr setWindowMonitor; - internal IntPtr setWindowMousePassthrough; - internal IntPtr setWindowOpacity; - internal IntPtr setWindowPos; - internal IntPtr setWindowResizable; - internal IntPtr setWindowSize; - internal IntPtr setWindowSizeLimits; - internal IntPtr setWindowTitle; - internal IntPtr showWindow; - internal IntPtr terminateJoysticks; - internal IntPtr updateGamepadGUID; - - internal IntPtr VkPhysicalDevice; - internal IntPtr waitEvents; - internal IntPtr waitEventsTimeout; - internal IntPtr windowFocused; - internal IntPtr windowHovered; - internal IntPtr windowIconified; - internal IntPtr windowMaximized; - internal IntPtr windowVisible; - - } - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct GLFWmutex - { - - // This is defined in platform.h - // GLFW_PLATFORM_MUTEX_STATE - } - - // public unsafe struct VkAllocationCallbacks { } - - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct VkExtensionProperties - { - - private fixed byte extensionName[256]; - private uint specVersion; - - public VkExtensionProperties() { } - - } - - /* - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct GLFWerror - { - IntPtr next; - int code; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] - byte[] description = new byte[1024]; - - public GLFWerror() - { - } - } - */ - - [StructLayout(LayoutKind.Explicit, Size = 16)] - public struct uintptr_t - { - - [FieldOffset(0)] - private long part1; - - [FieldOffset(8)] - private long part2; - - } - - #endregion GLFW3 struct - -} - -/**/ \ No newline at end of file diff --git a/StgSharp.Common/MVVM/OpenGLControllingItemRender.cs b/StgSharp.Common/MVVM/OpenGLControllingItemRender.cs deleted file mode 100644 index 12cef513..00000000 --- a/StgSharp.Common/MVVM/OpenGLControllingItemRender.cs +++ /dev/null @@ -1,54 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="OpenGLControllingItemRender" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.MVVM -{ - public class OpenGLControllingItemRender : glRender - { - - public override bool IsContextSharable => true; - - protected override void CustomizeDeinit() - { - throw new NotImplementedException(); - } - - protected override void CustomizeInit() - { - throw new NotImplementedException(); - } - - } -} diff --git a/StgSharp.Common/MVVM/ViewModel/ViewModel.cs b/StgSharp.Common/MVVM/ViewModel/ViewModel.cs index e7a5f978..e80cf115 100644 --- a/StgSharp.Common/MVVM/ViewModel/ViewModel.cs +++ b/StgSharp.Common/MVVM/ViewModel/ViewModel.cs @@ -30,7 +30,7 @@ using StgSharp.Controlling.UsrActivity; using StgSharp.Graphics; using StgSharp.Graphics.OpenGL; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using StgSharp.MVVM; using StgSharp.MVVM.ViewModel; using StgSharp.Threading; diff --git a/StgSharp.Common/Mathematics/Linear/ElementType.cs b/StgSharp.Common/Mathematics/Linear/ElementType.cs deleted file mode 100644 index 4afb6871..00000000 --- a/StgSharp.Common/Mathematics/Linear/ElementType.cs +++ /dev/null @@ -1,76 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ElementType" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -#pragma warning disable CA1028 -namespace StgSharp.Mathematics.Numeric -{ - [StructLayout(LayoutKind.Explicit, Size = 4)] - public struct MatrixElementType - { - - public static readonly MatrixElementType F32 = new(0x03000004); - public static readonly MatrixElementType F64 = new(0x03000008); - public static readonly MatrixElementType I08 = new(0x0100001); - public static readonly MatrixElementType I16 = new(0x0100002); - public static readonly MatrixElementType I32 = new(0x0100004); - public static readonly MatrixElementType I64 = new(0x0100008); - public static readonly MatrixElementType U08 = new(0x0200001); - public static readonly MatrixElementType U16 = new(0x0200002); - public static readonly MatrixElementType U32 = new(0x0200004); - public static readonly MatrixElementType U64 = new(0x0200008); - - [FieldOffset(0)] internal readonly int Mask; - [FieldOffset(3)] public readonly MatrixElementTypeGroup Group; - - [FieldOffset(0)] public readonly ushort Size; - - private MatrixElementType( - int mask - ) - { - Unsafe.SkipInit(out this); - Unsafe.SkipInit(out Size); - Unsafe.SkipInit(out Group); - this.Mask = mask; - } - - } - - public enum MatrixElementTypeGroup : byte - { - - None = 0, - Singed = 1, - Unsigned = 2, - Float = 3, - - } -} -#pragma warning restore CA1028 diff --git a/StgSharp.Common/Stg/Bullet.cs b/StgSharp.Common/Stg/Bullet.cs index 3dd88bb9..f6589363 100644 --- a/StgSharp.Common/Stg/Bullet.cs +++ b/StgSharp.Common/Stg/Bullet.cs @@ -27,7 +27,7 @@ // ----------------------------------------------------------------------- using StgSharp.Geometries; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using System; diff --git a/StgSharp.Common/Stg/CollisionTexture.cs b/StgSharp.Common/Stg/CollisionTexture.cs index dbd7afe9..89331ced 100644 --- a/StgSharp.Common/Stg/CollisionTexture.cs +++ b/StgSharp.Common/Stg/CollisionTexture.cs @@ -31,7 +31,7 @@ using StgSharp.Graphics.OpenGL; using StgSharp.Internal; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using StgSharp.MVVM; using System; diff --git a/StgSharp.Common/StgSharp.Common.csproj b/StgSharp.Common/StgSharp.Common.csproj index 094bcda9..3b5d5ea0 100644 --- a/StgSharp.Common/StgSharp.Common.csproj +++ b/StgSharp.Common/StgSharp.Common.csproj @@ -115,6 +115,10 @@ + + + + diff --git a/StgSharp.Common/Internal/Intrinsic/ColumnSet2.cs b/StgSharp.Mathematics/Internal/ColumnSet2.cs similarity index 81% rename from StgSharp.Common/Internal/Intrinsic/ColumnSet2.cs rename to StgSharp.Mathematics/Internal/ColumnSet2.cs index 0366b022..f5ebc582 100644 --- a/StgSharp.Common/Internal/Intrinsic/ColumnSet2.cs +++ b/StgSharp.Mathematics/Internal/ColumnSet2.cs @@ -1,87 +1,99 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ColumnSet2" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp; -using StgSharp.Internal.Intrinsic; - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Internal.Intrinsic -{ - [StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)] - internal struct ColumnSet2 : IEquatable - { - - [FieldOffset(0 * sizeof(float))] internal float m00; - [FieldOffset(4 * sizeof(float))] internal float m01; - [FieldOffset(1 * sizeof(float))] internal float m10; - [FieldOffset(5 * sizeof(float))] internal float m11; - [FieldOffset(2 * sizeof(float))] internal float m20; - [FieldOffset(6 * sizeof(float))] internal float m21; - [FieldOffset(3 * sizeof(float))] internal float m30; - [FieldOffset(7 * sizeof(float))] internal float m31; - - [FieldOffset(0)] internal Vector4 colum0; - [FieldOffset(4 * sizeof(float))] internal Vector4 colum1; - - internal ColumnSet2(Vector4 c0, Vector4 c1) - { - Unsafe.SkipInit(out this); - colum0 = c0; - colum1 = c1; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool Equals(object? obj) - { - return (obj is ColumnSet2 mat) && Equals(mat); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Equals(ColumnSet2 other) - { - return colum0.Equals(other.colum0) && colum1.Equals(other.colum1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(ColumnSet2 left, ColumnSet2 right) - { - return !(left == right); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(ColumnSet2 left, ColumnSet2 right) - { - return left.Equals(right); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ColumnSet2" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp; + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Mathematics.Internal +{ + [StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)] + internal struct ColumnSet2 : IEquatable + { + + [FieldOffset(0 * sizeof(float))] internal float m00; + [FieldOffset(4 * sizeof(float))] internal float m01; + [FieldOffset(1 * sizeof(float))] internal float m10; + [FieldOffset(5 * sizeof(float))] internal float m11; + [FieldOffset(2 * sizeof(float))] internal float m20; + [FieldOffset(6 * sizeof(float))] internal float m21; + [FieldOffset(3 * sizeof(float))] internal float m30; + [FieldOffset(7 * sizeof(float))] internal float m31; + + [FieldOffset(0)] internal Vector4 colum0; + [FieldOffset(4 * sizeof(float))] internal Vector4 colum1; + + internal ColumnSet2( + Vector4 c0, + Vector4 c1 + ) + { + Unsafe.SkipInit(out this); + colum0 = c0; + colum1 = c1; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals( + object? obj + ) + { + return (obj is ColumnSet2 mat) && Equals(mat); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals( + ColumnSet2 other + ) + { + return colum0.Equals(other.colum0) && colum1.Equals(other.colum1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=( + ColumnSet2 left, + ColumnSet2 right + ) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==( + ColumnSet2 left, + ColumnSet2 right + ) + { + return left.Equals(right); + } + + } +} diff --git a/StgSharp.Common/Internal/Intrinsic/ColumnSet3.cs b/StgSharp.Mathematics/Internal/ColumnSet3.cs similarity index 93% rename from StgSharp.Common/Internal/Intrinsic/ColumnSet3.cs rename to StgSharp.Mathematics/Internal/ColumnSet3.cs index 262a3b7b..59153acb 100644 --- a/StgSharp.Common/Internal/Intrinsic/ColumnSet3.cs +++ b/StgSharp.Mathematics/Internal/ColumnSet3.cs @@ -1,83 +1,83 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ColumnSet3" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Internal.Intrinsic; -using StgSharp.Mathematics; - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Internal.Intrinsic -{ - [StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)] - internal struct ColumnSet3 : IEquatable - { - - [FieldOffset(0 * sizeof(float))] internal float m00; - [FieldOffset(4 * sizeof(float))] internal float m01; - [FieldOffset(8 * sizeof(float))] internal float m02; - [FieldOffset(1 * sizeof(float))] internal float m10; - [FieldOffset(5 * sizeof(float))] internal float m11; - [FieldOffset(9 * sizeof(float))] internal float m12; - [FieldOffset(2 * sizeof(float))] internal float m20; - [FieldOffset(6 * sizeof(float))] internal float m21; - [FieldOffset(10 * sizeof(float))] internal float m22; - [FieldOffset(3 * sizeof(float))] internal float m30; - [FieldOffset(7 * sizeof(float))] internal float m31; - [FieldOffset(11 * sizeof(float))] internal float m32; - - [FieldOffset(0)] internal Vector4 colum0; - [FieldOffset(4 * sizeof(float))] internal Vector4 colum1; - [FieldOffset(8 * sizeof(float))] internal Vector4 colum2; - - public override bool Equals(object? obj) - { - return (obj is ColumnSet3 mat) && Equals(mat); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Equals(ColumnSet3 other) - { - return colum0.Equals(other.colum0) && colum1.Equals(other.colum1) && colum2.Equals(other.colum2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(ColumnSet3 left, ColumnSet3 right) - { - return !(left == right); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(ColumnSet3 left, ColumnSet3 right) - { - return left.Equals(right); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ColumnSet3" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics.Internal; +using StgSharp.Mathematics; + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Internal +{ + [StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)] + internal struct ColumnSet3 : IEquatable + { + + [FieldOffset(0 * sizeof(float))] internal float m00; + [FieldOffset(4 * sizeof(float))] internal float m01; + [FieldOffset(8 * sizeof(float))] internal float m02; + [FieldOffset(1 * sizeof(float))] internal float m10; + [FieldOffset(5 * sizeof(float))] internal float m11; + [FieldOffset(9 * sizeof(float))] internal float m12; + [FieldOffset(2 * sizeof(float))] internal float m20; + [FieldOffset(6 * sizeof(float))] internal float m21; + [FieldOffset(10 * sizeof(float))] internal float m22; + [FieldOffset(3 * sizeof(float))] internal float m30; + [FieldOffset(7 * sizeof(float))] internal float m31; + [FieldOffset(11 * sizeof(float))] internal float m32; + + [FieldOffset(0)] internal Vector4 colum0; + [FieldOffset(4 * sizeof(float))] internal Vector4 colum1; + [FieldOffset(8 * sizeof(float))] internal Vector4 colum2; + + public override bool Equals(object? obj) + { + return (obj is ColumnSet3 mat) && Equals(mat); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ColumnSet3 other) + { + return colum0.Equals(other.colum0) && colum1.Equals(other.colum1) && colum2.Equals(other.colum2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ColumnSet3 left, ColumnSet3 right) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ColumnSet3 left, ColumnSet3 right) + { + return left.Equals(right); + } + + } +} diff --git a/StgSharp.Common/Internal/Intrinsic/ColumnSet4.cs b/StgSharp.Mathematics/Internal/ColumnSet4.cs similarity index 93% rename from StgSharp.Common/Internal/Intrinsic/ColumnSet4.cs rename to StgSharp.Mathematics/Internal/ColumnSet4.cs index e40c1210..91d11d51 100644 --- a/StgSharp.Common/Internal/Intrinsic/ColumnSet4.cs +++ b/StgSharp.Mathematics/Internal/ColumnSet4.cs @@ -1,101 +1,101 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ColumnSet4" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp; -using StgSharp.Internal.Intrinsic; - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Internal.Intrinsic -{ - [StructLayout(LayoutKind.Explicit, Size = 16 * sizeof(float))] - internal struct ColumnSet4 : IEquatable - { - - [FieldOffset(0)] internal Vector4 colum0; - [FieldOffset(16)] internal Vector4 colum1; - [FieldOffset(32)] internal Vector4 colum2; - [FieldOffset(48)] internal Vector4 colum3; - - [FieldOffset(0)] public float m00; - [FieldOffset(16)] public float m01; - [FieldOffset(32)] public float m02; - [FieldOffset(48)] public float m03; - [FieldOffset(4)] public float m10; - [FieldOffset(20)] public float m11; - [FieldOffset(36)] public float m12; - [FieldOffset(52)] public float m13; - [FieldOffset(8)] public float m20; - [FieldOffset(24)] public float m21; - [FieldOffset(40)] public float m22; - [FieldOffset(56)] public float m23; - [FieldOffset(12)] public float m30; - [FieldOffset(28)] public float m31; - [FieldOffset(44)] public float m32; - [FieldOffset(60)] public float m33; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal ColumnSet4(Vector4 colum0, Vector4 colum1, Vector4 colum2, Vector4 colum3) - { - Unsafe.SkipInit(out this); - this.colum0 = colum0; - this.colum1 = colum1; - this.colum2 = colum2; - this.colum3 = colum3; - } - - public override bool Equals(object? obj) - { - return (obj is ColumnSet4 mat) && Equals(mat); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Equals(ColumnSet4 other) - { - return colum0.Equals(other.colum0) && - colum1.Equals(other.colum1) && - colum2.Equals(other.colum2) && - colum3.Equals(other.colum3); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(ColumnSet4 left, ColumnSet4 right) - { - return !(left == right); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(ColumnSet4 left, ColumnSet4 right) - { - return left.Equals(right); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ColumnSet4" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp; +using StgSharp.Mathematics.Internal; + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Internal +{ + [StructLayout(LayoutKind.Explicit, Size = 16 * sizeof(float))] + internal struct ColumnSet4 : IEquatable + { + + [FieldOffset(0)] internal Vector4 colum0; + [FieldOffset(16)] internal Vector4 colum1; + [FieldOffset(32)] internal Vector4 colum2; + [FieldOffset(48)] internal Vector4 colum3; + + [FieldOffset(0)] public float m00; + [FieldOffset(16)] public float m01; + [FieldOffset(32)] public float m02; + [FieldOffset(48)] public float m03; + [FieldOffset(4)] public float m10; + [FieldOffset(20)] public float m11; + [FieldOffset(36)] public float m12; + [FieldOffset(52)] public float m13; + [FieldOffset(8)] public float m20; + [FieldOffset(24)] public float m21; + [FieldOffset(40)] public float m22; + [FieldOffset(56)] public float m23; + [FieldOffset(12)] public float m30; + [FieldOffset(28)] public float m31; + [FieldOffset(44)] public float m32; + [FieldOffset(60)] public float m33; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal ColumnSet4(Vector4 colum0, Vector4 colum1, Vector4 colum2, Vector4 colum3) + { + Unsafe.SkipInit(out this); + this.colum0 = colum0; + this.colum1 = colum1; + this.colum2 = colum2; + this.colum3 = colum3; + } + + public override bool Equals(object? obj) + { + return (obj is ColumnSet4 mat) && Equals(mat); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ColumnSet4 other) + { + return colum0.Equals(other.colum0) && + colum1.Equals(other.colum1) && + colum2.Equals(other.colum2) && + colum3.Equals(other.colum3); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ColumnSet4 left, ColumnSet4 right) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ColumnSet4 left, ColumnSet4 right) + { + return left.Equals(right); + } + + } +} diff --git a/StgSharp.Common/Internal/Intrinsic/IntrinsicContext.cs b/StgSharp.Mathematics/Internal/IntrinsicContext.cs similarity index 52% rename from StgSharp.Common/Internal/Intrinsic/IntrinsicContext.cs rename to StgSharp.Mathematics/Internal/IntrinsicContext.cs index 16bc3b0a..300289a6 100644 --- a/StgSharp.Common/Internal/Intrinsic/IntrinsicContext.cs +++ b/StgSharp.Mathematics/Internal/IntrinsicContext.cs @@ -1,79 +1,123 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="IntrinsicContext" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.Marshalling; - -namespace StgSharp.Internal.Intrinsic -{ - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct MatrixIntrinsic - { - - public delegate* unmanaged[Cdecl] buffer_add; //f32_buffer_add - public delegate* unmanaged[Cdecl] buffer_fill; //f32_buffer_fill - public delegate* unmanaged[Cdecl] buffer_scalar_mul; //f32_buffer_s_m - public delegate* unmanaged[Cdecl] buffer_sub; //f32_kernel_sub - public delegate* unmanaged[Cdecl] buffer_transpose; //f32_kernel_transpose - public delegate* unmanaged[Cdecl] build_panel; //f32_build_panel - public delegate* unmanaged[Cdecl] clear_panel; //f32_clear_panel - public delegate* unmanaged[Cdecl] kernel_fma; //f32_panel_fma - public delegate* unmanaged[Cdecl] kernel_tile_fma; //f32_panel_fma - public delegate* unmanaged[Cdecl] pivot; //f32_panel_mul - public delegate* unmanaged[Cdecl] store_panel; //f32_store_panel - - } - - [InlineArray(4)] - internal unsafe struct MatrixIntrinsicArray - { - - private MatrixIntrinsic e0; - - } - - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct IntrinsicContext - { - - public delegate* unmanaged[Cdecl] city_hash_simplify; // city_hash_simplify - public delegate* unmanaged[Cdecl] factorial_simd; // factorial_simd - public delegate* unmanaged[Cdecl] index_pair; // index_pair - public delegate* unmanaged[Cdecl] vec_f32_normalize_3; // f32_normalize_3 - public MatrixIntrinsicArray mat; // mat[4] in native order - - public IntrinsicContext() - { - Unsafe.SkipInit(out this); - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="IntrinsicContext" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Internal +{ + [InlineArray(10)] + internal unsafe struct MatrixIntrinsic + { + + private nint handle; //f32_panel_mul + + public readonly nint this[ + MatrixIntrinsicHandle handle + ] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this[(int)handle]; + } + + } + + internal enum MatrixIntrinsicHandle : int + { + + BufferAdd = 0, + BufferFill = 1, + BufferScalarMul = 2, + BufferSub = 3, + BufferTranspose = 4, + ClearPanel = 5, + KerFma = 6, + TileFma = 7, + Pivot = 8, + + } + + [StructLayout(LayoutKind.Explicit, Size = 4)] + public struct MatrixElementType + { + + public const int IntrinsicCount = 0xa; + + public static readonly MatrixElementType F32 = new(0x00010004); + public static readonly MatrixElementType F64 = new(0x00020008); + public static readonly MatrixElementType I08 = new(0x00030001); + public static readonly MatrixElementType I16 = new(0x00040002); + public static readonly MatrixElementType I32 = new(0x00050004); + public static readonly MatrixElementType I64 = new(0x00060008); + public static readonly MatrixElementType U08 = new(0x00070001); + public static readonly MatrixElementType U16 = new(0x00080002); + public static readonly MatrixElementType U32 = new(0x00090004); + public static readonly MatrixElementType U64 = new(0x000a0008); + + [FieldOffset(0)] internal readonly int Mask; + [FieldOffset(2)] public readonly ushort IntrinsicNode; + + [FieldOffset(0)] public readonly ushort Size; + + private MatrixElementType( + int mask + ) + { + Unsafe.SkipInit(out this); + Unsafe.SkipInit(out Size); + Unsafe.SkipInit(out IntrinsicNode); + this.Mask = mask; + } + + } + + [InlineArray(MatrixElementType.IntrinsicCount)] + internal unsafe struct MatrixIntrinsicArray + { + + private MatrixIntrinsic e0; + + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct IntrinsicContext + { + + public delegate* unmanaged[Cdecl] city_hash_simplify; // city_hash_simplify + public delegate* unmanaged[Cdecl] factorial_simd; // factorial_simd + public delegate* unmanaged[Cdecl] index_pair; // index_pair + public delegate* unmanaged[Cdecl] vec_f32_normalize_3; // f32_normalize_3 + public MatrixIntrinsicArray mat; // mat[4] in native order + + public IntrinsicContext() + { + Unsafe.SkipInit(out this); + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Internal/Intrinsic/SIMDID.cs b/StgSharp.Mathematics/Internal/SIMDID.cs similarity index 91% rename from StgSharp.Common/Internal/Intrinsic/SIMDID.cs rename to StgSharp.Mathematics/Internal/SIMDID.cs index d86417f6..4b593e28 100644 --- a/StgSharp.Common/Internal/Intrinsic/SIMDID.cs +++ b/StgSharp.Mathematics/Internal/SIMDID.cs @@ -1,51 +1,51 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="SIMDID" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Internal.Intrinsic -{ - [StructLayout(LayoutKind.Explicit)] - internal unsafe struct SIMDID - { - - [FieldOffset(0)]public fixed byte MaskByte[16]; - [FieldOffset(0)]public ulong Mask; - - public SIMDID() - { - Unsafe.SkipInit(out this); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="SIMDID" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Internal +{ + [StructLayout(LayoutKind.Explicit)] + internal unsafe struct SIMDID + { + + [FieldOffset(0)]public fixed byte MaskByte[16]; + [FieldOffset(0)]public ulong Mask; + + public SIMDID() + { + Unsafe.SkipInit(out this); + } + + } +} diff --git a/StgSharp.Common/Internal/Intrinsic/intrinsicContextProvider.cs b/StgSharp.Mathematics/Internal/intrinsicContextProvider.cs similarity index 56% rename from StgSharp.Common/Internal/Intrinsic/intrinsicContextProvider.cs rename to StgSharp.Mathematics/Internal/intrinsicContextProvider.cs index 55effeee..ad28d2b0 100644 --- a/StgSharp.Common/Internal/Intrinsic/intrinsicContextProvider.cs +++ b/StgSharp.Mathematics/Internal/intrinsicContextProvider.cs @@ -1,82 +1,79 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="intrinsicContextProvider.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Internal.Intrinsic; - -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Internal -{ - internal static unsafe partial class NativeIntrinsic - { - - private static readonly IntrinsicContext _intrinsicContext = new(); - - public static SIMDID IntrinsicMask { get; set; } - - internal static IntrinsicContext Context - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _intrinsicContext; - } - - /* - internal static void InitIntrinsicContext() - { - ulong statCode = 0; - - fixed (IntrinsicContext* cPtr = &_intrinsicContext) { - statCode = LoadIntrinsicFunction(cPtr); - } - SIMDID id = new() - { - Mask = statCode - }; - switch (id.MaskByte[1]) - { - case 0: - Dialogue.PostError(new PlatformNotSupportedException("No SIMD instructions supported on current hardware platform")); - Environment.Exit(-1); - break; - default: - break; - } - IntrinsicMask = id; - } - - [LibraryImport(Native.LibName, EntryPoint = "load_intrinsic_function")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - private static partial void LoadIntrinsicFunction(IntrinsicContext* context, ulong id); - /**/ - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="intrinsicContextProvider" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics.Internal; + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Internal +{ + internal static unsafe partial class NativeIntrinsic + { + + private static readonly IntrinsicContext _intrinsicContext = new(); + + public static SIMDID IntrinsicMask { get; set; } + + internal static IntrinsicContext Context + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _intrinsicContext; + } + + /* + internal static void InitIntrinsicContext() + { + ulong statCode = 0; + + fixed (IntrinsicContext* cPtr = &_intrinsicContext) { + statCode = LoadIntrinsicFunction(cPtr); + } + SIMDID id = new() + { + Mask = statCode + }; + switch (id.MaskByte[1]) + { + case 0: + Dialogue.PostError(new PlatformNotSupportedException("No SIMD instructions supported on current hardware platform")); + Environment.Exit(-1); + break; + default: + break; + } + IntrinsicMask = id; + } + + [LibraryImport(Native.LibName, EntryPoint = "load_intrinsic_function")] + [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + private static partial void LoadIntrinsicFunction(IntrinsicContext* context, ulong id); + /**/ + } } \ No newline at end of file diff --git a/StgSharp.Common/Mathematics/Graphic/Matrix44.cs b/StgSharp.Mathematics/Numeric/Graphics/Matrix44.cs similarity index 96% rename from StgSharp.Common/Mathematics/Graphic/Matrix44.cs rename to StgSharp.Mathematics/Numeric/Graphics/Matrix44.cs index b9753556..4eae1b2e 100644 --- a/StgSharp.Common/Mathematics/Graphic/Matrix44.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Matrix44.cs @@ -1,262 +1,263 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Matrix44" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Numeric; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Graphic -{ - [StructLayout(LayoutKind.Explicit, Size = (16 * sizeof(float)), Pack = 16)] - public unsafe struct Matrix44 : IEquatable - { - - [FieldOffset(0 * sizeof(float))] internal Column column; - - [FieldOffset(0)] internal ColumnSet4 mat; - [FieldOffset(0)] internal MatrixKernel kernel; - - internal Matrix44( - ColumnSet4 mat - ) - { - Unsafe.SkipInit(out this); - this.mat = mat; - } - - internal Matrix44( - Vector4 vec0, - Vector4 vec1, - Vector4 vec2, - Vector4 vec3 - ) - { - Unsafe.SkipInit(out this); - mat.colum0 = vec0; - mat.colum1 = vec1; - mat.colum2 = vec2; - mat.colum3 = vec3; - } - - public Matrix44() - { - Unsafe.SkipInit(out this); - } - - public unsafe Matrix44( - float a00, - float a01, - float a02, - float a03, - float a10, - float a11, - float a12, - float a13, - float a20, - float a21, - float a22, - float a23, - float a30, - float a31, - float a32, - float a33 - ) - { - Unsafe.SkipInit(out this); - mat.colum0 = new Vector4(a00, a10, a20, a30); - mat.colum1 = new Vector4(a01, a11, a21, a31); - mat.colum2 = new Vector4(a02, a12, a22, a32); - mat.colum3 = new Vector4(a03, a13, a23, a33); - } - - public unsafe float this[ - int rowNum, - int columNum - ] - { - get - { -#if DEBUG - if (rowNum is > 3 or < 0) - { - throw new ArgumentOutOfRangeException(nameof(columNum)); - } - if (columNum is > 3 or < 0) { - throw new ArgumentOutOfRangeException(nameof(columNum)); - } -#endif - return kernel[rowNum + 4 * columNum]; - } - set - { -#if DEBUG - if (rowNum is > 3 or < 0) - { - throw new ArgumentOutOfRangeException(nameof(columNum)); - } - if (columNum is > 3 or < 0) { - throw new ArgumentOutOfRangeException(nameof(columNum)); - } -#endif - kernel[rowNum + 4 * columNum] = value; - } - } - - public Matrix44 Transpose - { - get - { - Matrix44 transpose = new(); - InternalTranspose(ref transpose); - return transpose; - } - } - - public static Matrix44 Unit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - - public static Matrix44 WNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1); - - public static Matrix44 XNegativeUnit => new Matrix44(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - - public static Matrix44 YNegativeUnit => new Matrix44(1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - - public static Matrix44 ZNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1); - - public ReadOnlySpan AsSpan() - { - return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As(ref mat), 16); - } - - public override bool Equals( - object? obj - ) - { - return obj is Matrix44 x && Equals(x); - } - - public bool Equals( - Matrix44 other - ) - { - return mat.Equals(other.mat); - } - - public override int GetHashCode() - { - return HashCode.Combine(mat.colum0.GetHashCode(), mat.colum1.GetHashCode(), - mat.colum2.GetHashCode(), mat.colum3.GetHashCode()); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe void InternalTranspose( - ref Matrix44 transpose - ) - { - const int f32 = 0; - fixed (MatrixKernel* source = &this.kernel, target = &transpose.kernel) { - NativeIntrinsic.Context.mat[f32].buffer_transpose(source, target); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe Matrix44 operator -( - Matrix44 left, - Matrix44 right - ) - { - Matrix44 ret = new(); - const int f32 = 0; - NativeIntrinsic.Context.mat[f32].buffer_sub(&left, &right, &ret, 1); - return ret; - } - - public static bool operator !=( - Matrix44 left, - Matrix44 right - ) - { - return !(left == right); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe Matrix44 operator *( - Matrix44 mat, - float value - ) - { - return new Matrix44(mat.mat.colum0 * value, mat.mat.colum1 * value, - mat.mat.colum2 * value, mat.mat.colum3 * value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix44 operator *( - Matrix44 left, - Matrix44 right - ) - { - Matrix44 ret = new(); - int f32 = (int)MatrixElementType.F32; - NativeIntrinsic.Context.mat[f32].kernel_fma(&left, &right, &ret); - return ret; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe Matrix44 operator +( - Matrix44 left, - Matrix44 right - ) - { - Matrix44 ret = new(); - const int f32 = 0; - NativeIntrinsic.Context.mat[f32].buffer_add(&left, &right, &ret, 1); - return ret; - } - - public static bool operator ==( - Matrix44 left, - Matrix44 right - ) - { - return left.Equals(right); - } - - [InlineArray(4)] - internal struct Column - { - - private Vec4 value; - - } - - } -} - +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Matrix44" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.Mathematics.Internal; +using StgSharp.Mathematics.Numeric; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Graphics +{ + [StructLayout(LayoutKind.Explicit, Size = (16 * sizeof(float)), Pack = 16)] + public unsafe struct Matrix44 : IEquatable + { + + [FieldOffset(0 * sizeof(float))] internal Column column; + + [FieldOffset(0)] internal ColumnSet4 mat; + [FieldOffset(0)] internal MatrixKernel kernel; + + internal Matrix44( + ColumnSet4 mat + ) + { + Unsafe.SkipInit(out this); + this.mat = mat; + } + + internal Matrix44( + Vector4 vec0, + Vector4 vec1, + Vector4 vec2, + Vector4 vec3 + ) + { + Unsafe.SkipInit(out this); + mat.colum0 = vec0; + mat.colum1 = vec1; + mat.colum2 = vec2; + mat.colum3 = vec3; + } + + public Matrix44() + { + Unsafe.SkipInit(out this); + } + + public unsafe Matrix44( + float a00, + float a01, + float a02, + float a03, + float a10, + float a11, + float a12, + float a13, + float a20, + float a21, + float a22, + float a23, + float a30, + float a31, + float a32, + float a33 + ) + { + Unsafe.SkipInit(out this); + mat.colum0 = new Vector4(a00, a10, a20, a30); + mat.colum1 = new Vector4(a01, a11, a21, a31); + mat.colum2 = new Vector4(a02, a12, a22, a32); + mat.colum3 = new Vector4(a03, a13, a23, a33); + } + + public unsafe float this[ + int rowNum, + int columNum + ] + { + get + { +#if DEBUG + if (rowNum is > 3 or < 0) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if (columNum is > 3 or < 0) { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } +#endif + return kernel[rowNum + 4 * columNum]; + } + set + { +#if DEBUG + if (rowNum is > 3 or < 0) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if (columNum is > 3 or < 0) { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } +#endif + kernel[rowNum + 4 * columNum] = value; + } + } + + public Matrix44 Transpose + { + get + { + Matrix44 transpose = new(); + InternalTranspose(ref transpose); + return transpose; + } + } + + public static Matrix44 Unit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + + public static Matrix44 WNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1); + + public static Matrix44 XNegativeUnit => new Matrix44(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + + public static Matrix44 YNegativeUnit => new Matrix44(1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + + public static Matrix44 ZNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1); + + public ReadOnlySpan AsSpan() + { + return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As(ref mat), 16); + } + + public override bool Equals( + object? obj + ) + { + return obj is Matrix44 x && Equals(x); + } + + public bool Equals( + Matrix44 other + ) + { + return mat.Equals(other.mat); + } + + public override int GetHashCode() + { + return HashCode.Combine(mat.colum0.GetHashCode(), mat.colum1.GetHashCode(), + mat.colum2.GetHashCode(), mat.colum3.GetHashCode()); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void InternalTranspose( + ref Matrix44 transpose + ) + { + const int f32 = 0; + fixed (MatrixKernel* source = &this.kernel, target = &transpose.kernel) { + NativeIntrinsic.Context.mat[f32].buffer_transpose(source, target); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix44 operator -( + Matrix44 left, + Matrix44 right + ) + { + Matrix44 ret = new(); + const int f32 = 0; + NativeIntrinsic.Context.mat[f32].buffer_sub(&left, &right, &ret, 1); + return ret; + } + + public static bool operator !=( + Matrix44 left, + Matrix44 right + ) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix44 operator *( + Matrix44 mat, + float value + ) + { + return new Matrix44(mat.mat.colum0 * value, mat.mat.colum1 * value, + mat.mat.colum2 * value, mat.mat.colum3 * value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix44 operator *( + Matrix44 left, + Matrix44 right + ) + { + Matrix44 ret = new(); + int f32 = (int)MatrixElementType.F32; + NativeIntrinsic.Context.mat[f32].kernel_fma(&left, &right, &ret); + return ret; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix44 operator +( + Matrix44 left, + Matrix44 right + ) + { + Matrix44 ret = new(); + const int f32 = 0; + NativeIntrinsic.Context.mat[f32].buffer_add(&left, &right, &ret, 1); + return ret; + } + + public static bool operator ==( + Matrix44 left, + Matrix44 right + ) + { + return left.Equals(right); + } + + [InlineArray(4)] + internal struct Column + { + + private Vec4 value; + + } + + } +} + diff --git a/StgSharp.Common/Mathematics/Graphic/Vec2.cs b/StgSharp.Mathematics/Numeric/Graphics/Vec2.cs similarity index 94% rename from StgSharp.Common/Mathematics/Graphic/Vec2.cs rename to StgSharp.Mathematics/Numeric/Graphics/Vec2.cs index 4177cad8..f580aefa 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vec2.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vec2.cs @@ -1,162 +1,162 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vec2" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Numeric; -using System.Net.Http.Headers; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Graphic -{ - /// - /// A two dimension vector defined by two elements. Vec2 in World are default used as colum - /// vector. - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] - public struct Vec2 : IUnmanagedVector - { - - [FieldOffset(0)] internal unsafe fixed float num[2]; - - [FieldOffset(0)] - internal M128 reg; - - [FieldOffset(0)] - internal Vector2 v; - - [FieldOffset(0)] - public float X; - [FieldOffset(4)] - public float Y; - - internal Vec2(Vector2 vec) - { - Unsafe.SkipInit(out reg); - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - v = vec; - } - - internal Vec2(M128 vec) - { - Unsafe.SkipInit(out reg); - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - reg = vec; - reg.Member(1) = 0; - } - - public Vec2(float x, float y) - { - v = new Vector2(x, y); - } - - public static Vec2 Unit => new Vec2(1, 1); - - public static Vec2 Zero => new Vec2(0, 0); - - public static Vec2 One - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new Vec2(1, 1); - } - - public Vec2 XY - { - readonly get => this; - set => this = value; - } - - public Vec3 XYZ - { - readonly get => new(reg); - set - { - reg = value.reg; - reg.Member(1) = 0; - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public float Cross(Vec2 right) - { - return X * right.Y - Y * right.X; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public float Dot(Vec2 vec) - { - return Vector2.Dot(v, vec.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec2 operator -(Vec2 left, Vec2 right) - { - return new Vec2(left.v - right.v); - } - - public static bool operator !=(Vec2 left, Vec2 right) - { - return !(left == right); - } - - public static Vec2 operator *(Vec2 vec, float value) - { - return new Vec2(vec.v * value); - } - public static Vec2 operator *(float value, Vec2 vec) - { - return new Vec2(vec.v * value); - } - - public static Vec2 operator /(Vec2 vec, float value) - { - return new Vec2(vec.v / value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec2 operator +(Vec2 left, Vec2 right) - { - return new Vec2(left.v + right.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Vec2 left, Vec2 right) - { - return left.v == right.v; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator Vec2((float, float) tuple) - { - return new Vec2(tuple.Item1, tuple.Item2); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vec2" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.Mathematics.Numeric; +using System.Net.Http.Headers; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Graphics +{ + /// + /// A two dimension vector defined by two elements. Vec2 in World are default used as colum + /// vector. + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] + public struct Vec2 : IUnmanagedVector + { + + [FieldOffset(0)] internal unsafe fixed float num[2]; + + [FieldOffset(0)] + internal M128 reg; + + [FieldOffset(0)] + internal Vector2 v; + + [FieldOffset(0)] + public float X; + [FieldOffset(4)] + public float Y; + + internal Vec2(Vector2 vec) + { + Unsafe.SkipInit(out reg); + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + v = vec; + } + + internal Vec2(M128 vec) + { + Unsafe.SkipInit(out reg); + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + reg = vec; + reg.Member(1) = 0; + } + + public Vec2(float x, float y) + { + v = new Vector2(x, y); + } + + public static Vec2 Unit => new Vec2(1, 1); + + public static Vec2 Zero => new Vec2(0, 0); + + public static Vec2 One + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new Vec2(1, 1); + } + + public Vec2 XY + { + readonly get => this; + set => this = value; + } + + public Vec3 XYZ + { + readonly get => new(reg); + set + { + reg = value.reg; + reg.Member(1) = 0; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Cross(Vec2 right) + { + return X * right.Y - Y * right.X; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Dot(Vec2 vec) + { + return Vector2.Dot(v, vec.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec2 operator -(Vec2 left, Vec2 right) + { + return new Vec2(left.v - right.v); + } + + public static bool operator !=(Vec2 left, Vec2 right) + { + return !(left == right); + } + + public static Vec2 operator *(Vec2 vec, float value) + { + return new Vec2(vec.v * value); + } + public static Vec2 operator *(float value, Vec2 vec) + { + return new Vec2(vec.v * value); + } + + public static Vec2 operator /(Vec2 vec, float value) + { + return new Vec2(vec.v / value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec2 operator +(Vec2 left, Vec2 right) + { + return new Vec2(left.v + right.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Vec2 left, Vec2 right) + { + return left.v == right.v; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator Vec2((float, float) tuple) + { + return new Vec2(tuple.Item1, tuple.Item2); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Graphic/Vec3.cs b/StgSharp.Mathematics/Numeric/Graphics/Vec3.cs similarity index 71% rename from StgSharp.Common/Mathematics/Graphic/Vec3.cs rename to StgSharp.Mathematics/Numeric/Graphics/Vec3.cs index 06f3f265..611ba524 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vec3.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vec3.cs @@ -1,236 +1,288 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vec3" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Numeric; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Graphic -{ - [CollectionBuilder(typeof(Vec3), nameof(FromSpan))] - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] - public struct Vec3 : IEquatable, IUnmanagedVector, IEnumerable - { - - [FieldOffset(0)] internal unsafe fixed float num[3]; - [FieldOffset(0)] internal M128 reg; - - [FieldOffset(0)] internal Vector3 v; - - [FieldOffset(0)] public float X; - [FieldOffset(4)] public float Y; - [FieldOffset(8)] public float Z; - - internal Vec3(M128 vector) - { - Unsafe.SkipInit(out this); - reg = vector; - reg.Member(3) = 0; - } - - internal Vec3(Vector3 vector) - { - v = vector; - } - - public Vec3() - { - Unsafe.SkipInit(out this); - } - - public Vec3(Vec2 xy, float z) - { - Unsafe.SkipInit(out this); - reg = xy.reg; - Z = z; - } - - public Vec3(float x, float y, float z) - { - Unsafe.SkipInit(out this); - v = new Vector3(x, y, z); - } - - public unsafe Vec2 XY - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => new(reg); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => Unsafe.As(ref v) = value.v; - } - - public Vec3 XYZ - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => new(v); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => this = value; - } - - public static Vec3 Zero => new(0, 0, 0); - - public static Vec3 One => new(1, 1, 1); - - public static Vec3 UnitX => new(1, 0, 0); - - public static Vec3 UnitY => new(0, 1, 0); - - public static Vec3 UnitZ => new(0, 0, 1); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 Cross(Vec3 left, Vec3 right) - { - return Linear.Cross(left, right); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float Dot(Vec3 right) - { - return Vector3.Dot(v, right.v); - } - - public readonly bool Equals(Vec3 other) - { - return reg == other.reg; - } - - public override readonly bool Equals(object obj) - { - return obj is not null && obj is Vec3 vec && this == vec; - } - - public static Vec3 FromSpan(ReadOnlySpan span) - { - Vec3 v = new(); - span.CopyTo(MemoryMarshal.CreateSpan(ref v.X, 3)); - return v; - } - - public unsafe IEnumerator GetEnumerator() - { - for (int i = 0; i < 3; i++) { - yield return reg.Member(i); - } - } - - public override unsafe int GetHashCode() - { - fixed (float* add = &X) { - return HashCode.Combine(X, Y, Z, (ulong)add); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float GetMaxValue() - { - float ret = X; - ret = ret > Y ? ret : Y; - ret = ret > Z ? ret : Z; - return ret; - } - - public static bool IsParallel(Vec3 left, Vec3 right) - { - return Cross(left, right) == Zero; - } - - public override readonly string ToString() - { - return $"[{X},{Y},{Z}]"; - } - - public readonly string ToString(string sample) - { - return $"[{X.ToString(sample)},{Y.ToString(sample)},{Z.ToString(sample)}]"; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator -(Vec3 vec) - { - return new Vec3(-vec.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator -(Vec3 left, Vec3 right) - { - return new Vec3(left.v - right.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Vec3 left, Vec3 right) - { - return left.v != right.v; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator *(Vec3 vec, float value) - { - return new Vec3(vec.v * value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float operator *(Vec3 left, Vec3 right) - { - return Vector3.Dot(left.v, right.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator /(Vec3 vec, float value) - { - return new Vec3(vec.v / value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator +(Vec3 left, Vec3 right) - { - return new Vec3(left.v + right.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Vec3 left, Vec3 right) - { - return left.v == right.v; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe implicit operator Vec3((float, float, float) tuple) - { - return Unsafe.As<(float,float,float), Vec3>(ref tuple); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vec3" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.Mathematics.Numeric; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Graphics +{ + [CollectionBuilder(typeof(Vec3), nameof(FromSpan))] + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] + public struct Vec3 : IEquatable, IUnmanagedVector, IEnumerable + { + + [FieldOffset(0)] internal unsafe fixed float num[3]; + [FieldOffset(0)] internal M128 reg; + + [FieldOffset(0)] internal Vector3 v; + + [FieldOffset(0)] public float X; + [FieldOffset(4)] public float Y; + [FieldOffset(8)] public float Z; + + internal Vec3( + M128 vector + ) + { + Unsafe.SkipInit(out this); + reg = vector; + reg.Member(3) = 0; + } + + internal Vec3( + Vector3 vector + ) + { + v = vector; + } + + public Vec3() + { + Unsafe.SkipInit(out this); + } + + public Vec3( + Vec2 xy, + float z + ) + { + Unsafe.SkipInit(out this); + reg = xy.reg; + Z = z; + } + + public Vec3( + float x, + float y, + float z + ) + { + Unsafe.SkipInit(out this); + v = new Vector3(x, y, z); + } + + public unsafe Vec2 XY + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => new(reg); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref v) = value.v; + } + + public Vec3 XYZ + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => new(v); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => this = value; + } + + public static Vec3 Zero => new(0, 0, 0); + + public static Vec3 One => new(1, 1, 1); + + public static Vec3 UnitX => new(1, 0, 0); + + public static Vec3 UnitY => new(0, 1, 0); + + public static Vec3 UnitZ => new(0, 0, 1); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 Cross( + Vec3 left, + Vec3 right + ) + { + return Linear.Cross(left, right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly float Dot( + Vec3 right + ) + { + return Vector3.Dot(v, right.v); + } + + public readonly bool Equals( + Vec3 other + ) + { + return reg == other.reg; + } + + public override readonly bool Equals( + object obj + ) + { + return obj is not null && obj is Vec3 vec && this == vec; + } + + public static Vec3 FromSpan( + ReadOnlySpan span + ) + { + Vec3 v = new(); + span.CopyTo(MemoryMarshal.CreateSpan(ref v.X, 3)); + return v; + } + + public unsafe IEnumerator GetEnumerator() + { + for (int i = 0; i < 3; i++) { + yield return reg.Member(i); + } + } + + public override unsafe int GetHashCode() + { + fixed (float* add = &X) { + return HashCode.Combine(X, Y, Z, (ulong)add); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly float GetMaxValue() + { + float ret = X; + ret = ret > Y ? ret : Y; + ret = ret > Z ? ret : Z; + return ret; + } + + public static bool IsParallel( + Vec3 left, + Vec3 right + ) + { + return Cross(left, right) == Zero; + } + + public override readonly string ToString() + { + return $"[{X},{Y},{Z}]"; + } + + public readonly string ToString( + string sample + ) + { + return $"[{X.ToString(sample)},{Y.ToString(sample)},{Z.ToString(sample)}]"; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator -( + Vec3 vec + ) + { + return new Vec3(-vec.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator -( + Vec3 left, + Vec3 right + ) + { + return new Vec3(left.v - right.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=( + Vec3 left, + Vec3 right + ) + { + return left.v != right.v; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator *( + Vec3 vec, + float value + ) + { + return new Vec3(vec.v * value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float operator *( + Vec3 left, + Vec3 right + ) + { + return Vector3.Dot(left.v, right.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator /( + Vec3 vec, + float value + ) + { + return new Vec3(vec.v / value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator +( + Vec3 left, + Vec3 right + ) + { + return new Vec3(left.v + right.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==( + Vec3 left, + Vec3 right + ) + { + return left.v == right.v; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe implicit operator Vec3( + (float, float, float) tuple + ) + { + return Unsafe.As<(float,float,float), Vec3>(ref tuple); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Graphic/Vec4.cs b/StgSharp.Mathematics/Numeric/Graphics/Vec4.cs similarity index 76% rename from StgSharp.Common/Mathematics/Graphic/Vec4.cs rename to StgSharp.Mathematics/Numeric/Graphics/Vec4.cs index f9422ed5..2c6ba1c1 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vec4.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vec4.cs @@ -1,212 +1,251 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vec4" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Internal.Intrinsic; -using StgSharp.Mathematics.Numeric; -using System; -using System.Data.Common; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Graphic -{ - [CollectionBuilder(builderType:typeof(Vec4), methodName: nameof(Vec4.FromSpan))] - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] - public unsafe struct Vec4 : IEquatable, IUnmanagedVector - { - - [FieldOffset(0)] internal unsafe fixed float num[4]; - - [FieldOffset(0)] internal M128 reg; - - [FieldOffset(0)] internal Vector4 vec; - [FieldOffset(12)] public float W; - - [FieldOffset(0)] public float X; - [FieldOffset(4)] public float Y; - [FieldOffset(8)] public float Z; - - internal Vec4(Vector4 v) - { - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - Unsafe.SkipInit(out Z); - Unsafe.SkipInit(out W); - Unsafe.SkipInit(out reg); - - vec = v; - } - - internal Vec4(M128 v) - { - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - Unsafe.SkipInit(out Z); - Unsafe.SkipInit(out W); - Unsafe.SkipInit(out vec); - - reg = v; - } - - public Vec4(Vec3 v3, float w) - { - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - Unsafe.SkipInit(out Z); - Unsafe.SkipInit(out W); - reg = v3.reg; - W = w; - } - - public Vec4(float x, float y, float z, float w) - { - vec = new Vector4(x, y, z, w); - } - - public unsafe Vec2 XY - { - get => new Vec2(reg); - set - { - X = value.X; - Y = value.Y; - } - } - - public unsafe Vec3 XYZ - { - get => new Vec3(reg); - set - { - float w = W; - reg = value.reg; - W = w; - } - } - - public static Vec4 One - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new Vec4(1, 1, 1, 1); - } - - public static Vec4 Zero - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new Vec4(0, 0, 0, 0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 Add(Vec4 left, Vec4 right) - { - return left + right; - } - - public ReadOnlySpan AsSpan() - { - return MemoryMarshal.CreateReadOnlySpan(ref reg.Member(0), 4); - } - - public override bool Equals(object obj) - { - return obj is Vec4 v && v == this; - } - - public static Vec4 FromSpan(ReadOnlySpan span) - { - if (span.Length < 4) { - throw new ArgumentException("Span length must be at least 4.", nameof(span)); - } - - // Read 4 floats as a Vector4 in one operation without per-element copy. - Vector4 v = MemoryMarshal.Read(MemoryMarshal.AsBytes(span)); - return new Vec4(v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ReadOnlySpan.Enumerator GetEnumerator() - { - return AsSpan().GetEnumerator(); - } - - public override int GetHashCode() - { - return vec.GetHashCode(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 Subtract(Vec4 left, Vec4 right) - { - return left - right; - } - - public override string ToString() - { - return vec.ToString(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator -(Vec4 left, Vec4 right) - { - return new Vec4(left.vec - right.vec); - } - - public static bool operator !=(Vec4 left, Vec4 right) - { - return !(left == right); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator *(Matrix44 mat, Vec4 vec) - { - Matrix44 transpose = mat.Transpose; - return new Vec4(Vector4.Dot(transpose.mat.colum0, vec.vec), - Vector4.Dot(transpose.mat.colum1, vec.vec), - Vector4.Dot(transpose.mat.colum2, vec.vec), - Vector4.Dot(transpose.mat.colum3, vec.vec)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator +(Vec4 left, Vec4 right) - { - return new Vec4(left.vec + right.vec); - } - - public static bool operator ==(Vec4 left, Vec4 right) - { - return left.vec == right.vec; - } - - bool IEquatable.Equals(Vec4 other) - { - return vec == other.vec; - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vec4" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.Mathematics.Internal; +using StgSharp.Mathematics.Numeric; +using System; +using System.Data.Common; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Graphics +{ + [CollectionBuilder(builderType:typeof(Vec4), methodName: nameof(Vec4.FromSpan))] + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] + public unsafe struct Vec4 : IEquatable, IUnmanagedVector + { + + [FieldOffset(0)] internal unsafe fixed float num[4]; + + [FieldOffset(0)] internal M128 reg; + + [FieldOffset(0)] internal Vector4 vec; + [FieldOffset(12)] public float W; + + [FieldOffset(0)] public float X; + [FieldOffset(4)] public float Y; + [FieldOffset(8)] public float Z; + + internal Vec4( + Vector4 v + ) + { + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + Unsafe.SkipInit(out Z); + Unsafe.SkipInit(out W); + Unsafe.SkipInit(out reg); + + vec = v; + } + + internal Vec4( + M128 v + ) + { + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + Unsafe.SkipInit(out Z); + Unsafe.SkipInit(out W); + Unsafe.SkipInit(out vec); + + reg = v; + } + + public Vec4( + Vec3 v3, + float w + ) + { + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + Unsafe.SkipInit(out Z); + Unsafe.SkipInit(out W); + reg = v3.reg; + W = w; + } + + public Vec4( + float x, + float y, + float z, + float w + ) + { + vec = new Vector4(x, y, z, w); + } + + public unsafe Vec2 XY + { + get => new Vec2(reg); + set + { + X = value.X; + Y = value.Y; + } + } + + public unsafe Vec3 XYZ + { + get => new Vec3(reg); + set + { + float w = W; + reg = value.reg; + W = w; + } + } + + public static Vec4 One + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new Vec4(1, 1, 1, 1); + } + + public static Vec4 Zero + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new Vec4(0, 0, 0, 0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 Add( + Vec4 left, + Vec4 right + ) + { + return left + right; + } + + public ReadOnlySpan AsSpan() + { + return MemoryMarshal.CreateReadOnlySpan(ref reg.Member(0), 4); + } + + public override bool Equals( + object obj + ) + { + return obj is Vec4 v && v == this; + } + + public static Vec4 FromSpan( + ReadOnlySpan span + ) + { + if (span.Length < 4) { + throw new ArgumentException("Span length must be at least 4.", nameof(span)); + } + + // Read 4 floats as a Vector4 in one operation without per-element copy. + Vector4 v = MemoryMarshal.Read(MemoryMarshal.AsBytes(span)); + return new Vec4(v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ReadOnlySpan.Enumerator GetEnumerator() + { + return AsSpan().GetEnumerator(); + } + + public override int GetHashCode() + { + return vec.GetHashCode(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 Subtract( + Vec4 left, + Vec4 right + ) + { + return left - right; + } + + public override string ToString() + { + return vec.ToString(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 operator -( + Vec4 left, + Vec4 right + ) + { + return new Vec4(left.vec - right.vec); + } + + public static bool operator !=( + Vec4 left, + Vec4 right + ) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 operator *( + Matrix44 mat, + Vec4 vec + ) + { + Matrix44 transpose = mat.Transpose; + return new Vec4(Vector4.Dot(transpose.mat.colum0, vec.vec), + Vector4.Dot(transpose.mat.colum1, vec.vec), + Vector4.Dot(transpose.mat.colum2, vec.vec), + Vector4.Dot(transpose.mat.colum3, vec.vec)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 operator +( + Vec4 left, + Vec4 right + ) + { + return new Vec4(left.vec + right.vec); + } + + public static bool operator ==( + Vec4 left, + Vec4 right + ) + { + return left.vec == right.vec; + } + + bool IEquatable.Equals( + Vec4 other + ) + { + return vec == other.vec; + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.Cross.cs b/StgSharp.Mathematics/Numeric/Graphics/Vector.Cross.cs similarity index 90% rename from StgSharp.Common/Mathematics/Graphic/Vector.Cross.cs rename to StgSharp.Mathematics/Numeric/Graphics/Vector.Cross.cs index 1f977d44..f5681692 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.Cross.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vector.Cross.cs @@ -1,49 +1,49 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vector.Cross" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Mathematics.Graphic; - -namespace StgSharp.Mathematics.Graphic -{ - public static unsafe partial class Linear - { - - public static float Cross(Vec2 vec1, Vec2 vec2) - { - return (vec1.X * vec2.Y) - (vec1.Y * vec2.X); - } - - public static Vec3 Cross(Vec3 vec1, Vec3 vec2) - { - return new Vec3( - (vec1.Y * vec2.Z) - (vec1.Z * vec2.Y), - (vec1.X * vec2.Z) - (vec1.Z * vec2.X), - (vec1.X * vec2.Y) - (vec1.Y * vec2.X)); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vector.Cross" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics.Graphics; + +namespace StgSharp.Mathematics.Graphics +{ + public static unsafe partial class Linear + { + + public static float Cross(Vec2 vec1, Vec2 vec2) + { + return (vec1.X * vec2.Y) - (vec1.Y * vec2.X); + } + + public static Vec3 Cross(Vec3 vec1, Vec3 vec2) + { + return new Vec3( + (vec1.Y * vec2.Z) - (vec1.Z * vec2.Y), + (vec1.X * vec2.Z) - (vec1.Z * vec2.X), + (vec1.X * vec2.Y) - (vec1.Y * vec2.X)); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.GetAngle.cs b/StgSharp.Mathematics/Numeric/Graphics/Vector.GetAngle.cs similarity index 90% rename from StgSharp.Common/Mathematics/Graphic/Vector.GetAngle.cs rename to StgSharp.Mathematics/Numeric/Graphics/Vector.GetAngle.cs index d766a272..18790f93 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.GetAngle.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vector.GetAngle.cs @@ -1,47 +1,47 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vector.GetAngle" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Mathematics.Graphic; - -namespace StgSharp.Mathematics.Graphic -{ - public static unsafe partial class Linear - { - - public static float GetAngle(Vec2 vec1, Vec2 vec2) - { - return Scalar.ACos( - 1 / (vec1.GetLength() * vec2.GetLength())); - } - - public static float GetAngle(Vec3 vec1, Vec3 vec2) - { - return Scalar.ACos((vec1 * vec2) / (vec1.GetLength() * vec2.GetLength())); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vector.GetAngle" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics.Graphics; + +namespace StgSharp.Mathematics.Graphics +{ + public static unsafe partial class Linear + { + + public static float GetAngle(Vec2 vec1, Vec2 vec2) + { + return Scalar.ACos( + 1 / (vec1.GetLength() * vec2.GetLength())); + } + + public static float GetAngle(Vec3 vec1, Vec3 vec2) + { + return Scalar.ACos((vec1 * vec2) / (vec1.GetLength() * vec2.GetLength())); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.GetLength.cs b/StgSharp.Mathematics/Numeric/Graphics/Vector.GetLength.cs similarity index 89% rename from StgSharp.Common/Mathematics/Graphic/Vector.GetLength.cs rename to StgSharp.Mathematics/Numeric/Graphics/Vector.GetLength.cs index f606bbc7..19a719d8 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.GetLength.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vector.GetLength.cs @@ -1,46 +1,46 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vector.GetLength" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Mathematics.Graphic; - -namespace StgSharp.Mathematics.Graphic -{ - public static unsafe partial class Linear - { - - public static float GetLength(this Vec3 vec) - { - return Scalar.Sqrt(vec.Dot(vec)); - } - - public static float GetLength(this Vec2 vec) - { - return Scalar.Sqrt(vec.Dot(vec)); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vector.GetLength" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics.Graphics; + +namespace StgSharp.Mathematics.Graphics +{ + public static unsafe partial class Linear + { + + public static float GetLength(this Vec3 vec) + { + return Scalar.Sqrt(vec.Dot(vec)); + } + + public static float GetLength(this Vec2 vec) + { + return Scalar.Sqrt(vec.Dot(vec)); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.Normalize.cs b/StgSharp.Mathematics/Numeric/Graphics/Vector.Normalize.cs similarity index 91% rename from StgSharp.Common/Mathematics/Graphic/Vector.Normalize.cs rename to StgSharp.Mathematics/Numeric/Graphics/Vector.Normalize.cs index 5cd77bca..eb21a4b5 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.Normalize.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vector.Normalize.cs @@ -1,82 +1,82 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vector.Normalize" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Mathematics.Graphic; -using System.Numerics; - -namespace StgSharp.Mathematics.Graphic -{ - public static partial class Linear - { - - public static Vec4 Normalize(Vec4 vec) - { - return new Vec4 - { - vec = Vector4.Normalize(vec.vec) - }; - } - - public static Vec3 Normalize(Vec3 vec) - { - return new Vec3 - { - v = Vector3.Normalize(vec.v) - }; - } - - public static unsafe void Normalize(ref 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; - } - - public static unsafe void Normalize(ref Vec3 source, ref Vec3 target) - { - Vector3 s = source.v; - Vector3 t = target.v; - - 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; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vector.Normalize" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics.Graphics; +using System.Numerics; + +namespace StgSharp.Mathematics.Graphics +{ + public static partial class Linear + { + + public static Vec4 Normalize(Vec4 vec) + { + return new Vec4 + { + vec = Vector4.Normalize(vec.vec) + }; + } + + public static Vec3 Normalize(Vec3 vec) + { + return new Vec3 + { + v = Vector3.Normalize(vec.v) + }; + } + + public static unsafe void Normalize(ref 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; + } + + public static unsafe void Normalize(ref Vec3 source, ref Vec3 target) + { + Vector3 s = source.v; + Vector3 t = target.v; + + 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; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.Orthogonalize.cs b/StgSharp.Mathematics/Numeric/Graphics/Vector.Orthogonalize.cs similarity index 92% rename from StgSharp.Common/Mathematics/Graphic/Vector.Orthogonalize.cs rename to StgSharp.Mathematics/Numeric/Graphics/Vector.Orthogonalize.cs index 6dec74bb..a893663d 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.Orthogonalize.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vector.Orthogonalize.cs @@ -1,92 +1,92 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vector.Orthogonalize" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Mathematics.Graphic; -using System.Numerics; - -namespace StgSharp.Mathematics.Graphic -{ - public static partial class Linear - { - - public static Vec4 Orthogonalize(this Vec4 vec) - { - return new Vec4 - { - vec = Vector4.Normalize(vec.vec) - }; - } - - public static Vec3 Orthogonalize(Vec3 vec) - { - 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; - } - - /// - /// Orthogonalize two s, let their length be 1 and perpendicular to - /// each other. - /// - /// - /// - /// - /// - /// - /// - public static unsafe void Orthogonalize(this Vec3 source, ref Vec3 target) - { - Vector3 s = source.v; - Vector3 t = target.v; - - 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; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vector.Orthogonalize" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics.Graphics; +using System.Numerics; + +namespace StgSharp.Mathematics.Graphics +{ + public static partial class Linear + { + + public static Vec4 Orthogonalize(this Vec4 vec) + { + return new Vec4 + { + vec = Vector4.Normalize(vec.vec) + }; + } + + public static Vec3 Orthogonalize(Vec3 vec) + { + 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; + } + + /// + /// Orthogonalize two s, let their length be 1 and perpendicular to + /// each other. + /// + /// + /// + /// + /// + /// + /// + public static unsafe void Orthogonalize(this Vec3 source, ref Vec3 target) + { + Vector3 s = source.v; + Vector3 t = target.v; + + 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; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Linear/CoordinationNaming.md b/StgSharp.Mathematics/Numeric/Linear/CoordinationNaming.md similarity index 97% rename from StgSharp.Common/Mathematics/Linear/CoordinationNaming.md rename to StgSharp.Mathematics/Numeric/Linear/CoordinationNaming.md index 5544f3b3..1f1cc175 100644 --- a/StgSharp.Common/Mathematics/Linear/CoordinationNaming.md +++ b/StgSharp.Mathematics/Numeric/Linear/CoordinationNaming.md @@ -1,88 +1,88 @@ -# Matrix Coordinate & Naming Conventions (StgSharp) - -This document defines the coordinate terminology and naming rules used across `Matrix`, `MatrixKernel`, and packed/triangular storage layouts. -Goal: eliminate ambiguity around `column`/`row` names (e.g., “index **of** a column” vs “index **along** a column”). - ---- - -## 1) The key rule: encode prepositions into identifiers (`Of` vs `In`) - -### `...OfX` — “which X” (object identity / ordinal) -Use **`Of`** when the value identifies **which object** (which column, which row, which kernel, etc.). - -Examples: -- `columnOfElement`: the element is located in **which column** -- `rowOfKernel`: the kernel block is located in **which row** - -### `...InX` / `...WithinX` — “inside X” (local coordinate) -Use **`In`** (or `Within`) when the value is a **local coordinate inside** another object. - -Examples: -- `columnInKernel`: local column coordinate **inside** a kernel block -- `rowInKernel`: local row coordinate **inside** a kernel block - -> Quick mental model: **`Of` = identity**, **`In` = inside**. - ---- - -## 2) Coordinate levels: `Element`, `KernelGrid`, `InKernel` - -StgSharp commonly uses three coordinate levels: - -1. **Element-level**: final matrix element coordinates (`Matrix[col,row]`) -2. **Kernel-grid level**: coordinates of a kernel block in the kernel grid -3. **In-kernel level**: local element coordinates within a kernel (e.g., 4×4) - -Recommended names: - -| Level | Column name | Row name | Meaning | -|---|---|---|---| -| Element | `columnOfElement` | `rowOfElement` | element located in which column/row (0-based) | -| Kernel grid | `columnOfKernel` | `rowOfKernel` | kernel block located in which kernel-column/kernel-row (0-based) | -| In-kernel | `columnInKernel` | `rowInKernel` | local coordinate inside the kernel (0..KernelSize-1) | - ---- - -## 3) Index base: 0-based (mandatory) - -Unless explicitly documented otherwise, all coordinates are **0-based**: - -- `columnOfElement ∈ [0, ColumnLength-1]` -- `rowOfElement ∈ [0, RowLength-1]` -- `columnOfKernel ∈ [0, KernelColumnLength-1]` -- `rowOfKernel ∈ [0, KernelRowLength-1]` -- `columnInKernel ∈ [0, KernelSize-1]` -- `rowInKernel ∈ [0, KernelSize-1]` - ---- - -## 4) Mapping element coordinates to kernel coordinates (KernelSize = 4 example) - -For a fixed kernel size `KernelSize = 4`: - -```csharp -int columnOfKernel = columnOfElement / 4; -int rowOfKernel = rowOfElement / 4; - -int columnInKernel = columnOfElement % 4; -int rowInKernel = rowOfElement % 4; -``` - -If `columnOfElement` and `rowOfElement` are guaranteed non-negative, bit operations can be used: - -```csharp -int columnOfKernel = columnOfElement >> 2; -int rowOfKernel = rowOfElement >> 2; - -int columnInKernel = columnOfElement & 3; -int rowInKernel = rowOfElement & 3; -``` - ---- - -## 5) Packed storage: distinguish `Index` from `Offset` - -Packed layouts do **not** store “empty blocks”; stored blocks are placed contiguously in a packed buffer. - -### Use the correct terms -- **`packedKernelIndex`**: “the N-th kernel +# Matrix Coordinate & Naming Conventions (StgSharp) + +This document defines the coordinate terminology and naming rules used across `Matrix`, `MatrixKernel`, and packed/triangular storage layouts. +Goal: eliminate ambiguity around `column`/`row` names (e.g., “index **of** a column” vs “index **along** a column”). + +--- + +## 1) The key rule: encode prepositions into identifiers (`Of` vs `In`) + +### `...OfX` — “which X” (object identity / ordinal) +Use **`Of`** when the value identifies **which object** (which column, which row, which kernel, etc.). + +Examples: +- `columnOfElement`: the element is located in **which column** +- `rowOfKernel`: the kernel block is located in **which row** + +### `...InX` / `...WithinX` — “inside X” (local coordinate) +Use **`In`** (or `Within`) when the value is a **local coordinate inside** another object. + +Examples: +- `columnInKernel`: local column coordinate **inside** a kernel block +- `rowInKernel`: local row coordinate **inside** a kernel block + +> Quick mental model: **`Of` = identity**, **`In` = inside**. + +--- + +## 2) Coordinate levels: `Element`, `KernelGrid`, `InKernel` + +StgSharp commonly uses three coordinate levels: + +1. **Element-level**: final matrix element coordinates (`Matrix[col,row]`) +2. **Kernel-grid level**: coordinates of a kernel block in the kernel grid +3. **In-kernel level**: local element coordinates within a kernel (e.g., 4×4) + +Recommended names: + +| Level | Column name | Row name | Meaning | +|---|---|---|---| +| Element | `columnOfElement` | `rowOfElement` | element located in which column/row (0-based) | +| Kernel grid | `columnOfKernel` | `rowOfKernel` | kernel block located in which kernel-column/kernel-row (0-based) | +| In-kernel | `columnInKernel` | `rowInKernel` | local coordinate inside the kernel (0..KernelSize-1) | + +--- + +## 3) Index base: 0-based (mandatory) + +Unless explicitly documented otherwise, all coordinates are **0-based**: + +- `columnOfElement ∈ [0, ColumnLength-1]` +- `rowOfElement ∈ [0, RowLength-1]` +- `columnOfKernel ∈ [0, KernelColumnLength-1]` +- `rowOfKernel ∈ [0, KernelRowLength-1]` +- `columnInKernel ∈ [0, KernelSize-1]` +- `rowInKernel ∈ [0, KernelSize-1]` + +--- + +## 4) Mapping element coordinates to kernel coordinates (KernelSize = 4 example) + +For a fixed kernel size `KernelSize = 4`: + +```csharp +int columnOfKernel = columnOfElement / 4; +int rowOfKernel = rowOfElement / 4; + +int columnInKernel = columnOfElement % 4; +int rowInKernel = rowOfElement % 4; +``` + +If `columnOfElement` and `rowOfElement` are guaranteed non-negative, bit operations can be used: + +```csharp +int columnOfKernel = columnOfElement >> 2; +int rowOfKernel = rowOfElement >> 2; + +int columnInKernel = columnOfElement & 3; +int rowInKernel = rowOfElement & 3; +``` + +--- + +## 5) Packed storage: distinguish `Index` from `Offset` + +Packed layouts do **not** store “empty blocks”; stored blocks are placed contiguously in a packed buffer. + +### Use the correct terms +- **`packedKernelIndex`**: “the N-th kernel diff --git a/StgSharp.Common/Mathematics/Linear/Cordination.cs b/StgSharp.Mathematics/Numeric/Linear/Cordination.cs similarity index 97% rename from StgSharp.Common/Mathematics/Linear/Cordination.cs rename to StgSharp.Mathematics/Numeric/Linear/Cordination.cs index 78ae7797..c40da654 100644 --- a/StgSharp.Common/Mathematics/Linear/Cordination.cs +++ b/StgSharp.Mathematics/Numeric/Linear/Cordination.cs @@ -1,38 +1,38 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Cordination" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -namespace StgSharp.Mathematics.Numeric -{ - public enum CoordinatePlain - { - - XY, - YZ, - XZ, - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Cordination" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +namespace StgSharp.Mathematics.Numeric +{ + public enum CoordinatePlain + { + + XY, + YZ, + XZ, + + } +} diff --git a/StgSharp.Common/Mathematics/Linear/IUnmanagedVector.cs b/StgSharp.Mathematics/Numeric/Linear/IUnmanagedVector.cs similarity index 97% rename from StgSharp.Common/Mathematics/Linear/IUnmanagedVector.cs rename to StgSharp.Mathematics/Numeric/Linear/IUnmanagedVector.cs index ddae5eb9..4b2cc294 100644 --- a/StgSharp.Common/Mathematics/Linear/IUnmanagedVector.cs +++ b/StgSharp.Mathematics/Numeric/Linear/IUnmanagedVector.cs @@ -1,46 +1,46 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="IUnmanagedVector" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public interface IUnmanagedVector where TSelf: unmanaged, IUnmanagedVector - { - - public static abstract TSelf Zero { get; } - - public static abstract TSelf One { get; } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="IUnmanagedVector" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public interface IUnmanagedVector where TSelf: unmanaged, IUnmanagedVector + { + + public static abstract TSelf Zero { get; } + + public static abstract TSelf One { get; } + + } +} diff --git a/StgSharp.Common/Mathematics/Linear/Matrix.Create.cs b/StgSharp.Mathematics/Numeric/Linear/Matrix.Create.cs similarity index 97% rename from StgSharp.Common/Mathematics/Linear/Matrix.Create.cs rename to StgSharp.Mathematics/Numeric/Linear/Matrix.Create.cs index 12dd7940..6b7cdd65 100644 --- a/StgSharp.Common/Mathematics/Linear/Matrix.Create.cs +++ b/StgSharp.Mathematics/Numeric/Linear/Matrix.Create.cs @@ -1,101 +1,101 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Matrix.Create" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.HighPerformance.Memory; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public unsafe partial class Matrix - { - - private const int KernelSideLength = 4; - - public static Matrix Create( - int columnLength, - int rowLength, - MatrixLayout layout, - HybridLayerSegregatedFitAllocator allocator) - { - ArgumentNullException.ThrowIfNull(allocator); - - ArgumentOutOfRangeException.ThrowIfNegativeOrZero(columnLength); - - ArgumentOutOfRangeException.ThrowIfNegativeOrZero(rowLength); - - int kernelColumns = DivideRoundUp(columnLength, KernelSideLength); - int kernelRows = DivideRoundUp(rowLength, KernelSideLength); - - if (layout is MatrixLayout.UpperTriangle or MatrixLayout.LowerTriangle) - { - if (kernelColumns != kernelRows) { - throw new ArgumentException("Triangular layouts require square matrices."); - } - } - - long kernelCount = layout switch - { - MatrixLayout.DenseRectangle => (long)kernelColumns * kernelRows, - MatrixLayout.UpperTriangle => TriangularKernelCount(kernelColumns), - MatrixLayout.LowerTriangle => TriangularKernelCount(kernelRows), - _ => throw new ArgumentOutOfRangeException(nameof(layout)) - }; - - long requiredBytes = kernelCount * MatrixKernel.Size; - ArgumentOutOfRangeException.ThrowIfNegativeOrZero(requiredBytes, nameof(requiredBytes)); - - HybridLayerSegregatedFitAllocationHandle handle = allocator.Alloc((uint)requiredBytes); - MatrixStorageHLSF storage = new MatrixStorageHLSF(allocator, handle); - - Matrix matrix = new Matrix(MatrixKernelBoarder.Create(layout), new MatrixSize(columnLength, rowLength, - kernelColumns, - kernelRows), storage); - - return matrix; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int DivideRoundUp(int value, int divisor) - { - return (value + (divisor - 1)) / divisor; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static long TriangularKernelCount(int order) - { - long n = order; - return (n * (n + 1L)) / 2L; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Matrix.Create" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.HighPerformance.Memory; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public unsafe partial class Matrix + { + + private const int KernelSideLength = 4; + + public static Matrix Create( + int columnLength, + int rowLength, + MatrixLayout layout, + HybridLayerSegregatedFitAllocator allocator) + { + ArgumentNullException.ThrowIfNull(allocator); + + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(columnLength); + + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(rowLength); + + int kernelColumns = DivideRoundUp(columnLength, KernelSideLength); + int kernelRows = DivideRoundUp(rowLength, KernelSideLength); + + if (layout is MatrixLayout.UpperTriangle or MatrixLayout.LowerTriangle) + { + if (kernelColumns != kernelRows) { + throw new ArgumentException("Triangular layouts require square matrices."); + } + } + + long kernelCount = layout switch + { + MatrixLayout.DenseRectangle => (long)kernelColumns * kernelRows, + MatrixLayout.UpperTriangle => TriangularKernelCount(kernelColumns), + MatrixLayout.LowerTriangle => TriangularKernelCount(kernelRows), + _ => throw new ArgumentOutOfRangeException(nameof(layout)) + }; + + long requiredBytes = kernelCount * MatrixKernel.Size; + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(requiredBytes, nameof(requiredBytes)); + + HybridLayerSegregatedFitAllocationHandle handle = allocator.Alloc((uint)requiredBytes); + MatrixStorageHLSF storage = new MatrixStorageHLSF(allocator, handle); + + Matrix matrix = new Matrix(MatrixKernelBoarder.Create(layout), new MatrixSize(columnLength, rowLength, + kernelColumns, + kernelRows), storage); + + return matrix; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static int DivideRoundUp(int value, int divisor) + { + return (value + (divisor - 1)) / divisor; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static long TriangularKernelCount(int order) + { + long n = order; + return (n * (n + 1L)) / 2L; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Linear/Matrix.cs b/StgSharp.Mathematics/Numeric/Linear/Matrix.cs similarity index 97% rename from StgSharp.Common/Mathematics/Linear/Matrix.cs rename to StgSharp.Mathematics/Numeric/Linear/Matrix.cs index 93ebba9a..0271b9b8 100644 --- a/StgSharp.Common/Mathematics/Linear/Matrix.cs +++ b/StgSharp.Mathematics/Numeric/Linear/Matrix.cs @@ -1,204 +1,204 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Matrix" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Numeric; -using System; -using System.Numerics; -using System.Runtime.CompilerServices; - -// using hlsfHandle = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle; - -namespace StgSharp.Mathematics.Numeric -{ - public unsafe partial class Matrix where T : unmanaged, INumber - { - - private protected static readonly int t_count = 16 / sizeof(T); - - private protected static readonly int t_size = sizeof(T); - private readonly MatrixKernelBoarder _boarder; - private readonly MatrixSize _size; - private readonly MatrixStorage _buffer; - - private protected Matrix( - MatrixKernelBoarder boarder, - MatrixSize size, - MatrixStorage buffer - - ) - { - _boarder = boarder; - _size = size; - _buffer = buffer; - } - - public T this[ - int x, - int y - ] - { - get - { - if (y < 0 || y > _size.ElementColumnLength || x < 0 || x > _size.ElementRowLength) { - throw new ArgumentOutOfRangeException($"Index [{x},{y}] is out of matrix index range."); - } - long offset = GetElementOffset(x, y); - if (offset < 0) { - return T.Zero; - } - return ((T*)Buffer)[offset]; - } - set - { - if (y < 0 || y > _size.ElementColumnLength || x < 0 || x > _size.ElementRowLength) { - throw new ArgumentOutOfRangeException($"Index [{x},{y}] is out of matrix index range."); - } - long offset = GetElementOffset(x, y); - if (offset < 0) { - return; - } - ((T*)Buffer)[offset] = value; - } - } - - /// - /// Matlab style indexer to generate a new matrix - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public unsafe Matrix this[ - ReadOnlySpan column, - ReadOnlySpan row - ] - { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - /// - /// Length of the matrix in columns. - /// - public int ColumnLength => _size.ElementColumnLength; - - /// - /// Length of the matrix in rows. - /// - public int RowLength => _size.ElementRowLength; - - public MatrixLayout Layout { get; init; } - - internal MatrixKernel* Buffer - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => (MatrixKernel*)_buffer.BufferPointer; - } - - protected internal int KernelColumnLength => _size.KernelColumnLength; - - protected internal int KernelRowLength => _size.KernelRowLength; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe ref MatrixKernel GetMatrixKernel( - int x, - int y - ) - { - return ref _boarder.IsInBuffer(x, y, in _size) ? - ref _buffer[_boarder.GetIndexOffset(x, y, in _size)] : - ref Unsafe.NullRef>(); - } - - internal long GetElementOffset( - int x, - int y - ) - { - int - k_c = y / 4, - c = y % 4, - k_r = x / 4, - r = x % 4; - if (!_boarder.IsInBuffer(k_r, k_c, in _size)) { - return -1; - } - long kernelOffset = _boarder.GetIndexOffset(k_r, k_c, in _size); - - return kernelOffset * 16 + 4 * r + c; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe ref T GetElementUnsafe( - int x, - int y - ) - { - // Caller guarantees: indices in range, layout is dense square. - int k_c = y / 4; - int k_r = x / 4; - int c = y % 4; - int r = x % 4; - - ref MatrixKernel kernel = ref _buffer[_boarder.GetIndexOffset(k_r, k_c, in _size)]; - return ref kernel[c, r]; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe MatrixKernel* GetKernelAddressUnsafe( - int x, - int y - ) - { - return Buffer + _boarder.GetIndexOffset(x, y, in _size); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe ref MatrixKernel GetKernelUnsafe( - int x, - int y - ) - { - // Caller guarantees: indices in range, layout is dense square. - int k_c = y / 4; - int k_r = x / 4; - int c = y % 4; - int r = x % 4; - return ref _buffer[_boarder.GetIndexOffset(k_c, k_r, in _size)]; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Matrix" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.Mathematics.Numeric; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; + +// using hlsfHandle = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle; + +namespace StgSharp.Mathematics.Numeric +{ + public unsafe partial class Matrix where T : unmanaged, INumber + { + + private protected static readonly int t_count = 16 / sizeof(T); + + private protected static readonly int t_size = sizeof(T); + private readonly MatrixKernelBoarder _boarder; + private readonly MatrixSize _size; + private readonly MatrixStorage _buffer; + + private protected Matrix( + MatrixKernelBoarder boarder, + MatrixSize size, + MatrixStorage buffer + + ) + { + _boarder = boarder; + _size = size; + _buffer = buffer; + } + + public T this[ + int x, + int y + ] + { + get + { + if (y < 0 || y > _size.ElementColumnLength || x < 0 || x > _size.ElementRowLength) { + throw new ArgumentOutOfRangeException($"Index [{x},{y}] is out of matrix index range."); + } + long offset = GetElementOffset(x, y); + if (offset < 0) { + return T.Zero; + } + return ((T*)Buffer)[offset]; + } + set + { + if (y < 0 || y > _size.ElementColumnLength || x < 0 || x > _size.ElementRowLength) { + throw new ArgumentOutOfRangeException($"Index [{x},{y}] is out of matrix index range."); + } + long offset = GetElementOffset(x, y); + if (offset < 0) { + return; + } + ((T*)Buffer)[offset] = value; + } + } + + /// + /// Matlab style indexer to generate a new matrix + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public unsafe Matrix this[ + ReadOnlySpan column, + ReadOnlySpan row + ] + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + /// + /// Length of the matrix in columns. + /// + public int ColumnLength => _size.ElementColumnLength; + + /// + /// Length of the matrix in rows. + /// + public int RowLength => _size.ElementRowLength; + + public MatrixLayout Layout { get; init; } + + internal MatrixKernel* Buffer + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => (MatrixKernel*)_buffer.BufferPointer; + } + + protected internal int KernelColumnLength => _size.KernelColumnLength; + + protected internal int KernelRowLength => _size.KernelRowLength; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe ref MatrixKernel GetMatrixKernel( + int x, + int y + ) + { + return ref _boarder.IsInBuffer(x, y, in _size) ? + ref _buffer[_boarder.GetIndexOffset(x, y, in _size)] : + ref Unsafe.NullRef>(); + } + + internal long GetElementOffset( + int x, + int y + ) + { + int + k_c = y / 4, + c = y % 4, + k_r = x / 4, + r = x % 4; + if (!_boarder.IsInBuffer(k_r, k_c, in _size)) { + return -1; + } + long kernelOffset = _boarder.GetIndexOffset(k_r, k_c, in _size); + + return kernelOffset * 16 + 4 * r + c; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe ref T GetElementUnsafe( + int x, + int y + ) + { + // Caller guarantees: indices in range, layout is dense square. + int k_c = y / 4; + int k_r = x / 4; + int c = y % 4; + int r = x % 4; + + ref MatrixKernel kernel = ref _buffer[_boarder.GetIndexOffset(k_r, k_c, in _size)]; + return ref kernel[c, r]; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe MatrixKernel* GetKernelAddressUnsafe( + int x, + int y + ) + { + return Buffer + _boarder.GetIndexOffset(x, y, in _size); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe ref MatrixKernel GetKernelUnsafe( + int x, + int y + ) + { + // Caller guarantees: indices in range, layout is dense square. + int k_c = y / 4; + int k_r = x / 4; + int c = y % 4; + int r = x % 4; + return ref _buffer[_boarder.GetIndexOffset(k_c, k_r, in _size)]; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Linear/MatrixIndex.cs b/StgSharp.Mathematics/Numeric/Linear/MatrixIndex.cs similarity index 97% rename from StgSharp.Common/Mathematics/Linear/MatrixIndex.cs rename to StgSharp.Mathematics/Numeric/Linear/MatrixIndex.cs index 8d62e8e9..6275eb0f 100644 --- a/StgSharp.Common/Mathematics/Linear/MatrixIndex.cs +++ b/StgSharp.Mathematics/Numeric/Linear/MatrixIndex.cs @@ -1,70 +1,70 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixIndex" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Numeric -{ - [StructLayout(LayoutKind.Sequential)] - public readonly struct MatrixIndex - { - - public readonly int Begin; - public readonly int End; - - private MatrixIndex(int begin, int end, bool safe = false) - { - Begin = begin; - End = end; - } - - internal MatrixIndex(int begin, int end) - { - if (begin > end) { - throw new ArgumentException("Begin index cannot be greater than end index."); - } - - Begin = begin; - End = end; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator MatrixIndex((int, int) range) - { - return new(range.Item1, range.Item2, false); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator MatrixIndex(int index) - { - return new(index, -1, false); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixIndex" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Numeric +{ + [StructLayout(LayoutKind.Sequential)] + public readonly struct MatrixIndex + { + + public readonly int Begin; + public readonly int End; + + private MatrixIndex(int begin, int end, bool safe = false) + { + Begin = begin; + End = end; + } + + internal MatrixIndex(int begin, int end) + { + if (begin > end) { + throw new ArgumentException("Begin index cannot be greater than end index."); + } + + Begin = begin; + End = end; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator MatrixIndex((int, int) range) + { + return new(range.Item1, range.Item2, false); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator MatrixIndex(int index) + { + return new(index, -1, false); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Linear/MatrixMetadata.cs b/StgSharp.Mathematics/Numeric/Linear/MatrixMetadata.cs similarity index 97% rename from StgSharp.Common/Mathematics/Linear/MatrixMetadata.cs rename to StgSharp.Mathematics/Numeric/Linear/MatrixMetadata.cs index 4180feb7..bcc27cf9 100644 --- a/StgSharp.Common/Mathematics/Linear/MatrixMetadata.cs +++ b/StgSharp.Mathematics/Numeric/Linear/MatrixMetadata.cs @@ -1,252 +1,252 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixMetadata" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Numeric -{ - public enum MatrixLayout - { - - DenseRectangle, - UpperTriangle, - LowerTriangle, - - } - - public abstract class MatrixKernelBoarder - { - - private static readonly MatrixKernelBoarder DenseSquareInstance = new DenseSquareKernelBoarder(); - private static readonly MatrixKernelBoarder LowerTriangleInstance = new LowerTriangleKernelBoarder(); - private static readonly MatrixKernelBoarder UpperTriangleInstance = new UpperTriangleKernelBoarder(); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MatrixKernelBoarder Create( - MatrixLayout layout - ) - { - return layout switch - { - MatrixLayout.DenseRectangle => DenseSquareInstance, - MatrixLayout.UpperTriangle => UpperTriangleInstance, - MatrixLayout.LowerTriangle => LowerTriangleInstance, - _ => throw new ArgumentOutOfRangeException(nameof(layout)), - }; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public abstract long GetIndexOffset( - int xKernel, - int yKernel, - in MatrixSize size - ); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public abstract bool IsInBuffer( - int xKernel, - int yKernel, - in MatrixSize enumerator - ); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected static long GetTriangularOrder( - in MatrixSize enumerator - ) - { - return Math.Min(enumerator.KernelColumnLength, enumerator.KernelRowLength); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected static bool IsWithinKernelDomain( - in MatrixSize enumerator, - int xKernel, - int yKernel - ) - { - return xKernel >= 0 && - yKernel >= 0 && - xKernel < enumerator.KernelColumnLength && - yKernel < enumerator.KernelRowLength; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected static bool IsWithinTriangularDomain( - in MatrixSize enumerator, - int xKernel, - int yKernel - ) - { - long order = GetTriangularOrder(enumerator); - return xKernel >= 0 && yKernel >= 0 && xKernel < order && yKernel < order; - } - - private sealed class DenseSquareKernelBoarder : MatrixKernelBoarder - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override long GetIndexOffset( - int xKernel, - int yKernel, - in MatrixSize enumerator - ) - { - long x = xKernel; - long y = yKernel; - long col = enumerator.KernelColumnLength; - - // Console.Write($"Attempt to get offset at ({x},{y}), offset is {x * col + y} "); - return x * col + y; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool IsInBuffer( - int xKernel, - int yKernel, - in MatrixSize enumerator - ) - { - return IsWithinKernelDomain(enumerator, xKernel, yKernel); - } - - } - - private sealed class LowerTriangleKernelBoarder : MatrixKernelBoarder - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override long GetIndexOffset( - int xKernel, - int yKernel, - in MatrixSize enumerator - ) - { - long order = GetTriangularOrder(enumerator); - long x = xKernel; - long y = yKernel; - - long prefixColumns = x * order - (x * (x - 1L)) / 2L; - return prefixColumns + (y - x); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool IsInBuffer( - int xKernel, - int yKernel, - in MatrixSize enumerator - ) - { - return IsWithinTriangularDomain(enumerator, xKernel, yKernel) && yKernel >= xKernel; - } - - } - - private sealed unsafe class UpperTriangleKernelBoarder : MatrixKernelBoarder - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override long GetIndexOffset( - int xKernel, - int yKernel, - in MatrixSize enumerator - ) - { - long x = xKernel; - long y = yKernel; - - long prefixColumns = (x * (x + 1L)) / 2L; - return prefixColumns + y; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool IsInBuffer( - int xKernel, - int yKernel, - in MatrixSize enumerator - ) - { - return IsWithinTriangularDomain(enumerator, xKernel, yKernel) && yKernel <= xKernel; - } - - } - - } - - [StructLayout(LayoutKind.Explicit)] - public struct MatrixSize - { - - [FieldOffset(0)] public readonly int ElementColumnLength; - [FieldOffset(4)] public readonly int ElementRowLength; - - [FieldOffset(8)] public readonly int KernelColumnLength; - [FieldOffset(12)] public readonly int KernelRowLength; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public MatrixSize( - int elementColumnLength, - int elementRowLength, - int kernelColumnLength, - int kernelRowLength - ) - { - ElementColumnLength = elementColumnLength; - ElementRowLength = elementRowLength; - KernelColumnLength = kernelColumnLength; - KernelRowLength = kernelRowLength; - } - - } - - [StructLayout(LayoutKind.Explicit)] - public struct MatrixKernelEnumerator - { - - [FieldOffset(0)] public int CurrentColumn; - [FieldOffset(4)] public int CurrentRow; - - [FieldOffset(8)] public readonly int KernelColumnLength; - [FieldOffset(12)] public readonly int KernelRowLength; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public MatrixKernelEnumerator( - int kernelColumnLength, - int kernelRowLength, - int currentColumn = 0, - int currentRow = 0 - ) - { - CurrentColumn = currentColumn; - CurrentRow = currentRow; - KernelColumnLength = kernelColumnLength; - KernelRowLength = kernelRowLength; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixMetadata" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Numeric +{ + public enum MatrixLayout + { + + DenseRectangle, + UpperTriangle, + LowerTriangle, + + } + + public abstract class MatrixKernelBoarder + { + + private static readonly MatrixKernelBoarder DenseSquareInstance = new DenseSquareKernelBoarder(); + private static readonly MatrixKernelBoarder LowerTriangleInstance = new LowerTriangleKernelBoarder(); + private static readonly MatrixKernelBoarder UpperTriangleInstance = new UpperTriangleKernelBoarder(); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static MatrixKernelBoarder Create( + MatrixLayout layout + ) + { + return layout switch + { + MatrixLayout.DenseRectangle => DenseSquareInstance, + MatrixLayout.UpperTriangle => UpperTriangleInstance, + MatrixLayout.LowerTriangle => LowerTriangleInstance, + _ => throw new ArgumentOutOfRangeException(nameof(layout)), + }; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public abstract long GetIndexOffset( + int xKernel, + int yKernel, + in MatrixSize size + ); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public abstract bool IsInBuffer( + int xKernel, + int yKernel, + in MatrixSize enumerator + ); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected static long GetTriangularOrder( + in MatrixSize enumerator + ) + { + return Math.Min(enumerator.KernelColumnLength, enumerator.KernelRowLength); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected static bool IsWithinKernelDomain( + in MatrixSize enumerator, + int xKernel, + int yKernel + ) + { + return xKernel >= 0 && + yKernel >= 0 && + xKernel < enumerator.KernelColumnLength && + yKernel < enumerator.KernelRowLength; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected static bool IsWithinTriangularDomain( + in MatrixSize enumerator, + int xKernel, + int yKernel + ) + { + long order = GetTriangularOrder(enumerator); + return xKernel >= 0 && yKernel >= 0 && xKernel < order && yKernel < order; + } + + private sealed class DenseSquareKernelBoarder : MatrixKernelBoarder + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override long GetIndexOffset( + int xKernel, + int yKernel, + in MatrixSize enumerator + ) + { + long x = xKernel; + long y = yKernel; + long col = enumerator.KernelColumnLength; + + // Console.Write($"Attempt to get offset at ({x},{y}), offset is {x * col + y} "); + return x * col + y; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool IsInBuffer( + int xKernel, + int yKernel, + in MatrixSize enumerator + ) + { + return IsWithinKernelDomain(enumerator, xKernel, yKernel); + } + + } + + private sealed class LowerTriangleKernelBoarder : MatrixKernelBoarder + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override long GetIndexOffset( + int xKernel, + int yKernel, + in MatrixSize enumerator + ) + { + long order = GetTriangularOrder(enumerator); + long x = xKernel; + long y = yKernel; + + long prefixColumns = x * order - (x * (x - 1L)) / 2L; + return prefixColumns + (y - x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool IsInBuffer( + int xKernel, + int yKernel, + in MatrixSize enumerator + ) + { + return IsWithinTriangularDomain(enumerator, xKernel, yKernel) && yKernel >= xKernel; + } + + } + + private sealed unsafe class UpperTriangleKernelBoarder : MatrixKernelBoarder + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override long GetIndexOffset( + int xKernel, + int yKernel, + in MatrixSize enumerator + ) + { + long x = xKernel; + long y = yKernel; + + long prefixColumns = (x * (x + 1L)) / 2L; + return prefixColumns + y; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool IsInBuffer( + int xKernel, + int yKernel, + in MatrixSize enumerator + ) + { + return IsWithinTriangularDomain(enumerator, xKernel, yKernel) && yKernel <= xKernel; + } + + } + + } + + [StructLayout(LayoutKind.Explicit)] + public struct MatrixSize + { + + [FieldOffset(0)] public readonly int ElementColumnLength; + [FieldOffset(4)] public readonly int ElementRowLength; + + [FieldOffset(8)] public readonly int KernelColumnLength; + [FieldOffset(12)] public readonly int KernelRowLength; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public MatrixSize( + int elementColumnLength, + int elementRowLength, + int kernelColumnLength, + int kernelRowLength + ) + { + ElementColumnLength = elementColumnLength; + ElementRowLength = elementRowLength; + KernelColumnLength = kernelColumnLength; + KernelRowLength = kernelRowLength; + } + + } + + [StructLayout(LayoutKind.Explicit)] + public struct MatrixKernelEnumerator + { + + [FieldOffset(0)] public int CurrentColumn; + [FieldOffset(4)] public int CurrentRow; + + [FieldOffset(8)] public readonly int KernelColumnLength; + [FieldOffset(12)] public readonly int KernelRowLength; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public MatrixKernelEnumerator( + int kernelColumnLength, + int kernelRowLength, + int currentColumn = 0, + int currentRow = 0 + ) + { + CurrentColumn = currentColumn; + CurrentRow = currentRow; + KernelColumnLength = kernelColumnLength; + KernelRowLength = kernelRowLength; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Linear/MatrixStorage.cs b/StgSharp.Mathematics/Numeric/Linear/MatrixStorage.cs similarity index 97% rename from StgSharp.Common/Mathematics/Linear/MatrixStorage.cs rename to StgSharp.Mathematics/Numeric/Linear/MatrixStorage.cs index ee494d62..6df883fd 100644 --- a/StgSharp.Common/Mathematics/Linear/MatrixStorage.cs +++ b/StgSharp.Mathematics/Numeric/Linear/MatrixStorage.cs @@ -1,72 +1,72 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixStorage" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.HighPerformance.Memory; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -using HLSFAllocator = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator; -using HLSFHandle = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle; - -namespace StgSharp.Mathematics.Numeric -{ - public abstract class MatrixStorage : IDisposable where T : unmanaged, INumber - { - - internal unsafe ref MatrixKernel this[long index] - { - get { return ref Unsafe.AsRef>(BufferPointer + MatrixKernel.Size * index); } - } - - protected internal abstract unsafe T* BufferPointer { get; } - - public abstract void Dispose(); - - } - - internal class MatrixStorageHLSF(HLSFAllocator allocator, HLSFHandle handle) : MatrixStorage - where T : unmanaged, INumber - { - - internal HLSFAllocator _allocator = allocator; - internal HLSFHandle _handle = handle; - - protected internal override unsafe T* BufferPointer => (T*)_handle.Pointer; - - public override void Dispose() - { - allocator.Free(_handle); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixStorage" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.HighPerformance.Memory; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +using HLSFAllocator = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator; +using HLSFHandle = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle; + +namespace StgSharp.Mathematics.Numeric +{ + public abstract class MatrixStorage : IDisposable where T : unmanaged, INumber + { + + internal unsafe ref MatrixKernel this[long index] + { + get { return ref Unsafe.AsRef>(BufferPointer + MatrixKernel.Size * index); } + } + + protected internal abstract unsafe T* BufferPointer { get; } + + public abstract void Dispose(); + + } + + internal class MatrixStorageHLSF(HLSFAllocator allocator, HLSFHandle handle) : MatrixStorage + where T : unmanaged, INumber + { + + internal HLSFAllocator _allocator = allocator; + internal HLSFHandle _handle = handle; + + protected internal override unsafe T* BufferPointer => (T*)_handle.Pointer; + + public override void Dispose() + { + allocator.Free(_handle); + } + + } +} diff --git a/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs b/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs index 9e676bea..483b9b59 100644 --- a/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs +++ b/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs @@ -76,7 +76,7 @@ namespace StgSharp.Mathematics.Numeric MatrixParallel.ReturnParallelResources(ref pool); return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Left = (nint)left.Buffer; package->Right = (nint)right.Buffer; package->Answer = (nint)ans.Buffer; @@ -112,7 +112,7 @@ namespace StgSharp.Mathematics.Numeric MatrixParallel.ReturnParallelResources(ref pool); return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Answer = (nint)ans.Buffer; package->ElementSize = sizeof(float); package->PrimCount = ans.KernelColumnLength; @@ -178,7 +178,7 @@ namespace StgSharp.Mathematics.Numeric } return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Left = (nint)left.Buffer; package->Right = (nint)right.Buffer; package->Answer = (nint)ans.Buffer; @@ -231,7 +231,7 @@ namespace StgSharp.Mathematics.Numeric MatrixParallel.ReturnParallelResources(ref pool); return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Right = (nint)left.Buffer; package->Answer = (nint)ans.Buffer; package->ElementSize = sizeof(float); @@ -287,7 +287,7 @@ namespace StgSharp.Mathematics.Numeric MatrixParallel.ReturnParallelResources(ref pool); return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Left = (nint)left.Buffer; package->Right = (nint)right.Buffer; package->Answer = (nint)ans.Buffer; diff --git a/StgSharp.Mathematics/Numeric/MatrixCompute.double.cs b/StgSharp.Mathematics/Numeric/MatrixCompute.double.cs index 7e6ce90f..3a6be6dc 100644 --- a/StgSharp.Mathematics/Numeric/MatrixCompute.double.cs +++ b/StgSharp.Mathematics/Numeric/MatrixCompute.double.cs @@ -72,7 +72,7 @@ namespace StgSharp.Mathematics.Numeric MatrixParallel.ReturnParallelResources(ref pool); return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Left = (nint)left.Buffer; package->Right = (nint)right.Buffer; package->Answer = (nint)ans.Buffer; @@ -108,7 +108,7 @@ namespace StgSharp.Mathematics.Numeric MatrixParallel.ReturnParallelResources(ref pool); return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Answer = (nint)ans.Buffer; package->ElementSize = sizeof(double); package->PrimCount = ans.KernelColumnLength; @@ -167,7 +167,7 @@ namespace StgSharp.Mathematics.Numeric } return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Left = (nint)left.Buffer; package->Right = (nint)right.Buffer; package->Answer = (nint)ans.Buffer; @@ -220,7 +220,7 @@ namespace StgSharp.Mathematics.Numeric MatrixParallel.ReturnParallelResources(ref pool); return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Right = (nint)left.Buffer; package->Answer = (nint)ans.Buffer; package->ElementSize = sizeof(double); @@ -276,7 +276,7 @@ namespace StgSharp.Mathematics.Numeric MatrixParallel.ReturnParallelResources(ref pool); return; } - MatrixParallelTaskPackage* package = MatrixParallelFactory.CreateBaseTask(); + MatrixParallelTask* package = MatrixParallelFactory.CreateBaseTask(); package->Left = (nint)left.Buffer; package->Right = (nint)right.Buffer; package->Answer = (nint)ans.Buffer; diff --git a/StgSharp.Mathematics/Numeric/MatrixParallelTaskPackage.cs b/StgSharp.Mathematics/Numeric/MatrixParallelTaskPackage.cs deleted file mode 100644 index dcfa05f9..00000000 --- a/StgSharp.Mathematics/Numeric/MatrixParallelTaskPackage.cs +++ /dev/null @@ -1,147 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallelTaskPackage" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Numeric -{ - /* - * #define PANEL_OP 1 - * #define BUFFER_OP 2 - * #define KERNEL_OP 3 - * - * #define RIGHT_ANS_PARAM 1 - * #define LEFT_RIGHT_ANS_PARAM 2 - * #define RIGHT_ANS_SCALAR_PARAM 3 - * #define LEFT_RIGHT_ANS_SCALAR_PARAM 4 - * #define ANS_SCALAR_PARAM 5 - * - * typedef struct matrix_op_mode { - * int16_t operation_style; // PANEL_OP, BUFFER_OP, KERNEL_OP - * int16_t parameter_style; // RIGHT_ANS_PARAM, LEFT_RIGHT_ANS_PARAM, e.g. - * } - * matrix_op_mode; - */ - - public enum MatrixIndexStyle : int - { - - NONE = 0, - BUFFER_INDEX = 1, - SEQ_FMA = -1, - - } - - [StructLayout(LayoutKind.Explicit, Size = 128)] - public unsafe struct MatrixParallelTaskPackage - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe void Copy( - MatrixParallelTaskPackage* source, - MatrixParallelTaskPackage* target - ) - { - Buffer.MemoryCopy(source, target, sizeof(MatrixParallelTaskPackage), - sizeof(MatrixParallelTaskPackage)); - } - - #region source - - // Group 1: Left/Right matrix kernel base address - [FieldOffset(0)] public IntPtr Left; // 8 - [FieldOffset(8)] public IntPtr Right; // 8 - - #endregion - - #region ans - - // Group 2: Result kernel base address + reserved - [FieldOffset(16)] public IntPtr Answer; // 8 - [FieldOffset(24)] public int ElementSize; - [FieldOffset(28)] public int ReservedPtr0; // 4 (extension/reserved) - - #endregion - - #region left enum - - [FieldOffset(32)]public int LeftPrimOffset; // 4 - [FieldOffset(36)]public int LeftPrimStride; // 4 - [FieldOffset(40)]public int LeftSecOffset; // 4 - [FieldOffset(44)]public int LeftSecStride; // 4 - - #endregion - - #region right enum - - [FieldOffset(48)]public int RightPrimOffset; // 4 - [FieldOffset(52)]public int RightPrimStride; // 4 - [FieldOffset(56)]public int RightSecOffset; // 4 - [FieldOffset(60)]public int RightSecStride; // 4 - - #endregion - - #region ans enum - - [FieldOffset(64)]public int AnsPrimOffset; // 4 - [FieldOffset(68)]public int AnsPrimStride; // 4 - [FieldOffset(72)]public int AnsSecOffset; // 4 - [FieldOffset(76)] public int AnsSecStride; // 4 - - #endregion - - #region scalar/compute - - [FieldOffset(80)]public ScalarPacket* Scalar; // 8 - [FieldOffset(88)]public IntPtr ComputeHandle; // 8 - - #endregion - - #region global profile - - [FieldOffset(96)]public int PrimCount; // 4 - [FieldOffset(100)]public int SecCount; // 4 - [FieldOffset(104)]public MatrixIndexStyle ComputeMode; // 4 - [FieldOffset(108)]private int ReservedInt0; // 4 - - #endregion - - #region count offset - - [FieldOffset(112)]public int PrimTileOffset; // 4 - [FieldOffset(116)]public int SecTileOffset; // 4 - [FieldOffset(120)] public int PrimColumnCountInTile; // 4 - [FieldOffset(124)] public int SecColumnCountInTile; // 4 - - #endregion - } -} \ No newline at end of file diff --git a/StgSharp.Mathematics/Numeric/MatrixParallel.Await.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Await.cs similarity index 97% rename from StgSharp.Mathematics/Numeric/MatrixParallel.Await.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Await.cs index f5694321..0f8ed03f 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallel.Await.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Await.cs @@ -1,146 +1,146 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallel.Await" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public static partial class MatrixParallel - { - - private static AwaitingQueue _awaitingLeaderHandle; - - private static volatile int _createGeneration = 0; - private static int _sortState; - - public static MatrixParallelThread[] LeadParallel(int recommendCount) - { - int min = int.Min(recommendCount, _threads.Capacity); - min /= 2; - MatrixParallelThread[] ret; - if (_threads.Count < min) - { - WaitHandle handle = new WaitHandle - ( - _createGeneration, - min, - recommendCount - ); - do - { - if (Interlocked.Exchange(ref _sortState, 1) == 0) - { - _awaitingLeaderHandle.Enqueue(handle); - _ = Interlocked.Exchange(ref _sortState, 0); - Interlocked.Increment(ref _createGeneration); - break; - } - } while (true); - int cycleGeneration = _createGeneration; - do - { - Thread.Sleep(0); - - if (_createGeneration != cycleGeneration) - { - if (Interlocked.Exchange(ref _sortState, 1) == 0) - { - if (_awaitingLeaderHandle.TryPopIfRefEqual(cycleGeneration, in handle)) - { - // Sort is implemented in TryPopIfRefEqual - ret = _threads.PopRange(handle.BestCount); - _createGeneration++; - _ = Interlocked.Exchange(ref _sortState, 0); - return ret; - } - _ = Interlocked.Exchange(ref _sortState, 0); - } else - { - cycleGeneration = _createGeneration; - } - } - } while (true); - } else - { - // directly get the leader - while (true) - { - if (Interlocked.Exchange(ref _sortState, 1) == 0) - { - ret = _threads.PopRange(recommendCount); - _createGeneration++; - _ = Interlocked.Exchange(ref _sortState, 0); - return ret; - } - } - } - - // return ret; - } - - public static void ReturnParallelResources(ref MatrixParallelThread[] pool) - { - while (true) - { - if (Interlocked.Exchange(ref _sortState, 1) == 0) - { - _threads.PushRange(pool); - Interlocked.Exchange(ref _sortState, 0); - break; - } - } - - pool = null!; - } - - private record class WaitHandle(int generation, int least, int best) - { - - public int CreateGeneration { get; init; } = generation; - - public int LeastCount { get; init; } = least; - - public int BestCount { get; init; } = best; - - public int Priority { get; private set; } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UpdatePriority(int currentGeneration) - { - Priority = (currentGeneration - CreateGeneration) * (MatrixParallel._threads.Capacity - LeastCount); - } - - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallel.Await" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public static partial class MatrixParallel + { + + private static AwaitingQueue _awaitingLeaderHandle; + + private static volatile int _createGeneration = 0; + private static int _sortState; + + public static MatrixParallelThread[] LeadParallel(int recommendCount) + { + int min = int.Min(recommendCount, _threads.Capacity); + min /= 2; + MatrixParallelThread[] ret; + if (_threads.Count < min) + { + WaitHandle handle = new WaitHandle + ( + _createGeneration, + min, + recommendCount + ); + do + { + if (Interlocked.Exchange(ref _sortState, 1) == 0) + { + _awaitingLeaderHandle.Enqueue(handle); + _ = Interlocked.Exchange(ref _sortState, 0); + Interlocked.Increment(ref _createGeneration); + break; + } + } while (true); + int cycleGeneration = _createGeneration; + do + { + Thread.Sleep(0); + + if (_createGeneration != cycleGeneration) + { + if (Interlocked.Exchange(ref _sortState, 1) == 0) + { + if (_awaitingLeaderHandle.TryPopIfRefEqual(cycleGeneration, in handle)) + { + // Sort is implemented in TryPopIfRefEqual + ret = _threads.PopRange(handle.BestCount); + _createGeneration++; + _ = Interlocked.Exchange(ref _sortState, 0); + return ret; + } + _ = Interlocked.Exchange(ref _sortState, 0); + } else + { + cycleGeneration = _createGeneration; + } + } + } while (true); + } else + { + // directly get the leader + while (true) + { + if (Interlocked.Exchange(ref _sortState, 1) == 0) + { + ret = _threads.PopRange(recommendCount); + _createGeneration++; + _ = Interlocked.Exchange(ref _sortState, 0); + return ret; + } + } + } + + // return ret; + } + + public static void ReturnParallelResources(ref MatrixParallelThread[] pool) + { + while (true) + { + if (Interlocked.Exchange(ref _sortState, 1) == 0) + { + _threads.PushRange(pool); + Interlocked.Exchange(ref _sortState, 0); + break; + } + } + + pool = null!; + } + + private record class WaitHandle(int generation, int least, int best) + { + + public int CreateGeneration { get; init; } = generation; + + public int LeastCount { get; init; } = least; + + public int BestCount { get; init; } = best; + + public int Priority { get; private set; } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UpdatePriority(int currentGeneration) + { + Priority = (currentGeneration - CreateGeneration) * (MatrixParallel._threads.Capacity - LeastCount); + } + + } + + } +} diff --git a/StgSharp.Mathematics/Numeric/MatrixParallel.AwaitingQueue.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.AwaitingQueue.cs similarity index 97% rename from StgSharp.Mathematics/Numeric/MatrixParallel.AwaitingQueue.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.AwaitingQueue.cs index d8044d2d..3988ea09 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallel.AwaitingQueue.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.AwaitingQueue.cs @@ -1,156 +1,156 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallel.AwaitingQueue" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public static partial class MatrixParallel - { - /* - * Because caller of this class has its own sync object - * this queue will use no sync object internally. - */ - - private class AwaitingQueue - { - - private Element _quickElements = new(); - private volatile int _count; - private readonly Queue _fallback = []; - - public AwaitingQueue() { } - - public void Enqueue(WaitHandle handle) - { - if (_count > 7) - { - _fallback.Enqueue(handle); - Interlocked.Increment(ref _count); - return; - } - _quickElements[_count] = handle; - Interlocked.Increment(ref _count); - } - - public bool TryDequeue(int generation, out WaitHandle handle) - { - if (_count == 0) - { - handle = null!; - return false; - } - for (int i = 0; i < _count; i++) { - _quickElements[i].UpdatePriority(generation); - } - Element.Sort(ref _quickElements); - handle = _quickElements[0]; - _count--; - _quickElements[0] = default!; - if (_count > 7) { - _ = _fallback.TryDequeue(out _quickElements[0]!); - } - return true; - } - - public bool TryPeek(int generation, out WaitHandle handle) - { - if (_count == 0) - { - handle = null!; - return false; - } - for (int i = 0; i < _count; i++) { - _quickElements[i].UpdatePriority(generation); - } - - Element.Sort(ref _quickElements); - handle = _quickElements[0]; - return true; - } - - public bool TryPopIfRefEqual(int generation, in WaitHandle handle) - { - if (_count == 0) { - return false; - } - for (int i = 0; i < _count; i++) { - _quickElements[i].UpdatePriority(generation); - } - Element.Sort(ref _quickElements); - if (!ReferenceEquals(_quickElements[0], handle)) { - return false; - } - _count--; - _quickElements[0] = null!; - if (_count > 7) { - _ = _fallback.TryDequeue(out _quickElements[0]!); - } - return true; - } - - } - - [InlineArray(8)] - private struct Element - { - - private WaitHandle value; - - public static void Sort(ref Element e) - { - int maxIdx = 0; - WaitHandle first = e[0]; - int maxPr = first?.Priority ?? int.MinValue; - - for (int i = 1; i < 8; i++) - { - WaitHandle cur = e[i]; - int p = cur?.Priority ?? int.MinValue; - if (p > maxPr) - { - maxPr = p; - maxIdx = i; - } - } - - if (maxIdx != 0) { - (e[0], e[maxIdx]) = (e[maxIdx], e[0]); - } - } - - } - - } -} - +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallel.AwaitingQueue" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public static partial class MatrixParallel + { + /* + * Because caller of this class has its own sync object + * this queue will use no sync object internally. + */ + + private class AwaitingQueue + { + + private Element _quickElements = new(); + private volatile int _count; + private readonly Queue _fallback = []; + + public AwaitingQueue() { } + + public void Enqueue(WaitHandle handle) + { + if (_count > 7) + { + _fallback.Enqueue(handle); + Interlocked.Increment(ref _count); + return; + } + _quickElements[_count] = handle; + Interlocked.Increment(ref _count); + } + + public bool TryDequeue(int generation, out WaitHandle handle) + { + if (_count == 0) + { + handle = null!; + return false; + } + for (int i = 0; i < _count; i++) { + _quickElements[i].UpdatePriority(generation); + } + Element.Sort(ref _quickElements); + handle = _quickElements[0]; + _count--; + _quickElements[0] = default!; + if (_count > 7) { + _ = _fallback.TryDequeue(out _quickElements[0]!); + } + return true; + } + + public bool TryPeek(int generation, out WaitHandle handle) + { + if (_count == 0) + { + handle = null!; + return false; + } + for (int i = 0; i < _count; i++) { + _quickElements[i].UpdatePriority(generation); + } + + Element.Sort(ref _quickElements); + handle = _quickElements[0]; + return true; + } + + public bool TryPopIfRefEqual(int generation, in WaitHandle handle) + { + if (_count == 0) { + return false; + } + for (int i = 0; i < _count; i++) { + _quickElements[i].UpdatePriority(generation); + } + Element.Sort(ref _quickElements); + if (!ReferenceEquals(_quickElements[0], handle)) { + return false; + } + _count--; + _quickElements[0] = null!; + if (_count > 7) { + _ = _fallback.TryDequeue(out _quickElements[0]!); + } + return true; + } + + } + + [InlineArray(8)] + private struct Element + { + + private WaitHandle value; + + public static void Sort(ref Element e) + { + int maxIdx = 0; + WaitHandle first = e[0]; + int maxPr = first?.Priority ?? int.MinValue; + + for (int i = 1; i < 8; i++) + { + WaitHandle cur = e[i]; + int p = cur?.Priority ?? int.MinValue; + if (p > maxPr) + { + maxPr = p; + maxIdx = i; + } + } + + if (maxIdx != 0) { + (e[0], e[maxIdx]) = (e[maxIdx], e[0]); + } + } + + } + + } +} + diff --git a/StgSharp.Mathematics/Numeric/MatrixParallel.Publish.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Publish.cs similarity index 96% rename from StgSharp.Mathematics/Numeric/MatrixParallel.Publish.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Publish.cs index bd345fb1..d7fbb556 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallel.Publish.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Publish.cs @@ -1,80 +1,80 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallel.Publish" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Collections; -using StgSharp.HighPerformance; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public static partial class MatrixParallel - { - - private const int MIN_TASK_PER_THREAD = 256; - private const int REC_TASK_PER_THREAD = 1024; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - - internal static unsafe MatrixParallelWrap ScheduleTask( - MatrixParallelTaskPackage* package - ) - { - switch (package->ComputeMode.OperationStyle) - { - case MatrixIndexStyle.BUFFER_INDEX: - return ScheduleBufferTask(package); - default: - throw new InvalidOperationException($"Unknown mode {package->ComputeMode.OperationStyle}."); - } - } - - private static unsafe MatrixParallelWrap ScheduleBufferTask( - MatrixParallelTaskPackage* package - ) - { - int primCount = package->PrimCount; - int secCount = package->SecCount; - long count = (long)primCount * secCount; - - // Console.WriteLine($"amount of kernels is {count}"); - - long recommendCount = count / 1024; - MatrixParallelThread[] pool = LeadParallel((int)recommendCount); - MatrixParallelWrap wrap = new MatrixParallelWrap(pool); - wrap.TaskQueue = MatrixParallelQueue.Rent(package); - return wrap; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallel.Publish" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Collections; +using StgSharp.HighPerformance; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public static partial class MatrixParallel + { + + private const int MIN_TASK_PER_THREAD = 256; + private const int REC_TASK_PER_THREAD = 1024; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + + internal static unsafe MatrixParallelWrap ScheduleTask( + MatrixParallelTask* package + ) + { + switch (package->ComputeMode.OperationStyle) + { + case MatrixIndexStyle.BUFFER_INDEX: + return ScheduleBufferTask(package); + default: + throw new InvalidOperationException($"Unknown mode {package->ComputeMode.OperationStyle}."); + } + } + + private static unsafe MatrixParallelWrap ScheduleBufferTask( + MatrixParallelTask* package + ) + { + int primCount = package->PrimCount; + int secCount = package->SecCount; + long count = (long)primCount * secCount; + + // Console.WriteLine($"amount of kernels is {count}"); + + long recommendCount = count / 1024; + MatrixParallelThread[] pool = LeadParallel((int)recommendCount); + MatrixParallelWrap wrap = new MatrixParallelWrap(pool); + wrap.TaskQueue = MatrixParallelQueue.Rent(package); + return wrap; + } + + } +} diff --git a/StgSharp.Mathematics/Numeric/MatrixParallel.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.cs similarity index 96% rename from StgSharp.Mathematics/Numeric/MatrixParallel.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.cs index b34009eb..742e3a4d 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallel.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.cs @@ -1,132 +1,132 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallel" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Collections; -using StgSharp.HighPerformance.Memory; -using StgSharp.Internal; -using StgSharp.Internal.Intrinsic; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public static partial class MatrixParallel - { - - private static bool _meaningful; - - private static CapacityFixedStack _threads; - - private static ConcurrentDictionary contextMap; - - private static SlabAllocator contextAllocator; - - public static bool IsParallelSupported { get; } = Environment.ProcessorCount > 6; - - public static bool IsParallelMeaningful => Environment.ProcessorCount > 6 && IsInitialized; - - private static bool IsInitialized { get; set; } = false; - - internal static unsafe IntrinsicContext* GetContext( - SIMDID simd - ) - { - if (!IsParallelSupported) { - return null; - } - if (contextMap.TryGetValue(simd, out nint handle)) - { - return (IntrinsicContext*)handle; - } else - { - IntrinsicContext* context = (IntrinsicContext*)contextAllocator.Allocate(); - - return context; - } - } - - internal static void Init() - { - if (IsInitialized) { - return; - } - if (!IsParallelSupported) - { - IsInitialized = true; - return; - } - MatrixParallelFactory.Init(); - contextAllocator = SlabAllocator.Create(4, SlabBufferLayout.Chunked, false); - contextMap = []; - int count = Environment.ProcessorCount; - _threads = new(count); - for (int i = 0; i < count; i++) - { - MatrixParallelThread thread = new MatrixParallelThread(i); - _threads.Push(thread); - SpinWait.SpinUntil(() => thread.State == MatrixThreadState.Ready); - } - - // TODO 构建全局的保底上下文 - foreach (MatrixParallelThread thread in _threads) { } - if (contextMap.Keys.Count == 1) - { - for (int i = 0; i < 4; i++) - { - MatrixParallelThread thread = _threads.Pop(); - thread.Dispose(); - } - } else - { - // TODO 排序并丢弃四个能力最弱线程 - } - _awaitingLeaderHandle = new AwaitingQueue(); - IsInitialized = true; - } - - [LibraryImport(Native.LibName, EntryPoint = "sn_compare_simd")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - private static unsafe partial ulong CompareSIMDID( - IntrinsicContext* context, - ulong id - ); - - [LibraryImport(Native.LibName, EntryPoint = "load_intrinsic_function")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - private static unsafe partial void LoadIntrinsicFunction( - IntrinsicContext* context, - ulong id - ); - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallel" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Collections; +using StgSharp.HighPerformance.Memory; +using StgSharp.Internal; +using StgSharp.Mathematics.Internal; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public static partial class MatrixParallel + { + + private static bool _meaningful; + + private static CapacityFixedStack _threads; + + private static ConcurrentDictionary contextMap; + + private static SlabAllocator contextAllocator; + + public static bool IsParallelSupported { get; } = Environment.ProcessorCount > 6; + + public static bool IsParallelMeaningful => Environment.ProcessorCount > 6 && IsInitialized; + + private static bool IsInitialized { get; set; } = false; + + internal static unsafe IntrinsicContext* GetContext( + SIMDID simd + ) + { + if (!IsParallelSupported) { + return null; + } + if (contextMap.TryGetValue(simd, out nint handle)) + { + return (IntrinsicContext*)handle; + } else + { + IntrinsicContext* context = (IntrinsicContext*)contextAllocator.Allocate(); + + return context; + } + } + + internal static void Init() + { + if (IsInitialized) { + return; + } + if (!IsParallelSupported) + { + IsInitialized = true; + return; + } + MatrixParallelFactory.Init(); + contextAllocator = SlabAllocator.Create(4, SlabBufferLayout.Chunked, false); + contextMap = []; + int count = Environment.ProcessorCount; + _threads = new(count); + for (int i = 0; i < count; i++) + { + MatrixParallelThread thread = new MatrixParallelThread(i); + _threads.Push(thread); + SpinWait.SpinUntil(() => thread.State == MatrixThreadState.Ready); + } + + // TODO 构建全局的保底上下文 + foreach (MatrixParallelThread thread in _threads) { } + if (contextMap.Keys.Count == 1) + { + for (int i = 0; i < 4; i++) + { + MatrixParallelThread thread = _threads.Pop(); + thread.Dispose(); + } + } else + { + // TODO 排序并丢弃四个能力最弱线程 + } + _awaitingLeaderHandle = new AwaitingQueue(); + IsInitialized = true; + } + + [LibraryImport(Native.LibName, EntryPoint = "sn_compare_simd")] + [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + private static unsafe partial ulong CompareSIMDID( + IntrinsicContext* context, + ulong id + ); + + [LibraryImport(Native.LibName, EntryPoint = "load_intrinsic_function")] + [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + private static unsafe partial void LoadIntrinsicFunction( + IntrinsicContext* context, + ulong id + ); + + } +} diff --git a/StgSharp.Mathematics/Numeric/MatrixParallelQueue.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelQueue.cs similarity index 93% rename from StgSharp.Mathematics/Numeric/MatrixParallelQueue.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallelQueue.cs index 5d67062d..fd00529a 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallelQueue.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelQueue.cs @@ -40,16 +40,16 @@ namespace StgSharp.Mathematics.Numeric { private static ConcurrentStack _recycle = []; - private MatrixParallelTaskPackage* _package; + private MatrixParallelTask* _package; private ulong _cursor; private ulong _maxCount; private MatrixParallelQueue() { } - public MatrixParallelTaskPackage* Package => _package; + public MatrixParallelTask* Package => _package; public static MatrixParallelQueue Rent( - MatrixParallelTaskPackage* pack + MatrixParallelTask* pack ) { if (!_recycle.TryPop(out MatrixParallelQueue? queue)) { diff --git a/StgSharp.Common/Data/SSD/SSDraw.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelTask.cs similarity index 56% rename from StgSharp.Common/Data/SSD/SSDraw.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallelTask.cs index 3476206b..60c25c86 100644 --- a/StgSharp.Common/Data/SSD/SSDraw.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelTask.cs @@ -1,68 +1,64 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="SSDraw" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.ShaderEdit; - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security.Cryptography; -using System.Text; -using System.Xml.Serialization; - -namespace StgSharp.Internal.FileIO -{ - public class SSDraw - { - - private byte[] data; - - public SSDraw(string name, Stream streamSource) - { - if ((streamSource == null) || (streamSource.Length == 0)) { - throw new ArgumentNullException(nameof(streamSource)); - } - Name = name; - data = new byte[streamSource.Length]; - streamSource.Read(data.AsSpan()); - } - - public SSDrawHead Head { get; set; } - - public string Name { get; set; } - - } - - [StructLayout(LayoutKind.Explicit, Size = 32 * 16)] - public unsafe struct SSDrawHead { } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallelTask" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.Mathematics.Internal; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Numeric +{ + [StructLayout(LayoutKind.Explicit)] + internal unsafe struct MatrixParallelTask + { + + [FieldOffset(0)]public MatrixKernel* Mat1; // 8 + [FieldOffset(8)] public MatrixKernel* Mat2; // 8 + [FieldOffset(16)] public MatrixKernel* Mat3; // 16 + [FieldOffset(32)] public int Common_i; + [FieldOffset(36)] public int Common_j; + [FieldOffset(40)] public int Common_k; + [FieldOffset(44)] public int i; + [FieldOffset(48)] public int j; + [FieldOffset(52)] public int k; + [FieldOffset(56)] public MatrixElementType ElementType; // 56 + [FieldOffset(24)] public nint Span; // 24 + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Copy( + MatrixParallelTask* source, + MatrixParallelTask* target + ) + { + Buffer.MemoryCopy(source, target, sizeof(MatrixParallelTask), + sizeof(MatrixParallelTask)); + } + + } +} \ No newline at end of file diff --git a/StgSharp.Mathematics/Numeric/MatrixParallelThread.Fma.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Fma.cs similarity index 61% rename from StgSharp.Mathematics/Numeric/MatrixParallelThread.Fma.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Fma.cs index c121964b..d0b22669 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallelThread.Fma.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Fma.cs @@ -1,11 +1,38 @@ -using System; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallelThread.Fma" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.Internal; +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; -using StgSharp.HighPerformance; -using StgSharp.Internal; namespace StgSharp.Mathematics.Numeric { @@ -13,10 +40,10 @@ namespace StgSharp.Mathematics.Numeric { internal static unsafe void ComputeFmaPanelF32( - MatrixParallelTaskPackage* p + MatrixParallelTask* p ) { - int f32 = (int)MatrixElementType.F32; + int f32 = MatrixElementType.F32.IntrinsicNode; MatrixKernel* leftBuffer = (MatrixKernel*)p->Left; MatrixKernel* rightBuffer = (MatrixKernel*)p->Right; MatrixKernel* ansBuffer = (MatrixKernel*)p->Answer; @@ -43,10 +70,10 @@ namespace StgSharp.Mathematics.Numeric } internal static unsafe void ComputeFmaPanelF64( - MatrixParallelTaskPackage* p + MatrixParallelTask* p ) { - int f64 = (int)MatrixElementType.F64; + int f64 = MatrixElementType.F64.IntrinsicNode; // int size = 1; MatrixKernel* leftBuffer = (MatrixKernel*)p->Left; @@ -73,5 +100,6 @@ namespace StgSharp.Mathematics.Numeric enumeration); } } + } } diff --git a/StgSharp.Mathematics/Numeric/MatrixParallelThread.Model.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Model.cs similarity index 96% rename from StgSharp.Mathematics/Numeric/MatrixParallelThread.Model.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Model.cs index 05e4d438..492c4db6 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallelThread.Model.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Model.cs @@ -37,7 +37,7 @@ namespace StgSharp.Mathematics.Numeric private const int KernelStealCount = 64; internal unsafe void BufferCompute( - MatrixParallelTaskPackage* p + MatrixParallelTask* p ) { // while () { } @@ -55,7 +55,7 @@ namespace StgSharp.Mathematics.Numeric [MethodImpl(MethodImplOptions.AggressiveInlining)] internal unsafe void SpecialBufferCompute( - MatrixParallelTaskPackage* p + MatrixParallelTask* p ) { switch ((MatrixElementType)p->ElementSize) diff --git a/StgSharp.Mathematics/Numeric/MatrixParallelThread.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.cs similarity index 95% rename from StgSharp.Mathematics/Numeric/MatrixParallelThread.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.cs index 7f3e2aea..760a9389 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallelThread.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.cs @@ -1,169 +1,169 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallelThread" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Internal; -using StgSharp.Internal.Intrinsic; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Numeric -{ - internal enum MatrixThreadState : int - { - - Born = 0, - Ready = 1, - Running = 2, - Idle = 4, - Retired = 8, - - } - - public unsafe partial class MatrixParallelThread : IDisposable - { - - private IntPtr* _context; - private volatile bool _disposed, _isRetireRequested = false; - private readonly ManualResetEventSlim _resetEvent; - private readonly Thread _managedThread; - - internal MatrixParallelThread( - int poolId - ) - { - _resetEvent = new ManualResetEventSlim(false); - _managedThread = new Thread(MatrixParallelWorkLoad); - _managedThread.Start(); - PoolId = poolId; - } - - public int PoolId { get; init; } - - public ThreadPriority AfterWork { get; set; } - - internal ManualResetEventSlim? LeaderEvent { get; set; } - - internal IntrinsicContext* Intrinsic { get; set; } - - internal bool IsSingle { get; set; } - - internal MatrixParallelWrap BindedWrap { get; set; } - - internal MatrixThreadState State { get; set; } - - internal SIMDID Simd { get; set; } - - public void Dispose() - { - Dispose(disposing:true); - GC.SuppressFinalize(this); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Restart() - { - _resetEvent.Set(); - } - - [LibraryImport(Native.LibName, EntryPoint = "sn_get_simd_level_local")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - internal static partial ulong GetSimdId(); - - [LibraryImport(Native.LibName, EntryPoint = "sn_set_thread_affinity")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - internal static partial void SetThreadAffinity( - int coreId - ); - - protected virtual void Dispose( - bool disposing - ) - { - if (!_disposed) - { - if (disposing) - { - _isRetireRequested = true; - _resetEvent.Set(); - _managedThread.Join(); - _resetEvent.Dispose(); - } - _disposed = true; - } - } - - private unsafe void MatrixParallelWorkLoad() - { - State = MatrixThreadState.Born; - - // Bind OS-thread affinity once when the worker starts running - SetThreadAffinity(PoolId); - Thread.Yield(); - SIMDID feature = new(); - feature.Mask = GetSimdId(); - _context = (nint*)MatrixParallel.GetContext(feature); - State = MatrixThreadState.Ready; - while (true) - { - // Thread self = Thread.CurrentThread; - _resetEvent.Wait(); - _resetEvent.Reset(); - if (_isRetireRequested) - { - break; - } - State = MatrixThreadState.Running; - AfterWork = BindedWrap.AfterWork; - _managedThread.Priority = ThreadPriority.Highest; - if (IsSingle) - { - // TODO 将外部线程绑定到当前线程上,并执行任务包 - } else - { - MatrixParallelQueue taskQueue = BindedWrap.TaskQueue; - MatrixParallelTaskPackage* p = taskQueue.Package; - if (0 > (int)p ->ComputeHandle) { - SpecialBufferCompute(p); - } - switch (p->ComputeMode) - { - case MatrixIndexStyle.BUFFER_INDEX: - BufferCompute(p); - break; - default: - break; - } - BindedWrap.ReportThreadAccomplished(); - } - _managedThread.Priority = AfterWork; - State = MatrixThreadState.Idle; - } - State = MatrixThreadState.Retired; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallelThread" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Internal; +using StgSharp.Mathematics.Internal; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Numeric +{ + internal enum MatrixThreadState : int + { + + Born = 0, + Ready = 1, + Running = 2, + Idle = 4, + Retired = 8, + + } + + public unsafe partial class MatrixParallelThread : IDisposable + { + + private IntPtr* _context; + private volatile bool _disposed, _isRetireRequested = false; + private readonly ManualResetEventSlim _resetEvent; + private readonly Thread _managedThread; + + internal MatrixParallelThread( + int poolId + ) + { + _resetEvent = new ManualResetEventSlim(false); + _managedThread = new Thread(MatrixParallelWorkLoad); + _managedThread.Start(); + PoolId = poolId; + } + + public int PoolId { get; init; } + + public ThreadPriority AfterWork { get; set; } + + internal ManualResetEventSlim? LeaderEvent { get; set; } + + internal IntrinsicContext* Intrinsic { get; set; } + + internal bool IsSingle { get; set; } + + internal MatrixParallelWrap BindedWrap { get; set; } + + internal MatrixThreadState State { get; set; } + + internal SIMDID Simd { get; set; } + + public void Dispose() + { + Dispose(disposing:true); + GC.SuppressFinalize(this); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Restart() + { + _resetEvent.Set(); + } + + [LibraryImport(Native.LibName, EntryPoint = "sn_get_simd_level_local")] + [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + internal static partial ulong GetSimdId(); + + [LibraryImport(Native.LibName, EntryPoint = "sn_set_thread_affinity")] + [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + internal static partial void SetThreadAffinity( + int coreId + ); + + protected virtual void Dispose( + bool disposing + ) + { + if (!_disposed) + { + if (disposing) + { + _isRetireRequested = true; + _resetEvent.Set(); + _managedThread.Join(); + _resetEvent.Dispose(); + } + _disposed = true; + } + } + + private unsafe void MatrixParallelWorkLoad() + { + State = MatrixThreadState.Born; + + // Bind OS-thread affinity once when the worker starts running + SetThreadAffinity(PoolId); + Thread.Yield(); + SIMDID feature = new(); + feature.Mask = GetSimdId(); + _context = (nint*)MatrixParallel.GetContext(feature); + State = MatrixThreadState.Ready; + while (true) + { + // Thread self = Thread.CurrentThread; + _resetEvent.Wait(); + _resetEvent.Reset(); + if (_isRetireRequested) + { + break; + } + State = MatrixThreadState.Running; + AfterWork = BindedWrap.AfterWork; + _managedThread.Priority = ThreadPriority.Highest; + if (IsSingle) + { + // TODO 将外部线程绑定到当前线程上,并执行任务包 + } else + { + MatrixParallelQueue taskQueue = BindedWrap.TaskQueue; + MatrixParallelTask* p = taskQueue.Package; + if (0 > (int)p ->ComputeHandle) { + SpecialBufferCompute(p); + } + switch (p->ComputeMode) + { + case MatrixIndexStyle.BUFFER_INDEX: + BufferCompute(p); + break; + default: + break; + } + BindedWrap.ReportThreadAccomplished(); + } + _managedThread.Priority = AfterWork; + State = MatrixThreadState.Idle; + } + State = MatrixThreadState.Retired; + } + + } +} diff --git a/StgSharp.Mathematics/Numeric/MatrixParallelWrap.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelWrap.cs similarity index 97% rename from StgSharp.Mathematics/Numeric/MatrixParallelWrap.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixParallelWrap.cs index 8253b837..989e845e 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallelWrap.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelWrap.cs @@ -1,122 +1,122 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallelWrap.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Collections; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public enum SleepMode : int - { - - QuickWakeup = ThreadPriority.AboveNormal, - NormalSleep = ThreadPriority.BelowNormal, - DeepSleep = ThreadPriority.Lowest, - - } - - public class MatrixParallelWrap : IDisposable - { - - private MatrixParallelThread[] _threads; - private bool _disposed = false; - private int _count; - - internal MatrixParallelWrap(MatrixParallelThread[] threadArray) - { - _threads = threadArray; - IsMultithread = threadArray.Length > 1; - _count = threadArray.Length; - } - - public MatrixParallelQueue TaskQueue { get; set; } - - public ReadOnlySpan Threads - { - get - { - if (_disposed) { - throw new ObjectDisposedException(typeof(MatrixParallelWrap).Name); - } - return _threads; - } - } - - public ThreadPriority AfterWork { get; private set; } - - private bool IsMultithread { get; init; } - - public void Dispose() - { - if (_disposed) { - return; - } - MatrixParallel.ReturnParallelResources(ref _threads); - _disposed = true; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void LaunchParallel(SleepMode afterWork) - { - AfterWork = (ThreadPriority)afterWork; - foreach (MatrixParallelThread thread in _threads) - { - thread.AfterWork = AfterWork; - thread.BindedWrap = this; - } - WaitAllWraps(); - } - - public void WaitAllWraps() - { - if (_disposed) { - throw new ObjectDisposedException(typeof(MatrixParallelWrap).Name); - } - SpinWait.SpinUntil(() => Volatile.Read(ref _count) == 0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ReportThreadAccomplished() - { - if (_disposed) { - throw new ObjectDisposedException(typeof(MatrixParallelWrap).Name); - } - Interlocked.Decrement(ref _count); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallelWrap.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Collections; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public enum SleepMode : int + { + + QuickWakeup = ThreadPriority.AboveNormal, + NormalSleep = ThreadPriority.BelowNormal, + DeepSleep = ThreadPriority.Lowest, + + } + + public class MatrixParallelWrap : IDisposable + { + + private MatrixParallelThread[] _threads; + private bool _disposed = false; + private int _count; + + internal MatrixParallelWrap(MatrixParallelThread[] threadArray) + { + _threads = threadArray; + IsMultithread = threadArray.Length > 1; + _count = threadArray.Length; + } + + public MatrixParallelQueue TaskQueue { get; set; } + + public ReadOnlySpan Threads + { + get + { + if (_disposed) { + throw new ObjectDisposedException(typeof(MatrixParallelWrap).Name); + } + return _threads; + } + } + + public ThreadPriority AfterWork { get; private set; } + + private bool IsMultithread { get; init; } + + public void Dispose() + { + if (_disposed) { + return; + } + MatrixParallel.ReturnParallelResources(ref _threads); + _disposed = true; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void LaunchParallel(SleepMode afterWork) + { + AfterWork = (ThreadPriority)afterWork; + foreach (MatrixParallelThread thread in _threads) + { + thread.AfterWork = AfterWork; + thread.BindedWrap = this; + } + WaitAllWraps(); + } + + public void WaitAllWraps() + { + if (_disposed) { + throw new ObjectDisposedException(typeof(MatrixParallelWrap).Name); + } + SpinWait.SpinUntil(() => Volatile.Read(ref _count) == 0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ReportThreadAccomplished() + { + if (_disposed) { + throw new ObjectDisposedException(typeof(MatrixParallelWrap).Name); + } + Interlocked.Decrement(ref _count); + } + + } +} diff --git a/StgSharp.Mathematics/Numeric/MatrixTaskFactory.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixTaskFactory.cs similarity index 84% rename from StgSharp.Mathematics/Numeric/MatrixTaskFactory.cs rename to StgSharp.Mathematics/Numeric/Runtime/MatrixTaskFactory.cs index 0013d367..a218432c 100644 --- a/StgSharp.Mathematics/Numeric/MatrixTaskFactory.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixTaskFactory.cs @@ -1,119 +1,119 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixTaskFactory" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.HighPerformance.Memory; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -using hlsfAllocator = StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator; - -namespace StgSharp.Mathematics.Numeric -{ - internal static unsafe class MatrixParallelFactory - { - - private static hlsfAllocator _intermediateResult; - - private static -#if NET9_0_OR_GREATER - Lock -#else - object -#endif - _hlsfLock = new(); - - private static SlabAllocator _scalarAllocator ; - - private static SlabAllocator _wrapAllocator; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MatrixParallelTaskPackage* CreateBaseTask() - { - MatrixParallelTaskPackage* p = (MatrixParallelTaskPackage*)_wrapAllocator.Allocate(); - Span s = new Span((byte*)p, sizeof(MatrixParallelTaskPackage)); - s.Fill(0); - return p; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ScalarPacket* CreateScalarPacket() - { - ScalarPacket* p = (ScalarPacket*)_scalarAllocator.Allocate(); - return p; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe MatrixParallelTaskPackage* FromExistPackage( - MatrixParallelTaskPackage* exist - ) - { - MatrixParallelTaskPackage* ptr = (MatrixParallelTaskPackage*)_wrapAllocator.Allocate(); - MatrixParallelTaskPackage.Copy(exist, ptr); - return ptr; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - - public static void Release( - ScalarPacket* source - ) - { - _scalarAllocator.Free((nuint)source); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Release( - MatrixParallelTaskPackage* source - ) - { - if (source->Scalar != null) { - _scalarAllocator.Free((nuint)source->Scalar); - } - _wrapAllocator.Free((nuint)source); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void Init() - { - if (_intermediateResult is null) - { - _intermediateResult = new hlsfAllocator(64 * 16 * 16); - _scalarAllocator = SlabAllocator.Create(64 * 1024, SlabBufferLayout.Chunked); - _wrapAllocator = SlabAllocator. - Create(128 * 1024, SlabBufferLayout.Chunked); - } - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixTaskFactory" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.HighPerformance.Memory; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +using hlsfAllocator = StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator; + +namespace StgSharp.Mathematics.Numeric +{ + internal static unsafe class MatrixParallelFactory + { + + private static hlsfAllocator _intermediateResult; + + private static +#if NET9_0_OR_GREATER + Lock +#else + object +#endif + _hlsfLock = new(); + + private static SlabAllocator _scalarAllocator ; + + private static SlabAllocator _wrapAllocator; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static MatrixParallelTask* CreateBaseTask() + { + MatrixParallelTask* p = (MatrixParallelTask*)_wrapAllocator.Allocate(); + Span s = new Span((byte*)p, sizeof(MatrixParallelTask)); + s.Fill(0); + return p; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ScalarPacket* CreateScalarPacket() + { + ScalarPacket* p = (ScalarPacket*)_scalarAllocator.Allocate(); + return p; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe MatrixParallelTask* FromExistPackage( + MatrixParallelTask* exist + ) + { + MatrixParallelTask* ptr = (MatrixParallelTask*)_wrapAllocator.Allocate(); + MatrixParallelTask.Copy(exist, ptr); + return ptr; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + + public static void Release( + ScalarPacket* source + ) + { + _scalarAllocator.Free((nuint)source); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Release( + MatrixParallelTask* source + ) + { + if (source->Scalar != null) { + _scalarAllocator.Free((nuint)source->Scalar); + } + _wrapAllocator.Free((nuint)source); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void Init() + { + if (_intermediateResult is null) + { + _intermediateResult = new hlsfAllocator(64 * 16 * 16); + _scalarAllocator = SlabAllocator.Create(64 * 1024, SlabBufferLayout.Chunked); + _wrapAllocator = SlabAllocator. + Create(128 * 1024, SlabBufferLayout.Chunked); + } + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Mathematics/Scalar/ACos.cs b/StgSharp.Mathematics/Numeric/Scalar/ACos.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/ACos.cs rename to StgSharp.Mathematics/Numeric/Scalar/ACos.cs index d9c2d136..efcc8f7a 100644 --- a/StgSharp.Common/Mathematics/Scalar/ACos.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/ACos.cs @@ -1,107 +1,107 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ACos" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics -{ - public static unsafe partial class Scalar - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe float ACos(float x) - { - return MathF.Acos(x); - - /* - int sign = 1; - float y; - - if (x < 0) - { - sign = -1; - y = -x; - } - else - { - y = x; - } - - if (x > 1) - { - throw new ArgumentException(); - } - - float r, s, u, vec = 0.0f; - bool transform = (y >= 0.5f); - - if (transform) - { - r = 0.5f * (1.0f - y); - s = Scaler.Sqrt(r); - y = s; - } - else - { - r = y * y; - } - u = r * (0.184161606965100694821398249421F + - (-0.0565298683201845211985026327361F + - (-0.0133819288943925804214011424456F - - 0.00396137437848476485201154797087F * r) * r) * r) / - (1.10496961524520294485512696706F - - 0.836411276854206731913362287293F * r); - /* - - if (transform) - { - float c, s1, p, q; - uint us; - - us = *(uint*)&s; - uint uss = us & 0xffff0000; - s1 = *(float*)&uss; - - c = (r - s1 * s1) / (s + s1); - p = 2.0F * s * u - (piby2_tail - 2.0F * c); - q = hpiby2_head - 2.0F * s1; - vec = hpiby2_head - (p - q); - } - else - { - vec = y + y * u; - } - - vec = sign * vec; - - return piby2 - vec; - */ - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ACos" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics +{ + public static unsafe partial class Scalar + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float ACos(float x) + { + return MathF.Acos(x); + + /* + int sign = 1; + float y; + + if (x < 0) + { + sign = -1; + y = -x; + } + else + { + y = x; + } + + if (x > 1) + { + throw new ArgumentException(); + } + + float r, s, u, vec = 0.0f; + bool transform = (y >= 0.5f); + + if (transform) + { + r = 0.5f * (1.0f - y); + s = Scaler.Sqrt(r); + y = s; + } + else + { + r = y * y; + } + u = r * (0.184161606965100694821398249421F + + (-0.0565298683201845211985026327361F + + (-0.0133819288943925804214011424456F - + 0.00396137437848476485201154797087F * r) * r) * r) / + (1.10496961524520294485512696706F - + 0.836411276854206731913362287293F * r); + /* + + if (transform) + { + float c, s1, p, q; + uint us; + + us = *(uint*)&s; + uint uss = us & 0xffff0000; + s1 = *(float*)&uss; + + c = (r - s1 * s1) / (s + s1); + p = 2.0F * s * u - (piby2_tail - 2.0F * c); + q = hpiby2_head - 2.0F * s1; + vec = hpiby2_head - (p - q); + } + else + { + vec = y + y * u; + } + + vec = sign * vec; + + return piby2 - vec; + */ + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/ASin.cs b/StgSharp.Mathematics/Numeric/Scalar/ASin.cs similarity index 96% rename from StgSharp.Common/Mathematics/Scalar/ASin.cs rename to StgSharp.Mathematics/Numeric/Scalar/ASin.cs index 8edb5fa8..d8d49908 100644 --- a/StgSharp.Common/Mathematics/Scalar/ASin.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/ASin.cs @@ -1,119 +1,119 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ASin" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; - -namespace StgSharp.Mathematics -{ - public static unsafe partial class Scalar - { - - private const float - piby2_tail = 7.5497894159e-08f, /* 0x33a22168 */ - hpiby2_head = 7.8539812565e-01f, /* 0x3f490fda */ - piby2 = 1.5707963705e+00f; /* 0x3fc90fdb */ - - /// - /// Reurns the value of ArcSin(x) - /// - /// - /// The sine value of the angle - /// - /// - /// - /// - /// - /// - /// - public static float ASin(float x) - { - return MathF.Asin(x); - /* - int sign = 1; - float y; - - if (x < 0) - { - sign = -1; - y = -x; - } - else - { - y = x; - } - - if (x > 1) - { - throw new ArgumentException(); - } - - float r, s, u, vec = 0.0f; - bool transform = (y >= 0.5f); - - if (transform) - { - r = 0.5f * (1.0f - y); - s = Scaler.Sqrt(r); - y = s; - } - else - { - r = y * y; - } - u = r * (0.184161606965100694821398249421F + - (-0.0565298683201845211985026327361F + - (-0.0133819288943925804214011424456F - - 0.00396137437848476485201154797087F * r) * r) * r) / - (1.10496961524520294485512696706F - - 0.836411276854206731913362287293F * r); - /* - - if (transform) - { - float c, s1, p, q; - uint us; - - us = *(uint*)&s; - uint uss = us & 0xffff0000; - s1 = *(float*)&uss; - - c = (r - s1 * s1) / (s + s1); - p = 2.0F * s * u - (piby2_tail - 2.0F * c); - q = hpiby2_head - 2.0F * s1; - vec = hpiby2_head - (p - q); - } - else - { - vec = y + y * u; - }/* - - return sign * vec; - */ - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ASin" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; + +namespace StgSharp.Mathematics +{ + public static unsafe partial class Scalar + { + + private const float + piby2_tail = 7.5497894159e-08f, /* 0x33a22168 */ + hpiby2_head = 7.8539812565e-01f, /* 0x3f490fda */ + piby2 = 1.5707963705e+00f; /* 0x3fc90fdb */ + + /// + /// Reurns the value of ArcSin(x) + /// + /// + /// The sine value of the angle + /// + /// + /// + /// + /// + /// + /// + public static float ASin(float x) + { + return MathF.Asin(x); + /* + int sign = 1; + float y; + + if (x < 0) + { + sign = -1; + y = -x; + } + else + { + y = x; + } + + if (x > 1) + { + throw new ArgumentException(); + } + + float r, s, u, vec = 0.0f; + bool transform = (y >= 0.5f); + + if (transform) + { + r = 0.5f * (1.0f - y); + s = Scaler.Sqrt(r); + y = s; + } + else + { + r = y * y; + } + u = r * (0.184161606965100694821398249421F + + (-0.0565298683201845211985026327361F + + (-0.0133819288943925804214011424456F - + 0.00396137437848476485201154797087F * r) * r) * r) / + (1.10496961524520294485512696706F - + 0.836411276854206731913362287293F * r); + /* + + if (transform) + { + float c, s1, p, q; + uint us; + + us = *(uint*)&s; + uint uss = us & 0xffff0000; + s1 = *(float*)&uss; + + c = (r - s1 * s1) / (s + s1); + p = 2.0F * s * u - (piby2_tail - 2.0F * c); + q = hpiby2_head - 2.0F * s1; + vec = hpiby2_head - (p - q); + } + else + { + vec = y + y * u; + }/* + + return sign * vec; + */ + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/ATan.cs b/StgSharp.Mathematics/Numeric/Scalar/ATan.cs similarity index 96% rename from StgSharp.Common/Mathematics/Scalar/ATan.cs rename to StgSharp.Mathematics/Numeric/Scalar/ATan.cs index 3c9325f8..4097f17a 100644 --- a/StgSharp.Common/Mathematics/Scalar/ATan.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/ATan.cs @@ -1,116 +1,116 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ATan" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics -{ - public static unsafe partial class Scalar - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe float ATan(float x) - { - return MathF.Atan(x); - /* - float sign = 1, angle = 0; - if (x < 0) - { - sign = -1; - x = -x; - } - uint xBit = *(uint*)&x; - int xExp = (int)(xBit >> 23) - 127; - if (xExp >= 26) - { - return 1; - } - if (xExp <= -15) - { - return x; - } - if (xExp >= 0) - { - x = (x - 1) / (x + 1); - angle = 0.7853981634f; - } - - float vec = 0.7853981634f * x + x * (1 - x) * (0.2447f + 0.0663f * x); - vec += angle; - vec *= sign; - - return vec; - - - } - - - public static unsafe float ATan(float x, float y) - { - - - float z = y / x; - - float sign = 1, angle = 0, angle2 = 0; - if (x < 0) - { - angle = -3.1415926535f; - } - if (z < 0) - { - sign = -1; - z = -z; - } - uint zBit = *(uint*)&z; - int zExp = (int)(zBit >> 23) - 127; - if (zExp >= 26) - { - return 1; - } - if (zExp <= -15) - { - return z; - } - if (zExp >= 0) - { - z = (z - 1) / (z + 1); - angle2 = 0.7853981634f; - } - - float vec = 0.7853981634f * z + z * (1 - z) * (0.2447f + 0.0663f * z); - vec *= 57.29577951f; - vec += angle2; - vec += angle; - vec *= sign; - - return vec; - */ - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ATan" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics +{ + public static unsafe partial class Scalar + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float ATan(float x) + { + return MathF.Atan(x); + /* + float sign = 1, angle = 0; + if (x < 0) + { + sign = -1; + x = -x; + } + uint xBit = *(uint*)&x; + int xExp = (int)(xBit >> 23) - 127; + if (xExp >= 26) + { + return 1; + } + if (xExp <= -15) + { + return x; + } + if (xExp >= 0) + { + x = (x - 1) / (x + 1); + angle = 0.7853981634f; + } + + float vec = 0.7853981634f * x + x * (1 - x) * (0.2447f + 0.0663f * x); + vec += angle; + vec *= sign; + + return vec; + + + } + + + public static unsafe float ATan(float x, float y) + { + + + float z = y / x; + + float sign = 1, angle = 0, angle2 = 0; + if (x < 0) + { + angle = -3.1415926535f; + } + if (z < 0) + { + sign = -1; + z = -z; + } + uint zBit = *(uint*)&z; + int zExp = (int)(zBit >> 23) - 127; + if (zExp >= 26) + { + return 1; + } + if (zExp <= -15) + { + return z; + } + if (zExp >= 0) + { + z = (z - 1) / (z + 1); + angle2 = 0.7853981634f; + } + + float vec = 0.7853981634f * z + z * (1 - z) * (0.2447f + 0.0663f * z); + vec *= 57.29577951f; + vec += angle2; + vec += angle; + vec *= sign; + + return vec; + */ + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/BasicOps.cs b/StgSharp.Mathematics/Numeric/Scalar/BasicOps.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/BasicOps.cs rename to StgSharp.Mathematics/Numeric/Scalar/BasicOps.cs index 63fb94d9..8024f2a8 100644 --- a/StgSharp.Common/Mathematics/Scalar/BasicOps.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/BasicOps.cs @@ -1,67 +1,67 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="BasicOps" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Globalization; -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics -{ - public static unsafe partial class Scalar - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe float Abs(float x) - { - uint* a = (uint*)&x; - *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; - return *(float*)a; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe int Abs(int x) - { - uint* a = (uint*)&x; - *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; - return *(int*)a; - } - - internal static string GetListSeparator(IFormatProvider formatProvider) - { - if (formatProvider is CultureInfo cultureInfo) { - return cultureInfo.TextInfo.ListSeparator; - } - - if (formatProvider?.GetFormat(typeof(TextInfo)) is TextInfo textInfo) { - return textInfo.ListSeparator; - } - - return CultureInfo.CurrentCulture.TextInfo.ListSeparator; - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="BasicOps" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Globalization; +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics +{ + public static unsafe partial class Scalar + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float Abs(float x) + { + uint* a = (uint*)&x; + *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; + return *(float*)a; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int Abs(int x) + { + uint* a = (uint*)&x; + *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; + return *(int*)a; + } + + internal static string GetListSeparator(IFormatProvider formatProvider) + { + if (formatProvider is CultureInfo cultureInfo) { + return cultureInfo.TextInfo.ListSeparator; + } + + if (formatProvider?.GetFormat(typeof(TextInfo)) is TextInfo textInfo) { + return textInfo.ListSeparator; + } + + return CultureInfo.CurrentCulture.TextInfo.ListSeparator; + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Mathematics/Scalar/Compare.cs b/StgSharp.Mathematics/Numeric/Scalar/Compare.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Compare.cs rename to StgSharp.Mathematics/Numeric/Scalar/Compare.cs index 3ea7d41f..16bb34f4 100644 --- a/StgSharp.Common/Mathematics/Scalar/Compare.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Compare.cs @@ -1,64 +1,64 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Compare" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics -{ - public static partial class Scalar - { - - public static float MaxOf(params float[] stream) - { - float ret = stream[0]; - foreach (float num in stream) - { - if (ret < num) { - ret = num; - } - } - return ret; - } - - public static float MinOf(params float[] stream) - { - float ret = stream[0]; - foreach (float num in stream) - { - if (ret > num) { - ret = num; - } - } - return ret; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Compare" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics +{ + public static partial class Scalar + { + + public static float MaxOf(params float[] stream) + { + float ret = stream[0]; + foreach (float num in stream) + { + if (ret < num) { + ret = num; + } + } + return ret; + } + + public static float MinOf(params float[] stream) + { + float ret = stream[0]; + foreach (float num in stream) + { + if (ret > num) { + ret = num; + } + } + return ret; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Cos.cs b/StgSharp.Mathematics/Numeric/Scalar/Cos.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Cos.cs rename to StgSharp.Mathematics/Numeric/Scalar/Cos.cs index 8bc5869a..b37c84c6 100644 --- a/StgSharp.Common/Mathematics/Scalar/Cos.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Cos.cs @@ -1,57 +1,57 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Cos" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics -{ - public static partial class Scalar - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Cos(float x) - { - /* - float refer = x / 360.0f; - refer -= (int)refer; - - refer *= 40; - int a = (int)refer; //大分度,查表 - refer -= a; //小分度,拟合 - - float refer2 = refer * refer; - - - return ((-sinData[a]) * ((0.1570796327f * refer) - (6.459640975e-4f * refer * refer2))) - + (cosData[a] * ((1 - (0.0123370055f * refer2)) + (2.536695709e-5f * refer2 * refer2))); - */ - return MathF.Cos(x); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Cos" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics +{ + public static partial class Scalar + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Cos(float x) + { + /* + float refer = x / 360.0f; + refer -= (int)refer; + + refer *= 40; + int a = (int)refer; //大分度,查表 + refer -= a; //小分度,拟合 + + float refer2 = refer * refer; + + + return ((-sinData[a]) * ((0.1570796327f * refer) - (6.459640975e-4f * refer * refer2))) + + (cosData[a] * ((1 - (0.0123370055f * refer2)) + (2.536695709e-5f * refer2 * refer2))); + */ + return MathF.Cos(x); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Ctor.cs b/StgSharp.Mathematics/Numeric/Scalar/Ctor.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Ctor.cs rename to StgSharp.Mathematics/Numeric/Scalar/Ctor.cs index 0ecb9da3..f5ce3796 100644 --- a/StgSharp.Common/Mathematics/Scalar/Ctor.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Ctor.cs @@ -1,52 +1,52 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Ctor" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics -{ - public unsafe delegate float ScalarCalcHandler(float* x); - - public static unsafe partial class Scalar - { - - private const uint MEM_COMMIT = 0x1000; - private const uint MEM_RELEASE = 0x8000; - private const uint MEM_RESERVE = 0x2000; - private const uint PAGE_EXECUTE_READWRITE = 0x40; - - static Scalar() { } - - [DllImport("Kernel32.dll", EntryPoint = "VirtualAlloc")] - private static extern IntPtr VirtualAlloc(IntPtr address, int size, uint allocType, uint protect); - - [DllImport("Kernel32.dll", EntryPoint = "VirtualFree")] - private static extern bool VirtualFree(IntPtr address, int size, uint freeType); - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Ctor" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics +{ + public unsafe delegate float ScalarCalcHandler(float* x); + + public static unsafe partial class Scalar + { + + private const uint MEM_COMMIT = 0x1000; + private const uint MEM_RELEASE = 0x8000; + private const uint MEM_RESERVE = 0x2000; + private const uint PAGE_EXECUTE_READWRITE = 0x40; + + static Scalar() { } + + [DllImport("Kernel32.dll", EntryPoint = "VirtualAlloc")] + private static extern IntPtr VirtualAlloc(IntPtr address, int size, uint allocType, uint protect); + + [DllImport("Kernel32.dll", EntryPoint = "VirtualFree")] + private static extern bool VirtualFree(IntPtr address, int size, uint freeType); + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Exp.cs b/StgSharp.Mathematics/Numeric/Scalar/Exp.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Exp.cs rename to StgSharp.Mathematics/Numeric/Scalar/Exp.cs index 6b121941..7236b2fc 100644 --- a/StgSharp.Common/Mathematics/Scalar/Exp.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Exp.cs @@ -1,109 +1,109 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Exp" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics -{ - public static unsafe partial class Scalar - { - - public const float E = 2.718281828f; - public const double EDouble = System.Math.E; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Exp(float x) - { - return MathF.Exp(x); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double Exp(double x) - { - return System.Math.Exp(x); - } - - /// - /// Get the value of E ^ x; - /// - /// - /// - /// - /// - /// - /// - public static unsafe float ExpSlow(float x) - { - if (x == 1) { - return E; - } - if (x == 0) { - return 1; - } - - bool sign = false; - if (x < 0) - { - sign = true; - x = -x; - } - - float z = x, t; - if (x < 0.5f) - { - t = 1.0f + (x * (1.0f + (x * (0.5f + (x * (0.1666666667f + (x * (0.0416666666667f + (x * 8.333333333e-3f))))))))); - } else - { - /* - * define z = n * 2 ^ m - * n is between 0 and 0.5 - */ - uint zBit = *(uint*)&z; - uint zBitAbs = zBit & 0b_0111_1111_1111_1111_1111_1111_1111_1111; - uint uintm = zBitAbs >> 23; - int m = (*(int*)&uintm) - 126; - - - uint nBit = (zBitAbs & 0b_0000_0000_0111_1111_1111_1111_1111_1111) + 0b_0011_1111_0000_0000_0000_0000_0000_0000; - float n = (*(float*)&nBit) - 1; - - t = 2.718281828f + (n * (2.718281828f + (n * (1.359140914f + (n * (0.4530469714f + (n * (0.1132617429f + (n * 0.02265234857f))))))))); - - for (int i = 0; i < m; i++) { - t = t * t; - } - } - - if (sign) { - t = 1 / t; - } - return t; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Exp" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics +{ + public static unsafe partial class Scalar + { + + public const float E = 2.718281828f; + public const double EDouble = System.Math.E; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Exp(float x) + { + return MathF.Exp(x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double Exp(double x) + { + return System.Math.Exp(x); + } + + /// + /// Get the value of E ^ x; + /// + /// + /// + /// + /// + /// + /// + public static unsafe float ExpSlow(float x) + { + if (x == 1) { + return E; + } + if (x == 0) { + return 1; + } + + bool sign = false; + if (x < 0) + { + sign = true; + x = -x; + } + + float z = x, t; + if (x < 0.5f) + { + t = 1.0f + (x * (1.0f + (x * (0.5f + (x * (0.1666666667f + (x * (0.0416666666667f + (x * 8.333333333e-3f))))))))); + } else + { + /* + * define z = n * 2 ^ m + * n is between 0 and 0.5 + */ + uint zBit = *(uint*)&z; + uint zBitAbs = zBit & 0b_0111_1111_1111_1111_1111_1111_1111_1111; + uint uintm = zBitAbs >> 23; + int m = (*(int*)&uintm) - 126; + + + uint nBit = (zBitAbs & 0b_0000_0000_0111_1111_1111_1111_1111_1111) + 0b_0011_1111_0000_0000_0000_0000_0000_0000; + float n = (*(float*)&nBit) - 1; + + t = 2.718281828f + (n * (2.718281828f + (n * (1.359140914f + (n * (0.4530469714f + (n * (0.1132617429f + (n * 0.02265234857f))))))))); + + for (int i = 0; i < m; i++) { + t = t * t; + } + } + + if (sign) { + t = 1 / t; + } + return t; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Factorial.cs b/StgSharp.Mathematics/Numeric/Scalar/Factorial.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Factorial.cs rename to StgSharp.Mathematics/Numeric/Scalar/Factorial.cs index 58d37917..83b66fef 100644 --- a/StgSharp.Common/Mathematics/Scalar/Factorial.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Factorial.cs @@ -1,68 +1,68 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Factorial" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; - -namespace StgSharp.Mathematics -{ - public static partial class Scalar - { - - private static readonly uint[] factorialResult = [ - 1, - 1, - 2, - 6, - 24, - 120, - 720, - 5040, - 40320, - 362880, - 3628800, - 39916800, - 479001600 - ]; - - public static unsafe ulong Factorial(int n) - { - ArgumentOutOfRangeException.ThrowIfLessThan(n, 0); - if (n < 13) { - return factorialResult[n]; - } - if (n < 30) { - return NativeIntrinsic.Context.factorial_simd(n); - } - double - dn = n, - stir = Sqrt(2 * PiDouble * dn) * Pow(dn / EDouble, dn), - correction = Exp(1 / (12 * dn)); - return (ulong)(stir * correction); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Factorial" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; + +namespace StgSharp.Mathematics +{ + public static partial class Scalar + { + + private static readonly uint[] factorialResult = [ + 1, + 1, + 2, + 6, + 24, + 120, + 720, + 5040, + 40320, + 362880, + 3628800, + 39916800, + 479001600 + ]; + + public static unsafe ulong Factorial(int n) + { + ArgumentOutOfRangeException.ThrowIfLessThan(n, 0); + if (n < 13) { + return factorialResult[n]; + } + if (n < 30) { + return NativeIntrinsic.Context.factorial_simd(n); + } + double + dn = n, + stir = Sqrt(2 * PiDouble * dn) * Pow(dn / EDouble, dn), + correction = Exp(1 / (12 * dn)); + return (ulong)(stir * correction); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Function.cs b/StgSharp.Mathematics/Numeric/Scalar/Function.cs similarity index 98% rename from StgSharp.Common/Mathematics/Scalar/Function.cs rename to StgSharp.Mathematics/Numeric/Scalar/Function.cs index ca467761..571618d0 100644 --- a/StgSharp.Common/Mathematics/Scalar/Function.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Function.cs @@ -1,31 +1,31 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Function" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -namespace StgSharp.Mathematics -{ - public class Function { } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Function" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +namespace StgSharp.Mathematics +{ + public class Function { } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Log.cs b/StgSharp.Mathematics/Numeric/Scalar/Log.cs similarity index 98% rename from StgSharp.Common/Mathematics/Scalar/Log.cs rename to StgSharp.Mathematics/Numeric/Scalar/Log.cs index 14a1c50a..c11ed98f 100644 --- a/StgSharp.Common/Mathematics/Scalar/Log.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Log.cs @@ -1,80 +1,80 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Log" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; - -namespace StgSharp.Mathematics -{ - public static partial class Scalar - { - - private static readonly float[] logArray = { - 0f, 0.00995033085316809f, 0.0198026272961797f, 0.0295588022415444f, 0.0392207131532813f, 0.048790164169432f, 0.0582689081239758f, 0.0676586484738149f, 0.0769610411361284f, 0.0861776962410524f, 0.0953101798043249f, 0.104360015324243f, 0.113328685307003f, 0.122217632724249f, 0.131028262406404f, 0.139761942375159f, 0.148420005118273f, 0.157003748809665f, 0.165514438477573f, 0.173953307123438f, 0.182321556793955f, 0.19062035960865f, 0.198850858745165f, 0.207014169384326f, 0.215111379616945f, 0.22314355131421f, 0.231111720963387f, 0.2390169004705f, 0.246860077931526f, 0.254642218373581f, 0.262364264467491f, 0.27002713721306f, 0.27763173659828f, 0.285178942233662f, 0.29266961396282f, 0.300104592450338f, 0.307484699747961f, 0.314810739840034f, 0.322083499169113f, 0.3293037471426f, 0.336472236621213f, 0.343589704390077f, 0.350656871613169f, 0.357674444271816f, 0.364643113587909f, 0.371563556432483f, 0.378436435720245f, 0.385262400790645f, 0.392042087776024f, 0.398776119957368f, 0.405465108108164f, 0.412109650826833f, 0.418710334858185f, 0.425267735404344f, 0.431782416425538f, 0.438254930931155f, 0.444685821261446f, 0.451075619360217f, 0.457424847038875f, 0.46373401623214f, 0.470003629245736f, 0.476234178996372f, 0.482426149244293f, 0.488580014818671f, 0.494696241836107f, 0.500775287912489f, 0.506817602368452f, 0.512823626428664f, 0.518793793415168f, 0.524728528934982f, 0.53062825106217f, 0.536493370514568f, 0.542324290825362f, 0.548121408509688f, 0.553885113226438f, 0.559615787935423f, 0.56531380905006f, 0.570979546585738f, 0.576613364303994f, 0.582215619852664f, 0.587786664902119f, 0.593326845277734f, 0.598836501088704f, 0.60431596685333f, 0.609765571620894f, 0.615185639090233f, 0.62057648772511f, 0.625938430866495f, 0.631271776841858f, 0.636576829071551f, 0.641853886172395f, 0.647103242058538f, 0.65232518603969f, 0.657520002916794f, 0.662687973075237f, 0.667829372575655f, 0.672944473242426f, 0.678033542749897f, 0.683096844706444f, 0.688134638736401f, - }; - - /// - /// - /// - /// - /// - /// - /// - /// Returns the value of ln(x). - /// - public static unsafe float Log(float x) - { - if (x < 0) { - throw new ArgumentOutOfRangeException(); - } - uint input = *(uint*)&x; - - int f = (int)input; - f >>= 23; - f -= 127; - input <<= 9; - input >>= 9; - input += 0b_0011_1111_1000_0000_0000_0000_0000_0000; - float result = *(float*)&input; - uint order = ((uint)(result * 100)) - 100; - - float cache = (result / (1f + (0.01f * order))) - 1; - result = (cache * (-0.25f)) + 0.3333333333333f; - result = (result * cache) - 0.5f; - result = (result * cache) + 1.0f; - result *= cache; - - return - (f * 0.6931471806f) + result + logArray[order]; - } - - public static float Log(float x, float y) - { - return Log(x) / Log(y); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Log" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; + +namespace StgSharp.Mathematics +{ + public static partial class Scalar + { + + private static readonly float[] logArray = { + 0f, 0.00995033085316809f, 0.0198026272961797f, 0.0295588022415444f, 0.0392207131532813f, 0.048790164169432f, 0.0582689081239758f, 0.0676586484738149f, 0.0769610411361284f, 0.0861776962410524f, 0.0953101798043249f, 0.104360015324243f, 0.113328685307003f, 0.122217632724249f, 0.131028262406404f, 0.139761942375159f, 0.148420005118273f, 0.157003748809665f, 0.165514438477573f, 0.173953307123438f, 0.182321556793955f, 0.19062035960865f, 0.198850858745165f, 0.207014169384326f, 0.215111379616945f, 0.22314355131421f, 0.231111720963387f, 0.2390169004705f, 0.246860077931526f, 0.254642218373581f, 0.262364264467491f, 0.27002713721306f, 0.27763173659828f, 0.285178942233662f, 0.29266961396282f, 0.300104592450338f, 0.307484699747961f, 0.314810739840034f, 0.322083499169113f, 0.3293037471426f, 0.336472236621213f, 0.343589704390077f, 0.350656871613169f, 0.357674444271816f, 0.364643113587909f, 0.371563556432483f, 0.378436435720245f, 0.385262400790645f, 0.392042087776024f, 0.398776119957368f, 0.405465108108164f, 0.412109650826833f, 0.418710334858185f, 0.425267735404344f, 0.431782416425538f, 0.438254930931155f, 0.444685821261446f, 0.451075619360217f, 0.457424847038875f, 0.46373401623214f, 0.470003629245736f, 0.476234178996372f, 0.482426149244293f, 0.488580014818671f, 0.494696241836107f, 0.500775287912489f, 0.506817602368452f, 0.512823626428664f, 0.518793793415168f, 0.524728528934982f, 0.53062825106217f, 0.536493370514568f, 0.542324290825362f, 0.548121408509688f, 0.553885113226438f, 0.559615787935423f, 0.56531380905006f, 0.570979546585738f, 0.576613364303994f, 0.582215619852664f, 0.587786664902119f, 0.593326845277734f, 0.598836501088704f, 0.60431596685333f, 0.609765571620894f, 0.615185639090233f, 0.62057648772511f, 0.625938430866495f, 0.631271776841858f, 0.636576829071551f, 0.641853886172395f, 0.647103242058538f, 0.65232518603969f, 0.657520002916794f, 0.662687973075237f, 0.667829372575655f, 0.672944473242426f, 0.678033542749897f, 0.683096844706444f, 0.688134638736401f, + }; + + /// + /// + /// + /// + /// + /// + /// + /// Returns the value of ln(x). + /// + public static unsafe float Log(float x) + { + if (x < 0) { + throw new ArgumentOutOfRangeException(); + } + uint input = *(uint*)&x; + + int f = (int)input; + f >>= 23; + f -= 127; + input <<= 9; + input >>= 9; + input += 0b_0011_1111_1000_0000_0000_0000_0000_0000; + float result = *(float*)&input; + uint order = ((uint)(result * 100)) - 100; + + float cache = (result / (1f + (0.01f * order))) - 1; + result = (cache * (-0.25f)) + 0.3333333333333f; + result = (result * cache) - 0.5f; + result = (result * cache) + 1.0f; + result *= cache; + + return + (f * 0.6931471806f) + result + logArray[order]; + } + + public static float Log(float x, float y) + { + return Log(x) / Log(y); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Pow.cs b/StgSharp.Mathematics/Numeric/Scalar/Pow.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Pow.cs rename to StgSharp.Mathematics/Numeric/Scalar/Pow.cs index 6a3dcc41..23075e54 100644 --- a/StgSharp.Common/Mathematics/Scalar/Pow.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Pow.cs @@ -1,121 +1,121 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Pow" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics -{ - public static unsafe partial class Scalar - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe float Pow(float x, float y) - { - return System.MathF.Pow(x, y); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe double Pow(double x, double y) - { - return System.Math.Pow(x, y); - } - - /// - /// calculate the value of x^y - /// - /// - /// - /// - /// - /// - /// - /// - /// Returns the value of x^y - /// - public static unsafe float PowSlow(float x, float y) - { - /* - * x^y = E ^ ( log( x ) * y ) - * Now define z = | log(x) * y | = m * n - * and m is an integer, and 0.5 < |n| < 1 - * then E ^ z = ( E ^ n ) ^ m - * - * - * As a float number can be expressed in (1+e)*(2^f) - * n = (1+e)/2 - * m = 2 ^ (f + 1) - * - */ - float z, t; - if ((x == 1) || (y == 0)) { - return 1; - } - if ((x == 1) && (y == 0)) { - return float.PositiveInfinity; - } - if ((x == 0) && (y != 0)) { - return 0; - } - - z = Scalar.Log(x) * y; - - bool sign = false; - if (z < 0) - { - sign = true; - z = -z; - } - - if (z < 0.5f) - { - t = 1.0f + (z * (1.0f + (z * (0.5f + (z * (0.1666666667f + (z * (0.0416666666667f + (z * 8.333333333e-3f))))))))); - } else - { - uint zBit = *(uint*)&z; - uint zBitAbs = zBit & 0b_0111_1111_1111_1111_1111_1111_1111_1111; - uint uintm = zBitAbs >> 23; - int m = (*(int*)&uintm) - 126; - - - uint nBit = (zBitAbs & 0b_0000_0000_0111_1111_1111_1111_1111_1111) + 0b_0011_1111_0000_0000_0000_0000_0000_0000; - float n = (*(float*)&nBit) - 1; - - t = 2.718281828f + (n * (2.718281828f + (n * (1.359140914f + (n * (0.4530469714f + (n * (0.1132617429f + (n * 0.02265234857f))))))))); - - for (int i = 0; i < m; i++) { - t = t * t; - } - } - if (sign) { - t = 1 / t; - } - - return t; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Pow" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics +{ + public static unsafe partial class Scalar + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float Pow(float x, float y) + { + return System.MathF.Pow(x, y); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe double Pow(double x, double y) + { + return System.Math.Pow(x, y); + } + + /// + /// calculate the value of x^y + /// + /// + /// + /// + /// + /// + /// + /// + /// Returns the value of x^y + /// + public static unsafe float PowSlow(float x, float y) + { + /* + * x^y = E ^ ( log( x ) * y ) + * Now define z = | log(x) * y | = m * n + * and m is an integer, and 0.5 < |n| < 1 + * then E ^ z = ( E ^ n ) ^ m + * + * + * As a float number can be expressed in (1+e)*(2^f) + * n = (1+e)/2 + * m = 2 ^ (f + 1) + * + */ + float z, t; + if ((x == 1) || (y == 0)) { + return 1; + } + if ((x == 1) && (y == 0)) { + return float.PositiveInfinity; + } + if ((x == 0) && (y != 0)) { + return 0; + } + + z = Scalar.Log(x) * y; + + bool sign = false; + if (z < 0) + { + sign = true; + z = -z; + } + + if (z < 0.5f) + { + t = 1.0f + (z * (1.0f + (z * (0.5f + (z * (0.1666666667f + (z * (0.0416666666667f + (z * 8.333333333e-3f))))))))); + } else + { + uint zBit = *(uint*)&z; + uint zBitAbs = zBit & 0b_0111_1111_1111_1111_1111_1111_1111_1111; + uint uintm = zBitAbs >> 23; + int m = (*(int*)&uintm) - 126; + + + uint nBit = (zBitAbs & 0b_0000_0000_0111_1111_1111_1111_1111_1111) + 0b_0011_1111_0000_0000_0000_0000_0000_0000; + float n = (*(float*)&nBit) - 1; + + t = 2.718281828f + (n * (2.718281828f + (n * (1.359140914f + (n * (0.4530469714f + (n * (0.1132617429f + (n * 0.02265234857f))))))))); + + for (int i = 0; i < m; i++) { + t = t * t; + } + } + if (sign) { + t = 1 / t; + } + + return t; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Random.cs b/StgSharp.Mathematics/Numeric/Scalar/Random.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Random.cs rename to StgSharp.Mathematics/Numeric/Scalar/Random.cs index 05027232..d0451621 100644 --- a/StgSharp.Common/Mathematics/Scalar/Random.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Random.cs @@ -1,126 +1,126 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Random" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Mathematics; - -using System; -using System.Collections.Generic; -using System.Data; -using System.Numerics; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Security.Cryptography; -using System.Text; - -namespace StgSharp.Mathematics -{ - public static unsafe partial class Scalar - { - - private static byte[] randomSeed; - - internal static float currentSeed -#if DEBUG - = 0.5f; - - #else - = Abs(System.DateTime.UtcNow.GetHashCode()); - #endif - - /// - /// returns a random float number between 0 and 1. - /// - /// - /// - /// - public static unsafe float LowProceisionRandom() - { - float seed = currentSeed; - - float sample = Scalar.Pow(Scalar.SeedSqrt(seed), 2); - float sample2 = (sample - seed) / seed; - sample2 = Scalar.Abs(sample2); - - if (sample == 1) { - sample = sample2; - } - - currentSeed = sample; - sample2 *= 1000000; - - float result = sample2 - ((int)sample2); - if (result == 0) - { - currentSeed = sample2 + 0.1f; - result = Scalar.LowProceisionRandom(); - } - return result; - } - - /// - /// - /// - /// - /// - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Random() where T : unmanaged, IConvertible, INumber - - { - if (randomSeed == null) - { - randomSeed = new byte[64]; - string originSeed = - ($"{((Assembly.GetEntryAssembly() == null) ? (Assembly.GetAssembly(typeof(World))!) : - Assembly.GetEntryAssembly())}") + ($"{DateTime.UtcNow.ToString("o")}"); - randomSeed = SHA256.HashData(Encoding.UTF8.GetBytes(originSeed)); - } - randomSeed = SHA256.HashData(randomSeed); - fixed (byte* bptr = randomSeed) { - return *(T*)bptr; - } - } - - /// - /// Generates a random seed in int value. - /// - /// - /// - /// - public static unsafe int RandomSeed() - { - float seedValue1 = LowProceisionRandom(); - float seedValue2 = LowProceisionRandom(); - uint seedValueBits = *(uint*)&seedValue1; - - float seedValue = seedValueBits * seedValue2; - - return *(int*)&seedValue; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Random" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; + +using System; +using System.Collections.Generic; +using System.Data; +using System.Numerics; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Security.Cryptography; +using System.Text; + +namespace StgSharp.Mathematics +{ + public static unsafe partial class Scalar + { + + private static byte[] randomSeed; + + internal static float currentSeed +#if DEBUG + = 0.5f; + + #else + = Abs(System.DateTime.UtcNow.GetHashCode()); + #endif + + /// + /// returns a random float number between 0 and 1. + /// + /// + /// + /// + public static unsafe float LowProceisionRandom() + { + float seed = currentSeed; + + float sample = Scalar.Pow(Scalar.SeedSqrt(seed), 2); + float sample2 = (sample - seed) / seed; + sample2 = Scalar.Abs(sample2); + + if (sample == 1) { + sample = sample2; + } + + currentSeed = sample; + sample2 *= 1000000; + + float result = sample2 - ((int)sample2); + if (result == 0) + { + currentSeed = sample2 + 0.1f; + result = Scalar.LowProceisionRandom(); + } + return result; + } + + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Random() where T : unmanaged, IConvertible, INumber + + { + if (randomSeed == null) + { + randomSeed = new byte[64]; + string originSeed = + ($"{((Assembly.GetEntryAssembly() == null) ? (Assembly.GetAssembly(typeof(World))!) : + Assembly.GetEntryAssembly())}") + ($"{DateTime.UtcNow.ToString("o")}"); + randomSeed = SHA256.HashData(Encoding.UTF8.GetBytes(originSeed)); + } + randomSeed = SHA256.HashData(randomSeed); + fixed (byte* bptr = randomSeed) { + return *(T*)bptr; + } + } + + /// + /// Generates a random seed in int value. + /// + /// + /// + /// + public static unsafe int RandomSeed() + { + float seedValue1 = LowProceisionRandom(); + float seedValue2 = LowProceisionRandom(); + uint seedValueBits = *(uint*)&seedValue1; + + float seedValue = seedValueBits * seedValue2; + + return *(int*)&seedValue; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/SignOf.cs b/StgSharp.Mathematics/Numeric/Scalar/SignOf.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/SignOf.cs rename to StgSharp.Mathematics/Numeric/Scalar/SignOf.cs index a65330be..9bb5a8ba 100644 --- a/StgSharp.Common/Mathematics/Scalar/SignOf.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/SignOf.cs @@ -1,65 +1,65 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="SignOf" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics -{ - public static unsafe partial class Scalar - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe int SignOf(float x) - { - if (x == 0) { - return 0; - } - if (x > 0) { - return 1; - } - return -1; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe int SignOf(int x) - { - if (x == 0) { - return 0; - } - if (x > 0) { - return 1; - } - return -1; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="SignOf" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics +{ + public static unsafe partial class Scalar + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int SignOf(float x) + { + if (x == 0) { + return 0; + } + if (x > 0) { + return 1; + } + return -1; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int SignOf(int x) + { + if (x == 0) { + return 0; + } + if (x > 0) { + return 1; + } + return -1; + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Sin.cs b/StgSharp.Mathematics/Numeric/Scalar/Sin.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Sin.cs rename to StgSharp.Mathematics/Numeric/Scalar/Sin.cs index 728c041a..b113ddf4 100644 --- a/StgSharp.Common/Mathematics/Scalar/Sin.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Sin.cs @@ -1,47 +1,47 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Sin" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Net.NetworkInformation; -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics -{ - public static partial class Scalar - { - - public const float Pi = 3.1415926f; - public const double PiDouble = System.Math.PI; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe float Sin(float x) - { - return MathF.Sin(x); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Sin" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Net.NetworkInformation; +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics +{ + public static partial class Scalar + { + + public const float Pi = 3.1415926f; + public const double PiDouble = System.Math.PI; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float Sin(float x) + { + return MathF.Sin(x); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Sqrt.cs b/StgSharp.Mathematics/Numeric/Scalar/Sqrt.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Sqrt.cs rename to StgSharp.Mathematics/Numeric/Scalar/Sqrt.cs index 7d3a5c71..6f47330b 100644 --- a/StgSharp.Common/Mathematics/Scalar/Sqrt.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Sqrt.cs @@ -1,74 +1,74 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Sqrt" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics -{ - public static partial class Scalar - { - - public static unsafe float SeedSqrt(float x) - { - ArgumentOutOfRangeException.ThrowIfNegative(x); - if (x <= 1e-12) { - return 0; - } - uint a = *(uint*)&x; - uint f = a; - f >>= 23; - f /= 2; - f += 64; - a -= 0b_0011_1111_0000_0000_0000_0000_0000_0000; - uint e = a << 8; - e >>= 8; - e *= 0b_1101_0001; - e >>= 24; - e += 0b_0000_0000_0001_0000_1010_1000_1110_0010; - f <<= 23; - e += f; - float result = *(float*)&e; - result = (result + (x / result)) / 2; - return (result + (x / result)) / 2; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Sqrt(float x) - { - return MathF.Sqrt(x); - /**/ - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double Sqrt(double x) - { - return System.Math.Sqrt(x); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Sqrt" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics +{ + public static partial class Scalar + { + + public static unsafe float SeedSqrt(float x) + { + ArgumentOutOfRangeException.ThrowIfNegative(x); + if (x <= 1e-12) { + return 0; + } + uint a = *(uint*)&x; + uint f = a; + f >>= 23; + f /= 2; + f += 64; + a -= 0b_0011_1111_0000_0000_0000_0000_0000_0000; + uint e = a << 8; + e >>= 8; + e *= 0b_1101_0001; + e >>= 24; + e += 0b_0000_0000_0001_0000_1010_1000_1110_0010; + f <<= 23; + e += f; + float result = *(float*)&e; + result = (result + (x / result)) / 2; + return (result + (x / result)) / 2; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Sqrt(float x) + { + return MathF.Sqrt(x); + /**/ + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double Sqrt(double x) + { + return System.Math.Sqrt(x); + } + + } +} diff --git a/StgSharp.Common/Mathematics/Scalar/Tan.cs b/StgSharp.Mathematics/Numeric/Scalar/Tan.cs similarity index 97% rename from StgSharp.Common/Mathematics/Scalar/Tan.cs rename to StgSharp.Mathematics/Numeric/Scalar/Tan.cs index 7659f27c..55bf2cc1 100644 --- a/StgSharp.Common/Mathematics/Scalar/Tan.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/Tan.cs @@ -1,43 +1,43 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Tan" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics -{ - public static partial class Scalar - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Tan(float x) - { - return MathF.Tan(x); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Tan" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics +{ + public static partial class Scalar + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Tan(float x) + { + return MathF.Tan(x); + } + + } +} diff --git a/StgSharp.Model/Step/Items/StepTriple.cs b/StgSharp.Model/Step/Items/StepTriple.cs index 3219e8a7..fa6438c0 100644 --- a/StgSharp.Model/Step/Items/StepTriple.cs +++ b/StgSharp.Model/Step/Items/StepTriple.cs @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using StgSharp.Model.Step; using StgSharp.Script; using StgSharp.Script.Express; diff --git a/StgSharp.Model/Step/Items/StepVertex.cs b/StgSharp.Model/Step/Items/StepVertex.cs index 5bb932d8..2fd94216 100644 --- a/StgSharp.Model/Step/Items/StepVertex.cs +++ b/StgSharp.Model/Step/Items/StepVertex.cs @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using StgSharp.Model.Step; using StgSharp.Script; using StgSharp.Script.Express; diff --git a/StgSharp.Model/Step/StepDataParser.cs b/StgSharp.Model/Step/StepDataParser.cs index 4572bbbe..db040c30 100644 --- a/StgSharp.Model/Step/StepDataParser.cs +++ b/StgSharp.Model/Step/StepDataParser.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="StepDataParser" // Project: StgSharp @@ -28,7 +28,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using StgSharp.Script.Express; using System; diff --git a/StgSharp.Native/StgSharp.Native.vcxproj b/StgSharp.Native/StgSharp.Native.vcxproj index f4fadcaf..94b69882 100644 --- a/StgSharp.Native/StgSharp.Native.vcxproj +++ b/StgSharp.Native/StgSharp.Native.vcxproj @@ -155,7 +155,6 @@ - diff --git a/StgSharp.Native/StgSharp.Native.vcxproj.filters b/StgSharp.Native/StgSharp.Native.vcxproj.filters index ff16b8a8..cb29bef4 100644 --- a/StgSharp.Native/StgSharp.Native.vcxproj.filters +++ b/StgSharp.Native/StgSharp.Native.vcxproj.filters @@ -54,9 +54,6 @@ 源文件 - - 源文件 - 源文件 diff --git a/StgSharp.Native/sn-head/sn_intrinsic.h b/StgSharp.Native/sn-head/sn_intrinsic.h index 74871335..01d77e95 100644 --- a/StgSharp.Native/sn-head/sn_intrinsic.h +++ b/StgSharp.Native/sn-head/sn_intrinsic.h @@ -59,41 +59,22 @@ typedef union scalar_pack { #define LEFT_RIGHT_ANS_SCALAR_PARAM 4 #define ANS_SCALAR_PARAM 5 -typedef struct matrix_op_mode { - int16_t operation_style; /* PANEL_OP, BUFFER_OP, KERNEL_OP */ - int16_t parameter_style; /* RIGHT_ANS_PARAM, LEFT_RIGHT_ANS_PARAM, e.g. */ -} matrix_op_mode; - /* Mirrors StgSharp.Mathematics.Numeric.MatrixParallelTaskPackage (128 bytes). */ -#define MAT_TASK(T) \ - struct { \ - MAT_KERNEL(T) * left; /* Offset 0: left matrix kernel base */ \ - MAT_KERNEL(T) * right; /* Offset 8: right matrix kernel base */ \ - MAT_KERNEL(T) * result; /* Offset 16: result matrix kernel base */ \ - int32_t element_size; /* Offset 24: sizeof(T) */ \ - int32_t reserved_ptr0; /* Offset 28: reserved/extension slot */ \ - int32_t left_prim_offset; /* Offset 32 */ \ - int32_t left_prim_stride; /* Offset 36 */ \ - int32_t left_sec_offset; /* Offset 40 */ \ - int32_t left_sec_stride; /* Offset 44 */ \ - int32_t right_prim_offset; /* Offset 48 */ \ - int32_t right_prim_stride; /* Offset 52 */ \ - int32_t right_sec_offset; /* Offset 56 */ \ - int32_t right_sec_stride; /* Offset 60 */ \ - int32_t result_prim_offset; /* Offset 64 */ \ - int32_t result_prim_stride; /* Offset 68 */ \ - int32_t result_sec_offset; /* Offset 72 */ \ - int32_t result_sec_stride; /* Offset 76 */ \ - scalar_pack *scalar; /* Offset 80 */ \ - void *compute_handle; /* Offset 88 */ \ - int32_t prim_count; /* Offset 96 */ \ - matrix_op_mode compute_mode; /* Offset 100 */ \ - int32_t sec_count; /* Offset 104 */ \ - int32_t reserved_int0; /* Offset 108 */ \ - int32_t prim_tile_offset; /* Offset 112 */ \ - int32_t sec_tile_offset; /* Offset 116 */ \ - int32_t prim_cols_in_tile; /* Offset 120 */ \ - int32_t sec_cols_in_tile; /* Offset 124 */ \ +#define MAT_TASK(T) \ + struct { \ + MAT_KERNEL(T) * mat_0; /* Offset 0: 1st matrix kernel base */ \ + MAT_KERNEL(T) * mat_1; /* Offset 8: 2nd matrix kernel base */ \ + MAT_KERNEL(T) * mat_2; /* Offset 16: 3rd matrix kernel base */ \ + void *scalar; /* Offset 24: scalar pack */ \ + int32_t i; /* Offset 32: row index of the result tile */ \ + int32_t j; /* Offset 36: column index of the result tile */ \ + int32_t k; /* Offset 40: column index of the result tile */ \ + int32_t common_i; /* Offset 44: row index of the result tile */ \ + int32_t common_j; /* Offset 48: column index of the result tile */ \ + int32_t common_k; /* Offset 52: column index of the result tile */ \ + uint32_t mask; /* Offset 56: mask for task schedualing, not useful in C side */ \ + uint32_t reverse; /* Offset 60: reserved for future use */ \ + scalar_pack padding; /* Offset 64: padding to make the struct size 128 bytes */ \ } typedef struct matrix_task matrix_task; @@ -103,6 +84,9 @@ static_assert(sizeof(matrix_task) == 128, "matrix_parallel_task_package size mis static_assert(sizeof(MAT_TASK(float)) == 128, "matrix_parallel_task_package size mismatch"); #endif +typedef void(SN_DECL *UNIFIKERNELPROC)(matrix_task *task); +#define UNIFIKERNRLPROC(T_arch, T_feature, T_op) mat_proc_##T_op##_##T_arch##_##T_feature + #pragma region matrix buffer operation function type typedef void(SN_DECL *BUF_PROC_AS)(mat_kernel *ans, scalar_pack *scalar, int count); @@ -247,17 +231,15 @@ typedef int(SN_DECL *INDEX_PAIR)(short const *stram, uint32_t target, int length #pragma endregion typedef struct mat_intrinsic { - BUF_PROC_LRA buffer_add; - BUF_PROC_AS buffer_fill; - BUF_PROC_RAS buffer_scalar_mul; - BUF_PROC_LRA buffer_sub; - KER_PROC_RA buffer_transpose; - PANEL_PROC build_panel; - PANEL_PROC clear_panel; - PNL_PROC_LRA ker_fma; - KERTILE_PROC_LRA ker_tile_fma; - PIVOTPROC pivot; - PANEL_PROC store_panel; + UNIFIKERNELPROC buffer_add; + UNIFIKERNELPROC buffer_fill; + UNIFIKERNELPROC buffer_scalar_mul; + UNIFIKERNELPROC buffer_sub; + UNIFIKERNELPROC buffer_transpose; + UNIFIKERNELPROC clear_panel; + UNIFIKERNELPROC ker_fma; + UNIFIKERNELPROC ker_tile_fma; + UNIFIKERNELPROC pivot; } mat_intrinsic; @@ -270,21 +252,7 @@ typedef struct sn_intrinsic { mat_intrinsic mat[4]; } sn_intrinsic; -typedef enum elment_type { F32 = 0, F64 = 1, I32 = 2, I64 = 3 } element_type; - -typedef enum most_advanced_instruction { -#ifdef _MSC_VER - SSE = __IA_SUPPORT_SSE42, - AVX256 = __IA_SUPPORT_VECTOR256, - AVX512 = __IA_SUPPORT_VECTOR512, - NEON -#else - SSE, - AVX256, - AVX512, - NEON -#endif -} most_advanced_instruction; +typedef enum elment_mask { F32 = 0, F64 = 1, I32 = 2, I64 = 3 } element_mask; #include "sn_target.h" diff --git a/StgSharp.Native/sn-head/sn_matkernel.h b/StgSharp.Native/sn-head/sn_matkernel.h index 1c7ca73b..27cb3b0c 100644 --- a/StgSharp.Native/sn-head/sn_matkernel.h +++ b/StgSharp.Native/sn-head/sn_matkernel.h @@ -125,7 +125,7 @@ extern __declspec(align(64)) sn_zero_kernel_u64 SN_ZERO_KERNEL; int col_length, int row_length, \ int col_index, int row_index) -/* Declarations for AVX float variant */ +/* Declarations for AVX float variant DECLARE_BUILD_PANEL(avx, float); DECLARE_BUILD_PANEL(512, float); @@ -136,5 +136,6 @@ DECLARE_STORE_PANEL(512, float); DECLARE_BUILD_PANEL(512, double); DECLARE_STORE_PANEL(512, double); +/**/ #endif /* SN_MATKERNEL */ diff --git a/StgSharp.Native/sn-head/sn_task_expand.h b/StgSharp.Native/sn-head/sn_task_expand.h new file mode 100644 index 00000000..e69de29b diff --git a/StgSharp.Native/sn-src/load_intrinsic.x86.c b/StgSharp.Native/sn-src/load_intrinsic.x86.c index e7d0cac5..2e56ff57 100644 --- a/StgSharp.Native/sn-src/load_intrinsic.x86.c +++ b/StgSharp.Native/sn-src/load_intrinsic.x86.c @@ -56,24 +56,20 @@ void load_intrinsic_sse(sn_intrinsic *context, SIMDID id) context->mat[F32].buffer_scalar_mul = BUF_PROC(float, sse, , scalar_mul); context->mat[F32].buffer_sub = BUF_PROC(float, sse, , sub); context->mat[F32].buffer_transpose = KER_PROC(float, sse, , transpose); - context->mat[F32].build_panel = NULL; context->mat[F32].clear_panel = PNL_PROC(float, sse, , clear); context->mat[F32].ker_fma = KER_PROC(float, sse, , fma); context->mat[F32].ker_tile_fma = KERTILE_PROC(float, sse, , fma); context->mat[F32].pivot = NULL; - context->mat[F32].store_panel = NULL; context->mat[F64].buffer_add = BUF_PROC(double, sse, , add); context->mat[F64].buffer_fill = BUF_PROC(double, sse, , fill); context->mat[F64].buffer_scalar_mul = BUF_PROC(double, sse, , scalar_mul); context->mat[F64].buffer_sub = BUF_PROC(double, sse, , sub); context->mat[F64].buffer_transpose = NULL; - context->mat[F64].build_panel = NULL; context->mat[F64].clear_panel = PNL_PROC(double, sse, , clear); context->mat[F64].ker_fma = KER_PROC(double, sse, , fma); context->mat[F64].ker_tile_fma = KERTILE_PROC(double, sse, , fma); context->mat[F64].pivot = NULL; - context->mat[F64].store_panel = NULL; context->vec_f32_normalize_3 = f32_normalize; } @@ -93,28 +89,24 @@ void load_intrinsic_avx(sn_intrinsic *context, SIMDID id) context->mat[F32].buffer_scalar_mul = BUF_PROC(float, avx, , scalar_mul); context->mat[F32].buffer_sub = BUF_PROC(float, avx, , sub); context->mat[F32].buffer_transpose = KER_PROC(float, avx, , transpose); - context->mat[F32].build_panel = BUILD_PANEL(avx, float); context->mat[F32].clear_panel = PNL_PROC(float, avx, , clear); context->mat[F32].ker_fma = is_fma ? KER_PROC(float, avx, , fma) : KER_PROC(float, avx, _fma, fma); context->mat[F32].ker_tile_fma = is_fma ? KERTILE_PROC(float, avx, , fma) : KERTILE_PROC(float, avx, _fma, fma); context->mat[F32].pivot = NULL; - context->mat[F32].store_panel = STORE_PANEL(avx, float); context->mat[F64].buffer_add = BUF_PROC(double, avx, , add); context->mat[F64].buffer_fill = BUF_PROC(double, avx, , fill); context->mat[F64].buffer_scalar_mul = BUF_PROC(double, avx, , scalar_mul); context->mat[F64].buffer_sub = BUF_PROC(double, avx, , sub); context->mat[F64].buffer_transpose = NULL; - context->mat[F64].build_panel = NULL; context->mat[F64].clear_panel = PNL_PROC(double, avx, , clear); context->mat[F64].ker_fma = is_fma ? KER_PROC(double, avx, , fma) : KER_PROC(double, avx, _fma, fma); context->mat[F64].ker_tile_fma = is_fma ? KERTILE_PROC(double, avx, , fma) : KERTILE_PROC(double, avx, _fma, fma); context->mat[F64].pivot = NULL; - context->mat[F64].store_panel = NULL; context->vec_f32_normalize_3 = f32_normalize; } @@ -130,24 +122,20 @@ void load_intrinsic_512(sn_intrinsic *context, SIMDID id) context->mat[F32].buffer_scalar_mul = BUF_PROC(float, 512, , scalar_mul); context->mat[F32].buffer_sub = BUF_PROC(float, 512, , sub); context->mat[F32].buffer_transpose = KER_PROC(float, 512, , transpose); - context->mat[F32].build_panel = BUILD_PANEL(512, float); context->mat[F32].clear_panel = PNL_PROC(float, 512, , clear); context->mat[F32].ker_fma = KER_PROC(float, 512, , fma); context->mat[F32].ker_tile_fma = KERTILE_PROC(float, 512, , fma); context->mat[F32].pivot = NULL; - context->mat[F32].store_panel = STORE_PANEL(512, float); context->mat[F64].buffer_add = BUF_PROC(double, 512, , add); context->mat[F64].buffer_fill = BUF_PROC(double, 512, , fill); context->mat[F64].buffer_scalar_mul = BUF_PROC(double, 512, , scalar_mul); context->mat[F64].buffer_sub = BUF_PROC(double, 512, , sub); context->mat[F64].buffer_transpose = NULL; - context->mat[F64].build_panel = BUILD_PANEL(512, double); context->mat[F64].clear_panel = PNL_PROC(double, 512, , clear); context->mat[F64].ker_fma = KER_PROC(double, 512, , fma); context->mat[F64].ker_tile_fma = KERTILE_PROC(double, 512, , fma); context->mat[F64].pivot = NULL; - context->mat[F64].store_panel = STORE_PANEL(512, double); context->vec_f32_normalize_3 = f32_normalize; } diff --git a/StgSharp.Native/sn-src/m.fma.x86.c b/StgSharp.Native/sn-src/m.fma.x86.c index 118e2362..f4da4d0b 100644 --- a/StgSharp.Native/sn-src/m.fma.x86.c +++ b/StgSharp.Native/sn-src/m.fma.x86.c @@ -244,33 +244,33 @@ DECLARE_KER_PROC_LEFT_RIGHT_ANS(double, avx, , fma) register __m256d ccol; /* Column 0 */ - ccol = _mm256_load_pd((double *)&ans->f32_y[0]); + ccol = _mm256_load_pd((double *)&ans->f64_y[0]); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a0, _mm256_permute4x64_pd(b0, _FMA_SELECT(0)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a1, _mm256_permute4x64_pd(b0, _FMA_SELECT(1)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a2, _mm256_permute4x64_pd(b0, _FMA_SELECT(2)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a3, _mm256_permute4x64_pd(b0, _FMA_SELECT(3)))); - ans->f64_y[0] = ccol; + _mm256_store_pd((double *)&ans->f64_y[0], ccol); /* Column 1 */ - ccol = _mm256_load_pd((double *)&ans->f32_y[1]); + ccol = _mm256_load_pd((double *)&ans->f64_y[1]); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a0, _mm256_permute4x64_pd(b1, _FMA_SELECT(0)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a1, _mm256_permute4x64_pd(b1, _FMA_SELECT(1)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a2, _mm256_permute4x64_pd(b1, _FMA_SELECT(2)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a3, _mm256_permute4x64_pd(b1, _FMA_SELECT(3)))); - ans->f64_y[1] = ccol; + _mm256_store_pd((double *)&ans->f64_y[1], ccol); /* Column 2 */ - ccol = _mm256_load_pd((double *)&ans->f32_y[2]); + ccol = _mm256_load_pd((double *)&ans->f64_y[2]); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a0, _mm256_permute4x64_pd(b2, _FMA_SELECT(0)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a1, _mm256_permute4x64_pd(b2, _FMA_SELECT(1)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a2, _mm256_permute4x64_pd(b2, _FMA_SELECT(2)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a3, _mm256_permute4x64_pd(b2, _FMA_SELECT(3)))); - ans->f64_y[2] = ccol; + _mm256_store_pd((double *)&ans->f64_y[2], ccol); /* Column 3 */ - ccol = _mm256_load_pd((double *)&ans->f32_y[3]); + ccol = _mm256_load_pd((double *)&ans->f64_y[3]); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a0, _mm256_permute4x64_pd(b3, _FMA_SELECT(0)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a1, _mm256_permute4x64_pd(b3, _FMA_SELECT(1)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a2, _mm256_permute4x64_pd(b3, _FMA_SELECT(2)))); ccol = _mm256_add_pd(ccol, _mm256_mul_pd(a3, _mm256_permute4x64_pd(b3, _FMA_SELECT(3)))); - ans->f64_y[3] = ccol; + _mm256_store_pd((double *)&ans->f64_y[3], ccol); } DECLARE_KER_PROC_LEFT_RIGHT_ANS(double, avx, _fma, fma) @@ -288,33 +288,33 @@ DECLARE_KER_PROC_LEFT_RIGHT_ANS(double, avx, _fma, fma) register __m256d ccol; /* Column 0 */ - ccol = _mm256_load_pd((double *)&ans->f32_y[0]); + ccol = _mm256_load_pd((double *)&ans->f64_y[0]); ccol = _mm256_fmadd_pd(a0, _mm256_permute4x64_pd(b0, _FMA_SELECT(0)), ccol); ccol = _mm256_fmadd_pd(a1, _mm256_permute4x64_pd(b0, _FMA_SELECT(1)), ccol); ccol = _mm256_fmadd_pd(a2, _mm256_permute4x64_pd(b0, _FMA_SELECT(2)), ccol); ccol = _mm256_fmadd_pd(a3, _mm256_permute4x64_pd(b0, _FMA_SELECT(3)), ccol); - ans->f64_y[0] = ccol; + _mm256_store_pd((double *)&ans->f64_y[0], ccol); /* Column 1 */ - ccol = _mm256_load_pd((double *)&ans->f32_y[1]); + ccol = _mm256_load_pd((double *)&ans->f64_y[1]); ccol = _mm256_fmadd_pd(a0, _mm256_permute4x64_pd(b1, _FMA_SELECT(0)), ccol); ccol = _mm256_fmadd_pd(a1, _mm256_permute4x64_pd(b1, _FMA_SELECT(1)), ccol); ccol = _mm256_fmadd_pd(a2, _mm256_permute4x64_pd(b1, _FMA_SELECT(2)), ccol); ccol = _mm256_fmadd_pd(a3, _mm256_permute4x64_pd(b1, _FMA_SELECT(3)), ccol); - ans->f64_y[1] = ccol; + _mm256_store_pd((double *)&ans->f64_y[1], ccol); /* Column 2 */ - ccol = _mm256_load_pd((double *)&ans->f32_y[2]); + ccol = _mm256_load_pd((double *)&ans->f64_y[2]); ccol = _mm256_fmadd_pd(a0, _mm256_permute4x64_pd(b2, _FMA_SELECT(0)), ccol); ccol = _mm256_fmadd_pd(a1, _mm256_permute4x64_pd(b2, _FMA_SELECT(1)), ccol); ccol = _mm256_fmadd_pd(a2, _mm256_permute4x64_pd(b2, _FMA_SELECT(2)), ccol); ccol = _mm256_fmadd_pd(a3, _mm256_permute4x64_pd(b2, _FMA_SELECT(3)), ccol); - ans->f64_y[2] = ccol; + _mm256_store_pd((double *)&ans->f64_y[2], ccol); /* Column 3 */ - ccol = _mm256_load_pd((double *)&ans->f32_y[3]); + ccol = _mm256_load_pd((double *)&ans->f64_y[3]); ccol = _mm256_fmadd_pd(a0, _mm256_permute4x64_pd(b3, _FMA_SELECT(0)), ccol); ccol = _mm256_fmadd_pd(a1, _mm256_permute4x64_pd(b3, _FMA_SELECT(1)), ccol); ccol = _mm256_fmadd_pd(a2, _mm256_permute4x64_pd(b3, _FMA_SELECT(2)), ccol); ccol = _mm256_fmadd_pd(a3, _mm256_permute4x64_pd(b3, _FMA_SELECT(3)), ccol); - ans->f64_y[3] = ccol; + _mm256_store_pd((double *)&ans->f64_y[3], ccol); } DECLARE_KER_PROC_LEFT_RIGHT_ANS(double, 512, , fma) @@ -359,8 +359,8 @@ DECLARE_KER_PROC_LEFT_RIGHT_ANS(double, 512, , fma) c01 = _mm512_fmadd_pd(a30, b01_perm, c01); c23 = _mm512_fmadd_pd(a12, b23_perm, c23); - ans->f64_z[0] = c01; - ans->f64_z[1] = c23; + _mm512_store_pd((double *)&ans->f64_z[0], c01); + _mm512_store_pd((double *)&ans->f64_z[1], c23); } #endif diff --git a/StgSharp.Native/sn-src/m.fma_tile.x86.c b/StgSharp.Native/sn-src/m.fma_tile.x86.c index 6af7ebba..03a2d9ff 100644 --- a/StgSharp.Native/sn-src/m.fma_tile.x86.c +++ b/StgSharp.Native/sn-src/m.fma_tile.x86.c @@ -277,7 +277,7 @@ DECLARE_KERTILE_PROC_LEFT_RIGHT_ANS(float, 512, , fma) b = _mm_shuffle_pd(b_hi, b_hi, 0x3); \ c##i##_lo = _mm_add_pd(c##i##_lo, _mm_mul_pd(a_lo, b)); \ c##i##_hi = _mm_add_pd(c##i##_hi, _mm_mul_pd(a_hi, b)); \ - } while (0); + } while (0) DECLARE_KERTILE_PROC_LEFT_RIGHT_ANS(double, sse, , fma) { @@ -300,13 +300,13 @@ DECLARE_KERTILE_PROC_LEFT_RIGHT_ANS(double, sse, , fma) const *left_cur = left + GET_INDEX(ansHeight, i, k), const *right_cur = right + GET_INDEX(commonK, j, k); // GetKernelAddressUnsafe - DOUBLE_KERNEL_FMA_CYCLE(0) + DOUBLE_KERNEL_FMA_CYCLE(0); - DOUBLE_KERNEL_FMA_CYCLE(1) + DOUBLE_KERNEL_FMA_CYCLE(1); - DOUBLE_KERNEL_FMA_CYCLE(2) + DOUBLE_KERNEL_FMA_CYCLE(2); - DOUBLE_KERNEL_FMA_CYCLE(3) + DOUBLE_KERNEL_FMA_CYCLE(3); } _mm_store_pd(ans->f64_x + (0 * 2 + 0), c0_lo); diff --git a/StgSharpDebug/RenderStream/Partical.cs b/StgSharpDebug/RenderStream/Partical.cs index e99510c2..9d82f644 100644 --- a/StgSharpDebug/RenderStream/Partical.cs +++ b/StgSharpDebug/RenderStream/Partical.cs @@ -30,7 +30,7 @@ using StgSharp.Geometries; using StgSharp.Graphics; using StgSharp.Graphics.OpenGL; using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; +using StgSharp.Mathematics.Graphics; using StgSharp.Timing; using System; diff --git a/StgSharpDevelop.sln b/StgSharpDevelop.sln index 7eaab1e3..989ddf29 100644 --- a/StgSharpDevelop.sln +++ b/StgSharpDevelop.sln @@ -34,6 +34,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StgSharp.Mathematics", "Stg EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StgSharp.RegularAnalysis", "StgSharp.RegularAnalysis\StgSharp.RegularAnalysis.csproj", "{46339874-C6B8-4361-997E-2E30387E51F9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StgsSharp.Graphics", "StgsSharp.Graphics\StgsSharp.Graphics.csproj", "{80CD3DDE-0642-451D-82DF-0DE422FC6E34}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 @@ -152,6 +154,18 @@ Global {46339874-C6B8-4361-997E-2E30387E51F9}.Release|ARM64.Build.0 = Release|Any CPU {46339874-C6B8-4361-997E-2E30387E51F9}.Release|x64.ActiveCfg = Release|Any CPU {46339874-C6B8-4361-997E-2E30387E51F9}.Release|x64.Build.0 = Release|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.Debug|ARM64.Build.0 = Debug|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.Debug|x64.ActiveCfg = Debug|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.Debug|x64.Build.0 = Debug|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.PerformanceDebug|ARM64.ActiveCfg = Debug|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.PerformanceDebug|ARM64.Build.0 = Debug|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.PerformanceDebug|x64.ActiveCfg = Debug|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.PerformanceDebug|x64.Build.0 = Debug|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.Release|ARM64.ActiveCfg = Release|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.Release|ARM64.Build.0 = Release|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.Release|x64.ActiveCfg = Release|Any CPU + {80CD3DDE-0642-451D-82DF-0DE422FC6E34}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/StgSharp.Common/Graphics/CPUanimation/IImageProvider.cs b/StgsSharp.Graphics/CPUanimation/IImageProvider.cs similarity index 97% rename from StgSharp.Common/Graphics/CPUanimation/IImageProvider.cs rename to StgsSharp.Graphics/CPUanimation/IImageProvider.cs index 1ce1b866..63095bd9 100644 --- a/StgSharp.Common/Graphics/CPUanimation/IImageProvider.cs +++ b/StgsSharp.Graphics/CPUanimation/IImageProvider.cs @@ -1,40 +1,40 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="IImageProvider" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Graphics -{ - public interface IImageProvider - { - - Image ProvideImage(); - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="IImageProvider" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Graphics +{ + public interface IImageProvider + { + + Image ProvideImage(); + + } +} diff --git a/StgSharp.Common/Graphics/CPUanimation/ImageHelper.cs b/StgsSharp.Graphics/CPUanimation/ImageHelper.cs similarity index 97% rename from StgSharp.Common/Graphics/CPUanimation/ImageHelper.cs rename to StgsSharp.Graphics/CPUanimation/ImageHelper.cs index 8e31694e..559e4f06 100644 --- a/StgSharp.Common/Graphics/CPUanimation/ImageHelper.cs +++ b/StgsSharp.Graphics/CPUanimation/ImageHelper.cs @@ -1,83 +1,83 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ImageHelper" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Text; - -namespace StgSharp.Graphics -{ - public static class ImageHelper - { - - public static void Resize(Image i, int width, int height, ImageMovement move) - { - if (i == null) { - throw new ArgumentNullException(nameof(i)); - } - if (i.Size == (width, height)) { - return; - } - if (!Enum.IsDefined(typeof(ImageMovement), move)) { - throw new InvalidEnumArgumentException(nameof(move)); - } - byte[] oldData = i.Data; - i.Data = new byte[width * height * i.PixelSize]; - i.Height = height; - i.Width = width; - i.PixelUpdateCount++; - switch (move) - { - case ImageMovement.Discard: - break; - case ImageMovement.Top: - break; - default: - throw new NotImplementedException(); - } - } - - } - - [Flags] - public enum ImageMovement - { -#pragma warning disable CA1008 - Discard = 0, - #pragma warning restore CA1008 - Top = 1, - Bottom = 2, - Left = 4, - Right = 8, - TopLeft = Top | Left, - BottomLeft = Bottom | Left, - TopRight = Top | Right, - BottomRight = Bottom | Right, - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ImageHelper" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; + +namespace StgSharp.Graphics +{ + public static class ImageHelper + { + + public static void Resize(Image i, int width, int height, ImageMovement move) + { + if (i == null) { + throw new ArgumentNullException(nameof(i)); + } + if (i.Size == (width, height)) { + return; + } + if (!Enum.IsDefined(typeof(ImageMovement), move)) { + throw new InvalidEnumArgumentException(nameof(move)); + } + byte[] oldData = i.Data; + i.Data = new byte[width * height * i.PixelSize]; + i.Height = height; + i.Width = width; + i.PixelUpdateCount++; + switch (move) + { + case ImageMovement.Discard: + break; + case ImageMovement.Top: + break; + default: + throw new NotImplementedException(); + } + } + + } + + [Flags] + public enum ImageMovement + { +#pragma warning disable CA1008 + Discard = 0, + #pragma warning restore CA1008 + Top = 1, + Bottom = 2, + Left = 4, + Right = 8, + TopLeft = Top | Left, + BottomLeft = Bottom | Left, + TopRight = Top | Right, + BottomRight = Bottom | Right, + + } +} diff --git a/StgSharp.Common/Mathematics/Graphic/Camera.cs b/StgsSharp.Graphics/Camera.cs similarity index 95% rename from StgSharp.Common/Mathematics/Graphic/Camera.cs rename to StgsSharp.Graphics/Camera.cs index 7d3c1855..56d7fe0f 100644 --- a/StgSharp.Common/Mathematics/Graphic/Camera.cs +++ b/StgsSharp.Graphics/Camera.cs @@ -1,306 +1,306 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Camera" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using StgSharp.Graphics.ShaderEdit; - -using System; - -namespace StgSharp.Mathematics.Graphic -{ - public sealed class Camera : IglConvertable - { - - private bool _isLookAtAvailable; - internal Matrix44 _lookAt; - internal Matrix44 _projection; - internal Matrix44 cameraAtt; - internal Matrix44 rotation; - internal Matrix44 rotationAtt; - internal Radius _pitch; - internal Radius _row; - internal Radius _yaw; - internal Uniform convertedUniform; - internal Vec3 _target, up; - - public Camera() - { - cameraAtt = Matrix44.Unit; - _target = Vec3.Zero; - up = Vec3.Zero; - _isLookAtAvailable = false; - _lookAt = Matrix44.Unit; - rotationAtt = Matrix44.Unit; - _projection = new Matrix44(); - } - - public Camera(Vec3 position, Vec3 target, Vec3 up) - : this() - { - rotationAtt = Matrix44.Unit; - cameraAtt = new Matrix44(); - SetViewDirection(position, target, up); - _pitch = Radius.Zero; - _row = Radius.Zero; - _yaw = Radius.Zero; - } - - public Matrix44 Projection => _projection; - - public Matrix44 View - { - get - { - if (_isLookAtAvailable) { - return _lookAt; - } - Matrix44 move = Matrix44.Unit; - move.column[3].vec -= cameraAtt.column[3].vec; - _lookAt = rotationAtt.Transpose * move; - _isLookAtAvailable = true; - return _lookAt; - } - } - - public Matrix44 CameraMatrix() - { - return Projection * View; - } - - public void DisplayGLtypeDefinition() - { - Console.WriteLine("uniform matrix4x4 cameraName;"); - } - - /// - /// Get all uniform related to this . - /// - /// - /// Shader program requires this camera. - /// - /// - /// ContextName of all related uniforms. If you fallow form from - /// - /// - /// - /// - public unsafe void GainAllUniforms(ShaderProgram source, params string[] uniformName) - { - if (uniformName is null || uniformName.Length != 1) { - throw new ArgumentException( - "Camera needs exactly one uniform.", nameof(uniformName)); - } - convertedUniform = source.GetUniform(uniformName[0]); - } - - public void MoveNear(float distance) - { - cameraAtt.column[3].Z -= distance; - _isLookAtAvailable = false; - } - - public void MoveRight(float distance) - { - cameraAtt.column[3].X -= distance; - _isLookAtAvailable = false; - } - - public void MoveUp(float distance) - { - cameraAtt.column[3].Y -= distance; - _isLookAtAvailable = false; - } - - public unsafe void SetAllUniforms() - { - // Console.WriteLine(Projection * ViewBase); - OpenGLFunction.CurrentGL.SetUniformValue(convertedUniform, Projection * View); - } - - public void SetViewDirection(Vec3 position, Vec3 target, Vec3 up) - { - Vec3 direction = position - target; - if ((position.reg == cameraAtt.column[3].reg) && - (this.up == up) && - (cameraAtt.column[3].reg == direction.reg)) { - return; - } - if (direction.GetLength() == 0) - { - // deadlock - throw new ArgumentException("Direction bust is not zero."); - } - if (Vec3.IsParallel(direction, up)) { - throw new ArgumentException("Direction and UP is on on same way"); - } - _target = direction; - this.up = up; - - _isLookAtAvailable = false; - - direction.Orthogonalize(ref up); - - Vec3 right = Linear.Orthogonalize(Linear.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; - - InternalPitch(); - InternalRow(); - InternalYaw(); - } - - public void SetViewRange( - Radius fovRadius, - Vec2 size, - Vec2 offset, - (float front, float back) depthRange) - { - float - distance = _target.GetLength(), - near = distance - depthRange.front, - far = distance + depthRange.back, - offsetX = offset.X, - offsetY = offset.Y, - width = Scalar.Abs(GeometryScaler.Tan(fovRadius / 2) * near * 2), - height = width * size.Y / size.X; - - _projection.column[0].X = 2 * near / width; - _projection.column[1].Y = 2 * near / height; - _projection.column[2].X = 2 * offsetX / width; - _projection.column[2].Y = 2 * offsetY / height; - _projection.column[2].Z = (far + near) / (near - far); - _projection.column[2].W = -1; - _projection.column[3].Z = 2 * near * far / (near - far); - } - - public void Test(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};"); - } - } - - ShaderStruct IglConvertable.GetConvertedGLtype() - { - throw new NotImplementedException(); - } - - ~Camera() { } - - #region rotation - - public void Yaw(Radius r) - { - _yaw -= r; - - // Console.WriteLine(_yaw._radius); - // Console.WriteLine(rotationAtt); - InternalYaw(); - } - - public void Pitch(Radius r) - { - _pitch -= r; - - // Console.WriteLine(_pitch._radius); - // Console.WriteLine(rotationAtt); - InternalPitch(); - } - - public void Row(Radius r) - { - _row -= r; - - // Console.WriteLine(_row._radius); - // Console.WriteLine(rotationAtt); - InternalRow(); - } - - internal void InternalPitch() - { - /* - _isLookAtAvailable = false; - - Matrix32 partialCoord = new Matrix32(cameraAtt.colum1.vec, cameraAtt.colum2.vec); - float angle = _pitch._radius; - - Matrix22 rotation = new Matrix22( - Scaler.Cos(angle), -Scaler.Sin(angle), Scaler.Sin(angle), Scaler.Cos(angle)); - - partialCoord *= rotation; - rotationAtt.colum1.reg = partialCoord.colum0.reg; - rotationAtt.colum2.reg = partialCoord.colum1.reg; - rotationAtt.isTransposed = false; - /**/ - } - - internal void InternalRow() - { - /* - _isLookAtAvailable = false; - - Matrix32 partialCoord = new Matrix32(cameraAtt.colum0.vec, cameraAtt.colum1.vec); - float angle = _row._radius; - - Matrix22 rotation = new Matrix22( - Scaler.Cos(angle), -Scaler.Sin(angle), Scaler.Sin(angle), Scaler.Cos(angle)); - - partialCoord *= rotation; - rotationAtt.colum0.reg = partialCoord.colum0.reg; - rotationAtt.colum1.reg = partialCoord.colum1.reg; - rotationAtt.isTransposed = false; - */ - } - - internal void InternalYaw() - { - /* - _isLookAtAvailable = false; - - Matrix32 partialCoord = new Matrix32(cameraAtt.colum0.vec, cameraAtt.colum2.vec); - float angle = _yaw._radius; - Matrix22 rotation = new Matrix22( - Scaler.Cos(angle), -Scaler.Sin(angle), Scaler.Sin(angle), Scaler.Cos(angle)); - - partialCoord *= rotation; - rotationAtt.colum0.reg = partialCoord.colum0.reg; - rotationAtt.colum2.reg = partialCoord.colum1.reg; - rotationAtt.isTransposed = false; - */ - } - - #endregion - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Camera" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using StgSharp.Graphics.ShaderEdit; + +using System; + +namespace StgSharp.Mathematics.Graphics +{ + public sealed class Camera : IglConvertable + { + + private bool _isLookAtAvailable; + internal Matrix44 _lookAt; + internal Matrix44 _projection; + internal Matrix44 cameraAtt; + internal Matrix44 rotation; + internal Matrix44 rotationAtt; + internal Radius _pitch; + internal Radius _row; + internal Radius _yaw; + internal Uniform convertedUniform; + internal Vec3 _target, up; + + public Camera() + { + cameraAtt = Matrix44.Unit; + _target = Vec3.Zero; + up = Vec3.Zero; + _isLookAtAvailable = false; + _lookAt = Matrix44.Unit; + rotationAtt = Matrix44.Unit; + _projection = new Matrix44(); + } + + public Camera(Vec3 position, Vec3 target, Vec3 up) + : this() + { + rotationAtt = Matrix44.Unit; + cameraAtt = new Matrix44(); + SetViewDirection(position, target, up); + _pitch = Radius.Zero; + _row = Radius.Zero; + _yaw = Radius.Zero; + } + + public Matrix44 Projection => _projection; + + public Matrix44 View + { + get + { + if (_isLookAtAvailable) { + return _lookAt; + } + Matrix44 move = Matrix44.Unit; + move.column[3].vec -= cameraAtt.column[3].vec; + _lookAt = rotationAtt.Transpose * move; + _isLookAtAvailable = true; + return _lookAt; + } + } + + public Matrix44 CameraMatrix() + { + return Projection * View; + } + + public void DisplayGLtypeDefinition() + { + Console.WriteLine("uniform matrix4x4 cameraName;"); + } + + /// + /// Get all uniform related to this . + /// + /// + /// Shader program requires this camera. + /// + /// + /// ContextName of all related uniforms. If you fallow form from + /// + /// + /// + /// + public unsafe void GainAllUniforms(ShaderProgram source, params string[] uniformName) + { + if (uniformName is null || uniformName.Length != 1) { + throw new ArgumentException( + "Camera needs exactly one uniform.", nameof(uniformName)); + } + convertedUniform = source.GetUniform(uniformName[0]); + } + + public void MoveNear(float distance) + { + cameraAtt.column[3].Z -= distance; + _isLookAtAvailable = false; + } + + public void MoveRight(float distance) + { + cameraAtt.column[3].X -= distance; + _isLookAtAvailable = false; + } + + public void MoveUp(float distance) + { + cameraAtt.column[3].Y -= distance; + _isLookAtAvailable = false; + } + + public unsafe void SetAllUniforms() + { + // Console.WriteLine(Projection * ViewBase); + OpenGLFunction.CurrentGL.SetUniformValue(convertedUniform, Projection * View); + } + + public void SetViewDirection(Vec3 position, Vec3 target, Vec3 up) + { + Vec3 direction = position - target; + if ((position.reg == cameraAtt.column[3].reg) && + (this.up == up) && + (cameraAtt.column[3].reg == direction.reg)) { + return; + } + if (direction.GetLength() == 0) + { + // deadlock + throw new ArgumentException("Direction bust is not zero."); + } + if (Vec3.IsParallel(direction, up)) { + throw new ArgumentException("Direction and UP is on on same way"); + } + _target = direction; + this.up = up; + + _isLookAtAvailable = false; + + direction.Orthogonalize(ref up); + + Vec3 right = Linear.Orthogonalize(Linear.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; + + InternalPitch(); + InternalRow(); + InternalYaw(); + } + + public void SetViewRange( + Radius fovRadius, + Vec2 size, + Vec2 offset, + (float front, float back) depthRange) + { + float + distance = _target.GetLength(), + near = distance - depthRange.front, + far = distance + depthRange.back, + offsetX = offset.X, + offsetY = offset.Y, + width = Scalar.Abs(GeometryScaler.Tan(fovRadius / 2) * near * 2), + height = width * size.Y / size.X; + + _projection.column[0].X = 2 * near / width; + _projection.column[1].Y = 2 * near / height; + _projection.column[2].X = 2 * offsetX / width; + _projection.column[2].Y = 2 * offsetY / height; + _projection.column[2].Z = (far + near) / (near - far); + _projection.column[2].W = -1; + _projection.column[3].Z = 2 * near * far / (near - far); + } + + public void Test(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};"); + } + } + + ShaderStruct IglConvertable.GetConvertedGLtype() + { + throw new NotImplementedException(); + } + + ~Camera() { } + + #region rotation + + public void Yaw(Radius r) + { + _yaw -= r; + + // Console.WriteLine(_yaw._radius); + // Console.WriteLine(rotationAtt); + InternalYaw(); + } + + public void Pitch(Radius r) + { + _pitch -= r; + + // Console.WriteLine(_pitch._radius); + // Console.WriteLine(rotationAtt); + InternalPitch(); + } + + public void Row(Radius r) + { + _row -= r; + + // Console.WriteLine(_row._radius); + // Console.WriteLine(rotationAtt); + InternalRow(); + } + + internal void InternalPitch() + { + /* + _isLookAtAvailable = false; + + Matrix32 partialCoord = new Matrix32(cameraAtt.colum1.vec, cameraAtt.colum2.vec); + float angle = _pitch._radius; + + Matrix22 rotation = new Matrix22( + Scaler.Cos(angle), -Scaler.Sin(angle), Scaler.Sin(angle), Scaler.Cos(angle)); + + partialCoord *= rotation; + rotationAtt.colum1.reg = partialCoord.colum0.reg; + rotationAtt.colum2.reg = partialCoord.colum1.reg; + rotationAtt.isTransposed = false; + /**/ + } + + internal void InternalRow() + { + /* + _isLookAtAvailable = false; + + Matrix32 partialCoord = new Matrix32(cameraAtt.colum0.vec, cameraAtt.colum1.vec); + float angle = _row._radius; + + Matrix22 rotation = new Matrix22( + Scaler.Cos(angle), -Scaler.Sin(angle), Scaler.Sin(angle), Scaler.Cos(angle)); + + partialCoord *= rotation; + rotationAtt.colum0.reg = partialCoord.colum0.reg; + rotationAtt.colum1.reg = partialCoord.colum1.reg; + rotationAtt.isTransposed = false; + */ + } + + internal void InternalYaw() + { + /* + _isLookAtAvailable = false; + + Matrix32 partialCoord = new Matrix32(cameraAtt.colum0.vec, cameraAtt.colum2.vec); + float angle = _yaw._radius; + Matrix22 rotation = new Matrix22( + Scaler.Cos(angle), -Scaler.Sin(angle), Scaler.Sin(angle), Scaler.Cos(angle)); + + partialCoord *= rotation; + rotationAtt.colum0.reg = partialCoord.colum0.reg; + rotationAtt.colum2.reg = partialCoord.colum1.reg; + rotationAtt.isTransposed = false; + */ + } + + #endregion + } +} diff --git a/StgSharp.Common/Graphics/Define/BufferObjectBase.cs b/StgsSharp.Graphics/Define/BufferObjectBase.cs similarity index 97% rename from StgSharp.Common/Graphics/Define/BufferObjectBase.cs rename to StgsSharp.Graphics/Define/BufferObjectBase.cs index 532d113a..7047e002 100644 --- a/StgSharp.Common/Graphics/Define/BufferObjectBase.cs +++ b/StgsSharp.Graphics/Define/BufferObjectBase.cs @@ -1,86 +1,86 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="BufferObjectBase" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Graphics.OpenGL; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics -{ - /// - /// Interface of all kinds OpenGL BufferHandle objects - /// - public abstract class BufferObjectBase : IDisposable - { - - protected GlHandle[] _bufferHandle; - protected RenderStream binding; - - /// - /// Get the only handle to one of the Object instance - /// - /// - /// - /// - /// - /// - /// - public GlHandle this[int index] => _bufferHandle[index]; - - /// - /// Bind a BufferHandle instance to OpenGL - /// - /// - /// Index of handle of the object in this instance to be bind - /// - public abstract void Bind(int index); - - public void Dispose() - { - Dispose(disposing:true); - GC.SuppressFinalize(this); - } - - /// - public override string ToString() - { - return $"This is a {GetType().FullName}, containing {_bufferHandle.Length} buffer handles: {_bufferHandle.ToString()}."; - } - - protected abstract void Dispose(bool disposing); - - ~BufferObjectBase() - { - Dispose(disposing:false); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="BufferObjectBase" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Graphics.OpenGL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics +{ + /// + /// Interface of all kinds OpenGL BufferHandle objects + /// + public abstract class BufferObjectBase : IDisposable + { + + protected GlHandle[] _bufferHandle; + protected RenderStream binding; + + /// + /// Get the only handle to one of the Object instance + /// + /// + /// + /// + /// + /// + /// + public GlHandle this[int index] => _bufferHandle[index]; + + /// + /// Bind a BufferHandle instance to OpenGL + /// + /// + /// Index of handle of the object in this instance to be bind + /// + public abstract void Bind(int index); + + public void Dispose() + { + Dispose(disposing:true); + GC.SuppressFinalize(this); + } + + /// + public override string ToString() + { + return $"This is a {GetType().FullName}, containing {_bufferHandle.Length} buffer handles: {_bufferHandle.ToString()}."; + } + + protected abstract void Dispose(bool disposing); + + ~BufferObjectBase() + { + Dispose(disposing:false); + } + + } +} diff --git a/StgSharp.Common/Graphics/FrameworkConstant.cs b/StgsSharp.Graphics/FrameworkConstant.cs similarity index 97% rename from StgSharp.Common/Graphics/FrameworkConstant.cs rename to StgsSharp.Graphics/FrameworkConstant.cs index d6138dbd..2cc3d08a 100644 --- a/StgSharp.Common/Graphics/FrameworkConstant.cs +++ b/StgsSharp.Graphics/FrameworkConstant.cs @@ -1,336 +1,336 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="FrameworkConstant" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics -{ - public static class FrameworkConstant - { - - #region glfw - - public const int VERSION_MAJOR = 3; - public const int VERSION_MINOR = 3; - public const int VERSION_REVISION = 8; - public const int TRUE = 1; - public const int FALSE = 0; - public const int RELEASE = 0; - public const int PRESS = 1; - public const int REPEAT = 2; - public const int HAT_CENTERED = 0; - public const int HAT_UP = 1; - public const int HAT_RIGHT = 2; - public const int HAT_DOWN = 4; - public const int HAT_LEFT = 8; - public const int HAT_RIGHT_UP = HAT_RIGHT | HAT_UP; - public const int HAT_RIGHT_DOWN = HAT_RIGHT | HAT_DOWN; - public const int HAT_LEFT_UP = HAT_LEFT | HAT_UP; - public const int HAT_LEFT_DOWN = HAT_LEFT | HAT_DOWN; - public const int KEY_UNKNOWN = -1; - public const int KEY_SPACE = 32; - public const int KEY_APOSTROPHE = 39; - public const int KEY_COMMA = 44; - public const int KEY_MINUS = 45; - public const int KEY_PERIOD = 46; - public const int KEY_SLASH = 47; - public const int KEY_0 = 48; - public const int KEY_1 = 49; - public const int KEY_2 = 50; - public const int KEY_3 = 51; - public const int KEY_4 = 52; - public const int KEY_5 = 53; - public const int KEY_6 = 54; - public const int KEY_7 = 55; - public const int KEY_8 = 56; - public const int KEY_9 = 57; - public const int KEY_SEMICOLON = 59; - public const int KEY_EQUAL = 61; - public const int KEY_A = 65; - public const int KEY_B = 66; - public const int KEY_C = 67; - public const int KEY_D = 68; - public const int KEY_E = 69; - public const int KEY_F = 70; - public const int KEY_G = 71; - public const int KEY_H = 72; - public const int KEY_I = 73; - public const int KEY_J = 74; - public const int KEY_K = 75; - public const int KEY_L = 76; - public const int KEY_M = 77; - public const int KEY_N = 78; - public const int KEY_O = 79; - public const int KEY_P = 80; - public const int KEY_Q = 81; - public const int KEY_R = 82; - public const int KEY_S = 83; - public const int KEY_T = 84; - public const int KEY_U = 85; - public const int KEY_V = 86; - public const int KEY_W = 87; - public const int KEY_X = 88; - public const int KEY_Y = 89; - public const int KEY_Z = 90; - public const int KEY_LEFT_BRACKET = 91; - public const int KEY_BACKSLASH = 92; - public const int KEY_RIGHT_BRACKET = 93; - public const int KEY_GRAVE_ACCENT = 96; - public const int KEY_WORLD_1 = 161; - public const int KEY_WORLD_2 = 162; - public const int KEY_ESCAPE = 256; - public const int KEY_ENTER = 257; - public const int KEY_TAB = 258; - public const int KEY_BACKSPACE = 259; - public const int KEY_INSERT = 260; - public const int KEY_DELETE = 261; - public const int KEY_RIGHT = 262; - public const int KEY_LEFT = 263; - public const int KEY_DOWN = 264; - public const int KEY_UP = 265; - public const int KEY_PAGE_UP = 266; - public const int KEY_PAGE_DOWN = 267; - public const int KEY_HOME = 268; - public const int KEY_END = 269; - public const int KEY_CAPS_LOCK = 280; - public const int KEY_SCROLL_LOCK = 281; - public const int KEY_NUM_LOCK = 282; - public const int KEY_PRINT_SCREEN = 283; - public const int KEY_PAUSE = 284; - public const int KEY_F1 = 290; - public const int KEY_F2 = 291; - public const int KEY_F3 = 292; - public const int KEY_F4 = 293; - public const int KEY_F5 = 294; - public const int KEY_F6 = 295; - public const int KEY_F7 = 296; - public const int KEY_F8 = 297; - public const int KEY_F9 = 298; - public const int KEY_F10 = 299; - public const int KEY_F11 = 300; - public const int KEY_F12 = 301; - public const int KEY_F13 = 302; - public const int KEY_F14 = 303; - public const int KEY_F15 = 304; - public const int KEY_F16 = 305; - public const int KEY_F17 = 306; - public const int KEY_F18 = 307; - public const int KEY_F19 = 308; - public const int KEY_F20 = 309; - public const int KEY_F21 = 310; - public const int KEY_F22 = 311; - public const int KEY_F23 = 312; - public const int KEY_F24 = 313; - public const int KEY_F25 = 314; - public const int KEY_KP_0 = 320; - public const int KEY_KP_1 = 321; - public const int KEY_KP_2 = 322; - public const int KEY_KP_3 = 323; - public const int KEY_KP_4 = 324; - public const int KEY_KP_5 = 325; - public const int KEY_KP_6 = 326; - public const int KEY_KP_7 = 327; - public const int KEY_KP_8 = 328; - public const int KEY_KP_9 = 329; - public const int KEY_KP_DECIMAL = 330; - public const int KEY_KP_DIVIDE = 331; - public const int KEY_KP_MULTIPLY = 332; - public const int KEY_KP_SUBTRACT = 333; - public const int KEY_KP_ADD = 334; - public const int KEY_KP_ENTER = 335; - public const int KEY_KP_EQUAL = 336; - public const int KEY_LEFT_SHIFT = 340; - public const int KEY_LEFT_CONTROL = 341; - public const int KEY_LEFT_ALT = 342; - public const int KEY_LEFT_SUPER = 343; - public const int KEY_RIGHT_SHIFT = 344; - public const int KEY_RIGHT_CONTROL = 345; - public const int KEY_RIGHT_ALT = 346; - public const int KEY_RIGHT_SUPER = 347; - public const int KEY_MENU = 348; - public const int KEY_LAST = KEY_MENU; - public const int MOD_SHIFT = 0x0001; - public const int MOD_CONTROL = 0x0002; - public const int MOD_ALT = 0x0004; - public const int MOD_SUPER = 0x0008; - public const int MOD_CAPS_LOCK = 0x0010; - public const int MOD_NUM_LOCK = 0x0020; - public const int MOUSE_BUTTON_1 = 0; - public const int MOUSE_BUTTON_2 = 1; - public const int MOUSE_BUTTON_3 = 2; - public const int MOUSE_BUTTON_4 = 3; - public const int MOUSE_BUTTON_5 = 4; - public const int MOUSE_BUTTON_6 = 5; - public const int MOUSE_BUTTON_7 = 6; - public const int MOUSE_BUTTON_8 = 7; - public const int MOUSE_BUTTON_LAST = MOUSE_BUTTON_8; - public const int MOUSE_BUTTON_LEFT = MOUSE_BUTTON_1; - public const int MOUSE_BUTTON_RIGHT = MOUSE_BUTTON_2; - public const int MOUSE_BUTTON_MIDDLE = MOUSE_BUTTON_3; - public const int JOYSTICK_1 = 0; - public const int JOYSTICK_2 = 1; - public const int JOYSTICK_3 = 2; - public const int JOYSTICK_4 = 3; - public const int JOYSTICK_5 = 4; - public const int JOYSTICK_6 = 5; - public const int JOYSTICK_7 = 6; - public const int JOYSTICK_8 = 7; - public const int JOYSTICK_9 = 8; - public const int JOYSTICK_10 = 9; - public const int JOYSTICK_11 = 10; - public const int JOYSTICK_12 = 11; - public const int JOYSTICK_13 = 12; - public const int JOYSTICK_14 = 13; - public const int JOYSTICK_15 = 14; - public const int JOYSTICK_16 = 15; - public const int JOYSTICK_LAST = JOYSTICK_16; - public const int GAMEPAD_BUTTON_A = 0; - public const int GAMEPAD_BUTTON_B = 1; - public const int GAMEPAD_BUTTON_X = 2; - public const int GAMEPAD_BUTTON_Y = 3; - public const int GAMEPAD_BUTTON_LEFT_BUMPER = 4; - public const int GAMEPAD_BUTTON_RIGHT_BUMPER = 5; - public const int GAMEPAD_BUTTON_BACK = 6; - public const int GAMEPAD_BUTTON_START = 7; - public const int GAMEPAD_BUTTON_GUIDE = 8; - public const int GAMEPAD_BUTTON_LEFT_THUMB = 9; - public const int GAMEPAD_BUTTON_RIGHT_THUMB = 10; - public const int GAMEPAD_BUTTON_DPAD_UP = 11; - public const int GAMEPAD_BUTTON_DPAD_RIGHT = 12; - public const int GAMEPAD_BUTTON_DPAD_DOWN = 13; - public const int GAMEPAD_BUTTON_DPAD_LEFT = 14; - public const int GAMEPAD_BUTTON_LAST = GAMEPAD_BUTTON_DPAD_LEFT; - public const int GAMEPAD_BUTTON_CROSS = GAMEPAD_BUTTON_A; - public const int GAMEPAD_BUTTON_CIRCLE = GAMEPAD_BUTTON_B; - public const int GAMEPAD_BUTTON_SQUARE = GAMEPAD_BUTTON_X; - public const int GAMEPAD_BUTTON_TRIANGLE = GAMEPAD_BUTTON_Y; - public const int GAMEPAD_AXIS_LEFT_X = 0; - public const int GAMEPAD_AXIS_LEFT_Y = 1; - public const int GAMEPAD_AXIS_RIGHT_X = 2; - public const int GAMEPAD_AXIS_RIGHT_Y = 3; - public const int GAMEPAD_AXIS_LEFT_TRIGGER = 4; - public const int GAMEPAD_AXIS_RIGHT_TRIGGER = 5; - public const int GAMEPAD_AXIS_LAST = GAMEPAD_AXIS_RIGHT_TRIGGER; - public const int NO_ERROR = 0; - public const int NOT_INITIALIZED = 0x00010001; - public const int NO_CURRENT_CONTEXT = 0x00010002; - public const int INVALID_ENUM = 0x00010003; - public const int INVALID_VALUE = 0x00010004; - public const int OUT_OF_MEMORY = 0x00010005; - public const int API_UNAVAILABLE = 0x00010006; - public const int VERSION_UNAVAILABLE = 0x00010007; - public const int PLATFORM_ERROR = 0x00010008; - public const int FORMAT_UNAVAILABLE = 0x00010009; - public const int NO_WINDOW_CONTEXT = 0x0001000A; - public const int FOCUSED = 0x00020001; - public const int ICONIFIED = 0x00020002; - public const int RESIZABLE = 0x00020003; - public const int VISIBLE = 0x00020004; - public const int DECORATED = 0x00020005; - public const int AUTO_ICONIFY = 0x00020006; - public const int FLOATING = 0x00020007; - public const int MAXIMIZED = 0x00020008; - public const int CENTER_CURSOR = 0x00020009; - public const int TRANSPARENT_FRAMEBUFFER = 0x0002000A; - public const int HOVERED = 0x0002000B; - public const int FOCUS_ON_SHOW = 0x0002000C; - public const int RED_BITS = 0x00021001; - public const int GREEN_BITS = 0x00021002; - public const int BLUE_BITS = 0x00021003; - public const int ALPHA_BITS = 0x00021004; - public const int DEPTH_BITS = 0x00021005; - public const int STENCIL_BITS = 0x00021006; - public const int ACCUM_RED_BITS = 0x00021007; - public const int ACCUM_GREEN_BITS = 0x00021008; - public const int ACCUM_BLUE_BITS = 0x00021009; - public const int ACCUM_ALPHA_BITS = 0x0002100A; - public const int AUX_BUFFERS = 0x0002100B; - public const int STEREO = 0x0002100C; - public const int SAMPLES = 0x0002100D; - public const int SRGB_CAPABLE = 0x0002100E; - public const int REFRESH_RATE = 0x0002100F; - public const int DOUBLEBUFFER = 0x00021010; - public const int CLIENT_API = 0x00022001; - public const int CONTEXT_VERSION_MAJOR = 0x00022002; - public const int CONTEXT_VERSION_MINOR = 0x00022003; - public const int CONTEXT_REVISION = 0x00022004; - public const int CONTEXT_ROBUSTNESS = 0x00022005; - public const int OPENGL_FORWARD_COMPAT = 0x00022006; - public const int OPENGL_DEBUG_CONTEXT = 0x00022007; - public const int OPENGL_PROFILE = 0x00022008; - public const int CONTEXT_RELEASE_BEHAVIOR = 0x00022009; - public const int CONTEXT_NO_ERROR = 0x0002200A; - public const int CONTEXT_CREATION_API = 0x0002200B; - public const int SCALE_TO_MONITOR = 0x0002200C; - public const int COCOA_RETINA_FRAMEBUFFER = 0x00023001; - public const int COCOA_FRAME_NAME = 0x00023002; - public const int COCOA_GRAPHICS_SWITCHING = 0x00023003; - public const int X11_CLASS_NAME = 0x00024001; - public const int X11_INSTANCE_NAME = 0x00024002; - public const int NO_API = 0; - public const int OPENGL_API = 0x00030001; - public const int OPENGL_ES_API = 0x00030002; - public const int NO_ROBUSTNESS = 0; - public const int NO_RESET_NOTIFICATION = 0x00031001; - public const int LOSE_CONTEXT_ON_RESET = 0x00031002; - public const int OPENGL_ANY_PROFILE = 0; - public const int OPENGL_CORE_PROFILE = 0x00032001; - public const int OPENGL_COMPAT_PROFILE = 0x00032002; - public const int CURSOR = 0x00033001; - public const int STICKY_KEYS = 0x00033002; - public const int STICKY_MOUSE_BUTTONS = 0x00033003; - public const int LOCK_KEY_MODS = 0x00033004; - public const int RAW_MOUSE_MOTION = 0x00033005; - public const int CURSOR_NORMAL = 0x00034001; - public const int CURSOR_HIDDEN = 0x00034002; - public const int CURSOR_DISABLED = 0x00034003; - public const int ANY_RELEASE_BEHAVIOR = 0; - public const int RELEASE_BEHAVIOR_FLUSH = 0x00035001; - public const int RELEASE_BEHAVIOR_NONE = 0x00035002; - public const int NATIVE_CONTEXT_API = 0x00036001; - public const int EGL_CONTEXT_API = 0x00036002; - public const int OSMESA_CONTEXT_API = 0x00036003; - public const int ARROW_CURSOR = 0x00036001; - public const int IBEAM_CURSOR = 0x00036002; - public const int CROSSHAIR_CURSOR = 0x00036003; - public const int HAND_CURSOR = 0x00036004; - public const int HRESIZE_CURSOR = 0x00036005; - public const int VRESIZE_CURSOR = 0x00036006; - public const int CONNECTED = 0x00040001; - public const int DISCONNECTED = 0x00040002; - public const int JOYSTICK_HAT_BUTTONS = 0x00050001; - public const int COCOA_CHDIR_RESOURCES = 0x00051001; - public const int COCOA_MENUBAR = 0x00051002; - public const int DONT_CARE = -1; - - #endregion - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="FrameworkConstant" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics +{ + public static class FrameworkConstant + { + + #region glfw + + public const int VERSION_MAJOR = 3; + public const int VERSION_MINOR = 3; + public const int VERSION_REVISION = 8; + public const int TRUE = 1; + public const int FALSE = 0; + public const int RELEASE = 0; + public const int PRESS = 1; + public const int REPEAT = 2; + public const int HAT_CENTERED = 0; + public const int HAT_UP = 1; + public const int HAT_RIGHT = 2; + public const int HAT_DOWN = 4; + public const int HAT_LEFT = 8; + public const int HAT_RIGHT_UP = HAT_RIGHT | HAT_UP; + public const int HAT_RIGHT_DOWN = HAT_RIGHT | HAT_DOWN; + public const int HAT_LEFT_UP = HAT_LEFT | HAT_UP; + public const int HAT_LEFT_DOWN = HAT_LEFT | HAT_DOWN; + public const int KEY_UNKNOWN = -1; + public const int KEY_SPACE = 32; + public const int KEY_APOSTROPHE = 39; + public const int KEY_COMMA = 44; + public const int KEY_MINUS = 45; + public const int KEY_PERIOD = 46; + public const int KEY_SLASH = 47; + public const int KEY_0 = 48; + public const int KEY_1 = 49; + public const int KEY_2 = 50; + public const int KEY_3 = 51; + public const int KEY_4 = 52; + public const int KEY_5 = 53; + public const int KEY_6 = 54; + public const int KEY_7 = 55; + public const int KEY_8 = 56; + public const int KEY_9 = 57; + public const int KEY_SEMICOLON = 59; + public const int KEY_EQUAL = 61; + public const int KEY_A = 65; + public const int KEY_B = 66; + public const int KEY_C = 67; + public const int KEY_D = 68; + public const int KEY_E = 69; + public const int KEY_F = 70; + public const int KEY_G = 71; + public const int KEY_H = 72; + public const int KEY_I = 73; + public const int KEY_J = 74; + public const int KEY_K = 75; + public const int KEY_L = 76; + public const int KEY_M = 77; + public const int KEY_N = 78; + public const int KEY_O = 79; + public const int KEY_P = 80; + public const int KEY_Q = 81; + public const int KEY_R = 82; + public const int KEY_S = 83; + public const int KEY_T = 84; + public const int KEY_U = 85; + public const int KEY_V = 86; + public const int KEY_W = 87; + public const int KEY_X = 88; + public const int KEY_Y = 89; + public const int KEY_Z = 90; + public const int KEY_LEFT_BRACKET = 91; + public const int KEY_BACKSLASH = 92; + public const int KEY_RIGHT_BRACKET = 93; + public const int KEY_GRAVE_ACCENT = 96; + public const int KEY_WORLD_1 = 161; + public const int KEY_WORLD_2 = 162; + public const int KEY_ESCAPE = 256; + public const int KEY_ENTER = 257; + public const int KEY_TAB = 258; + public const int KEY_BACKSPACE = 259; + public const int KEY_INSERT = 260; + public const int KEY_DELETE = 261; + public const int KEY_RIGHT = 262; + public const int KEY_LEFT = 263; + public const int KEY_DOWN = 264; + public const int KEY_UP = 265; + public const int KEY_PAGE_UP = 266; + public const int KEY_PAGE_DOWN = 267; + public const int KEY_HOME = 268; + public const int KEY_END = 269; + public const int KEY_CAPS_LOCK = 280; + public const int KEY_SCROLL_LOCK = 281; + public const int KEY_NUM_LOCK = 282; + public const int KEY_PRINT_SCREEN = 283; + public const int KEY_PAUSE = 284; + public const int KEY_F1 = 290; + public const int KEY_F2 = 291; + public const int KEY_F3 = 292; + public const int KEY_F4 = 293; + public const int KEY_F5 = 294; + public const int KEY_F6 = 295; + public const int KEY_F7 = 296; + public const int KEY_F8 = 297; + public const int KEY_F9 = 298; + public const int KEY_F10 = 299; + public const int KEY_F11 = 300; + public const int KEY_F12 = 301; + public const int KEY_F13 = 302; + public const int KEY_F14 = 303; + public const int KEY_F15 = 304; + public const int KEY_F16 = 305; + public const int KEY_F17 = 306; + public const int KEY_F18 = 307; + public const int KEY_F19 = 308; + public const int KEY_F20 = 309; + public const int KEY_F21 = 310; + public const int KEY_F22 = 311; + public const int KEY_F23 = 312; + public const int KEY_F24 = 313; + public const int KEY_F25 = 314; + public const int KEY_KP_0 = 320; + public const int KEY_KP_1 = 321; + public const int KEY_KP_2 = 322; + public const int KEY_KP_3 = 323; + public const int KEY_KP_4 = 324; + public const int KEY_KP_5 = 325; + public const int KEY_KP_6 = 326; + public const int KEY_KP_7 = 327; + public const int KEY_KP_8 = 328; + public const int KEY_KP_9 = 329; + public const int KEY_KP_DECIMAL = 330; + public const int KEY_KP_DIVIDE = 331; + public const int KEY_KP_MULTIPLY = 332; + public const int KEY_KP_SUBTRACT = 333; + public const int KEY_KP_ADD = 334; + public const int KEY_KP_ENTER = 335; + public const int KEY_KP_EQUAL = 336; + public const int KEY_LEFT_SHIFT = 340; + public const int KEY_LEFT_CONTROL = 341; + public const int KEY_LEFT_ALT = 342; + public const int KEY_LEFT_SUPER = 343; + public const int KEY_RIGHT_SHIFT = 344; + public const int KEY_RIGHT_CONTROL = 345; + public const int KEY_RIGHT_ALT = 346; + public const int KEY_RIGHT_SUPER = 347; + public const int KEY_MENU = 348; + public const int KEY_LAST = KEY_MENU; + public const int MOD_SHIFT = 0x0001; + public const int MOD_CONTROL = 0x0002; + public const int MOD_ALT = 0x0004; + public const int MOD_SUPER = 0x0008; + public const int MOD_CAPS_LOCK = 0x0010; + public const int MOD_NUM_LOCK = 0x0020; + public const int MOUSE_BUTTON_1 = 0; + public const int MOUSE_BUTTON_2 = 1; + public const int MOUSE_BUTTON_3 = 2; + public const int MOUSE_BUTTON_4 = 3; + public const int MOUSE_BUTTON_5 = 4; + public const int MOUSE_BUTTON_6 = 5; + public const int MOUSE_BUTTON_7 = 6; + public const int MOUSE_BUTTON_8 = 7; + public const int MOUSE_BUTTON_LAST = MOUSE_BUTTON_8; + public const int MOUSE_BUTTON_LEFT = MOUSE_BUTTON_1; + public const int MOUSE_BUTTON_RIGHT = MOUSE_BUTTON_2; + public const int MOUSE_BUTTON_MIDDLE = MOUSE_BUTTON_3; + public const int JOYSTICK_1 = 0; + public const int JOYSTICK_2 = 1; + public const int JOYSTICK_3 = 2; + public const int JOYSTICK_4 = 3; + public const int JOYSTICK_5 = 4; + public const int JOYSTICK_6 = 5; + public const int JOYSTICK_7 = 6; + public const int JOYSTICK_8 = 7; + public const int JOYSTICK_9 = 8; + public const int JOYSTICK_10 = 9; + public const int JOYSTICK_11 = 10; + public const int JOYSTICK_12 = 11; + public const int JOYSTICK_13 = 12; + public const int JOYSTICK_14 = 13; + public const int JOYSTICK_15 = 14; + public const int JOYSTICK_16 = 15; + public const int JOYSTICK_LAST = JOYSTICK_16; + public const int GAMEPAD_BUTTON_A = 0; + public const int GAMEPAD_BUTTON_B = 1; + public const int GAMEPAD_BUTTON_X = 2; + public const int GAMEPAD_BUTTON_Y = 3; + public const int GAMEPAD_BUTTON_LEFT_BUMPER = 4; + public const int GAMEPAD_BUTTON_RIGHT_BUMPER = 5; + public const int GAMEPAD_BUTTON_BACK = 6; + public const int GAMEPAD_BUTTON_START = 7; + public const int GAMEPAD_BUTTON_GUIDE = 8; + public const int GAMEPAD_BUTTON_LEFT_THUMB = 9; + public const int GAMEPAD_BUTTON_RIGHT_THUMB = 10; + public const int GAMEPAD_BUTTON_DPAD_UP = 11; + public const int GAMEPAD_BUTTON_DPAD_RIGHT = 12; + public const int GAMEPAD_BUTTON_DPAD_DOWN = 13; + public const int GAMEPAD_BUTTON_DPAD_LEFT = 14; + public const int GAMEPAD_BUTTON_LAST = GAMEPAD_BUTTON_DPAD_LEFT; + public const int GAMEPAD_BUTTON_CROSS = GAMEPAD_BUTTON_A; + public const int GAMEPAD_BUTTON_CIRCLE = GAMEPAD_BUTTON_B; + public const int GAMEPAD_BUTTON_SQUARE = GAMEPAD_BUTTON_X; + public const int GAMEPAD_BUTTON_TRIANGLE = GAMEPAD_BUTTON_Y; + public const int GAMEPAD_AXIS_LEFT_X = 0; + public const int GAMEPAD_AXIS_LEFT_Y = 1; + public const int GAMEPAD_AXIS_RIGHT_X = 2; + public const int GAMEPAD_AXIS_RIGHT_Y = 3; + public const int GAMEPAD_AXIS_LEFT_TRIGGER = 4; + public const int GAMEPAD_AXIS_RIGHT_TRIGGER = 5; + public const int GAMEPAD_AXIS_LAST = GAMEPAD_AXIS_RIGHT_TRIGGER; + public const int NO_ERROR = 0; + public const int NOT_INITIALIZED = 0x00010001; + public const int NO_CURRENT_CONTEXT = 0x00010002; + public const int INVALID_ENUM = 0x00010003; + public const int INVALID_VALUE = 0x00010004; + public const int OUT_OF_MEMORY = 0x00010005; + public const int API_UNAVAILABLE = 0x00010006; + public const int VERSION_UNAVAILABLE = 0x00010007; + public const int PLATFORM_ERROR = 0x00010008; + public const int FORMAT_UNAVAILABLE = 0x00010009; + public const int NO_WINDOW_CONTEXT = 0x0001000A; + public const int FOCUSED = 0x00020001; + public const int ICONIFIED = 0x00020002; + public const int RESIZABLE = 0x00020003; + public const int VISIBLE = 0x00020004; + public const int DECORATED = 0x00020005; + public const int AUTO_ICONIFY = 0x00020006; + public const int FLOATING = 0x00020007; + public const int MAXIMIZED = 0x00020008; + public const int CENTER_CURSOR = 0x00020009; + public const int TRANSPARENT_FRAMEBUFFER = 0x0002000A; + public const int HOVERED = 0x0002000B; + public const int FOCUS_ON_SHOW = 0x0002000C; + public const int RED_BITS = 0x00021001; + public const int GREEN_BITS = 0x00021002; + public const int BLUE_BITS = 0x00021003; + public const int ALPHA_BITS = 0x00021004; + public const int DEPTH_BITS = 0x00021005; + public const int STENCIL_BITS = 0x00021006; + public const int ACCUM_RED_BITS = 0x00021007; + public const int ACCUM_GREEN_BITS = 0x00021008; + public const int ACCUM_BLUE_BITS = 0x00021009; + public const int ACCUM_ALPHA_BITS = 0x0002100A; + public const int AUX_BUFFERS = 0x0002100B; + public const int STEREO = 0x0002100C; + public const int SAMPLES = 0x0002100D; + public const int SRGB_CAPABLE = 0x0002100E; + public const int REFRESH_RATE = 0x0002100F; + public const int DOUBLEBUFFER = 0x00021010; + public const int CLIENT_API = 0x00022001; + public const int CONTEXT_VERSION_MAJOR = 0x00022002; + public const int CONTEXT_VERSION_MINOR = 0x00022003; + public const int CONTEXT_REVISION = 0x00022004; + public const int CONTEXT_ROBUSTNESS = 0x00022005; + public const int OPENGL_FORWARD_COMPAT = 0x00022006; + public const int OPENGL_DEBUG_CONTEXT = 0x00022007; + public const int OPENGL_PROFILE = 0x00022008; + public const int CONTEXT_RELEASE_BEHAVIOR = 0x00022009; + public const int CONTEXT_NO_ERROR = 0x0002200A; + public const int CONTEXT_CREATION_API = 0x0002200B; + public const int SCALE_TO_MONITOR = 0x0002200C; + public const int COCOA_RETINA_FRAMEBUFFER = 0x00023001; + public const int COCOA_FRAME_NAME = 0x00023002; + public const int COCOA_GRAPHICS_SWITCHING = 0x00023003; + public const int X11_CLASS_NAME = 0x00024001; + public const int X11_INSTANCE_NAME = 0x00024002; + public const int NO_API = 0; + public const int OPENGL_API = 0x00030001; + public const int OPENGL_ES_API = 0x00030002; + public const int NO_ROBUSTNESS = 0; + public const int NO_RESET_NOTIFICATION = 0x00031001; + public const int LOSE_CONTEXT_ON_RESET = 0x00031002; + public const int OPENGL_ANY_PROFILE = 0; + public const int OPENGL_CORE_PROFILE = 0x00032001; + public const int OPENGL_COMPAT_PROFILE = 0x00032002; + public const int CURSOR = 0x00033001; + public const int STICKY_KEYS = 0x00033002; + public const int STICKY_MOUSE_BUTTONS = 0x00033003; + public const int LOCK_KEY_MODS = 0x00033004; + public const int RAW_MOUSE_MOTION = 0x00033005; + public const int CURSOR_NORMAL = 0x00034001; + public const int CURSOR_HIDDEN = 0x00034002; + public const int CURSOR_DISABLED = 0x00034003; + public const int ANY_RELEASE_BEHAVIOR = 0; + public const int RELEASE_BEHAVIOR_FLUSH = 0x00035001; + public const int RELEASE_BEHAVIOR_NONE = 0x00035002; + public const int NATIVE_CONTEXT_API = 0x00036001; + public const int EGL_CONTEXT_API = 0x00036002; + public const int OSMESA_CONTEXT_API = 0x00036003; + public const int ARROW_CURSOR = 0x00036001; + public const int IBEAM_CURSOR = 0x00036002; + public const int CROSSHAIR_CURSOR = 0x00036003; + public const int HAND_CURSOR = 0x00036004; + public const int HRESIZE_CURSOR = 0x00036005; + public const int VRESIZE_CURSOR = 0x00036006; + public const int CONNECTED = 0x00040001; + public const int DISCONNECTED = 0x00040002; + public const int JOYSTICK_HAT_BUTTONS = 0x00050001; + public const int COCOA_CHDIR_RESOURCES = 0x00051001; + public const int COCOA_MENUBAR = 0x00051002; + public const int DONT_CARE = -1; + + #endregion + } +} diff --git a/StgSharp.Common/Graphics/Image.cs b/StgsSharp.Graphics/Image.cs similarity index 86% rename from StgSharp.Common/Graphics/Image.cs rename to StgsSharp.Graphics/Image.cs index d7cb87e4..2e2bb1af 100644 --- a/StgSharp.Common/Graphics/Image.cs +++ b/StgsSharp.Graphics/Image.cs @@ -1,191 +1,207 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Image" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; - -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Graphics -{ - public class Image : ISSDSerializable, IImageProvider - { - - private byte[] _data; - private ImageInfo _rawInfo; - private int _pixelUpdateCount = 0; - - internal unsafe Image() - { - _rawInfo = new ImageInfo(); - } - - internal Image(ImageInfo information) - { - _rawInfo = information; - _data = []; - - // int length = _rawInfo.width * _rawInfo.height * _rawInfo.channel; - } - - public (int width, int height) Size - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => (_rawInfo.Width, _rawInfo.Height); - } - - public byte[] PixelBuffer - { - get - { - if ((_data.Length == 0) || (_data == null)) - { - GetBytes(); - return _data!; - } - return _data; - } - } - - public ImageChannel Channel => _rawInfo.Channel; - - /// - /// Hash code of time pixels updated last time. - /// - public int PixelUpdateCount - { - get => _pixelUpdateCount; - internal set => _pixelUpdateCount = value; - } - - public int ChannelCount => _rawInfo.ChannelCount; - - public int Height - { - get => _rawInfo.Height; - internal set => _rawInfo.Height = value; - } - - public int Width - { - get => _rawInfo.Width; - internal set => _rawInfo.Width = value; - } - - public int PixelSize => ImageInfo.GetPixelSize(_rawInfo.pixelLayout, _rawInfo.Channel); - - public PixelChannelLayout PixelLayout - { - get => _rawInfo.pixelLayout; - private set => _rawInfo.pixelLayout = value; - } - - public SerializableTypeCode SSDTypeCode => SerializableTypeCode.PixelImage; - - internal ref byte[] Data => ref _data; - - public void FromBytes(byte[] stream) { } - - public static unsafe Image FromFile(string route, ImageLoader loader) - { - Image ret = new Image(); - fixed (ImageInfo* iptr = &ret._rawInfo) { - GraphicFramework.InternalLoadImage(route, iptr, loader); - } - return ret; - } - - public static Image FromMemory((int width, int height) size, ImageChannel channel, byte[] stream) - { - ImageInfo _info = new ImageInfo - { - Height = size.height, - Width = size.width, - Channel = channel, - StreamPtr = IntPtr.Zero - }; - Image ret = new Image(_info); - ret.PixelLayout = PixelChannelLayout.Byte; - ret._data = stream; - return ret; - } - - public static Image FromMemory( - (int width, int height) size, - ImageChannel channel, - PixelChannelLayout layout, - byte[] stream) - { - ImageInfo _info = new ImageInfo - { - Height = size.height, - Width = size.width, - Channel = channel, - StreamPtr = IntPtr.Zero - }; - Image ret = new Image(_info); - ret.PixelLayout = layout; - ret._data = stream; - return ret; - } - - public unsafe byte[] GetBytes() - { - if (_data.Length == 0) - { - int size = Width * Height * ImageInfo.GetPixelSize(PixelLayout, Channel); - _data = new Span((byte*)_rawInfo.StreamPtr, size).ToArray(); - fixed (ImageInfo* pptr = &_rawInfo) { - GraphicFramework.InternalUnloadImage(pptr); - } - _rawInfo.StreamPtr = IntPtr.Zero; - } - return _data; - } - - public Image ProvideImage() - { - return this; - } - - internal static Image FromMemory(ImageInfo info, byte[] data, int operationCount) - { - return new Image - { - _rawInfo = info, - _data = data, - _pixelUpdateCount = operationCount - }; - } - - byte[] ISSDSerializable.GetBytes() - { - throw new NotImplementedException(); - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Image" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; + +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Graphics +{ + public class Image : IImageProvider + { + + private byte[] _data; + private ImageInfo _rawInfo; + private int _pixelUpdateCount = 0; + + internal unsafe Image() + { + _rawInfo = new ImageInfo(); + } + + internal Image( + ImageInfo information + ) + { + _rawInfo = information; + _data = []; + + // int length = _rawInfo.width * _rawInfo.height * _rawInfo.channel; + } + + public (int width, int height) Size + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => (_rawInfo.Width, _rawInfo.Height); + } + + public byte[] PixelBuffer + { + get + { + if ((_data.Length == 0) || (_data == null)) + { + GetBytes(); + return _data!; + } + return _data; + } + } + + public ImageChannel Channel => _rawInfo.Channel; + + /// + /// Hash code of time pixels updated last time. + /// + public int PixelUpdateCount + { + get => _pixelUpdateCount; + internal set => _pixelUpdateCount = value; + } + + public int ChannelCount => _rawInfo.ChannelCount; + + public int Height + { + get => _rawInfo.Height; + internal set => _rawInfo.Height = value; + } + + public int Width + { + get => _rawInfo.Width; + internal set => _rawInfo.Width = value; + } + + public int PixelSize => ImageInfo.GetPixelSize(_rawInfo.pixelLayout, _rawInfo.Channel); + + public PixelChannelLayout PixelLayout + { + get => _rawInfo.pixelLayout; + private set => _rawInfo.pixelLayout = value; + } + + public SerializableTypeCode SSDTypeCode => SerializableTypeCode.PixelImage; + + internal ref byte[] Data => ref _data; + + public void FromBytes( + byte[] stream + ) { } + + public static unsafe Image FromFile( + string route, + ImageLoader loader + ) + { + Image ret = new Image(); + fixed (ImageInfo* iptr = &ret._rawInfo) { + GraphicFramework.InternalLoadImage(route, iptr, loader); + } + return ret; + } + + public static Image FromMemory( + (int width, int height) size, + ImageChannel channel, + byte[] stream + ) + { + ImageInfo _info = new ImageInfo + { + Height = size.height, + Width = size.width, + Channel = channel, + StreamPtr = IntPtr.Zero + }; + Image ret = new Image(_info); + ret.PixelLayout = PixelChannelLayout.Byte; + ret._data = stream; + return ret; + } + + public static Image FromMemory( + (int width, int height) size, + ImageChannel channel, + PixelChannelLayout layout, + byte[] stream + ) + { + ImageInfo _info = new ImageInfo + { + Height = size.height, + Width = size.width, + Channel = channel, + StreamPtr = IntPtr.Zero + }; + Image ret = new Image(_info); + ret.PixelLayout = layout; + ret._data = stream; + return ret; + } + + public unsafe byte[] GetBytes() + { + if (_data.Length == 0) + { + int size = Width * Height * ImageInfo.GetPixelSize(PixelLayout, Channel); + _data = new Span((byte*)_rawInfo.StreamPtr, size).ToArray(); + fixed (ImageInfo* pptr = &_rawInfo) { + GraphicFramework.InternalUnloadImage(pptr); + } + _rawInfo.StreamPtr = IntPtr.Zero; + } + return _data; + } + + public Image ProvideImage() + { + return this; + } + + internal static Image FromMemory( + ImageInfo info, + byte[] data, + int operationCount + ) + { + return new Image + { + _rawInfo = info, + _data = data, + _pixelUpdateCount = operationCount + }; + } + + byte[] ISSDSerializable.GetBytes() + { + throw new NotImplementedException(); + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/ImageInfo.cs b/StgsSharp.Graphics/ImageInfo.cs similarity index 97% rename from StgSharp.Common/Graphics/ImageInfo.cs rename to StgsSharp.Graphics/ImageInfo.cs index 2572623c..9bd73916 100644 --- a/StgSharp.Common/Graphics/ImageInfo.cs +++ b/StgsSharp.Graphics/ImageInfo.cs @@ -1,162 +1,162 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ImageInfo" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Graphics -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)] - public delegate IntPtr ImageLoader( - string name, - ref int width, - ref int height, - ref int definedChannel, - int desiredChannel); - - [StructLayout(LayoutKind.Sequential)] - internal struct ImageInfo - { - - private ImageChannel channel; - private int height; - private int width; - private IntPtr pixelPtr; - internal PixelChannelLayout pixelLayout; - - public ImageChannel Channel - { - get => channel; - set { channel = value; } - } - - public int ChannelCount - { - get => GetChannelCount(channel); - } - - public int Height - { - get => height; - set => height = value; - } - - public int StreamSize - { - get => width * height * GetPixelSize( - pixelLayout, channel); - } - - public int Width - { - get => width; - set => width = value; - } - - public IntPtr StreamPtr - { - get => pixelPtr; - internal set => pixelPtr = value; - } - - public override int GetHashCode() - { - int hash = 17; - hash = (hash * 17) + width; - hash = (hash * 17) + height; - hash = (hash * 17) + (int)channel; - return hash; - } - - public override string ToString() - { - return $"{channel}\t{width}\t{height}\t{(ulong)StreamPtr}"; - } - - internal static int GetChannelCount(ImageChannel channel) - { - return channel switch - { - ImageChannel.SingleColor => 1, - ImageChannel.DoubleColor => 2, - ImageChannel.TripleColor => 3, - ImageChannel.WithAlphaChannel => 4, - _ => throw new InvalidCastException( - "Unknown color channel decoding setting.") - }; - } - - internal static int GetPixelSize(PixelChannelLayout layout, ImageChannel channel) - { - return layout switch - { - PixelChannelLayout.UByte => sizeof(byte) * GetChannelCount( - channel), - PixelChannelLayout.Byte => sizeof(byte) * GetChannelCount( - channel), - PixelChannelLayout.UShort => sizeof(short) * GetChannelCount( - channel), - PixelChannelLayout.Short => sizeof(short) * GetChannelCount( - channel), - PixelChannelLayout.UInt => sizeof(int) * GetChannelCount( - channel), - PixelChannelLayout.Int => sizeof(int) * GetChannelCount( - channel), - PixelChannelLayout.Float => sizeof(float) * GetChannelCount( - channel), - PixelChannelLayout.UByte332 => sizeof(byte), - PixelChannelLayout.UByte233Rev => sizeof(byte), - PixelChannelLayout.UShort565 => sizeof(short), - PixelChannelLayout.UShort565Rev => sizeof(short), - PixelChannelLayout.UShort4444 => sizeof(short), - PixelChannelLayout.UShort4444Rev => sizeof(short), - PixelChannelLayout.UShort5551 => sizeof(short), - PixelChannelLayout.UShort1555Rev => sizeof(short), - PixelChannelLayout.UInt8888 => sizeof(int), - PixelChannelLayout.UInt8888Rev => sizeof(int), - PixelChannelLayout.UInt1010102 => sizeof(int), - PixelChannelLayout.UInt2101010Rev => sizeof(int), - _ => throw new ArgumentException("Unknown layout type"), - }; - } - - } - - public enum ImageChannel : uint - { - - SingleColor = glConst.RED, - DoubleColor = glConst.RG, - TripleColor = glConst.RGB, - WithAlphaChannel = glConst.RGBA, - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ImageInfo" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)] + public delegate IntPtr ImageLoader( + string name, + ref int width, + ref int height, + ref int definedChannel, + int desiredChannel); + + [StructLayout(LayoutKind.Sequential)] + internal struct ImageInfo + { + + private ImageChannel channel; + private int height; + private int width; + private IntPtr pixelPtr; + internal PixelChannelLayout pixelLayout; + + public ImageChannel Channel + { + get => channel; + set { channel = value; } + } + + public int ChannelCount + { + get => GetChannelCount(channel); + } + + public int Height + { + get => height; + set => height = value; + } + + public int StreamSize + { + get => width * height * GetPixelSize( + pixelLayout, channel); + } + + public int Width + { + get => width; + set => width = value; + } + + public IntPtr StreamPtr + { + get => pixelPtr; + internal set => pixelPtr = value; + } + + public override int GetHashCode() + { + int hash = 17; + hash = (hash * 17) + width; + hash = (hash * 17) + height; + hash = (hash * 17) + (int)channel; + return hash; + } + + public override string ToString() + { + return $"{channel}\t{width}\t{height}\t{(ulong)StreamPtr}"; + } + + internal static int GetChannelCount(ImageChannel channel) + { + return channel switch + { + ImageChannel.SingleColor => 1, + ImageChannel.DoubleColor => 2, + ImageChannel.TripleColor => 3, + ImageChannel.WithAlphaChannel => 4, + _ => throw new InvalidCastException( + "Unknown color channel decoding setting.") + }; + } + + internal static int GetPixelSize(PixelChannelLayout layout, ImageChannel channel) + { + return layout switch + { + PixelChannelLayout.UByte => sizeof(byte) * GetChannelCount( + channel), + PixelChannelLayout.Byte => sizeof(byte) * GetChannelCount( + channel), + PixelChannelLayout.UShort => sizeof(short) * GetChannelCount( + channel), + PixelChannelLayout.Short => sizeof(short) * GetChannelCount( + channel), + PixelChannelLayout.UInt => sizeof(int) * GetChannelCount( + channel), + PixelChannelLayout.Int => sizeof(int) * GetChannelCount( + channel), + PixelChannelLayout.Float => sizeof(float) * GetChannelCount( + channel), + PixelChannelLayout.UByte332 => sizeof(byte), + PixelChannelLayout.UByte233Rev => sizeof(byte), + PixelChannelLayout.UShort565 => sizeof(short), + PixelChannelLayout.UShort565Rev => sizeof(short), + PixelChannelLayout.UShort4444 => sizeof(short), + PixelChannelLayout.UShort4444Rev => sizeof(short), + PixelChannelLayout.UShort5551 => sizeof(short), + PixelChannelLayout.UShort1555Rev => sizeof(short), + PixelChannelLayout.UInt8888 => sizeof(int), + PixelChannelLayout.UInt8888Rev => sizeof(int), + PixelChannelLayout.UInt1010102 => sizeof(int), + PixelChannelLayout.UInt2101010Rev => sizeof(int), + _ => throw new ArgumentException("Unknown layout type"), + }; + } + + } + + public enum ImageChannel : uint + { + + SingleColor = glConst.RED, + DoubleColor = glConst.RG, + TripleColor = glConst.RGB, + WithAlphaChannel = glConst.RGBA, + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/AutoTexture.cs b/StgsSharp.Graphics/OpenGL/Buffer/AutoTexture.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/Buffer/AutoTexture.cs rename to StgsSharp.Graphics/OpenGL/Buffer/AutoTexture.cs index 7f9de16e..3119cb3a 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/AutoTexture.cs +++ b/StgsSharp.Graphics/OpenGL/Buffer/AutoTexture.cs @@ -1,160 +1,160 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="AutoTexture" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Collections; -using StgSharp.Graphics; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; - -using System.Threading.Tasks; - -namespace StgSharp.Graphics.OpenGL -{ - /// - /// A collection of a sets of OpenGL textures. The collection can automatically select one of - /// the texture with minimum costs to upgrade pixels to BufferHandle. Usually is used for loading, but not for - /// target of . - /// - public sealed class AutoTextureGL - { - - private TextureProperty[] propertyCache; - private BidirectionalDictionary imageIndexMap = new BidirectionalDictionary( - ); - private Dictionary imageUpdateIndex = new Dictionary(); - - private int _size, _currentIndex; - private LinkedList usedTextureIndex; - private Queue unusedTextureUnitIndex; - private TextureGL texturePackage; - - private TextureProperty _textureProperty; - - private AutoTextureGL(TextureGL texture) - { - texturePackage = texture; - _size = texture.Count; - imageIndexMap = new BidirectionalDictionary(); - unusedTextureUnitIndex = new Queue(Enumerable.Range(0, _size)); - usedTextureIndex = new LinkedList(); - propertyCache = new TextureProperty[_size]; - } - - public AutoTextureGL(int textureObjectSize, [NotNull]glRender binding) - { - this._size = textureObjectSize; - imageIndexMap = new BidirectionalDictionary(); - texturePackage = new TextureGL(textureObjectSize, binding); - unusedTextureUnitIndex = new Queue(Enumerable.Range(0, _size)); - usedTextureIndex = new LinkedList(); - propertyCache = new TextureProperty[_size]; - } - - public TextureProperty DefaultTextureProperty - { - get => _textureProperty; - set => _textureProperty = value; - } - - private OpenGLFunction GL - { - get => texturePackage.GL; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SelectTextureAndBind(Image i) - { - TextureProperty property = _textureProperty; - - SelectTextureAndBind(i, property); - } - - public void SelectTextureAndBind([NotNull]Image i, TextureProperty property) - { - // usable texture with image match - if (imageIndexMap.TryGetValue(i, out int index)) - { - // prop setting match - if (propertyCache[index] == property) - { - _currentIndex = index; //GL.Assert(true); - texturePackage.Bind2D(index); //GL.Assert(true); - if (i.PixelUpdateCount != imageUpdateIndex[i]) - { - texturePackage.LoadTexture(index, i); //GL.Assert(true); - } - } else - { - _currentIndex = index; //GL.Assert(true); - texturePackage.Bind2D(index); //GL.Assert(true); - texturePackage.Set2dProperty(index, property); //GL.Assert(true); - if (i.PixelUpdateCount != imageUpdateIndex[i]) - { - texturePackage.LoadTexture(index, i); //GL.Assert(true); - } - } - } else - { - if (unusedTextureUnitIndex.TryDequeue(out int newIndex)) - { - // has extra unused texture object - imageIndexMap.Add(i, index); - texturePackage.Bind2D(index); - texturePackage.Set2dProperty(index, property); - texturePackage.LoadTexture(index, i); - usedTextureIndex.AddLast(newIndex); - propertyCache[newIndex] = property; - imageUpdateIndex[i] = i.PixelUpdateCount; - } else - { - // recycle from current - int reusedIndex = usedTextureIndex.First!.Value; - usedTextureIndex.RemoveFirst(); - usedTextureIndex.AddLast(reusedIndex); - imageIndexMap[i] = reusedIndex; - propertyCache[newIndex] = property; - imageUpdateIndex[i] = i.PixelUpdateCount; - } - } - } - - public static AutoTextureGL ToAuto([NotNull]TextureGL texture) - { - if (texture.IndexOfCurrentTexture != -1) { - throw new InvalidOperationException("Texture to be converted has been editted."); - } - return new AutoTextureGL(texture); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="AutoTexture" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Collections; +using StgSharp.Graphics; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; + +using System.Threading.Tasks; + +namespace StgSharp.Graphics.OpenGL +{ + /// + /// A collection of a sets of OpenGL textures. The collection can automatically select one of + /// the texture with minimum costs to upgrade pixels to BufferHandle. Usually is used for loading, but not for + /// target of . + /// + public sealed class AutoTextureGL + { + + private TextureProperty[] propertyCache; + private BidirectionalDictionary imageIndexMap = new BidirectionalDictionary( + ); + private Dictionary imageUpdateIndex = new Dictionary(); + + private int _size, _currentIndex; + private LinkedList usedTextureIndex; + private Queue unusedTextureUnitIndex; + private TextureGL texturePackage; + + private TextureProperty _textureProperty; + + private AutoTextureGL(TextureGL texture) + { + texturePackage = texture; + _size = texture.Count; + imageIndexMap = new BidirectionalDictionary(); + unusedTextureUnitIndex = new Queue(Enumerable.Range(0, _size)); + usedTextureIndex = new LinkedList(); + propertyCache = new TextureProperty[_size]; + } + + public AutoTextureGL(int textureObjectSize, [NotNull]glRender binding) + { + this._size = textureObjectSize; + imageIndexMap = new BidirectionalDictionary(); + texturePackage = new TextureGL(textureObjectSize, binding); + unusedTextureUnitIndex = new Queue(Enumerable.Range(0, _size)); + usedTextureIndex = new LinkedList(); + propertyCache = new TextureProperty[_size]; + } + + public TextureProperty DefaultTextureProperty + { + get => _textureProperty; + set => _textureProperty = value; + } + + private OpenGLFunction GL + { + get => texturePackage.GL; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SelectTextureAndBind(Image i) + { + TextureProperty property = _textureProperty; + + SelectTextureAndBind(i, property); + } + + public void SelectTextureAndBind([NotNull]Image i, TextureProperty property) + { + // usable texture with image match + if (imageIndexMap.TryGetValue(i, out int index)) + { + // prop setting match + if (propertyCache[index] == property) + { + _currentIndex = index; //GL.Assert(true); + texturePackage.Bind2D(index); //GL.Assert(true); + if (i.PixelUpdateCount != imageUpdateIndex[i]) + { + texturePackage.LoadTexture(index, i); //GL.Assert(true); + } + } else + { + _currentIndex = index; //GL.Assert(true); + texturePackage.Bind2D(index); //GL.Assert(true); + texturePackage.Set2dProperty(index, property); //GL.Assert(true); + if (i.PixelUpdateCount != imageUpdateIndex[i]) + { + texturePackage.LoadTexture(index, i); //GL.Assert(true); + } + } + } else + { + if (unusedTextureUnitIndex.TryDequeue(out int newIndex)) + { + // has extra unused texture object + imageIndexMap.Add(i, index); + texturePackage.Bind2D(index); + texturePackage.Set2dProperty(index, property); + texturePackage.LoadTexture(index, i); + usedTextureIndex.AddLast(newIndex); + propertyCache[newIndex] = property; + imageUpdateIndex[i] = i.PixelUpdateCount; + } else + { + // recycle from current + int reusedIndex = usedTextureIndex.First!.Value; + usedTextureIndex.RemoveFirst(); + usedTextureIndex.AddLast(reusedIndex); + imageIndexMap[i] = reusedIndex; + propertyCache[newIndex] = property; + imageUpdateIndex[i] = i.PixelUpdateCount; + } + } + } + + public static AutoTextureGL ToAuto([NotNull]TextureGL texture) + { + if (texture.IndexOfCurrentTexture != -1) { + throw new InvalidOperationException("Texture to be converted has been editted."); + } + return new AutoTextureGL(texture); + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/EBO.cs b/StgsSharp.Graphics/OpenGL/Buffer/EBO.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/Buffer/EBO.cs rename to StgsSharp.Graphics/OpenGL/Buffer/EBO.cs index c3db8628..b137ca90 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/EBO.cs +++ b/StgsSharp.Graphics/OpenGL/Buffer/EBO.cs @@ -1,81 +1,81 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="EBO" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Graphics.OpenGL; - -using StgSharp.Mathematics; - -using System; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - /// - /// A collection of handle to Element BufferHandle Object in OpenglFunc. Each value indexed from instance of this class this is the only handle to - /// one Element BufferHandle Object. - /// - public sealed unsafe class ElementBuffer : GlBufferObjectBase - { - - internal ElementBuffer(int n, glRender binding) - : base(binding) - { - _bufferHandle = GL.GenBuffers(n); - } - - public sealed override void Bind(int index) - { - GL.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); - } - - public void SetValue(int index, T[] bufferArray, BufferUsage usage) where T: unmanaged, INumber - { - GL.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); - GL.SetBufferData(BufferType.ElementArrayBuffer, bufferArray, usage); - } - - public void SetValue(int index, ReadOnlySpan bufferSpan, BufferUsage usage) where T: unmanaged, INumber - { - GL.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); - GL.SetBufferData(BufferType.ElementArrayBuffer, bufferSpan, usage); - } - - protected sealed override void Dispose(bool disposing) - { - if (disposing) { - GL.DeleteBuffers(_bufferHandle); - } - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="EBO" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Graphics.OpenGL; + +using StgSharp.Mathematics; + +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + /// + /// A collection of handle to Element BufferHandle Object in OpenglFunc. Each value indexed from instance of this class this is the only handle to + /// one Element BufferHandle Object. + /// + public sealed unsafe class ElementBuffer : GlBufferObjectBase + { + + internal ElementBuffer(int n, glRender binding) + : base(binding) + { + _bufferHandle = GL.GenBuffers(n); + } + + public sealed override void Bind(int index) + { + GL.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); + } + + public void SetValue(int index, T[] bufferArray, BufferUsage usage) where T: unmanaged, INumber + { + GL.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); + GL.SetBufferData(BufferType.ElementArrayBuffer, bufferArray, usage); + } + + public void SetValue(int index, ReadOnlySpan bufferSpan, BufferUsage usage) where T: unmanaged, INumber + { + GL.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); + GL.SetBufferData(BufferType.ElementArrayBuffer, bufferSpan, usage); + } + + protected sealed override void Dispose(bool disposing) + { + if (disposing) { + GL.DeleteBuffers(_bufferHandle); + } + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs b/StgsSharp.Graphics/OpenGL/Buffer/FBO.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs rename to StgsSharp.Graphics/OpenGL/Buffer/FBO.cs index 07dbe6c7..dd295fe8 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs +++ b/StgsSharp.Graphics/OpenGL/Buffer/FBO.cs @@ -1,115 +1,115 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="FBO" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -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, - - } - - public sealed class FrameBuffer : GlBufferObjectBase - { - - internal unsafe FrameBuffer( - int count, - glRender binding - ) - : base(binding) - { - _bufferHandle = new GlHandle[count]; - GL.GenFrameBuffers(_bufferHandle); - } - - /// - /// Bind the frame BufferHandle object with _label frame BufferHandle to the frame - /// BufferHandle target specified by target. will - /// be set as default target. - /// - /// - /// Index of object to be binded in handle set - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override unsafe void Bind( - int index - ) - { - GL.BindFrameBuffer(FrameBufferTarget.All, _bufferHandle[index]); - } - - /// - /// Bind the frame BufferHandle object with _label frame BufferHandle to the frame - /// BufferHandle target specified by target. Target of this frame BufferHandle should be - /// set manually. - /// - /// - /// The frame BufferHandle target of the binding operation. - /// - /// - /// Index of object to be binded in handle set - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void Bind( - FrameBufferTarget target, - int index - ) - { - GL.BindFrameBuffer(target, _bufferHandle[index]); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void BindNull() - { - OpenGLFunction.CurrentGL.BindFrameBuffer(FrameBufferTarget.All, GlHandle.Zero); - } - - protected override void Dispose( - bool disposing - ) - { - throw new NotImplementedException(); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="FBO" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +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, + + } + + public sealed class FrameBuffer : GlBufferObjectBase + { + + internal unsafe FrameBuffer( + int count, + glRender binding + ) + : base(binding) + { + _bufferHandle = new GlHandle[count]; + GL.GenFrameBuffers(_bufferHandle); + } + + /// + /// Bind the frame BufferHandle object with _label frame BufferHandle to the frame + /// BufferHandle target specified by target. will + /// be set as default target. + /// + /// + /// Index of object to be binded in handle set + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override unsafe void Bind( + int index + ) + { + GL.BindFrameBuffer(FrameBufferTarget.All, _bufferHandle[index]); + } + + /// + /// Bind the frame BufferHandle object with _label frame BufferHandle to the frame + /// BufferHandle target specified by target. Target of this frame BufferHandle should be + /// set manually. + /// + /// + /// The frame BufferHandle target of the binding operation. + /// + /// + /// Index of object to be binded in handle set + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Bind( + FrameBufferTarget target, + int index + ) + { + GL.BindFrameBuffer(target, _bufferHandle[index]); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void BindNull() + { + OpenGLFunction.CurrentGL.BindFrameBuffer(FrameBufferTarget.All, GlHandle.Zero); + } + + protected override void Dispose( + bool disposing + ) + { + throw new NotImplementedException(); + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/GLBufferObjectBase.cs b/StgsSharp.Graphics/OpenGL/Buffer/GLBufferObjectBase.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/Buffer/GLBufferObjectBase.cs rename to StgsSharp.Graphics/OpenGL/Buffer/GLBufferObjectBase.cs index d4b20194..a3c5c756 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/GLBufferObjectBase.cs +++ b/StgsSharp.Graphics/OpenGL/Buffer/GLBufferObjectBase.cs @@ -1,50 +1,50 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="GLBufferObjectBase" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; - -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - public abstract class GlBufferObjectBase : BufferObjectBase - { - - private readonly glRender _contextBinding; - - protected GlBufferObjectBase(glRender contextBinding) - { - binding = contextBinding; - _contextBinding = contextBinding; - } - - protected OpenGLFunction GL => _contextBinding.GL; - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="GLBufferObjectBase" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + public abstract class GlBufferObjectBase : BufferObjectBase + { + + private readonly glRender _contextBinding; + + protected GlBufferObjectBase(glRender contextBinding) + { + binding = contextBinding; + _contextBinding = contextBinding; + } + + protected OpenGLFunction GL => _contextBinding.GL; + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/RBO.cs b/StgsSharp.Graphics/OpenGL/Buffer/RBO.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/Buffer/RBO.cs rename to StgsSharp.Graphics/OpenGL/Buffer/RBO.cs index d7960a2d..13868597 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/RBO.cs +++ b/StgsSharp.Graphics/OpenGL/Buffer/RBO.cs @@ -1,67 +1,67 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="RBO" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using System; -using System.Collections.Generic; -using System.Security.Principal; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - public sealed class RenderBuffer : GlBufferObjectBase - { - - public RenderBuffer(int count, glRender binding) - : base(binding) - { - _bufferHandle = GL.GenRenderBuffer(count); - } - - public override void Bind(int index) - { - GL.BindRenderBuffer(this[index]); - } - - public void Store(RenderBufferInternalFormat format, (int width, int height) size) - { - if ((size.width > binding.Width) || (size.height > binding.Height)) { - World.LogWarning("FrameBuffer is larger than current canvas binding"); - } - } - - protected override void Dispose(bool disposing) - { - foreach (GlHandle item in _bufferHandle) - { - Console.WriteLine("removing a render buffer"); - GL.DeleteRenderBuffer(item); - } - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="RBO" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using System; +using System.Collections.Generic; +using System.Security.Principal; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + public sealed class RenderBuffer : GlBufferObjectBase + { + + public RenderBuffer(int count, glRender binding) + : base(binding) + { + _bufferHandle = GL.GenRenderBuffer(count); + } + + public override void Bind(int index) + { + GL.BindRenderBuffer(this[index]); + } + + public void Store(RenderBufferInternalFormat format, (int width, int height) size) + { + if ((size.width > binding.Width) || (size.height > binding.Height)) { + World.LogWarning("FrameBuffer is larger than current canvas binding"); + } + } + + protected override void Dispose(bool disposing) + { + foreach (GlHandle item in _bufferHandle) + { + Console.WriteLine("removing a render buffer"); + GL.DeleteRenderBuffer(item); + } + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/TextureGL.cs b/StgsSharp.Graphics/OpenGL/Buffer/TextureGL.cs similarity index 96% rename from StgSharp.Common/Graphics/OpenGL/Buffer/TextureGL.cs rename to StgsSharp.Graphics/OpenGL/Buffer/TextureGL.cs index 70706983..d3ed5347 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/TextureGL.cs +++ b/StgsSharp.Graphics/OpenGL/Buffer/TextureGL.cs @@ -1,311 +1,311 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="TextureGL" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.HighPerformance; - -using System; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Graphics.OpenGL -{ - public sealed unsafe class TextureGL - { - - private int currentEditingTextureIndex; - - private OpenGLFunction _gl; - internal GlHandle[] _textureHandle; - - internal TextureGL( - int count, - glRender binding - ) - { - // sourceList = new Image[count]; - this._gl = binding.GL; - _textureHandle = _gl.GenTextures(count); - } - - public GlHandle this[ - int index - ] - { - get => _textureHandle[index]; - } - - public int Count - { - get => _textureHandle.Length; - } - - // internal Image[] sourceList; - - public int IndexOfCurrentTexture - { - get => currentEditingTextureIndex; - } - - internal OpenGLFunction GL => _gl; - - public void ActivateAs( - TextureUnit unit - ) - { - _gl.ActiveTextureUnit((uint)unit); - } - - public void Bind2D( - int index - ) - { - currentEditingTextureIndex = index; - _gl.BindTexture(glConst.TEXTURE_2D, _textureHandle[index]); - } - - /// - /// Load an to certain texture. - /// - /// - /// - /// - /// - /// - /// - public unsafe void LoadTexture( - int index, - Image i - ) - { - byte[] handle = i.PixelBuffer; - _gl.TextureImage2d(Texture2DTarget.Texture2D, 0, i.Channel, i.Width, i.Height, - i.Channel, i.PixelLayout, pixels:handle); - _gl.GenerateMipmap(Texture2DTarget.Texture2D); - } - - #region texture setting - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Set2dFilterProperty( - int index, - TextureFilter onMinify, - TextureFilter onMagnify - ) - { - #if DEBUG - if (index != currentEditingTextureIndex) - { - throw new InvalidOperationException( - "Texture to be editted is not the one being activated."); - } - #endif - _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_MIN_FILTER, (int)onMinify); - _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_MAG_FILTER, - (int)onMagnify); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Set2dWrapProperty( - int index, - TextureWrap onHorizontial, - TextureWrap onVertical - ) - { - #if DEBUG - if (index != currentEditingTextureIndex) - { - throw new InvalidOperationException( - "Texture to be editted is not the one being activated."); - } - #endif - _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_S, - (int)onHorizontial); - _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_T, (int)onVertical); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Set2dProperty( - int index, - TextureProperty property - ) - { - Set2dFilterProperty(index, property.FilterOnMinify, property.FilterOnMagnify); - Set2dWrapProperty(index, property.WrapOnHorizontial, property.WrapOnVertical); - } - - #endregion texture setting - } - - [StructLayout(LayoutKind.Explicit)] - public struct TextureProperty - { - - [FieldOffset(0)] private M128 mask; - [FieldOffset(0)] private TextureFilter mag; - [FieldOffset(4)] private TextureFilter min; - - [FieldOffset(8)] private TextureWrap hori; - [FieldOffset(12)] private TextureWrap vert; - - public TextureProperty( - TextureFilter onMagnify, - TextureFilter onMinify, - TextureWrap onHorizontial, - TextureWrap onVertical - ) - { - FilterOnMagnify = onMagnify; - FilterOnMinify = onMinify; - WrapOnHorizontial = onHorizontial; - WrapOnVertical = onVertical; - } - - public TextureFilter FilterOnMagnify - { - get => mag; - set => mag = value; - } - - public TextureFilter FilterOnMinify - { - get => min; - set => min = value; - } - - public TextureWrap WrapOnHorizontial - { - get => hori; - set => hori = value; - } - - public TextureWrap WrapOnVertical - { - get => vert; - set => vert = value; - } - - public override bool Equals( - [NotNullWhen(true)] object obj - ) - { - return base.Equals(obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(FilterOnMagnify, FilterOnMagnify, WrapOnHorizontial, - WrapOnVertical); - } - - public override string ToString() - { - return $"FilterOnMagnify:{FilterOnMagnify}, " + $"FilterOnMagnify:{FilterOnMagnify}, " + $"WrapOnHorizontial:{WrapOnHorizontial}, " + $"WrapOnVertical:{WrapOnVertical}"; - } - - public static bool operator !=( - TextureProperty left, - TextureProperty right - ) - { - return left.mask != right.mask; - } - - public static bool operator ==( - TextureProperty left, - TextureProperty right - ) - { - return left.mask == right.mask; - } - - public static implicit operator TextureProperty( - ( - TextureFilter onMagnify, TextureFilter onMinify, - TextureWrap onHorizontial, TextureWrap onVertical - ) propertyValueTuple - ) - { - return new TextureProperty(propertyValueTuple.onMagnify, propertyValueTuple.onMinify, - propertyValueTuple.onHorizontial, - propertyValueTuple.onVertical); - } - - } - - #pragma warning disable CA1008 - public enum TextureFilter - #pragma warning restore CA1008 - { - - Nearest = glConst.NEAREST, - Linear = glConst.LINEAR, - NearestLinearMipmap = glConst.NEAREST_MIPMAP_LINEAR, - LinearLinearMipmap = glConst.LINEAR_MIPMAP_LINEAR, - NearestNearestMipmap = glConst.NEAREST_MIPMAP_NEAREST, - LinearNearestMipmap = glConst.LINEAR_MIPMAP_NEAREST, - - } - - #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 - { - - Repeat = glConst.REPEAT, - MirroredRepeat = glConst.MIRRORED_REPEAT, - ClampToEdge = glConst.CLAMP_TO_EDGE, - ClampToBorder = glConst.CLAMP_TO_BORDER, - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="TextureGL" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.HighPerformance; + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics.OpenGL +{ + public sealed unsafe class TextureGL + { + + private int currentEditingTextureIndex; + + private OpenGLFunction _gl; + internal GlHandle[] _textureHandle; + + internal TextureGL( + int count, + glRender binding + ) + { + // sourceList = new Image[count]; + this._gl = binding.GL; + _textureHandle = _gl.GenTextures(count); + } + + public GlHandle this[ + int index + ] + { + get => _textureHandle[index]; + } + + public int Count + { + get => _textureHandle.Length; + } + + // internal Image[] sourceList; + + public int IndexOfCurrentTexture + { + get => currentEditingTextureIndex; + } + + internal OpenGLFunction GL => _gl; + + public void ActivateAs( + TextureUnit unit + ) + { + _gl.ActiveTextureUnit((uint)unit); + } + + public void Bind2D( + int index + ) + { + currentEditingTextureIndex = index; + _gl.BindTexture(glConst.TEXTURE_2D, _textureHandle[index]); + } + + /// + /// Load an to certain texture. + /// + /// + /// + /// + /// + /// + /// + public unsafe void LoadTexture( + int index, + Image i + ) + { + byte[] handle = i.PixelBuffer; + _gl.TextureImage2d(Texture2DTarget.Texture2D, 0, i.Channel, i.Width, i.Height, + i.Channel, i.PixelLayout, pixels:handle); + _gl.GenerateMipmap(Texture2DTarget.Texture2D); + } + + #region texture setting + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Set2dFilterProperty( + int index, + TextureFilter onMinify, + TextureFilter onMagnify + ) + { + #if DEBUG + if (index != currentEditingTextureIndex) + { + throw new InvalidOperationException( + "Texture to be editted is not the one being activated."); + } + #endif + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_MIN_FILTER, (int)onMinify); + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_MAG_FILTER, + (int)onMagnify); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Set2dWrapProperty( + int index, + TextureWrap onHorizontial, + TextureWrap onVertical + ) + { + #if DEBUG + if (index != currentEditingTextureIndex) + { + throw new InvalidOperationException( + "Texture to be editted is not the one being activated."); + } + #endif + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_S, + (int)onHorizontial); + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_T, (int)onVertical); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Set2dProperty( + int index, + TextureProperty property + ) + { + Set2dFilterProperty(index, property.FilterOnMinify, property.FilterOnMagnify); + Set2dWrapProperty(index, property.WrapOnHorizontial, property.WrapOnVertical); + } + + #endregion texture setting + } + + [StructLayout(LayoutKind.Explicit)] + public struct TextureProperty + { + + [FieldOffset(0)] private M128 mask; + [FieldOffset(0)] private TextureFilter mag; + [FieldOffset(4)] private TextureFilter min; + + [FieldOffset(8)] private TextureWrap hori; + [FieldOffset(12)] private TextureWrap vert; + + public TextureProperty( + TextureFilter onMagnify, + TextureFilter onMinify, + TextureWrap onHorizontial, + TextureWrap onVertical + ) + { + FilterOnMagnify = onMagnify; + FilterOnMinify = onMinify; + WrapOnHorizontial = onHorizontial; + WrapOnVertical = onVertical; + } + + public TextureFilter FilterOnMagnify + { + get => mag; + set => mag = value; + } + + public TextureFilter FilterOnMinify + { + get => min; + set => min = value; + } + + public TextureWrap WrapOnHorizontial + { + get => hori; + set => hori = value; + } + + public TextureWrap WrapOnVertical + { + get => vert; + set => vert = value; + } + + public override bool Equals( + [NotNullWhen(true)] object obj + ) + { + return base.Equals(obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(FilterOnMagnify, FilterOnMagnify, WrapOnHorizontial, + WrapOnVertical); + } + + public override string ToString() + { + return $"FilterOnMagnify:{FilterOnMagnify}, " + $"FilterOnMagnify:{FilterOnMagnify}, " + $"WrapOnHorizontial:{WrapOnHorizontial}, " + $"WrapOnVertical:{WrapOnVertical}"; + } + + public static bool operator !=( + TextureProperty left, + TextureProperty right + ) + { + return left.mask != right.mask; + } + + public static bool operator ==( + TextureProperty left, + TextureProperty right + ) + { + return left.mask == right.mask; + } + + public static implicit operator TextureProperty( + ( + TextureFilter onMagnify, TextureFilter onMinify, + TextureWrap onHorizontial, TextureWrap onVertical + ) propertyValueTuple + ) + { + return new TextureProperty(propertyValueTuple.onMagnify, propertyValueTuple.onMinify, + propertyValueTuple.onHorizontial, + propertyValueTuple.onVertical); + } + + } + + #pragma warning disable CA1008 + public enum TextureFilter + #pragma warning restore CA1008 + { + + Nearest = glConst.NEAREST, + Linear = glConst.LINEAR, + NearestLinearMipmap = glConst.NEAREST_MIPMAP_LINEAR, + LinearLinearMipmap = glConst.LINEAR_MIPMAP_LINEAR, + NearestNearestMipmap = glConst.NEAREST_MIPMAP_NEAREST, + LinearNearestMipmap = glConst.LINEAR_MIPMAP_NEAREST, + + } + + #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 + { + + Repeat = glConst.REPEAT, + MirroredRepeat = glConst.MIRRORED_REPEAT, + ClampToEdge = glConst.CLAMP_TO_EDGE, + ClampToBorder = glConst.CLAMP_TO_BORDER, + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/VAO.cs b/StgsSharp.Graphics/OpenGL/Buffer/VAO.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/Buffer/VAO.cs rename to StgsSharp.Graphics/OpenGL/Buffer/VAO.cs index 8da27daa..c81649d3 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/VAO.cs +++ b/StgsSharp.Graphics/OpenGL/Buffer/VAO.cs @@ -1,86 +1,86 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="VAO" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - public sealed unsafe class VertexArray : GlBufferObjectBase - { - - internal VertexArray( - int n, - glRender binding - ) - : base(binding) - { - _bufferHandle = GL.GenVertexArrays(n); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public sealed override void Bind( - int index - ) - { - GL.BindVertexArray(_bufferHandle[index]); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void BindNull() - { - OpenGLFunction.CurrentGL.BindVertexArray(GlHandle.Zero); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetVertexAttribute( - uint attributeIndex, - int vertexLength, - TypeCode dataType, - bool isNomalized, - int stride, - int pointer - ) - { - GL.SetVertexAttribute(attributeIndex, vertexLength, dataType, isNomalized, stride, - pointer); - } - - protected sealed override void Dispose( - bool disposing - ) - { - if (disposing) { - GL.DeleteVertexArrays(_bufferHandle); - } - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="VAO" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + public sealed unsafe class VertexArray : GlBufferObjectBase + { + + internal VertexArray( + int n, + glRender binding + ) + : base(binding) + { + _bufferHandle = GL.GenVertexArrays(n); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public sealed override void Bind( + int index + ) + { + GL.BindVertexArray(_bufferHandle[index]); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void BindNull() + { + OpenGLFunction.CurrentGL.BindVertexArray(GlHandle.Zero); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetVertexAttribute( + uint attributeIndex, + int vertexLength, + TypeCode dataType, + bool isNomalized, + int stride, + int pointer + ) + { + GL.SetVertexAttribute(attributeIndex, vertexLength, dataType, isNomalized, stride, + pointer); + } + + protected sealed override void Dispose( + bool disposing + ) + { + if (disposing) { + GL.DeleteVertexArrays(_bufferHandle); + } + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/VBO.cs b/StgsSharp.Graphics/OpenGL/Buffer/VBO.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/Buffer/VBO.cs rename to StgsSharp.Graphics/OpenGL/Buffer/VBO.cs index db1e6047..5451fe87 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/VBO.cs +++ b/StgsSharp.Graphics/OpenGL/Buffer/VBO.cs @@ -1,181 +1,181 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="VBO" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Mathematics; -using StgSharp.Mathematics.Numeric; - -using System; -using System.Collections.Generic; -using System.Net.Security; -using System.Numerics; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - public sealed unsafe class VertexBuffer : GlBufferObjectBase - { - - internal VertexBuffer( - int n, - glRender binding - ) - : base(binding) - { - _bufferHandle = GL.GenBuffers(n); - } - - public sealed override void Bind( - int index - ) - { - GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); - } - - /// - /// - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Unbind() - { - GL.BindBuffer(BufferType.ArrayBuffer, GlHandle.Zero); - } - - /// - /// Set _data to current vertex BufferHandle object - /// - /// - /// Type of bufferData - /// - /// - /// Index to find certain VBO in this instance - /// - /// - /// Data to write in - /// - /// - /// How OpenGL use these _data, defined by - /// - public void WriteScalerData( - int index, - T[] bufferArray, - BufferUsage usage - ) where T : unmanaged, INumber - { - GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); - GL.SetBufferData(BufferType.ArrayBuffer, bufferArray, usage); - } - - /// - /// Set _data to current vertex BufferHandle object - /// - /// - /// Type of bufferData - /// - /// - /// Index to find certain VBO in this instance - /// - /// - /// A of _data to write in - /// - /// - /// How OpenGL use these _data, defined by - /// - public void WriteScalerData( - int index, - ReadOnlySpan scalerSpan, - BufferUsage usage - ) where T : unmanaged,INumber - { - GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); - GL.SetBufferData(BufferType.ArrayBuffer, scalerSpan, usage); - } - - /// - /// Set data to current vertex BufferHandle object - /// - /// - /// Type of bufferData - /// - /// - /// Index to find certain VBO in this instance - /// - /// - /// A of data to write in - /// - /// - /// How OpenGL use these data, defined by - /// - public void WriteVectorData( - int index, - ReadOnlySpan vectorSpan, - BufferUsage usage - ) where T : unmanaged, IUnmanagedVector - { - GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); - GL.SetBufferVectorData(BufferType.ArrayBuffer, vectorSpan, usage); - } - - /// - /// Set _data to current vertex BufferHandle object - /// - /// - /// Type of bufferData - /// - /// - /// Index to find certain VBO in this instance - /// - /// - /// A array of _data to write in - /// - /// - /// How OpenGL use these _data, defined by - /// - public void WriteVectorData( - int index, - T[] vectorArray, - BufferUsage usage - ) where T : unmanaged, IUnmanagedVector - { - GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); - GL.SetBufferVectorData(BufferType.ArrayBuffer, vectorArray, usage); - } - - protected sealed override void Dispose( - bool disposing - ) - { - if (disposing) { - GL.DeleteBuffers(_bufferHandle); - } - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="VBO" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Mathematics; +using StgSharp.Mathematics.Numeric; + +using System; +using System.Collections.Generic; +using System.Net.Security; +using System.Numerics; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + public sealed unsafe class VertexBuffer : GlBufferObjectBase + { + + internal VertexBuffer( + int n, + glRender binding + ) + : base(binding) + { + _bufferHandle = GL.GenBuffers(n); + } + + public sealed override void Bind( + int index + ) + { + GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + } + + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Unbind() + { + GL.BindBuffer(BufferType.ArrayBuffer, GlHandle.Zero); + } + + /// + /// Set _data to current vertex BufferHandle object + /// + /// + /// Type of bufferData + /// + /// + /// Index to find certain VBO in this instance + /// + /// + /// Data to write in + /// + /// + /// How OpenGL use these _data, defined by + /// + public void WriteScalerData( + int index, + T[] bufferArray, + BufferUsage usage + ) where T : unmanaged, INumber + { + GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + GL.SetBufferData(BufferType.ArrayBuffer, bufferArray, usage); + } + + /// + /// Set _data to current vertex BufferHandle object + /// + /// + /// Type of bufferData + /// + /// + /// Index to find certain VBO in this instance + /// + /// + /// A of _data to write in + /// + /// + /// How OpenGL use these _data, defined by + /// + public void WriteScalerData( + int index, + ReadOnlySpan scalerSpan, + BufferUsage usage + ) where T : unmanaged,INumber + { + GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + GL.SetBufferData(BufferType.ArrayBuffer, scalerSpan, usage); + } + + /// + /// Set data to current vertex BufferHandle object + /// + /// + /// Type of bufferData + /// + /// + /// Index to find certain VBO in this instance + /// + /// + /// A of data to write in + /// + /// + /// How OpenGL use these data, defined by + /// + public void WriteVectorData( + int index, + ReadOnlySpan vectorSpan, + BufferUsage usage + ) where T : unmanaged, IUnmanagedVector + { + GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + GL.SetBufferVectorData(BufferType.ArrayBuffer, vectorSpan, usage); + } + + /// + /// Set _data to current vertex BufferHandle object + /// + /// + /// Type of bufferData + /// + /// + /// Index to find certain VBO in this instance + /// + /// + /// A array of _data to write in + /// + /// + /// How OpenGL use these _data, defined by + /// + public void WriteVectorData( + int index, + T[] vectorArray, + BufferUsage usage + ) where T : unmanaged, IUnmanagedVector + { + GL.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + GL.SetBufferVectorData(BufferType.ArrayBuffer, vectorArray, usage); + } + + protected sealed override void Dispose( + bool disposing + ) + { + if (disposing) { + GL.DeleteBuffers(_bufferHandle); + } + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/IglConvertable.cs b/StgsSharp.Graphics/OpenGL/ShaderEdit/IglConvertable.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/ShaderEdit/IglConvertable.cs rename to StgsSharp.Graphics/OpenGL/ShaderEdit/IglConvertable.cs index 51e617ba..b555891b 100644 --- a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/IglConvertable.cs +++ b/StgsSharp.Graphics/OpenGL/ShaderEdit/IglConvertable.cs @@ -1,65 +1,65 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="IglConvertable" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics.ShaderEdit -{ - public interface IglConvertable - { - - /// - /// - /// - public void DisplayGLtypeDefinition(); - - /// - /// - /// - public void GainAllUniforms(ShaderProgram source, params string[] uniformName); - - /// - /// - /// - /// - /// - /// - public ShaderStruct GetConvertedGLtype(); - - /// - /// - /// - public void SetAllUniforms(); - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="IglConvertable" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.ShaderEdit +{ + public interface IglConvertable + { + + /// + /// + /// + public void DisplayGLtypeDefinition(); + + /// + /// + /// + public void GainAllUniforms(ShaderProgram source, params string[] uniformName); + + /// + /// + /// + /// + /// + /// + public ShaderStruct GetConvertedGLtype(); + + /// + /// + /// + public void SetAllUniforms(); + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Shader.cs b/StgsSharp.Graphics/OpenGL/ShaderEdit/Shader.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/ShaderEdit/Shader.cs rename to StgsSharp.Graphics/OpenGL/ShaderEdit/Shader.cs index 0cc7cdb9..cbe4b5b5 100644 --- a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Shader.cs +++ b/StgsSharp.Graphics/OpenGL/ShaderEdit/Shader.cs @@ -1,318 +1,318 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Shader" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp; -using StgSharp.Graphics; -using StgSharp.Internal; - -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Xml.Linq; - -namespace StgSharp.Graphics.OpenGL -{ - public abstract partial class glRender : RenderStream - { - - /// - /// Create an instance of program - /// - /// - /// New instance of instance. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected sealed override ShaderProgram CreateShaderProgram() - { - return new ShaderProgram(this); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected sealed override Shader CreateShaderSegment( - ShaderType type, - int count - ) - { - return new Shader(GL.CreateShaderSet(count, type), type, this); - } - - } - - public class Shader : ISSDSerializable - { - - private readonly OpenGLFunction GL; - internal readonly GlHandle[] handle; - public readonly ShaderType type; - - internal unsafe Shader( - GlHandle[] handle, - ShaderType usage, - glRender stream - ) - { - this.handle = handle; - GL = stream.GL; - type = usage; - } - - public SerializableTypeCode SSDTypeCode => SerializableTypeCode.Shader; - - /// - /// Attach one shader code to a shader program. - /// - /// - /// Shader program to attach - /// - /// - /// Index of shader code in current shader code set. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void AttachTo( - int index, - [NotNull]ShaderProgram target - ) - { - GL.AttachShader(target.handle, handle[index]); - } - - public void CheckStatus( - int index, - ShaderStatus status - ) - { - string log = GL.GetShaderStatus(this, index, (int)status); - if (!string.IsNullOrEmpty(log)) { - throw new InvalidOperationException($"{$"Shader Error \t{status}\n"}{log}"); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void Compile( - int index, - ReadOnlySpan codeU8Stream - ) - { - GL.LoadShaderSource(handle[index], codeU8Stream); - GL.CompileShader(handle[index]); - CheckStatus(index, ShaderStatus.CompileStatus); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void Compile( - int index, - byte[] codeStream - ) - { - ArgumentNullException.ThrowIfNull(codeStream); - GL.LoadShaderSource(handle[index], codeStream); - GL.CompileShader(handle[index]); - CheckStatus(index, ShaderStatus.CompileStatus); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void Compile( - int index, - string codeStream - ) - { - ArgumentNullException.ThrowIfNull(codeStream); - GL.LoadShaderSource(handle[index], codeStream.AsSpan()); - GL.CompileShader(handle[index]); - CheckStatus(index, ShaderStatus.CompileStatus); - } - - public void FromBytes( - byte[] stream - ) - { - throw new NotImplementedException(); - } - - public static byte[] FromCodeFile( - string fileRoute - ) - { - string str = File.ReadAllText(fileRoute); - if (string.IsNullOrEmpty(str)) { - throw new InvalidOperationException($"Cannot load and GLSL code from {fileRoute}"); - } - return Encoding.UTF8.GetBytes(str); - } - - public byte[] GetBytes() - { - return Array.Empty(); - } - - public byte[] GetBytes( - out int length - ) - { - throw new NotImplementedException(); - } - - public override string ToString() - { - return $"This is a {type} shader, its shader handles are {handle.ToString()}."; - } - - } - - public enum ShaderStatus : int - { - - CompileStatus = glConst.COMPILE_STATUS, - - } - - public class ShaderProgram - { - - private readonly OpenGLFunction GL; - internal readonly GlHandle handle; - - /// - /// CustomizeInit a program with no shader attached. - /// - internal unsafe ShaderProgram( - glRender binding - ) - { - GL = binding.GL; - handle = GL.CreateProgram(); - } - - /// - /// Get a uniform form current shader, the value type of the uniform should be provided. - /// - /// - /// ContextName of the Uniform in shader code - /// - /// - /// - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe Uniform GetUniform( - string name - ) where T : unmanaged - { - return new Uniform(GL.GetUniformLocation(this.handle, name)); - } - - /// - /// Get a uniform form current shader, the value type of the uniform should be provided. - /// - /// - /// ContextName of the Uniform in shader code - /// - /// - /// - /// - public unsafe Uniform GetUniform( - string name - ) where T : unmanaged where U : struct - { - return new Uniform(GL.GetUniformLocation(this.handle, name)); - } - - /// - /// Get a uniform form current shader, the value type of the uniform should be provided. - /// - /// - /// ContextName of the Uniform in shader code - /// - /// - /// - /// - public unsafe Uniform GetUniform( - string name - ) where T : unmanaged where U : struct where V : struct - { - return new Uniform(GL.GetUniformLocation(this.handle, name)); - } - - /// - /// Get a uniform form current shader, the value type of the uniform should be provided. - /// - /// - /// ContextName of the Uniform in shader code - /// - /// - /// - /// - public unsafe Uniform GetUniform( - string name - ) where T : unmanaged where U : struct where V : struct where W : struct - { - return new Uniform(GL.GetUniformLocation(this.handle, name)); - } - - /// - /// Link the shader to current viewPortDisplay. - /// - public unsafe void Link() - { - if (GraphicFramework.InternalLinkShaderProgram( - (OpenglContext*)this.GL.ContextHandle, handle.Value) == 0) - { - IntPtr logPtr = GraphicFramework.InternalReadSSCLog(); - try - { - byte[] logByte = new byte[512]; - Marshal.Copy(logPtr, logByte, 0, 512); - string log = Encoding.UTF8.GetString(logByte); - log = log.Replace("\0", string.Empty); - DefaultLog.InternalWriteLog(log, LogType.Error); - } - catch (Exception ex) - { - DefaultLog.InternalWriteLog(ex.Message, LogType.Error); - } - } - } - - /// - /// Let the current viewPortDisplay use this shader. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void Use() - { - GL.UseProgram(handle); - } - - ~ShaderProgram() - { - // handle.Dispose(); - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Shader" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp; +using StgSharp.Graphics; +using StgSharp.Internal; + +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Xml.Linq; + +namespace StgSharp.Graphics.OpenGL +{ + public abstract partial class glRender : RenderStream + { + + /// + /// Create an instance of program + /// + /// + /// New instance of instance. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected sealed override ShaderProgram CreateShaderProgram() + { + return new ShaderProgram(this); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected sealed override Shader CreateShaderSegment( + ShaderType type, + int count + ) + { + return new Shader(GL.CreateShaderSet(count, type), type, this); + } + + } + + public class Shader : ISSDSerializable + { + + private readonly OpenGLFunction GL; + internal readonly GlHandle[] handle; + public readonly ShaderType type; + + internal unsafe Shader( + GlHandle[] handle, + ShaderType usage, + glRender stream + ) + { + this.handle = handle; + GL = stream.GL; + type = usage; + } + + public SerializableTypeCode SSDTypeCode => SerializableTypeCode.Shader; + + /// + /// Attach one shader code to a shader program. + /// + /// + /// Shader program to attach + /// + /// + /// Index of shader code in current shader code set. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AttachTo( + int index, + [NotNull]ShaderProgram target + ) + { + GL.AttachShader(target.handle, handle[index]); + } + + public void CheckStatus( + int index, + ShaderStatus status + ) + { + string log = GL.GetShaderStatus(this, index, (int)status); + if (!string.IsNullOrEmpty(log)) { + throw new InvalidOperationException($"{$"Shader Error \t{status}\n"}{log}"); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Compile( + int index, + ReadOnlySpan codeU8Stream + ) + { + GL.LoadShaderSource(handle[index], codeU8Stream); + GL.CompileShader(handle[index]); + CheckStatus(index, ShaderStatus.CompileStatus); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Compile( + int index, + byte[] codeStream + ) + { + ArgumentNullException.ThrowIfNull(codeStream); + GL.LoadShaderSource(handle[index], codeStream); + GL.CompileShader(handle[index]); + CheckStatus(index, ShaderStatus.CompileStatus); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Compile( + int index, + string codeStream + ) + { + ArgumentNullException.ThrowIfNull(codeStream); + GL.LoadShaderSource(handle[index], codeStream.AsSpan()); + GL.CompileShader(handle[index]); + CheckStatus(index, ShaderStatus.CompileStatus); + } + + public void FromBytes( + byte[] stream + ) + { + throw new NotImplementedException(); + } + + public static byte[] FromCodeFile( + string fileRoute + ) + { + string str = File.ReadAllText(fileRoute); + if (string.IsNullOrEmpty(str)) { + throw new InvalidOperationException($"Cannot load and GLSL code from {fileRoute}"); + } + return Encoding.UTF8.GetBytes(str); + } + + public byte[] GetBytes() + { + return Array.Empty(); + } + + public byte[] GetBytes( + out int length + ) + { + throw new NotImplementedException(); + } + + public override string ToString() + { + return $"This is a {type} shader, its shader handles are {handle.ToString()}."; + } + + } + + public enum ShaderStatus : int + { + + CompileStatus = glConst.COMPILE_STATUS, + + } + + public class ShaderProgram + { + + private readonly OpenGLFunction GL; + internal readonly GlHandle handle; + + /// + /// CustomizeInit a program with no shader attached. + /// + internal unsafe ShaderProgram( + glRender binding + ) + { + GL = binding.GL; + handle = GL.CreateProgram(); + } + + /// + /// Get a uniform form current shader, the value type of the uniform should be provided. + /// + /// + /// ContextName of the Uniform in shader code + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe Uniform GetUniform( + string name + ) where T : unmanaged + { + return new Uniform(GL.GetUniformLocation(this.handle, name)); + } + + /// + /// Get a uniform form current shader, the value type of the uniform should be provided. + /// + /// + /// ContextName of the Uniform in shader code + /// + /// + /// + /// + public unsafe Uniform GetUniform( + string name + ) where T : unmanaged where U : struct + { + return new Uniform(GL.GetUniformLocation(this.handle, name)); + } + + /// + /// Get a uniform form current shader, the value type of the uniform should be provided. + /// + /// + /// ContextName of the Uniform in shader code + /// + /// + /// + /// + public unsafe Uniform GetUniform( + string name + ) where T : unmanaged where U : struct where V : struct + { + return new Uniform(GL.GetUniformLocation(this.handle, name)); + } + + /// + /// Get a uniform form current shader, the value type of the uniform should be provided. + /// + /// + /// ContextName of the Uniform in shader code + /// + /// + /// + /// + public unsafe Uniform GetUniform( + string name + ) where T : unmanaged where U : struct where V : struct where W : struct + { + return new Uniform(GL.GetUniformLocation(this.handle, name)); + } + + /// + /// Link the shader to current viewPortDisplay. + /// + public unsafe void Link() + { + if (GraphicFramework.InternalLinkShaderProgram( + (OpenglContext*)this.GL.ContextHandle, handle.Value) == 0) + { + IntPtr logPtr = GraphicFramework.InternalReadSSCLog(); + try + { + byte[] logByte = new byte[512]; + Marshal.Copy(logPtr, logByte, 0, 512); + string log = Encoding.UTF8.GetString(logByte); + log = log.Replace("\0", string.Empty); + DefaultLog.InternalWriteLog(log, LogType.Error); + } + catch (Exception ex) + { + DefaultLog.InternalWriteLog(ex.Message, LogType.Error); + } + } + } + + /// + /// Let the current viewPortDisplay use this shader. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Use() + { + GL.UseProgram(handle); + } + + ~ShaderProgram() + { + // handle.Dispose(); + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Uniform.cs b/StgsSharp.Graphics/OpenGL/ShaderEdit/Uniform.cs similarity index 96% rename from StgSharp.Common/Graphics/OpenGL/ShaderEdit/Uniform.cs rename to StgsSharp.Graphics/OpenGL/ShaderEdit/Uniform.cs index 6923043c..9a5e2494 100644 --- a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Uniform.cs +++ b/StgsSharp.Graphics/OpenGL/ShaderEdit/Uniform.cs @@ -1,225 +1,225 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Uniform" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Mathematics.Graphic; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.CompilerServices; - -namespace StgSharp.Graphics.OpenGL -{ - public class Uniform - { - - internal GlHandle id; - - public GlHandle Handle => id; - - } - - public sealed class Uniform : Uniform where T : unmanaged - { - - internal Uniform() { } - - internal unsafe Uniform( - GlHandle id - ) - { - this.id = id; - } - - internal static Uniform FromHandle( - GlHandle handle - ) - { - return new Uniform - { - id = handle - }; - } - - } - - public sealed class Uniform : Uniform where T : unmanaged where U : struct - { - - internal Uniform() { } - - internal unsafe Uniform( - GlHandle id - ) - { - this.id = id; - } - - internal static Uniform FromHandle( - GlHandle handle - ) - { - return new Uniform - { - id = handle - }; - } - - } - - public sealed class Uniform : Uniform where T : unmanaged where U : struct - where V : struct - { - - internal Uniform() { } - - internal unsafe Uniform( - GlHandle id - ) - { - this.id = id; - } - - internal static Uniform FromHandle( - GlHandle handle - ) - { - return new Uniform - { - id = handle - }; - } - - } - - public sealed class Uniform : Uniform where T : unmanaged where U : struct - where V : struct - where W : struct - { - - internal Uniform() { } - - internal unsafe Uniform( - GlHandle id - ) - { - this.id = id; - } - - internal static Uniform FromHandle( - GlHandle handle - ) - { - return new Uniform - { - id = handle - }; - } - - } - - public unsafe partial class OpenGLFunction - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetUniformValue( - [NotNull] Uniform uniform, - Matrix44 mat - ) - { - Context.glUniformMatrix4fv(uniform.id.SignedValue, 1, (byte)0, (float*)&mat); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetUniformValue( - [NotNull]Uniform uniform, - Vec4 vec - ) - { - Context.glUniform1fv(uniform.id.SignedValue, 4, (float*)&vec); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetUniformValue( - [NotNull]Uniform uniform, - Vec4 vec - ) - { - Context.glUniform1fv(uniform.id.SignedValue, 4, (float*)&vec); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetUniformValue( - [NotNull]Uniform uniform, - float v0 - ) - { - Context.glUniform1f(uniform.id.SignedValue, v0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetUniformValue( - [NotNull]Uniform uniform, - int i0 - ) - { - Context.glUniform1i(uniform.id.SignedValue, i0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetUniformValue( - [NotNull] Uniform uniform, - float v0, - float v1 - ) - { - Context.glUniform2f(uniform.id.SignedValue, v0, v1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetUniformValue( - [NotNull] Uniform uniform, - float v0, - float v1, - float v2 - ) - { - Context.glUniform3f(uniform.id.SignedValue, v0, v1, v2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetUniformValue( - [NotNull] Uniform uniform, - float v0, - float v1, - float v2, - float v3 - ) - { - Context.glUniform4f(uniform.id.SignedValue, v0, v1, v2, v3); - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Uniform" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Mathematics.Graphics; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; + +namespace StgSharp.Graphics.OpenGL +{ + public class Uniform + { + + internal GlHandle id; + + public GlHandle Handle => id; + + } + + public sealed class Uniform : Uniform where T : unmanaged + { + + internal Uniform() { } + + internal unsafe Uniform( + GlHandle id + ) + { + this.id = id; + } + + internal static Uniform FromHandle( + GlHandle handle + ) + { + return new Uniform + { + id = handle + }; + } + + } + + public sealed class Uniform : Uniform where T : unmanaged where U : struct + { + + internal Uniform() { } + + internal unsafe Uniform( + GlHandle id + ) + { + this.id = id; + } + + internal static Uniform FromHandle( + GlHandle handle + ) + { + return new Uniform + { + id = handle + }; + } + + } + + public sealed class Uniform : Uniform where T : unmanaged where U : struct + where V : struct + { + + internal Uniform() { } + + internal unsafe Uniform( + GlHandle id + ) + { + this.id = id; + } + + internal static Uniform FromHandle( + GlHandle handle + ) + { + return new Uniform + { + id = handle + }; + } + + } + + public sealed class Uniform : Uniform where T : unmanaged where U : struct + where V : struct + where W : struct + { + + internal Uniform() { } + + internal unsafe Uniform( + GlHandle id + ) + { + this.id = id; + } + + internal static Uniform FromHandle( + GlHandle handle + ) + { + return new Uniform + { + id = handle + }; + } + + } + + public unsafe partial class OpenGLFunction + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetUniformValue( + [NotNull] Uniform uniform, + Matrix44 mat + ) + { + Context.glUniformMatrix4fv(uniform.id.SignedValue, 1, (byte)0, (float*)&mat); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetUniformValue( + [NotNull]Uniform uniform, + Vec4 vec + ) + { + Context.glUniform1fv(uniform.id.SignedValue, 4, (float*)&vec); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetUniformValue( + [NotNull]Uniform uniform, + Vec4 vec + ) + { + Context.glUniform1fv(uniform.id.SignedValue, 4, (float*)&vec); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetUniformValue( + [NotNull]Uniform uniform, + float v0 + ) + { + Context.glUniform1f(uniform.id.SignedValue, v0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetUniformValue( + [NotNull]Uniform uniform, + int i0 + ) + { + Context.glUniform1i(uniform.id.SignedValue, i0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetUniformValue( + [NotNull] Uniform uniform, + float v0, + float v1 + ) + { + Context.glUniform2f(uniform.id.SignedValue, v0, v1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetUniformValue( + [NotNull] Uniform uniform, + float v0, + float v1, + float v2 + ) + { + Context.glUniform3f(uniform.id.SignedValue, v0, v1, v2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetUniformValue( + [NotNull] Uniform uniform, + float v0, + float v1, + float v2, + float v3 + ) + { + Context.glUniform4f(uniform.id.SignedValue, v0, v1, v2, v3); + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/glApiManager.Const.cs b/StgsSharp.Graphics/OpenGL/glApiManager.Const.cs similarity index 98% rename from StgSharp.Common/Graphics/OpenGL/glApiManager.Const.cs rename to StgsSharp.Graphics/OpenGL/glApiManager.Const.cs index 6763c599..ccea2fc6 100644 --- a/StgSharp.Common/Graphics/OpenGL/glApiManager.Const.cs +++ b/StgsSharp.Graphics/OpenGL/glApiManager.Const.cs @@ -1,685 +1,685 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glApiManagerConst" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - public static partial class glManager - { - - #region coreVersion - - private static bool core10 = false; - private static bool core11 = false; - private static bool core12 = false; - private static bool core13 = false; - private static bool core14 = false; - private static bool core15 = false; - private static bool core20 = false; - private static bool core21 = false; - private static bool core30 = false; - private static bool core31 = false; - private static bool core32 = false; - private static bool core33 = false; - private static bool core40 = false; - private static bool core41 = false; - private static bool core42 = false; - private static bool core43 = false; - private static bool core44 = false; - private static bool core45 = false; - private static bool core46 = false; - - #endregion - - #region extension - - private static bool _3DFX_tbuffer; - private static bool _3DFX_texture_compression_FXT1; - private static bool _4DFX_multisample; - private static bool AMD_blend_minmax_factor; - private static bool AMD_conservative_depth; - private static bool AMD_debug_output; - private static bool AMD_depth_clamp_separate; - private static bool AMD_draw_buffers_blend; - private static bool AMD_framebuffer_multisample_advanced; - private static bool AMD_framebuffer_sample_positions; - private static bool AMD_gcn_shader; - private static bool AMD_gpu_shader_half_float; - private static bool AMD_gpu_shader_int16; - private static bool AMD_gpu_shader_int64; - private static bool AMD_interleaved_elements; - private static bool AMD_multi_draw_indirect; - private static bool AMD_name_gen_delete; - private static bool AMD_occlusion_query_event; - private static bool AMD_performance_monitor; - private static bool AMD_pinned_memory; - private static bool AMD_query_buffer_object; - private static bool AMD_sample_positions; - private static bool AMD_seamless_cubemap_per_texture; - private static bool AMD_shader_atomic_counter_ops; - private static bool AMD_shader_ballot; - private static bool AMD_shader_explicit_vertex_parameter; - private static bool AMD_shader_gpu_shader_half_float_fetch; - private static bool AMD_shader_image_load_store_lod; - private static bool AMD_shader_stencil_export; - private static bool AMD_shader_trinary_minmax; - private static bool AMD_sparse_texture; - private static bool AMD_stencil_operation_extended; - private static bool AMD_texture_gather_bias_lod; - private static bool AMD_texture_texture4; - private static bool AMD_transform_feedback3_lines_triangles; - private static bool AMD_transform_feedback4; - private static bool AMD_vertex_shader_layer; - private static bool AMD_vertex_shader_tessellator; - private static bool AMD_vertex_shader_viewport_index; - private static bool APPLE_aux_depth_stencil; - private static bool APPLE_client_storage; - private static bool APPLE_element_array; - private static bool APPLE_fence; - private static bool APPLE_float_pixels; - private static bool APPLE_flush_buffer_range; - private static bool APPLE_object_purgeable; - private static bool APPLE_rgb_422; - private static bool APPLE_row_bytes; - private static bool APPLE_specular_vector; - private static bool APPLE_texture_range; - private static bool APPLE_transform_hint; - private static bool APPLE_vertex_array_object; - private static bool APPLE_vertex_array_range; - private static bool APPLE_vertex_program_evaluators; - private static bool APPLE_ycbcr_422; - private static bool ARB_arrays_of_arrays; - private static bool ARB_base_instance; - private static bool ARB_bindless_texture; - private static bool ARB_blend_func_extended; - private static bool ARB_buffer_storage; - private static bool ARB_cl_event; - private static bool ARB_clear_buffer_object; - private static bool ARB_clear_texture; - private static bool ARB_clip_control; - private static bool ARB_color_buffer_float; - private static bool ARB_compatibility; - private static bool ARB_compressed_texture_pixel_storage; - private static bool ARB_compute_shader; - private static bool ARB_compute_variable_group_size; - private static bool ARB_conditional_render_inverted; - private static bool ARB_conservative_depth; - private static bool ARB_copy_buffer; - private static bool ARB_copy_image; - private static bool ARB_cull_distance; - private static bool ARB_debug_output; - private static bool ARB_depth_buffer_float; - private static bool ARB_depth_clamp; - private static bool ARB_depth_texture; - private static bool ARB_derivative_control; - private static bool ARB_direct_state_access; - private static bool ARB_draw_buffers; - private static bool ARB_draw_buffers_blend; - private static bool ARB_draw_elements_base_vertex; - private static bool ARB_draw_indirect; - private static bool ARB_draw_instanced; - private static bool ARB_enhanced_layouts; - private static bool ARB_ES2_compatibility; - private static bool ARB_ES3_1_compatibility; - private static bool ARB_ES3_2_compatibility; - private static bool ARB_ES3_compatibility; - private static bool ARB_explicit_attrib_location; - private static bool ARB_explicit_uniform_location; - private static bool ARB_fragment_coord_conventions; - private static bool ARB_fragment_layer_viewport; - private static bool ARB_fragment_program; - private static bool ARB_fragment_program_shadow; - private static bool ARB_fragment_shader; - private static bool ARB_fragment_shader_interlock; - private static bool ARB_framebuffer_no_attachments; - private static bool ARB_framebuffer_object; - private static bool ARB_framebuffer_sRGB; - private static bool ARB_geometry_shader4; - private static bool ARB_get_program_binary; - private static bool ARB_get_texture_sub_image; - private static bool ARB_gl_spirv; - private static bool ARB_gpu_shader_fp64; - private static bool ARB_gpu_shader_int64; - private static bool ARB_gpu_shader5; - private static bool ARB_half_float_pixel; - private static bool ARB_half_float_vertex; - private static bool ARB_imaging; - private static bool ARB_indirect_parameters; - private static bool ARB_instanced_arrays; - private static bool ARB_internalformat_query; - private static bool ARB_internalformat_query2; - private static bool ARB_invalidate_subdata; - private static bool ARB_map_buffer_alignment; - private static bool ARB_map_buffer_range; - private static bool ARB_matrix_palette; - private static bool ARB_multi_bind; - private static bool ARB_multi_draw_indirect; - private static bool ARB_multisample; - private static bool ARB_multitexture; - private static bool ARB_occlusion_query; - private static bool ARB_occlusion_query2; - private static bool ARB_parallel_shader_compile; - private static bool ARB_pipeline_statistics_query; - private static bool ARB_pixel_buffer_object; - private static bool ARB_point_parameters; - private static bool ARB_point_sprite; - private static bool ARB_polygon_offset_clamp; - private static bool ARB_post_depth_coverage; - private static bool ARB_program_interface_query; - private static bool ARB_provoking_vertex; - private static bool ARB_query_buffer_object; - private static bool ARB_robust_buffer_access_behavior; - private static bool ARB_robustness; - private static bool ARB_robustness_isolation; - private static bool ARB_sample_locations; - private static bool ARB_sample_shading; - private static bool ARB_sampler_objects; - private static bool ARB_seamless_cube_map; - private static bool ARB_seamless_cubemap_per_texture; - private static bool ARB_separate_shader_objects; - private static bool ARB_shader_atomic_counter_ops; - private static bool ARB_shader_atomic_counters; - private static bool ARB_shader_ballot; - private static bool ARB_shader_bit_encoding; - private static bool ARB_shader_clock; - private static bool ARB_shader_draw_parameters; - private static bool ARB_shader_group_vote; - private static bool ARB_shader_image_load_store; - private static bool ARB_shader_image_size; - private static bool ARB_shader_objects; - private static bool ARB_shader_precision; - private static bool ARB_shader_stencil_export; - private static bool ARB_shader_storage_buffer_object; - private static bool ARB_shader_subroutine; - private static bool ARB_shader_texture_image_samples; - private static bool ARB_shader_texture_lod; - private static bool ARB_shader_viewport_layer_array; - private static bool ARB_shading_language_100; - private static bool ARB_shading_language_420pack; - private static bool ARB_shading_language_include; - private static bool ARB_shading_language_packing; - private static bool ARB_shadow; - private static bool ARB_shadow_ambient; - private static bool ARB_sparse_buffer; - private static bool ARB_sparse_texture; - private static bool ARB_sparse_texture_clamp; - private static bool ARB_sparse_texture2; - private static bool ARB_spirv_extensions; - private static bool ARB_stencil_texturing; - private static bool ARB_sync; - private static bool ARB_tessellation_shader; - private static bool ARB_texture_barrier; - private static bool ARB_texture_border_clamp; - private static bool ARB_texture_buffer_object; - private static bool ARB_texture_buffer_object_rgb32; - private static bool ARB_texture_buffer_range; - private static bool ARB_texture_compression; - private static bool ARB_texture_compression_bptc; - private static bool ARB_texture_compression_rgtc; - private static bool ARB_texture_cube_map; - private static bool ARB_texture_cube_map_array; - private static bool ARB_texture_env_add; - private static bool ARB_texture_env_combine; - private static bool ARB_texture_env_crossbar; - private static bool ARB_texture_env_dot3; - private static bool ARB_texture_filter_anisotropic; - private static bool ARB_texture_filter_minmax; - private static bool ARB_texture_float; - private static bool ARB_texture_gather; - private static bool ARB_texture_mirror_clamp_to_edge; - private static bool ARB_texture_mirrored_repeat; - private static bool ARB_texture_multisample; - private static bool ARB_texture_non_power_of_two; - private static bool ARB_texture_query_levels; - private static bool ARB_texture_query_lod; - private static bool ARB_texture_rectangle; - private static bool ARB_texture_rg; - private static bool ARB_texture_rgb10_a2ui; - private static bool ARB_texture_stencil8; - private static bool ARB_texture_storage; - private static bool ARB_texture_storage_multisample; - private static bool ARB_texture_swizzle; - private static bool ARB_texture_view; - private static bool ARB_timer_query; - private static bool ARB_transform_feedback_instanced; - private static bool ARB_transform_feedback_overflow_query; - private static bool ARB_transform_feedback2; - private static bool ARB_transform_feedback3; - private static bool ARB_transpose_matrix; - private static bool ARB_uniform_buffer_object; - private static bool ARB_vertex_array_bgra; - private static bool ARB_vertex_array_object; - private static bool ARB_vertex_attrib_64bit; - private static bool ARB_vertex_attrib_binding; - private static bool ARB_vertex_blend; - private static bool ARB_vertex_buffer_object; - private static bool ARB_vertex_program; - private static bool ARB_vertex_shader; - private static bool ARB_vertex_type_10f_11f_11f_rev; - private static bool ARB_vertex_type_2_10_10_10_rev; - private static bool ARB_viewport_array; - private static bool ARB_window_pos; - private static bool ATI_draw_buffers; - private static bool ATI_element_array; - private static bool ATI_envmap_bumpmap; - private static bool ATI_fragment_shader; - private static bool ATI_map_object_buffer; - private static bool ATI_meminfo; - private static bool ATI_pixel_format_float; - private static bool ATI_pn_triangles; - private static bool ATI_separate_stencil; - private static bool ATI_text_fragment_shader; - private static bool ATI_texture_env_combine3; - private static bool ATI_texture_float; - private static bool ATI_texture_mirror_once; - private static bool ATI_vertex_array_object; - private static bool ATI_vertex_attrib_array_object; - private static bool ATI_vertex_streams; - private static bool EXT_422_pixels; - private static bool EXT_abgr; - private static bool EXT_bgra; - private static bool EXT_bindable_uniform; - private static bool EXT_blend_color; - private static bool EXT_blend_equation_separate; - private static bool EXT_blend_func_separate; - private static bool EXT_blend_logic_op; - private static bool EXT_blend_minmax; - private static bool EXT_blend_subtract; - private static bool EXT_clip_volume_hint; - private static bool EXT_cmyka; - private static bool EXT_color_subtable; - private static bool EXT_compiled_vertex_array; - private static bool EXT_convolution; - private static bool EXT_coordinate_frame; - private static bool EXT_copy_texture; - private static bool EXT_cull_vertex; - private static bool EXT_debug_label; - private static bool EXT_debug_marker; - private static bool EXT_depth_bounds_test; - private static bool EXT_direct_state_access; - private static bool EXT_draw_buffers2; - private static bool EXT_draw_instanced; - private static bool EXT_draw_range_elements; - private static bool EXT_EGL_image_storage; - private static bool EXT_EGL_sync; - private static bool EXT_external_buffer; - private static bool EXT_fog_coord; - private static bool EXT_framebuffer_blit; - private static bool EXT_framebuffer_blit_layers; - private static bool EXT_framebuffer_multisample; - private static bool EXT_framebuffer_multisample_blit_scaled; - private static bool EXT_framebuffer_object; - private static bool EXT_framebuffer_sRGB; - private static bool EXT_geometry_shader4; - private static bool EXT_gpu_program_parameters; - private static bool EXT_gpu_shader4; - private static bool EXT_histogram; - private static bool EXT_index_array_formats; - private static bool EXT_index_func; - private static bool EXT_index_material; - private static bool EXT_index_texture; - private static bool EXT_light_texture; - private static bool EXT_memory_object; - private static bool EXT_memory_object_fd; - private static bool EXT_memory_object_win32; - private static bool EXT_misc_attribute; - private static bool EXT_multi_draw_arrays; - private static bool EXT_multisample; - private static bool EXT_multiview_tessellation_geometry_shader; - private static bool EXT_multiview_texture_multisample; - private static bool EXT_multiview_timer_query; - private static bool EXT_packed_depth_stencil; - private static bool EXT_packed_float; - private static bool EXT_packed_pixels; - private static bool EXT_paletted_texture; - private static bool EXT_pixel_buffer_object; - private static bool EXT_pixel_transform; - private static bool EXT_pixel_transform_color_table; - private static bool EXT_point_parameters; - private static bool EXT_polygon_offset; - private static bool EXT_polygon_offset_clamp; - private static bool EXT_post_depth_coverage; - private static bool EXT_provoking_vertex; - private static bool EXT_raster_multisample; - private static bool EXT_rescale_normal; - private static bool EXT_secondary_color; - private static bool EXT_semaphore; - private static bool EXT_semaphore_fd; - private static bool EXT_semaphore_win32; - private static bool EXT_separate_shader_objects; - private static bool EXT_separate_specular_color; - private static bool EXT_shader_framebuffer_fetch; - private static bool EXT_shader_framebuffer_fetch_non_coherent; - private static bool EXT_shader_image_load_formatted; - private static bool EXT_shader_image_load_store; - private static bool EXT_shader_integer_mix; - private static bool EXT_shader_samples_identical; - private static bool EXT_shadow_funcs; - private static bool EXT_shared_texture_palette; - private static bool EXT_sparse_texture2; - private static bool EXT_stencil_clear_tag; - private static bool EXT_stencil_two_side; - private static bool EXT_stencil_wrap; - private static bool EXT_subtexture; - private static bool EXT_texture; - private static bool EXT_texture_array; - private static bool EXT_texture_buffer_object; - private static bool EXT_texture_compression_latc; - private static bool EXT_texture_compression_rgtc; - private static bool EXT_texture_compression_s3tc; - private static bool EXT_texture_cube_map; - private static bool EXT_texture_env_add; - private static bool EXT_texture_env_combine; - private static bool EXT_texture_env_dot3; - private static bool EXT_texture_filter_anisotropic; - private static bool EXT_texture_filter_minmax; - private static bool EXT_texture_integer; - private static bool EXT_texture_lod_bias; - private static bool EXT_texture_mirror_clamp; - private static bool EXT_texture_object; - private static bool EXT_texture_perturb_normal; - private static bool EXT_texture_shadow_lod; - private static bool EXT_texture_shared_exponent; - private static bool EXT_texture_snorm; - private static bool EXT_texture_sRGB; - private static bool EXT_texture_sRGB_decode; - private static bool EXT_texture_sRGB_R8; - private static bool EXT_texture_sRGB_RG8; - private static bool EXT_texture_storage; - private static bool EXT_texture_swizzle; - private static bool EXT_texture3D; - private static bool EXT_timer_query; - private static bool EXT_transform_feedback; - private static bool EXT_vertex_array; - private static bool EXT_vertex_array_bgra; - private static bool EXT_vertex_attrib_64bit; - private static bool EXT_vertex_shader; - private static bool EXT_vertex_weighting; - private static bool EXT_win32_keyed_mutex; - private static bool EXT_window_rectangles; - private static bool EXT_x11_sync_object; - private static bool GREMEDY_frame_terminator; - private static bool GREMEDY_string_marker; - private static bool HP_convolution_border_modes; - private static bool HP_image_transform; - private static bool HP_occlusion_test; - private static bool HP_texture_lighting; - private static bool IBM_cull_vertex; - private static bool IBM_multimode_draw_arrays; - private static bool IBM_rasterpos_clip; - private static bool IBM_static_data; - private static bool IBM_texture_mirrored_repeat; - private static bool IBM_vertex_array_lists; - private static bool INGR_blend_func_separate; - private static bool INGR_color_clamp; - private static bool INGR_interlace_read; - private static bool INTEL_blackhole_render; - private static bool INTEL_conservative_rasterization; - private static bool INTEL_fragment_shader_ordering; - private static bool INTEL_framebuffer_CMAA; - private static bool INTEL_map_texture; - private static bool INTEL_parallel_arrays; - private static bool INTEL_performance_query; - private static bool KHR_blend_equation_advanced; - private static bool KHR_blend_equation_advanced_coherent; - private static bool KHR_context_flush_control; - private static bool KHR_debug; - private static bool KHR_no_error; - private static bool KHR_parallel_shader_compile; - private static bool KHR_robust_buffer_access_behavior; - private static bool KHR_robustness; - private static bool KHR_shader_subgroup; - private static bool KHR_texture_compression_astc_hdr; - private static bool KHR_texture_compression_astc_ldr; - private static bool KHR_texture_compression_astc_sliced_3d; - private static bool MESA_framebuffer_flip_x; - private static bool MESA_framebuffer_flip_y; - private static bool MESA_framebuffer_swap_xy; - private static bool MESA_pack_invert; - private static bool MESA_program_binary_formats; - private static bool MESA_resize_buffers; - private static bool MESA_shader_integer_functions; - private static bool MESA_tile_raster_order; - private static bool MESA_window_pos; - private static bool MESA_ycbcr_texture; - private static bool MESAX_texture_stack; - private static bool NV_alpha_to_coverage_dither_control; - private static bool NV_bindless_multi_draw_indirect; - private static bool NV_bindless_multi_draw_indirect_count; - private static bool NV_bindless_texture; - private static bool NV_blend_equation_advanced; - private static bool NV_blend_equation_advanced_coherent; - private static bool NV_blend_minmax_factor; - private static bool NV_blend_square; - private static bool NV_clip_space_w_scaling; - private static bool NV_command_list; - private static bool NV_compute_program5; - private static bool NV_compute_shader_derivatives; - private static bool NV_conditional_render; - private static bool NV_conservative_raster; - private static bool NV_conservative_raster_dilate; - private static bool NV_conservative_raster_pre_snap; - private static bool NV_conservative_raster_pre_snap_triangles; - private static bool NV_conservative_raster_underestimation; - private static bool NV_copy_depth_to_color; - private static bool NV_copy_image; - private static bool NV_deep_texture3D; - private static bool NV_depth_buffer_float; - private static bool NV_depth_clamp; - private static bool NV_draw_texture; - private static bool NV_draw_vulkan_image; - private static bool NV_evaluators; - private static bool NV_explicit_multisample; - private static bool NV_fence; - private static bool NV_fill_rectangle; - private static bool NV_float_buffer; - private static bool NV_fog_distance; - private static bool NV_fragment_coverage_to_color; - private static bool NV_fragment_program; - private static bool NV_fragment_program_option; - private static bool NV_fragment_program2; - private static bool NV_fragment_program4; - private static bool NV_fragment_shader_barycentric; - private static bool NV_fragment_shader_interlock; - private static bool NV_framebuffer_mixed_samples; - private static bool NV_framebuffer_multisample_coverage; - private static bool NV_geometry_program4; - private static bool NV_geometry_shader_passthrough; - private static bool NV_geometry_shader4; - private static bool NV_gpu_multicast; - private static bool NV_gpu_program4; - private static bool NV_gpu_program5; - private static bool NV_gpu_program5_mem_extended; - private static bool NV_gpu_shader5; - private static bool NV_half_float; - private static bool NV_internalformat_sample_query; - private static bool NV_light_max_exponent; - private static bool NV_memory_attachment; - private static bool NV_memory_object_sparse; - private static bool NV_mesh_shader; - private static bool NV_multisample_coverage; - private static bool NV_multisample_filter_hint; - private static bool NV_occlusion_query; - private static bool NV_packed_depth_stencil; - private static bool NV_parameter_buffer_object; - private static bool NV_parameter_buffer_object2; - private static bool NV_path_rendering; - private static bool NV_path_rendering_shared_edge; - private static bool NV_pixel_data_range; - private static bool NV_point_sprite; - private static bool NV_present_video; - private static bool NV_primitive_restart; - private static bool NV_primitive_shading_rate; - private static bool NV_query_resource; - private static bool NV_query_resource_tag; - private static bool NV_register_combiners; - private static bool NV_register_combiners2; - private static bool NV_representative_fragment_test; - private static bool NV_robustness_video_memory_purge; - private static bool NV_sample_locations; - private static bool NV_sample_mask_override_coverage; - private static bool NV_scissor_exclusive; - private static bool NV_shader_atomic_counters; - private static bool NV_shader_atomic_float; - private static bool NV_shader_atomic_float64; - private static bool NV_shader_atomic_fp16_vector; - private static bool NV_shader_atomic_int64; - private static bool NV_shader_buffer_load; - private static bool NV_shader_buffer_store; - private static bool NV_shader_storage_buffer_object; - private static bool NV_shader_subgroup_partitioned; - private static bool NV_shader_texture_footprint; - private static bool NV_shader_thread_group; - private static bool NV_shader_thread_shuffle; - private static bool NV_shading_rate_image; - private static bool NV_stereo_view_rendering; - private static bool NV_tessellation_program5; - private static bool NV_texgen_emboss; - private static bool NV_texgen_reflection; - private static bool NV_texture_barrier; - private static bool NV_texture_compression_vtc; - private static bool NV_texture_env_combine4; - private static bool NV_texture_expand_normal; - private static bool NV_texture_multisample; - private static bool NV_texture_rectangle; - private static bool NV_texture_rectangle_compressed; - private static bool NV_texture_shader; - private static bool NV_texture_shader2; - private static bool NV_texture_shader3; - private static bool NV_timeline_semaphore; - private static bool NV_transform_feedback; - private static bool NV_transform_feedback2; - private static bool NV_uniform_buffer_std430_layout; - private static bool NV_uniform_buffer_unified_memory; - private static bool NV_vdpau_interop; - private static bool NV_vdpau_interop2; - private static bool NV_vertex_array_range; - private static bool NV_vertex_array_range2; - private static bool NV_vertex_attrib_integer_64bit; - private static bool NV_vertex_buffer_unified_memory; - private static bool NV_vertex_program; - private static bool NV_vertex_program1_1; - private static bool NV_vertex_program2; - private static bool NV_vertex_program2_option; - private static bool NV_vertex_program3; - private static bool NV_vertex_program4; - private static bool NV_video_capture; - private static bool NV_viewport_array2; - private static bool NV_viewport_swizzle; - private static bool NVX_blend_equation_advanced_multi_draw_buffers; - private static bool NVX_conditional_render; - private static bool NVX_gpu_memory_info; - private static bool NVX_gpu_multicast2; - private static bool NVX_linked_gpu_multicast; - private static bool NVX_progress_fence; - private static bool OES_byte_coordinates; - private static bool OES_compressed_paletted_texture; - private static bool OES_fixed_point; - private static bool OES_query_matrix; - private static bool OES_read_format; - private static bool OES_single_precision; - private static bool OML_interlace; - private static bool OML_resample; - private static bool OML_subsample; - private static bool OVR_multiview; - private static bool OVR_multiview2; - private static bool PGI_misc_hints; - private static bool PGI_vertex_hints; - private static bool REND_screen_coordinates; - private static bool S3_s3tc; - private static bool SGI_color_matrix; - private static bool SGI_color_table; - private static bool SGI_texture_color_table; - private static bool SGIS_detail_texture; - private static bool SGIS_fog_function; - private static bool SGIS_generate_mipmap; - private static bool SGIS_multisample; - private static bool SGIS_pixel_texture; - private static bool SGIS_point_line_texgen; - private static bool SGIS_point_parameters; - private static bool SGIS_sharpen_texture; - private static bool SGIS_texture_border_clamp; - private static bool SGIS_texture_color_mask; - private static bool SGIS_texture_edge_clamp; - private static bool SGIS_texture_filter4; - private static bool SGIS_texture_lod; - private static bool SGIS_texture_select; - private static bool SGIS_texture4D; - private static bool SGIX_async; - private static bool SGIX_async_histogram; - private static bool SGIX_async_pixel; - private static bool SGIX_blend_alpha_minmax; - private static bool SGIX_calligraphic_fragment; - private static bool SGIX_clipmap; - private static bool SGIX_convolution_accuracy; - private static bool SGIX_depth_pass_instrument; - private static bool SGIX_depth_texture; - private static bool SGIX_flush_raster; - private static bool SGIX_fog_offset; - private static bool SGIX_fragment_lighting; - private static bool SGIX_framezoom; - private static bool SGIX_igloo_interface; - private static bool SGIX_instruments; - private static bool SGIX_interlace; - private static bool SGIX_ir_instrument1; - private static bool SGIX_list_priority; - private static bool SGIX_pixel_texture; - private static bool SGIX_pixel_tiles; - private static bool SGIX_polynomial_ffd; - private static bool SGIX_reference_plane; - private static bool SGIX_resample; - private static bool SGIX_scalebias_hint; - private static bool SGIX_shadow; - private static bool SGIX_shadow_ambient; - private static bool SGIX_sprite; - private static bool SGIX_subsample; - private static bool SGIX_tag_sample_buffer; - private static bool SGIX_texture_add_env; - private static bool SGIX_texture_coordinate_clamp; - private static bool SGIX_texture_lod_bias; - private static bool SGIX_texture_multi_buffer; - private static bool SGIX_texture_scale_bias; - private static bool SGIX_vertex_preclip; - private static bool SGIX_ycrcb; - private static bool SGIX_ycrcb_subsample; - private static bool SGIX_ycrcba; - private static bool SUN_convolution_border_modes; - private static bool SUN_global_alpha; - private static bool SUN_mesh_array; - private static bool SUN_slice_accum; - private static bool SUN_triangle_list; - private static bool SUN_vertex; - private static bool SUNX_constant_data; - private static bool WIN_phong_shading; - private static bool WIN_specular_fog; - - #endregion - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glApiManagerConst" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + public static partial class glManager + { + + #region coreVersion + + private static bool core10 = false; + private static bool core11 = false; + private static bool core12 = false; + private static bool core13 = false; + private static bool core14 = false; + private static bool core15 = false; + private static bool core20 = false; + private static bool core21 = false; + private static bool core30 = false; + private static bool core31 = false; + private static bool core32 = false; + private static bool core33 = false; + private static bool core40 = false; + private static bool core41 = false; + private static bool core42 = false; + private static bool core43 = false; + private static bool core44 = false; + private static bool core45 = false; + private static bool core46 = false; + + #endregion + + #region extension + + private static bool _3DFX_tbuffer; + private static bool _3DFX_texture_compression_FXT1; + private static bool _4DFX_multisample; + private static bool AMD_blend_minmax_factor; + private static bool AMD_conservative_depth; + private static bool AMD_debug_output; + private static bool AMD_depth_clamp_separate; + private static bool AMD_draw_buffers_blend; + private static bool AMD_framebuffer_multisample_advanced; + private static bool AMD_framebuffer_sample_positions; + private static bool AMD_gcn_shader; + private static bool AMD_gpu_shader_half_float; + private static bool AMD_gpu_shader_int16; + private static bool AMD_gpu_shader_int64; + private static bool AMD_interleaved_elements; + private static bool AMD_multi_draw_indirect; + private static bool AMD_name_gen_delete; + private static bool AMD_occlusion_query_event; + private static bool AMD_performance_monitor; + private static bool AMD_pinned_memory; + private static bool AMD_query_buffer_object; + private static bool AMD_sample_positions; + private static bool AMD_seamless_cubemap_per_texture; + private static bool AMD_shader_atomic_counter_ops; + private static bool AMD_shader_ballot; + private static bool AMD_shader_explicit_vertex_parameter; + private static bool AMD_shader_gpu_shader_half_float_fetch; + private static bool AMD_shader_image_load_store_lod; + private static bool AMD_shader_stencil_export; + private static bool AMD_shader_trinary_minmax; + private static bool AMD_sparse_texture; + private static bool AMD_stencil_operation_extended; + private static bool AMD_texture_gather_bias_lod; + private static bool AMD_texture_texture4; + private static bool AMD_transform_feedback3_lines_triangles; + private static bool AMD_transform_feedback4; + private static bool AMD_vertex_shader_layer; + private static bool AMD_vertex_shader_tessellator; + private static bool AMD_vertex_shader_viewport_index; + private static bool APPLE_aux_depth_stencil; + private static bool APPLE_client_storage; + private static bool APPLE_element_array; + private static bool APPLE_fence; + private static bool APPLE_float_pixels; + private static bool APPLE_flush_buffer_range; + private static bool APPLE_object_purgeable; + private static bool APPLE_rgb_422; + private static bool APPLE_row_bytes; + private static bool APPLE_specular_vector; + private static bool APPLE_texture_range; + private static bool APPLE_transform_hint; + private static bool APPLE_vertex_array_object; + private static bool APPLE_vertex_array_range; + private static bool APPLE_vertex_program_evaluators; + private static bool APPLE_ycbcr_422; + private static bool ARB_arrays_of_arrays; + private static bool ARB_base_instance; + private static bool ARB_bindless_texture; + private static bool ARB_blend_func_extended; + private static bool ARB_buffer_storage; + private static bool ARB_cl_event; + private static bool ARB_clear_buffer_object; + private static bool ARB_clear_texture; + private static bool ARB_clip_control; + private static bool ARB_color_buffer_float; + private static bool ARB_compatibility; + private static bool ARB_compressed_texture_pixel_storage; + private static bool ARB_compute_shader; + private static bool ARB_compute_variable_group_size; + private static bool ARB_conditional_render_inverted; + private static bool ARB_conservative_depth; + private static bool ARB_copy_buffer; + private static bool ARB_copy_image; + private static bool ARB_cull_distance; + private static bool ARB_debug_output; + private static bool ARB_depth_buffer_float; + private static bool ARB_depth_clamp; + private static bool ARB_depth_texture; + private static bool ARB_derivative_control; + private static bool ARB_direct_state_access; + private static bool ARB_draw_buffers; + private static bool ARB_draw_buffers_blend; + private static bool ARB_draw_elements_base_vertex; + private static bool ARB_draw_indirect; + private static bool ARB_draw_instanced; + private static bool ARB_enhanced_layouts; + private static bool ARB_ES2_compatibility; + private static bool ARB_ES3_1_compatibility; + private static bool ARB_ES3_2_compatibility; + private static bool ARB_ES3_compatibility; + private static bool ARB_explicit_attrib_location; + private static bool ARB_explicit_uniform_location; + private static bool ARB_fragment_coord_conventions; + private static bool ARB_fragment_layer_viewport; + private static bool ARB_fragment_program; + private static bool ARB_fragment_program_shadow; + private static bool ARB_fragment_shader; + private static bool ARB_fragment_shader_interlock; + private static bool ARB_framebuffer_no_attachments; + private static bool ARB_framebuffer_object; + private static bool ARB_framebuffer_sRGB; + private static bool ARB_geometry_shader4; + private static bool ARB_get_program_binary; + private static bool ARB_get_texture_sub_image; + private static bool ARB_gl_spirv; + private static bool ARB_gpu_shader_fp64; + private static bool ARB_gpu_shader_int64; + private static bool ARB_gpu_shader5; + private static bool ARB_half_float_pixel; + private static bool ARB_half_float_vertex; + private static bool ARB_imaging; + private static bool ARB_indirect_parameters; + private static bool ARB_instanced_arrays; + private static bool ARB_internalformat_query; + private static bool ARB_internalformat_query2; + private static bool ARB_invalidate_subdata; + private static bool ARB_map_buffer_alignment; + private static bool ARB_map_buffer_range; + private static bool ARB_matrix_palette; + private static bool ARB_multi_bind; + private static bool ARB_multi_draw_indirect; + private static bool ARB_multisample; + private static bool ARB_multitexture; + private static bool ARB_occlusion_query; + private static bool ARB_occlusion_query2; + private static bool ARB_parallel_shader_compile; + private static bool ARB_pipeline_statistics_query; + private static bool ARB_pixel_buffer_object; + private static bool ARB_point_parameters; + private static bool ARB_point_sprite; + private static bool ARB_polygon_offset_clamp; + private static bool ARB_post_depth_coverage; + private static bool ARB_program_interface_query; + private static bool ARB_provoking_vertex; + private static bool ARB_query_buffer_object; + private static bool ARB_robust_buffer_access_behavior; + private static bool ARB_robustness; + private static bool ARB_robustness_isolation; + private static bool ARB_sample_locations; + private static bool ARB_sample_shading; + private static bool ARB_sampler_objects; + private static bool ARB_seamless_cube_map; + private static bool ARB_seamless_cubemap_per_texture; + private static bool ARB_separate_shader_objects; + private static bool ARB_shader_atomic_counter_ops; + private static bool ARB_shader_atomic_counters; + private static bool ARB_shader_ballot; + private static bool ARB_shader_bit_encoding; + private static bool ARB_shader_clock; + private static bool ARB_shader_draw_parameters; + private static bool ARB_shader_group_vote; + private static bool ARB_shader_image_load_store; + private static bool ARB_shader_image_size; + private static bool ARB_shader_objects; + private static bool ARB_shader_precision; + private static bool ARB_shader_stencil_export; + private static bool ARB_shader_storage_buffer_object; + private static bool ARB_shader_subroutine; + private static bool ARB_shader_texture_image_samples; + private static bool ARB_shader_texture_lod; + private static bool ARB_shader_viewport_layer_array; + private static bool ARB_shading_language_100; + private static bool ARB_shading_language_420pack; + private static bool ARB_shading_language_include; + private static bool ARB_shading_language_packing; + private static bool ARB_shadow; + private static bool ARB_shadow_ambient; + private static bool ARB_sparse_buffer; + private static bool ARB_sparse_texture; + private static bool ARB_sparse_texture_clamp; + private static bool ARB_sparse_texture2; + private static bool ARB_spirv_extensions; + private static bool ARB_stencil_texturing; + private static bool ARB_sync; + private static bool ARB_tessellation_shader; + private static bool ARB_texture_barrier; + private static bool ARB_texture_border_clamp; + private static bool ARB_texture_buffer_object; + private static bool ARB_texture_buffer_object_rgb32; + private static bool ARB_texture_buffer_range; + private static bool ARB_texture_compression; + private static bool ARB_texture_compression_bptc; + private static bool ARB_texture_compression_rgtc; + private static bool ARB_texture_cube_map; + private static bool ARB_texture_cube_map_array; + private static bool ARB_texture_env_add; + private static bool ARB_texture_env_combine; + private static bool ARB_texture_env_crossbar; + private static bool ARB_texture_env_dot3; + private static bool ARB_texture_filter_anisotropic; + private static bool ARB_texture_filter_minmax; + private static bool ARB_texture_float; + private static bool ARB_texture_gather; + private static bool ARB_texture_mirror_clamp_to_edge; + private static bool ARB_texture_mirrored_repeat; + private static bool ARB_texture_multisample; + private static bool ARB_texture_non_power_of_two; + private static bool ARB_texture_query_levels; + private static bool ARB_texture_query_lod; + private static bool ARB_texture_rectangle; + private static bool ARB_texture_rg; + private static bool ARB_texture_rgb10_a2ui; + private static bool ARB_texture_stencil8; + private static bool ARB_texture_storage; + private static bool ARB_texture_storage_multisample; + private static bool ARB_texture_swizzle; + private static bool ARB_texture_view; + private static bool ARB_timer_query; + private static bool ARB_transform_feedback_instanced; + private static bool ARB_transform_feedback_overflow_query; + private static bool ARB_transform_feedback2; + private static bool ARB_transform_feedback3; + private static bool ARB_transpose_matrix; + private static bool ARB_uniform_buffer_object; + private static bool ARB_vertex_array_bgra; + private static bool ARB_vertex_array_object; + private static bool ARB_vertex_attrib_64bit; + private static bool ARB_vertex_attrib_binding; + private static bool ARB_vertex_blend; + private static bool ARB_vertex_buffer_object; + private static bool ARB_vertex_program; + private static bool ARB_vertex_shader; + private static bool ARB_vertex_type_10f_11f_11f_rev; + private static bool ARB_vertex_type_2_10_10_10_rev; + private static bool ARB_viewport_array; + private static bool ARB_window_pos; + private static bool ATI_draw_buffers; + private static bool ATI_element_array; + private static bool ATI_envmap_bumpmap; + private static bool ATI_fragment_shader; + private static bool ATI_map_object_buffer; + private static bool ATI_meminfo; + private static bool ATI_pixel_format_float; + private static bool ATI_pn_triangles; + private static bool ATI_separate_stencil; + private static bool ATI_text_fragment_shader; + private static bool ATI_texture_env_combine3; + private static bool ATI_texture_float; + private static bool ATI_texture_mirror_once; + private static bool ATI_vertex_array_object; + private static bool ATI_vertex_attrib_array_object; + private static bool ATI_vertex_streams; + private static bool EXT_422_pixels; + private static bool EXT_abgr; + private static bool EXT_bgra; + private static bool EXT_bindable_uniform; + private static bool EXT_blend_color; + private static bool EXT_blend_equation_separate; + private static bool EXT_blend_func_separate; + private static bool EXT_blend_logic_op; + private static bool EXT_blend_minmax; + private static bool EXT_blend_subtract; + private static bool EXT_clip_volume_hint; + private static bool EXT_cmyka; + private static bool EXT_color_subtable; + private static bool EXT_compiled_vertex_array; + private static bool EXT_convolution; + private static bool EXT_coordinate_frame; + private static bool EXT_copy_texture; + private static bool EXT_cull_vertex; + private static bool EXT_debug_label; + private static bool EXT_debug_marker; + private static bool EXT_depth_bounds_test; + private static bool EXT_direct_state_access; + private static bool EXT_draw_buffers2; + private static bool EXT_draw_instanced; + private static bool EXT_draw_range_elements; + private static bool EXT_EGL_image_storage; + private static bool EXT_EGL_sync; + private static bool EXT_external_buffer; + private static bool EXT_fog_coord; + private static bool EXT_framebuffer_blit; + private static bool EXT_framebuffer_blit_layers; + private static bool EXT_framebuffer_multisample; + private static bool EXT_framebuffer_multisample_blit_scaled; + private static bool EXT_framebuffer_object; + private static bool EXT_framebuffer_sRGB; + private static bool EXT_geometry_shader4; + private static bool EXT_gpu_program_parameters; + private static bool EXT_gpu_shader4; + private static bool EXT_histogram; + private static bool EXT_index_array_formats; + private static bool EXT_index_func; + private static bool EXT_index_material; + private static bool EXT_index_texture; + private static bool EXT_light_texture; + private static bool EXT_memory_object; + private static bool EXT_memory_object_fd; + private static bool EXT_memory_object_win32; + private static bool EXT_misc_attribute; + private static bool EXT_multi_draw_arrays; + private static bool EXT_multisample; + private static bool EXT_multiview_tessellation_geometry_shader; + private static bool EXT_multiview_texture_multisample; + private static bool EXT_multiview_timer_query; + private static bool EXT_packed_depth_stencil; + private static bool EXT_packed_float; + private static bool EXT_packed_pixels; + private static bool EXT_paletted_texture; + private static bool EXT_pixel_buffer_object; + private static bool EXT_pixel_transform; + private static bool EXT_pixel_transform_color_table; + private static bool EXT_point_parameters; + private static bool EXT_polygon_offset; + private static bool EXT_polygon_offset_clamp; + private static bool EXT_post_depth_coverage; + private static bool EXT_provoking_vertex; + private static bool EXT_raster_multisample; + private static bool EXT_rescale_normal; + private static bool EXT_secondary_color; + private static bool EXT_semaphore; + private static bool EXT_semaphore_fd; + private static bool EXT_semaphore_win32; + private static bool EXT_separate_shader_objects; + private static bool EXT_separate_specular_color; + private static bool EXT_shader_framebuffer_fetch; + private static bool EXT_shader_framebuffer_fetch_non_coherent; + private static bool EXT_shader_image_load_formatted; + private static bool EXT_shader_image_load_store; + private static bool EXT_shader_integer_mix; + private static bool EXT_shader_samples_identical; + private static bool EXT_shadow_funcs; + private static bool EXT_shared_texture_palette; + private static bool EXT_sparse_texture2; + private static bool EXT_stencil_clear_tag; + private static bool EXT_stencil_two_side; + private static bool EXT_stencil_wrap; + private static bool EXT_subtexture; + private static bool EXT_texture; + private static bool EXT_texture_array; + private static bool EXT_texture_buffer_object; + private static bool EXT_texture_compression_latc; + private static bool EXT_texture_compression_rgtc; + private static bool EXT_texture_compression_s3tc; + private static bool EXT_texture_cube_map; + private static bool EXT_texture_env_add; + private static bool EXT_texture_env_combine; + private static bool EXT_texture_env_dot3; + private static bool EXT_texture_filter_anisotropic; + private static bool EXT_texture_filter_minmax; + private static bool EXT_texture_integer; + private static bool EXT_texture_lod_bias; + private static bool EXT_texture_mirror_clamp; + private static bool EXT_texture_object; + private static bool EXT_texture_perturb_normal; + private static bool EXT_texture_shadow_lod; + private static bool EXT_texture_shared_exponent; + private static bool EXT_texture_snorm; + private static bool EXT_texture_sRGB; + private static bool EXT_texture_sRGB_decode; + private static bool EXT_texture_sRGB_R8; + private static bool EXT_texture_sRGB_RG8; + private static bool EXT_texture_storage; + private static bool EXT_texture_swizzle; + private static bool EXT_texture3D; + private static bool EXT_timer_query; + private static bool EXT_transform_feedback; + private static bool EXT_vertex_array; + private static bool EXT_vertex_array_bgra; + private static bool EXT_vertex_attrib_64bit; + private static bool EXT_vertex_shader; + private static bool EXT_vertex_weighting; + private static bool EXT_win32_keyed_mutex; + private static bool EXT_window_rectangles; + private static bool EXT_x11_sync_object; + private static bool GREMEDY_frame_terminator; + private static bool GREMEDY_string_marker; + private static bool HP_convolution_border_modes; + private static bool HP_image_transform; + private static bool HP_occlusion_test; + private static bool HP_texture_lighting; + private static bool IBM_cull_vertex; + private static bool IBM_multimode_draw_arrays; + private static bool IBM_rasterpos_clip; + private static bool IBM_static_data; + private static bool IBM_texture_mirrored_repeat; + private static bool IBM_vertex_array_lists; + private static bool INGR_blend_func_separate; + private static bool INGR_color_clamp; + private static bool INGR_interlace_read; + private static bool INTEL_blackhole_render; + private static bool INTEL_conservative_rasterization; + private static bool INTEL_fragment_shader_ordering; + private static bool INTEL_framebuffer_CMAA; + private static bool INTEL_map_texture; + private static bool INTEL_parallel_arrays; + private static bool INTEL_performance_query; + private static bool KHR_blend_equation_advanced; + private static bool KHR_blend_equation_advanced_coherent; + private static bool KHR_context_flush_control; + private static bool KHR_debug; + private static bool KHR_no_error; + private static bool KHR_parallel_shader_compile; + private static bool KHR_robust_buffer_access_behavior; + private static bool KHR_robustness; + private static bool KHR_shader_subgroup; + private static bool KHR_texture_compression_astc_hdr; + private static bool KHR_texture_compression_astc_ldr; + private static bool KHR_texture_compression_astc_sliced_3d; + private static bool MESA_framebuffer_flip_x; + private static bool MESA_framebuffer_flip_y; + private static bool MESA_framebuffer_swap_xy; + private static bool MESA_pack_invert; + private static bool MESA_program_binary_formats; + private static bool MESA_resize_buffers; + private static bool MESA_shader_integer_functions; + private static bool MESA_tile_raster_order; + private static bool MESA_window_pos; + private static bool MESA_ycbcr_texture; + private static bool MESAX_texture_stack; + private static bool NV_alpha_to_coverage_dither_control; + private static bool NV_bindless_multi_draw_indirect; + private static bool NV_bindless_multi_draw_indirect_count; + private static bool NV_bindless_texture; + private static bool NV_blend_equation_advanced; + private static bool NV_blend_equation_advanced_coherent; + private static bool NV_blend_minmax_factor; + private static bool NV_blend_square; + private static bool NV_clip_space_w_scaling; + private static bool NV_command_list; + private static bool NV_compute_program5; + private static bool NV_compute_shader_derivatives; + private static bool NV_conditional_render; + private static bool NV_conservative_raster; + private static bool NV_conservative_raster_dilate; + private static bool NV_conservative_raster_pre_snap; + private static bool NV_conservative_raster_pre_snap_triangles; + private static bool NV_conservative_raster_underestimation; + private static bool NV_copy_depth_to_color; + private static bool NV_copy_image; + private static bool NV_deep_texture3D; + private static bool NV_depth_buffer_float; + private static bool NV_depth_clamp; + private static bool NV_draw_texture; + private static bool NV_draw_vulkan_image; + private static bool NV_evaluators; + private static bool NV_explicit_multisample; + private static bool NV_fence; + private static bool NV_fill_rectangle; + private static bool NV_float_buffer; + private static bool NV_fog_distance; + private static bool NV_fragment_coverage_to_color; + private static bool NV_fragment_program; + private static bool NV_fragment_program_option; + private static bool NV_fragment_program2; + private static bool NV_fragment_program4; + private static bool NV_fragment_shader_barycentric; + private static bool NV_fragment_shader_interlock; + private static bool NV_framebuffer_mixed_samples; + private static bool NV_framebuffer_multisample_coverage; + private static bool NV_geometry_program4; + private static bool NV_geometry_shader_passthrough; + private static bool NV_geometry_shader4; + private static bool NV_gpu_multicast; + private static bool NV_gpu_program4; + private static bool NV_gpu_program5; + private static bool NV_gpu_program5_mem_extended; + private static bool NV_gpu_shader5; + private static bool NV_half_float; + private static bool NV_internalformat_sample_query; + private static bool NV_light_max_exponent; + private static bool NV_memory_attachment; + private static bool NV_memory_object_sparse; + private static bool NV_mesh_shader; + private static bool NV_multisample_coverage; + private static bool NV_multisample_filter_hint; + private static bool NV_occlusion_query; + private static bool NV_packed_depth_stencil; + private static bool NV_parameter_buffer_object; + private static bool NV_parameter_buffer_object2; + private static bool NV_path_rendering; + private static bool NV_path_rendering_shared_edge; + private static bool NV_pixel_data_range; + private static bool NV_point_sprite; + private static bool NV_present_video; + private static bool NV_primitive_restart; + private static bool NV_primitive_shading_rate; + private static bool NV_query_resource; + private static bool NV_query_resource_tag; + private static bool NV_register_combiners; + private static bool NV_register_combiners2; + private static bool NV_representative_fragment_test; + private static bool NV_robustness_video_memory_purge; + private static bool NV_sample_locations; + private static bool NV_sample_mask_override_coverage; + private static bool NV_scissor_exclusive; + private static bool NV_shader_atomic_counters; + private static bool NV_shader_atomic_float; + private static bool NV_shader_atomic_float64; + private static bool NV_shader_atomic_fp16_vector; + private static bool NV_shader_atomic_int64; + private static bool NV_shader_buffer_load; + private static bool NV_shader_buffer_store; + private static bool NV_shader_storage_buffer_object; + private static bool NV_shader_subgroup_partitioned; + private static bool NV_shader_texture_footprint; + private static bool NV_shader_thread_group; + private static bool NV_shader_thread_shuffle; + private static bool NV_shading_rate_image; + private static bool NV_stereo_view_rendering; + private static bool NV_tessellation_program5; + private static bool NV_texgen_emboss; + private static bool NV_texgen_reflection; + private static bool NV_texture_barrier; + private static bool NV_texture_compression_vtc; + private static bool NV_texture_env_combine4; + private static bool NV_texture_expand_normal; + private static bool NV_texture_multisample; + private static bool NV_texture_rectangle; + private static bool NV_texture_rectangle_compressed; + private static bool NV_texture_shader; + private static bool NV_texture_shader2; + private static bool NV_texture_shader3; + private static bool NV_timeline_semaphore; + private static bool NV_transform_feedback; + private static bool NV_transform_feedback2; + private static bool NV_uniform_buffer_std430_layout; + private static bool NV_uniform_buffer_unified_memory; + private static bool NV_vdpau_interop; + private static bool NV_vdpau_interop2; + private static bool NV_vertex_array_range; + private static bool NV_vertex_array_range2; + private static bool NV_vertex_attrib_integer_64bit; + private static bool NV_vertex_buffer_unified_memory; + private static bool NV_vertex_program; + private static bool NV_vertex_program1_1; + private static bool NV_vertex_program2; + private static bool NV_vertex_program2_option; + private static bool NV_vertex_program3; + private static bool NV_vertex_program4; + private static bool NV_video_capture; + private static bool NV_viewport_array2; + private static bool NV_viewport_swizzle; + private static bool NVX_blend_equation_advanced_multi_draw_buffers; + private static bool NVX_conditional_render; + private static bool NVX_gpu_memory_info; + private static bool NVX_gpu_multicast2; + private static bool NVX_linked_gpu_multicast; + private static bool NVX_progress_fence; + private static bool OES_byte_coordinates; + private static bool OES_compressed_paletted_texture; + private static bool OES_fixed_point; + private static bool OES_query_matrix; + private static bool OES_read_format; + private static bool OES_single_precision; + private static bool OML_interlace; + private static bool OML_resample; + private static bool OML_subsample; + private static bool OVR_multiview; + private static bool OVR_multiview2; + private static bool PGI_misc_hints; + private static bool PGI_vertex_hints; + private static bool REND_screen_coordinates; + private static bool S3_s3tc; + private static bool SGI_color_matrix; + private static bool SGI_color_table; + private static bool SGI_texture_color_table; + private static bool SGIS_detail_texture; + private static bool SGIS_fog_function; + private static bool SGIS_generate_mipmap; + private static bool SGIS_multisample; + private static bool SGIS_pixel_texture; + private static bool SGIS_point_line_texgen; + private static bool SGIS_point_parameters; + private static bool SGIS_sharpen_texture; + private static bool SGIS_texture_border_clamp; + private static bool SGIS_texture_color_mask; + private static bool SGIS_texture_edge_clamp; + private static bool SGIS_texture_filter4; + private static bool SGIS_texture_lod; + private static bool SGIS_texture_select; + private static bool SGIS_texture4D; + private static bool SGIX_async; + private static bool SGIX_async_histogram; + private static bool SGIX_async_pixel; + private static bool SGIX_blend_alpha_minmax; + private static bool SGIX_calligraphic_fragment; + private static bool SGIX_clipmap; + private static bool SGIX_convolution_accuracy; + private static bool SGIX_depth_pass_instrument; + private static bool SGIX_depth_texture; + private static bool SGIX_flush_raster; + private static bool SGIX_fog_offset; + private static bool SGIX_fragment_lighting; + private static bool SGIX_framezoom; + private static bool SGIX_igloo_interface; + private static bool SGIX_instruments; + private static bool SGIX_interlace; + private static bool SGIX_ir_instrument1; + private static bool SGIX_list_priority; + private static bool SGIX_pixel_texture; + private static bool SGIX_pixel_tiles; + private static bool SGIX_polynomial_ffd; + private static bool SGIX_reference_plane; + private static bool SGIX_resample; + private static bool SGIX_scalebias_hint; + private static bool SGIX_shadow; + private static bool SGIX_shadow_ambient; + private static bool SGIX_sprite; + private static bool SGIX_subsample; + private static bool SGIX_tag_sample_buffer; + private static bool SGIX_texture_add_env; + private static bool SGIX_texture_coordinate_clamp; + private static bool SGIX_texture_lod_bias; + private static bool SGIX_texture_multi_buffer; + private static bool SGIX_texture_scale_bias; + private static bool SGIX_vertex_preclip; + private static bool SGIX_ycrcb; + private static bool SGIX_ycrcb_subsample; + private static bool SGIX_ycrcba; + private static bool SUN_convolution_border_modes; + private static bool SUN_global_alpha; + private static bool SUN_mesh_array; + private static bool SUN_slice_accum; + private static bool SUN_triangle_list; + private static bool SUN_vertex; + private static bool SUNX_constant_data; + private static bool WIN_phong_shading; + private static bool WIN_specular_fog; + + #endregion + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glApiManager.Load.cs b/StgsSharp.Graphics/OpenGL/glApiManager.Load.cs similarity index 98% rename from StgSharp.Common/Graphics/OpenGL/glApiManager.Load.cs rename to StgsSharp.Graphics/OpenGL/glApiManager.Load.cs index e73c4404..e8528709 100644 --- a/StgSharp.Common/Graphics/OpenGL/glApiManager.Load.cs +++ b/StgsSharp.Graphics/OpenGL/glApiManager.Load.cs @@ -1,1611 +1,1611 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glApiManager.Load" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Graphics.OpenGL -{ - public static partial class glManager - { - - internal static unsafe bool LoadGLcore10( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core10) - { - DefaultLog.InternalAppendLog("The core version 1.0 is not supported."); - return false; - } - - #region load - - contextPtr->glBlendFunc = LoadGLFunction(load, "glBlendFunc"u8); - contextPtr->glClear = LoadGLFunction(load, "glClear"u8); - contextPtr->glClearColor = LoadGLFunction(load, "glClearColor"u8); - contextPtr->glClearDepth = LoadGLFunction(load, "glClearDepth"u8); - contextPtr->glClearStencil = LoadGLFunction(load, "glClearStencil"u8); - contextPtr->glColorMask = LoadGLFunction(load, "glColorMask"u8); - contextPtr->glCullFace = LoadGLFunction(load, "glCullFace"u8); - contextPtr->glDepthFunc = LoadGLFunction(load, "glDepthFunc"u8); - contextPtr->glDepthMask = LoadGLFunction(load, "glDepthMask"u8); - contextPtr->glDepthRange = LoadGLFunction(load, "glDepthRange"u8); - contextPtr->glDisable = LoadGLFunction(load, "glDisable"u8); - contextPtr->glDrawBuffer = LoadGLFunction(load, "glDrawBuffer"u8); - contextPtr->glEnable = LoadGLFunction(load, "glEnable"u8); - contextPtr->glFinish = LoadGLFunction(load, "glFinish"u8); - contextPtr->glFlush = LoadGLFunction(load, "glFlush"u8); - contextPtr->glFrontFace = LoadGLFunction(load, "glFrontFace"u8); - contextPtr->glGetBooleanv = LoadGLFunction(load, "glGetBooleanv"u8); - contextPtr->glGetDoublev = LoadGLFunction(load, "glGetDoublev"u8); - contextPtr->glGetError = LoadGLFunction(load, "glGetError"u8); - contextPtr->glGetFloatv = LoadGLFunction(load, "glGetFloatv"u8); - contextPtr->glGetIntegerv = LoadGLFunction(load, "glGetIntegerv"u8); - contextPtr->glGetString = LoadGLFunction(load, "glGetString"u8); - contextPtr->glGetTexImage = LoadGLFunction(load, "glGetTexImage"u8); - contextPtr->glGetTexLevelParameterfv = LoadGLFunction(load, "glGetTexLevelParameterfv"u8); - contextPtr->glGetTexLevelParameteriv = LoadGLFunction(load, "glGetTexLevelParameteriv"u8); - contextPtr->glGetTexParameterfv = LoadGLFunction(load, "glGetTexParameterfv"u8); - contextPtr->glGetTexParameteriv = LoadGLFunction(load, "glGetTexParameteriv"u8); - contextPtr->glHint = LoadGLFunction(load, "glHint"u8); - contextPtr->glIsEnabled = LoadGLFunction(load, "glIsEnabled"u8); - contextPtr->glLineWidth = LoadGLFunction(load, "glLineWidth"u8); - contextPtr->glLogicOp = LoadGLFunction(load, "glLogicOp"u8); - contextPtr->glPixelStoref = LoadGLFunction(load, "glPixelStoref"u8); - contextPtr->glPixelStorei = LoadGLFunction(load, "glPixelStorei"u8); - contextPtr->glPointSize = LoadGLFunction(load, "glPointSize"u8); - contextPtr->glPolygonMode = LoadGLFunction(load, "glPolygonMode"u8); - contextPtr->glReadBuffer = LoadGLFunction(load, "glReadBuffer"u8); - contextPtr->glReadPixels = LoadGLFunction(load, "glReadPixels"u8); - contextPtr->glScissor = LoadGLFunction(load, "glScissor"u8); - contextPtr->glStencilFunc = LoadGLFunction(load, "glStencilFunc"u8); - contextPtr->glStencilMask = LoadGLFunction(load, "glStencilMask"u8); - contextPtr->glStencilOp = LoadGLFunction(load, "glStencilOp"u8); - contextPtr->glTexImage1D = LoadGLFunction(load, "glTexImage1D"u8); - contextPtr->glTexImage2D = LoadGLFunction(load, "glTexImage2D"u8); - contextPtr->glTexParameterf = LoadGLFunction(load, "glTexParameterf"u8); - contextPtr->glTexParameterfv = LoadGLFunction(load, "glTexParameterfv"u8); - contextPtr->glTexParameteri = LoadGLFunction(load, "glTexParameteri"u8); - contextPtr->glTexParameteriv = LoadGLFunction(load, "glTexParameteriv"u8); - contextPtr->glViewport = LoadGLFunction(load, "glViewport"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.0 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore11( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core11) - { - DefaultLog.InternalAppendLog("The core version 1.1 is not supported."); - return false; - } - - #region load - - contextPtr->glBindTexture = LoadGLFunction(load, "glBindTexture"u8); - contextPtr->glCopyTexImage1D = LoadGLFunction(load, - "glCopyTexImage1D"u8); - contextPtr->glCopyTexImage2D = LoadGLFunction(load, - "glCopyTexImage2D"u8); - contextPtr->glCopyTexSubImage1D = LoadGLFunction(load, - "glCopyTexSubImage1D"u8); - contextPtr->glCopyTexSubImage2D = LoadGLFunction(load, - "glCopyTexSubImage2D"u8); - contextPtr->glDeleteTextures = LoadGLFunction(load, - "glDeleteTextures"u8); - contextPtr->glDrawArrays = LoadGLFunction(load, "glDrawArrays"u8); - contextPtr->glDrawElements = LoadGLFunction(load, - "glDrawElements"u8); - contextPtr->glGenTextures = LoadGLFunction(load, "glGenTextures"u8); - - // contextPtr->glGetPointerv =LoadGLFunction(load,"glGetPointerv"u8); - contextPtr->glIsTexture = LoadGLFunction(load, "glIsTexture"u8); - contextPtr->glPolygonOffset = LoadGLFunction(load, "glPolygonOffset"u8); - contextPtr->glTexSubImage1D = LoadGLFunction(load, - "glTexSubImage1D"u8); - contextPtr->glTexSubImage2D = LoadGLFunction(load, - "glTexSubImage2D"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.1 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore12( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core12) - { - DefaultLog.InternalAppendLog("The core version 1.2 is not supported."); - return false; - } - - #region load - - contextPtr->glCopyTexSubImage3D = LoadGLFunction(load, - "glCopyTexSubImage3D"u8); - contextPtr->glDrawRangeElements = LoadGLFunction(load, - "glDrawRangeElements"u8); - contextPtr->glTexImage3D = LoadGLFunction(load, - "glTexImage3D"u8); - contextPtr->glTexSubImage3D = LoadGLFunction(load, - "glTexSubImage3D"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.2 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore13( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core13) - { - DefaultLog.InternalAppendLog("The core version 1.3 is not supported."); - return false; - } - - #region load - - contextPtr->glActiveTexture = LoadGLFunction(load, "glActiveTexture"u8); - contextPtr->glCompressedTexImage1D = LoadGLFunction(load, - "glCompressedTexImage1D"u8); - contextPtr->glCompressedTexImage2D = LoadGLFunction(load, - "glCompressedTexImage2D"u8); - contextPtr->glCompressedTexImage3D = LoadGLFunction(load, - "glCompressedTexImage3D"u8); - contextPtr->glCompressedTexSubImage1D = LoadGLFunction(load, - "glCompressedTexSubImage1D"u8); - contextPtr->glCompressedTexSubImage2D = LoadGLFunction(load, - "glCompressedTexSubImage2D"u8); - contextPtr->glCompressedTexSubImage3D = LoadGLFunction(load, - "glCompressedTexSubImage3D"u8); - contextPtr->glGetCompressedTexImage = LoadGLFunction(load, - "glGetCompressedTexImage"u8); - contextPtr->glSampleCoverage = LoadGLFunction(load, - "glSampleCoverage"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.3 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore14( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core14) - { - DefaultLog.InternalAppendLog("The core version 1.4 is not supported."); - return false; - } - - #region load - - contextPtr->glBlendColor = LoadGLFunction(load, - "glBlendColor"u8); - contextPtr->glBlendEquation = LoadGLFunction(load, "glBlendEquation"u8); - contextPtr->glBlendFuncSeparate = LoadGLFunction(load, - "glBlendFuncSeparate"u8); - contextPtr->glMultiDrawArrays = LoadGLFunction(load, - "glMultiDrawArrays"u8); - contextPtr->glMultiDrawElements = LoadGLFunction(load, - "glMultiDrawElements"u8); - contextPtr->glPointParameterf = LoadGLFunction(load, - "glPointParameterf"u8); - contextPtr->glPointParameterfv = LoadGLFunction(load, - "glPointParameterfv"u8); - contextPtr->glPointParameteri = LoadGLFunction(load, - "glPointParameteri"u8); - contextPtr->glPointParameteriv = LoadGLFunction(load, - "glPointParameteriv"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.4 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore15( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core15) - { - DefaultLog.InternalAppendLog("The core version 1.5 is not supported."); - return false; - } - - #region load - - contextPtr->glBeginQuery = LoadGLFunction(load, "glBeginQuery"u8); - contextPtr->glBindBuffer = LoadGLFunction(load, "glBindBuffer"u8); - contextPtr->glBufferData = LoadGLFunction(load, - "glBufferData"u8); - contextPtr->glBufferSubData = LoadGLFunction(load, - "glBufferSubData"u8); - contextPtr->glDeleteBuffers = LoadGLFunction(load, "glDeleteBuffers"u8); - contextPtr->glDeleteQueries = LoadGLFunction(load, "glDeleteQueries"u8); - contextPtr->glEndQuery = LoadGLFunction(load, "glEndQuery"u8); - contextPtr->glGenBuffers = LoadGLFunction(load, "glGenBuffers"u8); - contextPtr->glGenQueries = LoadGLFunction(load, "glGenQueries"u8); - contextPtr->glGetBufferParameteriv = LoadGLFunction(load, - "glGetBufferParameteriv"u8); - contextPtr->glGetBufferPointerv = LoadGLFunction(load, - "glGetBufferPointerv"u8); - contextPtr->glGetBufferSubData = LoadGLFunction(load, - "glGetBufferSubData"u8); - contextPtr->glGetQueryObjectiv = LoadGLFunction(load, - "glGetQueryObjectiv"u8); - contextPtr->glGetQueryObjectuiv = LoadGLFunction(load, - "glGetQueryObjectuiv"u8); - contextPtr->glGetQueryiv = LoadGLFunction(load, "glGetQueryiv"u8); - contextPtr->glIsBuffer = LoadGLFunction(load, "glIsBuffer"u8); - contextPtr->glIsQuery = LoadGLFunction(load, "glIsQuery"u8); - contextPtr->glMapBuffer = LoadGLFunction(load, "glMapBuffer"u8); - contextPtr->glUnmapBuffer = LoadGLFunction(load, "glUnmapBuffer"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.5 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore20( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core20) - { - DefaultLog.InternalAppendLog("The core version 2.0 is not supported."); - return false; - } - - #region load - - contextPtr->glAttachShader = LoadGLFunction(load, "glAttachShader"u8); - contextPtr->glBindAttribLocation = LoadGLFunction(load, - "glBindAttribLocation"u8); - contextPtr->glBlendEquationSeparate = LoadGLFunction(load, - "glBlendEquationSeparate"u8); - contextPtr->glCompileShader = LoadGLFunction(load, "glCompileShader"u8); - contextPtr->glCreateProgram = LoadGLFunction(load, "glCreateProgram"u8); - contextPtr->glCreateShader = LoadGLFunction(load, "glCreateShader"u8); - contextPtr->glDeleteProgram = LoadGLFunction(load, "glDeleteProgram"u8); - contextPtr->glDeleteShader = LoadGLFunction(load, "glDeleteShader"u8); - contextPtr->glDetachShader = LoadGLFunction(load, "glDetachShader"u8); - contextPtr->glDisableVertexAttribArray = LoadGLFunction(load, - "glDisableVertexAttribArray"u8); - contextPtr->glDrawBuffers = LoadGLFunction(load, "glDrawBuffers"u8); - contextPtr->glEnableVertexAttribArray = LoadGLFunction(load, - "glEnableVertexAttribArray"u8); - contextPtr->glGetActiveAttrib = LoadGLFunction(load, - "glGetActiveAttrib"u8); - contextPtr->glGetActiveUniform = LoadGLFunction(load, - "glGetActiveUniform"u8); - contextPtr->glGetAttachedShaders = LoadGLFunction(load, - "glGetAttachedShaders"u8); - contextPtr->glGetAttribLocation = LoadGLFunction(load, - "glGetAttribLocation"u8); - contextPtr->glGetProgramInfoLog = LoadGLFunction(load, - "glGetProgramInfoLog"u8); - contextPtr->glGetProgramiv = LoadGLFunction(load, - "glGetProgramiv"u8); - contextPtr->glGetShaderInfoLog = LoadGLFunction(load, - "glGetShaderInfoLog"u8); - contextPtr->glGetShaderSource = LoadGLFunction(load, - "glGetShaderSource"u8); - contextPtr->glGetShaderiv = LoadGLFunction(load, "glGetShaderiv"u8); - contextPtr->glGetUniformLocation = LoadGLFunction(load, - "glGetUniformLocation"u8); - contextPtr->glGetUniformfv = LoadGLFunction(load, - "glGetUniformfv"u8); - contextPtr->glGetUniformiv = LoadGLFunction(load, - "glGetUniformiv"u8); - contextPtr->glGetVertexAttribPointerv = LoadGLFunction(load, - "glGetVertexAttribPointerv"u8); - contextPtr->glGetVertexAttribdv = LoadGLFunction(load, - "glGetVertexAttribdv"u8); - contextPtr->glGetVertexAttribfv = LoadGLFunction(load, - "glGetVertexAttribfv"u8); - contextPtr->glGetVertexAttribiv = LoadGLFunction(load, - "glGetVertexAttribiv"u8); - contextPtr->glIsProgram = LoadGLFunction(load, "glIsProgram"u8); - contextPtr->glIsShader = LoadGLFunction(load, "glIsShader"u8); - contextPtr->glLinkProgram = LoadGLFunction(load, "glLinkProgram"u8); - contextPtr->glShaderSource = LoadGLFunction(load, - "glShaderSource"u8); - contextPtr->glStencilFuncSeparate = LoadGLFunction(load, - "glStencilFuncSeparate"u8); - contextPtr->glStencilMaskSeparate = LoadGLFunction(load, - "glStencilMaskSeparate"u8); - contextPtr->glStencilOpSeparate = LoadGLFunction(load, - "glStencilOpSeparate"u8); - contextPtr->glUniform1f = LoadGLFunction(load, "glUniform1f"u8); - contextPtr->glUniform1fv = LoadGLFunction(load, "glUniform1fv"u8); - contextPtr->glUniform1i = LoadGLFunction(load, "glUniform1i"u8); - contextPtr->glUniform1iv = LoadGLFunction(load, "glUniform1iv"u8); - contextPtr->glUniform2f = LoadGLFunction(load, "glUniform2f"u8); - contextPtr->glUniform2fv = LoadGLFunction(load, "glUniform2fv"u8); - contextPtr->glUniform2i = LoadGLFunction(load, "glUniform2i"u8); - contextPtr->glUniform2iv = LoadGLFunction(load, "glUniform2iv"u8); - contextPtr->glUniform3f = LoadGLFunction(load, - "glUniform3f"u8); - contextPtr->glUniform3fv = LoadGLFunction(load, "glUniform3fv"u8); - contextPtr->glUniform3i = LoadGLFunction(load, "glUniform3i"u8); - contextPtr->glUniform3iv = LoadGLFunction(load, "glUniform3iv"u8); - contextPtr->glUniform4f = LoadGLFunction(load, - "glUniform4f"u8); - contextPtr->glUniform4fv = LoadGLFunction(load, "glUniform4fv"u8); - contextPtr->glUniform4i = LoadGLFunction(load, - "glUniform4i"u8); - contextPtr->glUniform4iv = LoadGLFunction(load, "glUniform4iv"u8); - contextPtr->glUniformMatrix2fv = LoadGLFunction(load, - "glUniformMatrix2fv"u8); - contextPtr->glUniformMatrix3fv = LoadGLFunction(load, - "glUniformMatrix3fv"u8); - contextPtr->glUniformMatrix4fv = LoadGLFunction(load, - "glUniformMatrix4fv"u8); - contextPtr->glUseProgram = LoadGLFunction(load, "glUseProgram"u8); - contextPtr->glValidateProgram = LoadGLFunction(load, "glValidateProgram"u8); - contextPtr->glVertexAttrib1d = LoadGLFunction(load, - "glVertexAttrib1d"u8); - contextPtr->glVertexAttrib1dv = LoadGLFunction(load, - "glVertexAttrib1dv"u8); - contextPtr->glVertexAttrib1f = LoadGLFunction(load, - "glVertexAttrib1f"u8); - contextPtr->glVertexAttrib1fv = LoadGLFunction(load, - "glVertexAttrib1fv"u8); - contextPtr->glVertexAttrib1s = LoadGLFunction(load, - "glVertexAttrib1s"u8); - contextPtr->glVertexAttrib1sv = LoadGLFunction(load, - "glVertexAttrib1sv"u8); - contextPtr->glVertexAttrib2d = LoadGLFunction(load, - "glVertexAttrib2d"u8); - contextPtr->glVertexAttrib2dv = LoadGLFunction(load, - "glVertexAttrib2dv"u8); - contextPtr->glVertexAttrib2f = LoadGLFunction(load, - "glVertexAttrib2f"u8); - contextPtr->glVertexAttrib2fv = LoadGLFunction(load, - "glVertexAttrib2fv"u8); - contextPtr->glVertexAttrib2s = LoadGLFunction(load, - "glVertexAttrib2s"u8); - contextPtr->glVertexAttrib2sv = LoadGLFunction(load, - "glVertexAttrib2sv"u8); - contextPtr->glVertexAttrib3d = LoadGLFunction(load, - "glVertexAttrib3d"u8); - contextPtr->glVertexAttrib3dv = LoadGLFunction(load, - "glVertexAttrib3dv"u8); - contextPtr->glVertexAttrib3f = LoadGLFunction(load, - "glVertexAttrib3f"u8); - contextPtr->glVertexAttrib3fv = LoadGLFunction(load, - "glVertexAttrib3fv"u8); - contextPtr->glVertexAttrib3s = LoadGLFunction(load, - "glVertexAttrib3s"u8); - contextPtr->glVertexAttrib3sv = LoadGLFunction(load, - "glVertexAttrib3sv"u8); - contextPtr->glVertexAttrib4Nbv = LoadGLFunction(load, - "glVertexAttrib4Nbv"u8); - contextPtr->glVertexAttrib4Niv = LoadGLFunction(load, - "glVertexAttrib4Niv"u8); - contextPtr->glVertexAttrib4Nsv = LoadGLFunction(load, - "glVertexAttrib4Nsv"u8); - contextPtr->glVertexAttrib4Nub = LoadGLFunction(load, - "glVertexAttrib4Nub"u8); - contextPtr->glVertexAttrib4Nubv = LoadGLFunction(load, - "glVertexAttrib4Nubv"u8); - contextPtr->glVertexAttrib4Nuiv = LoadGLFunction(load, - "glVertexAttrib4Nuiv"u8); - contextPtr->glVertexAttrib4Nusv = LoadGLFunction(load, - "glVertexAttrib4Nusv"u8); - contextPtr->glVertexAttrib4bv = LoadGLFunction(load, - "glVertexAttrib4bv"u8); - contextPtr->glVertexAttrib4d = LoadGLFunction(load, - "glVertexAttrib4d"u8); - contextPtr->glVertexAttrib4dv = LoadGLFunction(load, - "glVertexAttrib4dv"u8); - contextPtr->glVertexAttrib4f = LoadGLFunction(load, - "glVertexAttrib4f"u8); - contextPtr->glVertexAttrib4fv = LoadGLFunction(load, - "glVertexAttrib4fv"u8); - contextPtr->glVertexAttrib4iv = LoadGLFunction(load, - "glVertexAttrib4iv"u8); - contextPtr->glVertexAttrib4s = LoadGLFunction(load, - "glVertexAttrib4s"u8); - contextPtr->glVertexAttrib4sv = LoadGLFunction(load, - "glVertexAttrib4sv"u8); - contextPtr->glVertexAttrib4ubv = LoadGLFunction(load, - "glVertexAttrib4ubv"u8); - contextPtr->glVertexAttrib4uiv = LoadGLFunction(load, - "glVertexAttrib4uiv"u8); - contextPtr->glVertexAttrib4usv = LoadGLFunction(load, - "glVertexAttrib4usv"u8); - contextPtr->glVertexAttribPointer = LoadGLFunction(load, - "glVertexAttribPointer"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 2.0 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore21( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core21) - { - DefaultLog.InternalAppendLog("The core version 2.1 is not supported."); - return false; - } - - #region load - - contextPtr->glUniformMatrix2x3fv = LoadGLFunction(load, - "glUniformMatrix2x3fv"u8); - contextPtr->glUniformMatrix2x4fv = LoadGLFunction(load, - "glUniformMatrix2x4fv"u8); - contextPtr->glUniformMatrix3x2fv = LoadGLFunction(load, - "glUniformMatrix3x2fv"u8); - contextPtr->glUniformMatrix3x4fv = LoadGLFunction(load, - "glUniformMatrix3x4fv"u8); - contextPtr->glUniformMatrix4x2fv = LoadGLFunction(load, - "glUniformMatrix4x2fv"u8); - contextPtr->glUniformMatrix4x3fv = LoadGLFunction(load, - "glUniformMatrix4x3fv"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 2.1 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore30( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core30) - { - DefaultLog.InternalAppendLog("The core version 3.0 is not supported."); - return false; - } - - #region load - - contextPtr->glBeginConditionalRender = LoadGLFunction(load, - "glBeginConditionalRender"u8); - contextPtr->glBeginTransformFeedback = LoadGLFunction(load, - "glBeginTransformFeedback"u8); - contextPtr->glBindBufferBase = LoadGLFunction(load, - "glBindBufferBase"u8); - contextPtr->glBindBufferRange = LoadGLFunction(load, - "glBindBufferRange"u8); - contextPtr->glBindFragDataLocation = LoadGLFunction(load, - "glBindFragDataLocation"u8); - contextPtr->glBindFramebuffer = LoadGLFunction(load, - "glBindFramebuffer"u8); - contextPtr->glBindRenderbuffer = LoadGLFunction(load, - "glBindRenderbuffer"u8); - contextPtr->glBindVertexArray = LoadGLFunction(load, "glBindVertexArray"u8); - contextPtr->glBlitFramebuffer = LoadGLFunction(load, - "glBlitFramebuffer"u8); - contextPtr->glCheckFramebufferStatus = LoadGLFunction(load, - "glCheckFramebufferStatus"u8); - contextPtr->glClampColor = LoadGLFunction(load, "glClampColor"u8); - contextPtr->glClearBufferfi = LoadGLFunction(load, - "glClearBufferfi"u8); - contextPtr->glClearBufferfv = LoadGLFunction(load, - "glClearBufferfv"u8); - contextPtr->glClearBufferiv = LoadGLFunction(load, - "glClearBufferiv"u8); - contextPtr->glClearBufferuiv = LoadGLFunction(load, - "glClearBufferuiv"u8); - contextPtr->glColorMaski = LoadGLFunction(load, - "glColorMaski"u8); - contextPtr->glDeleteFramebuffers = LoadGLFunction(load, - "glDeleteFramebuffers"u8); - contextPtr->glDeleteRenderbuffers = LoadGLFunction(load, - "glDeleteRenderbuffers"u8); - contextPtr->glDeleteVertexArrays = LoadGLFunction(load, - "glDeleteVertexArrays"u8); - contextPtr->glDisablei = LoadGLFunction(load, "glDisablei"u8); - contextPtr->glEnablei = LoadGLFunction(load, "glEnablei"u8); - contextPtr->glEndConditionalRender = LoadGLFunction(load, "glEndConditionalRender"u8); - contextPtr->glEndTransformFeedback = LoadGLFunction(load, "glEndTransformFeedback"u8); - contextPtr->glFlushMappedBufferRange = LoadGLFunction(load, - "glFlushMappedBufferRange"u8); - contextPtr->glFramebufferRenderbuffer = LoadGLFunction(load, - "glFramebufferRenderbuffer"u8); - contextPtr->glFramebufferTexture1D = LoadGLFunction(load, - "glFramebufferTexture1D"u8); - contextPtr->glFramebufferTexture2D = LoadGLFunction(load, - "glFramebufferTexture2D"u8); - contextPtr->glFramebufferTexture3D = LoadGLFunction(load, - "glFramebufferTexture3D"u8); - contextPtr->glFramebufferTextureLayer = LoadGLFunction(load, - "glFramebufferTextureLayer"u8); - contextPtr->glGenFramebuffers = LoadGLFunction(load, - "glGenFramebuffers"u8); - contextPtr->glGenRenderbuffers = LoadGLFunction(load, - "glGenRenderbuffers"u8); - contextPtr->glGenVertexArrays = LoadGLFunction(load, - "glGenVertexArrays"u8); - contextPtr->glGenerateMipmap = LoadGLFunction(load, "glGenerateMipmap"u8); - contextPtr->glGetBooleani_v = LoadGLFunction(load, - "glGetBooleani_v"u8); - contextPtr->glGetFragDataLocation = LoadGLFunction(load, - "glGetFragDataLocation"u8); - contextPtr->glGetFramebufferAttachmentParameteriv = LoadGLFunction(load, - "glGetFramebufferAttachmentParameteriv"u8); - contextPtr->glGetIntegeri_v = LoadGLFunction(load, - "glGetIntegeri_v"u8); - contextPtr->glGetRenderbufferParameteriv = LoadGLFunction(load, - "glGetRenderbufferParameteriv"u8); - contextPtr->glGetStringi = LoadGLFunction(load, "glGetStringi"u8); - contextPtr->glGetTexParameterIiv = LoadGLFunction(load, - "glGetTexParameterIiv"u8); - contextPtr->glGetTexParameterIuiv = LoadGLFunction(load, - "glGetTexParameterIuiv"u8); - contextPtr->glGetTransformFeedbackVarying = LoadGLFunction(load, - "glGetTransformFeedbackVarying"u8); - contextPtr->glGetUniformuiv = LoadGLFunction(load, - "glGetUniformuiv"u8); - contextPtr->glGetVertexAttribIiv = LoadGLFunction(load, - "glGetVertexAttribIiv"u8); - contextPtr->glGetVertexAttribIuiv = LoadGLFunction(load, - "glGetVertexAttribIuiv"u8); - contextPtr->glIsEnabledi = LoadGLFunction(load, "glIsEnabledi"u8); - contextPtr->glIsFramebuffer = LoadGLFunction(load, "glIsFramebuffer"u8); - contextPtr->glIsRenderbuffer = LoadGLFunction(load, "glIsRenderbuffer"u8); - contextPtr->glIsVertexArray = LoadGLFunction(load, "glIsVertexArray"u8); - contextPtr->glMapBufferRange = LoadGLFunction(load, - "glMapBufferRange"u8); - contextPtr->glRenderbufferStorage = LoadGLFunction(load, - "glRenderbufferStorage"u8); - contextPtr->glRenderbufferStorageMultisample = LoadGLFunction(load, - "glRenderbufferStorageMultisample"u8); - contextPtr->glTexParameterIiv = LoadGLFunction(load, - "glTexParameterIiv"u8); - contextPtr->glTexParameterIuiv = LoadGLFunction(load, - "glTexParameterIuiv"u8); - contextPtr->glTransformFeedbackVaryings = LoadGLFunction(load, - "glTransformFeedbackVaryings"u8); - contextPtr->glUniform1ui = LoadGLFunction(load, "glUniform1ui"u8); - contextPtr->glUniform1uiv = LoadGLFunction(load, "glUniform1uiv"u8); - contextPtr->glUniform2ui = LoadGLFunction(load, "glUniform2ui"u8); - contextPtr->glUniform2uiv = LoadGLFunction(load, "glUniform2uiv"u8); - contextPtr->glUniform3ui = LoadGLFunction(load, - "glUniform3ui"u8); - contextPtr->glUniform3uiv = LoadGLFunction(load, "glUniform3uiv"u8); - contextPtr->glUniform4ui = LoadGLFunction(load, - "glUniform4ui"u8); - contextPtr->glUniform4uiv = LoadGLFunction(load, "glUniform4uiv"u8); - contextPtr->glVertexAttribI1i = LoadGLFunction(load, - "glVertexAttribI1i"u8); - contextPtr->glVertexAttribI1iv = LoadGLFunction(load, - "glVertexAttribI1iv"u8); - contextPtr->glVertexAttribI1ui = LoadGLFunction(load, - "glVertexAttribI1ui"u8); - contextPtr->glVertexAttribI1uiv = LoadGLFunction(load, - "glVertexAttribI1uiv"u8); - contextPtr->glVertexAttribI2i = LoadGLFunction(load, - "glVertexAttribI2i"u8); - contextPtr->glVertexAttribI2iv = LoadGLFunction(load, - "glVertexAttribI2iv"u8); - contextPtr->glVertexAttribI2ui = LoadGLFunction(load, - "glVertexAttribI2ui"u8); - contextPtr->glVertexAttribI2uiv = LoadGLFunction(load, - "glVertexAttribI2uiv"u8); - contextPtr->glVertexAttribI3i = LoadGLFunction(load, - "glVertexAttribI3i"u8); - contextPtr->glVertexAttribI3iv = LoadGLFunction(load, - "glVertexAttribI3iv"u8); - contextPtr->glVertexAttribI3ui = LoadGLFunction(load, - "glVertexAttribI3ui"u8); - contextPtr->glVertexAttribI3uiv = LoadGLFunction(load, - "glVertexAttribI3uiv"u8); - contextPtr->glVertexAttribI4bv = LoadGLFunction(load, - "glVertexAttribI4bv"u8); - contextPtr->glVertexAttribI4i = LoadGLFunction(load, - "glVertexAttribI4i"u8); - contextPtr->glVertexAttribI4iv = LoadGLFunction(load, - "glVertexAttribI4iv"u8); - contextPtr->glVertexAttribI4sv = LoadGLFunction(load, - "glVertexAttribI4sv"u8); - contextPtr->glVertexAttribI4ubv = LoadGLFunction(load, - "glVertexAttribI4ubv"u8); - contextPtr->glVertexAttribI4ui = LoadGLFunction(load, - "glVertexAttribI4ui"u8); - contextPtr->glVertexAttribI4uiv = LoadGLFunction(load, - "glVertexAttribI4uiv"u8); - contextPtr->glVertexAttribI4usv = LoadGLFunction(load, - "glVertexAttribI4usv"u8); - contextPtr->glVertexAttribIPointer = LoadGLFunction(load, - "glVertexAttribIPointer"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 3.0 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore31( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core31) - { - DefaultLog.InternalAppendLog("The core version 3.1 is not supported."); - return false; - } - - #region load - - contextPtr->glBindBufferBase = LoadGLFunction(load, - "glBindBufferBase"u8); - contextPtr->glBindBufferRange = LoadGLFunction(load, - "glBindBufferRange"u8); - contextPtr->glCopyBufferSubData = LoadGLFunction(load, - "glCopyBufferSubData"u8); - contextPtr->glDrawArraysInstanced = LoadGLFunction(load, - "glDrawArraysInstanced"u8); - contextPtr->glDrawElementsInstanced = LoadGLFunction(load, - "glDrawElementsInstanced"u8); - contextPtr->glGetActiveUniformBlockName = LoadGLFunction(load, - "glGetActiveUniformBlockName"u8); - contextPtr->glGetActiveUniformBlockiv = LoadGLFunction(load, - "glGetActiveUniformBlockiv"u8); - contextPtr->glGetActiveUniformName = LoadGLFunction(load, - "glGetActiveUniformName"u8); - contextPtr->glGetActiveUniformsiv = LoadGLFunction(load, - "glGetActiveUniformsiv"u8); - contextPtr->glGetIntegeri_v = LoadGLFunction(load, - "glGetIntegeri_v"u8); - contextPtr->glGetUniformBlockIndex = LoadGLFunction(load, - "glGetUniformBlockIndex"u8); - contextPtr->glGetUniformIndices = LoadGLFunction(load, - "glGetUniformIndices"u8); - contextPtr->glPrimitiveRestartIndex = LoadGLFunction(load, - "glPrimitiveRestartIndex"u8); - contextPtr->glTexBuffer = LoadGLFunction(load, "glTexBuffer"u8); - contextPtr->glUniformBlockBinding = LoadGLFunction(load, - "glUniformBlockBinding"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 3.1 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore32( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core32) - { - DefaultLog.InternalAppendLog("The core version 3.2 is not supported."); - return false; - } - - #region load - - contextPtr->glClientWaitSync = LoadGLFunction(load, - "glClientWaitSync"u8); - contextPtr->glDeleteSync = LoadGLFunction(load, "glDeleteSync"u8); - contextPtr->glDrawElementsBaseVertex = LoadGLFunction(load, - "glDrawElementsBaseVertex"u8); - contextPtr->glDrawElementsInstancedBaseVertex = LoadGLFunction(load, - "glDrawElementsInstancedBaseVertex"u8); - contextPtr->glDrawRangeElementsBaseVertex = LoadGLFunction(load, - "glDrawRangeElementsBaseVertex"u8); - contextPtr->glFenceSync = LoadGLFunction(load, "glFenceSync"u8); - contextPtr->glFramebufferTexture = LoadGLFunction(load, - "glFramebufferTexture"u8); - contextPtr->glGetBufferParameteri64v = LoadGLFunction(load, - "glGetBufferParameteri64v"u8); - contextPtr->glGetInteger64i_v = LoadGLFunction(load, - "glGetInteger64i_v"u8); - contextPtr->glGetInteger64v = LoadGLFunction(load, "glGetInteger64v"u8); - contextPtr->glGetMultisamplefv = LoadGLFunction(load, - "glGetMultisamplefv"u8); - contextPtr->glGetSynciv = LoadGLFunction(load, - "glGetSynciv"u8); - contextPtr->glIsSync = LoadGLFunction(load, "glIsSync"u8); - contextPtr->glMultiDrawElementsBaseVertex = LoadGLFunction(load, - "glMultiDrawElementsBaseVertex"u8); - contextPtr->glProvokingVertex = LoadGLFunction(load, "glProvokingVertex"u8); - contextPtr->glSampleMaski = LoadGLFunction(load, "glSampleMaski"u8); - contextPtr->glTexImage2DMultisample = LoadGLFunction(load, - "glTexImage2DMultisample"u8); - contextPtr->glTexImage3DMultisample = LoadGLFunction(load, - "glTexImage3DMultisample"u8); - contextPtr->glWaitSync = LoadGLFunction(load, "glWaitSync"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 3.2 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore33( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core33) - { - DefaultLog.InternalAppendLog("The core version 3.3 is not supported."); - return false; - } - - #region load - - contextPtr->glBindFragDataLocationIndexed = LoadGLFunction(load, - "glBindFragDataLocationIndexed"u8); - contextPtr->glBindSampler = LoadGLFunction(load, "glBindSampler"u8); - contextPtr->glDeleteSamplers = LoadGLFunction(load, - "glDeleteSamplers"u8); - contextPtr->glGenSamplers = LoadGLFunction(load, "glGenSamplers"u8); - contextPtr->glGetFragDataIndex = LoadGLFunction(load, - "glGetFragDataIndex"u8); - contextPtr->glGetQueryObjecti64v = LoadGLFunction(load, - "glGetQueryObjecti64v"u8); - contextPtr->glGetQueryObjectui64v = LoadGLFunction(load, - "glGetQueryObjectui64v"u8); - contextPtr->glGetSamplerParameterIiv = LoadGLFunction(load, - "glGetSamplerParameterIiv"u8); - contextPtr->glGetSamplerParameterIuiv = LoadGLFunction(load, - "glGetSamplerParameterIuiv"u8); - contextPtr->glGetSamplerParameterfv = LoadGLFunction(load, - "glGetSamplerParameterfv"u8); - contextPtr->glGetSamplerParameteriv = LoadGLFunction(load, - "glGetSamplerParameteriv"u8); - contextPtr->glIsSampler = LoadGLFunction(load, "glIsSampler"u8); - contextPtr->glQueryCounter = LoadGLFunction(load, "glQueryCounter"u8); - contextPtr->glSamplerParameterIiv = LoadGLFunction(load, - "glSamplerParameterIiv"u8); - contextPtr->glSamplerParameterIuiv = LoadGLFunction(load, - "glSamplerParameterIuiv"u8); - contextPtr->glSamplerParameterf = LoadGLFunction(load, - "glSamplerParameterf"u8); - contextPtr->glSamplerParameterfv = LoadGLFunction(load, - "glSamplerParameterfv"u8); - contextPtr->glSamplerParameteri = LoadGLFunction(load, - "glSamplerParameteri"u8); - contextPtr->glSamplerParameteriv = LoadGLFunction(load, - "glSamplerParameteriv"u8); - contextPtr->glVertexAttribDivisor = LoadGLFunction(load, - "glVertexAttribDivisor"u8); - contextPtr->glVertexAttribP1ui = LoadGLFunction(load, - "glVertexAttribP1ui"u8); - contextPtr->glVertexAttribP1uiv = LoadGLFunction(load, - "glVertexAttribP1uiv"u8); - contextPtr->glVertexAttribP2ui = LoadGLFunction(load, - "glVertexAttribP2ui"u8); - contextPtr->glVertexAttribP2uiv = LoadGLFunction(load, - "glVertexAttribP2uiv"u8); - contextPtr->glVertexAttribP3ui = LoadGLFunction(load, - "glVertexAttribP3ui"u8); - contextPtr->glVertexAttribP3uiv = LoadGLFunction(load, - "glVertexAttribP3uiv"u8); - contextPtr->glVertexAttribP4ui = LoadGLFunction(load, - "glVertexAttribP4ui"u8); - contextPtr->glVertexAttribP4uiv = LoadGLFunction(load, - "glVertexAttribP4uiv"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 3.3 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore40( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core40) - { - DefaultLog.InternalAppendLog("The core version 4.0 is not supported."); - return false; - } - - #region load - - contextPtr->glBeginQueryIndexed = LoadGLFunction(load, - "glBeginQueryIndexed"u8); - contextPtr->glBindTransformFeedback = LoadGLFunction(load, - "glBindTransformFeedback"u8); - contextPtr->glBlendEquationSeparatei = LoadGLFunction(load, - "glBlendEquationSeparatei"u8); - contextPtr->glBlendEquationi = LoadGLFunction(load, "glBlendEquationi"u8); - contextPtr->glBlendFuncSeparatei = LoadGLFunction(load, - "glBlendFuncSeparatei"u8); - contextPtr->glBlendFunci = LoadGLFunction(load, "glBlendFunci"u8); - contextPtr->glDeleteTransformFeedbacks = LoadGLFunction(load, - "glDeleteTransformFeedbacks"u8); - contextPtr->glDrawArraysIndirect = LoadGLFunction(load, - "glDrawArraysIndirect"u8); - contextPtr->glDrawElementsIndirect = LoadGLFunction(load, - "glDrawElementsIndirect"u8); - contextPtr->glDrawTransformFeedback = LoadGLFunction(load, - "glDrawTransformFeedback"u8); - contextPtr->glDrawTransformFeedbackStream = LoadGLFunction(load, - "glDrawTransformFeedbackStream"u8); - contextPtr->glEndQueryIndexed = LoadGLFunction(load, - "glEndQueryIndexed"u8); - contextPtr->glGenTransformFeedbacks = LoadGLFunction(load, - "glGenTransformFeedbacks"u8); - contextPtr->glGetActiveSubroutineName = LoadGLFunction(load, - "glGetActiveSubroutineName"u8); - contextPtr->glGetActiveSubroutineUniformName = LoadGLFunction(load, - "glGetActiveSubroutineUniformName"u8); - contextPtr->glGetActiveSubroutineUniformiv = LoadGLFunction(load, - "glGetActiveSubroutineUniformiv"u8); - contextPtr->glGetProgramStageiv = LoadGLFunction(load, - "glGetProgramStageiv"u8); - contextPtr->glGetQueryIndexediv = LoadGLFunction(load, - "glGetQueryIndexediv"u8); - contextPtr->glGetSubroutineIndex = LoadGLFunction(load, - "glGetSubroutineIndex"u8); - contextPtr->glGetSubroutineUniformLocation = LoadGLFunction(load, - "glGetSubroutineUniformLocation"u8); - contextPtr->glGetUniformSubroutineuiv = LoadGLFunction(load, - "glGetUniformSubroutineuiv"u8); - contextPtr->glGetUniformdv = LoadGLFunction(load, - "glGetUniformdv"u8); - contextPtr->glIsTransformFeedback = LoadGLFunction(load, - "glIsTransformFeedback"u8); - contextPtr->glMinSampleShading = LoadGLFunction(load, "glMinSampleShading"u8); - contextPtr->glPatchParameterfv = LoadGLFunction(load, - "glPatchParameterfv"u8); - contextPtr->glPatchParameteri = LoadGLFunction(load, - "glPatchParameteri"u8); - contextPtr->glPauseTransformFeedback = LoadGLFunction(load, - "glPauseTransformFeedback"u8); - contextPtr->glResumeTransformFeedback = LoadGLFunction(load, - "glResumeTransformFeedback"u8); - contextPtr->glUniform1d = LoadGLFunction(load, "glUniform1d"u8); - contextPtr->glUniform1dv = LoadGLFunction(load, "glUniform1dv"u8); - contextPtr->glUniform2d = LoadGLFunction(load, "glUniform2d"u8); - contextPtr->glUniform2dv = LoadGLFunction(load, "glUniform2dv"u8); - contextPtr->glUniform3d = LoadGLFunction(load, - "glUniform3d"u8); - contextPtr->glUniform3dv = LoadGLFunction(load, "glUniform3dv"u8); - contextPtr->glUniform4d = LoadGLFunction(load, - "glUniform4d"u8); - contextPtr->glUniform4dv = LoadGLFunction(load, "glUniform4dv"u8); - contextPtr->glUniformMatrix2dv = LoadGLFunction(load, - "glUniformMatrix2dv"u8); - contextPtr->glUniformMatrix2x3dv = LoadGLFunction(load, - "glUniformMatrix2x3dv"u8); - contextPtr->glUniformMatrix2x4dv = LoadGLFunction(load, - "glUniformMatrix2x4dv"u8); - contextPtr->glUniformMatrix3dv = LoadGLFunction(load, - "glUniformMatrix3dv"u8); - contextPtr->glUniformMatrix3x2dv = LoadGLFunction(load, - "glUniformMatrix3x2dv"u8); - contextPtr->glUniformMatrix3x4dv = LoadGLFunction(load, - "glUniformMatrix3x4dv"u8); - contextPtr->glUniformMatrix4dv = LoadGLFunction(load, - "glUniformMatrix4dv"u8); - contextPtr->glUniformMatrix4x2dv = LoadGLFunction(load, - "glUniformMatrix4x2dv"u8); - contextPtr->glUniformMatrix4x3dv = LoadGLFunction(load, - "glUniformMatrix4x3dv"u8); - contextPtr->glUniformSubroutinesuiv = LoadGLFunction(load, - "glUniformSubroutinesuiv"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.0 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore41( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core41) - { - DefaultLog.InternalAppendLog("The core version 4.1 is not supported."); - return false; - } - - #region load - - contextPtr->glActiveShaderProgram = LoadGLFunction(load, - "glActiveShaderProgram"u8); - contextPtr->glBindProgramPipeline = LoadGLFunction(load, - "glBindProgramPipeline"u8); - contextPtr->glClearDepthf = LoadGLFunction(load, "glClearDepthf"u8); - contextPtr->glCreateShaderProgramv = LoadGLFunction(load, - "glCreateShaderProgramv"u8); - contextPtr->glDeleteProgramPipelines = LoadGLFunction(load, - "glDeleteProgramPipelines"u8); - contextPtr->glDepthRangeArrayv = LoadGLFunction(load, - "glDepthRangeArrayv"u8); - contextPtr->glDepthRangeIndexed = LoadGLFunction(load, - "glDepthRangeIndexed"u8); - contextPtr->glDepthRangef = LoadGLFunction(load, "glDepthRangef"u8); - contextPtr->glGenProgramPipelines = LoadGLFunction(load, - "glGenProgramPipelines"u8); - contextPtr->glGetDoublei_v = LoadGLFunction(load, - "glGetDoublei_v"u8); - contextPtr->glGetFloati_v = LoadGLFunction(load, - "glGetFloati_v"u8); - contextPtr->glGetProgramBinary = LoadGLFunction(load, - "glGetProgramBinary"u8); - contextPtr->glGetProgramPipelineInfoLog = LoadGLFunction(load, - "glGetProgramPipelineInfoLog"u8); - contextPtr->glGetProgramPipelineiv = LoadGLFunction(load, - "glGetProgramPipelineiv"u8); - contextPtr->glGetShaderPrecisionFormat = LoadGLFunction(load, - "glGetShaderPrecisionFormat"u8); - contextPtr->glGetVertexAttribLdv = LoadGLFunction(load, - "glGetVertexAttribLdv"u8); - contextPtr->glIsProgramPipeline = LoadGLFunction(load, "glIsProgramPipeline"u8); - contextPtr->glProgramBinary = LoadGLFunction(load, - "glProgramBinary"u8); - contextPtr->glProgramParameteri = LoadGLFunction(load, - "glProgramParameteri"u8); - contextPtr->glProgramUniform1d = LoadGLFunction(load, - "glProgramUniform1d"u8); - contextPtr->glProgramUniform1dv = LoadGLFunction(load, - "glProgramUniform1dv"u8); - contextPtr->glProgramUniform1f = LoadGLFunction(load, - "glProgramUniform1f"u8); - contextPtr->glProgramUniform1fv = LoadGLFunction(load, - "glProgramUniform1fv"u8); - contextPtr->glProgramUniform1i = LoadGLFunction(load, - "glProgramUniform1i"u8); - contextPtr->glProgramUniform1iv = LoadGLFunction(load, - "glProgramUniform1iv"u8); - contextPtr->glProgramUniform1ui = LoadGLFunction(load, - "glProgramUniform1ui"u8); - contextPtr->glProgramUniform1uiv = LoadGLFunction(load, - "glProgramUniform1uiv"u8); - contextPtr->glProgramUniform2d = LoadGLFunction(load, - "glProgramUniform2d"u8); - contextPtr->glProgramUniform2dv = LoadGLFunction(load, - "glProgramUniform2dv"u8); - contextPtr->glProgramUniform2f = LoadGLFunction(load, - "glProgramUniform2f"u8); - contextPtr->glProgramUniform2fv = LoadGLFunction(load, - "glProgramUniform2fv"u8); - contextPtr->glProgramUniform2i = LoadGLFunction(load, - "glProgramUniform2i"u8); - contextPtr->glProgramUniform2iv = LoadGLFunction(load, - "glProgramUniform2iv"u8); - contextPtr->glProgramUniform2ui = LoadGLFunction(load, - "glProgramUniform2ui"u8); - contextPtr->glProgramUniform2uiv = LoadGLFunction(load, - "glProgramUniform2uiv"u8); - contextPtr->glProgramUniform3d = LoadGLFunction(load, - "glProgramUniform3d"u8); - contextPtr->glProgramUniform3dv = LoadGLFunction(load, - "glProgramUniform3dv"u8); - contextPtr->glProgramUniform3f = LoadGLFunction(load, - "glProgramUniform3f"u8); - contextPtr->glProgramUniform3fv = LoadGLFunction(load, - "glProgramUniform3fv"u8); - contextPtr->glProgramUniform3i = LoadGLFunction(load, - "glProgramUniform3i"u8); - contextPtr->glProgramUniform3iv = LoadGLFunction(load, - "glProgramUniform3iv"u8); - contextPtr->glProgramUniform3ui = LoadGLFunction(load, - "glProgramUniform3ui"u8); - contextPtr->glProgramUniform3uiv = LoadGLFunction(load, - "glProgramUniform3uiv"u8); - contextPtr->glProgramUniform4d = LoadGLFunction(load, - "glProgramUniform4d"u8); - contextPtr->glProgramUniform4dv = LoadGLFunction(load, - "glProgramUniform4dv"u8); - contextPtr->glProgramUniform4f = LoadGLFunction(load, - "glProgramUniform4f"u8); - contextPtr->glProgramUniform4fv = LoadGLFunction(load, - "glProgramUniform4fv"u8); - contextPtr->glProgramUniform4i = LoadGLFunction(load, - "glProgramUniform4i"u8); - contextPtr->glProgramUniform4iv = LoadGLFunction(load, - "glProgramUniform4iv"u8); - contextPtr->glProgramUniform4ui = LoadGLFunction(load, - "glProgramUniform4ui"u8); - contextPtr->glProgramUniform4uiv = LoadGLFunction(load, - "glProgramUniform4uiv"u8); - contextPtr->glProgramUniformMatrix2dv = LoadGLFunction(load, - "glProgramUniformMatrix2dv"u8); - contextPtr->glProgramUniformMatrix2fv = LoadGLFunction(load, - "glProgramUniformMatrix2fv"u8); - contextPtr->glProgramUniformMatrix2x3dv = LoadGLFunction(load, - "glProgramUniformMatrix2x3dv"u8); - contextPtr->glProgramUniformMatrix2x3fv = LoadGLFunction(load, - "glProgramUniformMatrix2x3fv"u8); - contextPtr->glProgramUniformMatrix2x4dv = LoadGLFunction(load, - "glProgramUniformMatrix2x4dv"u8); - contextPtr->glProgramUniformMatrix2x4fv = LoadGLFunction(load, - "glProgramUniformMatrix2x4fv"u8); - contextPtr->glProgramUniformMatrix3dv = LoadGLFunction(load, - "glProgramUniformMatrix3dv"u8); - contextPtr->glProgramUniformMatrix3fv = LoadGLFunction(load, - "glProgramUniformMatrix3fv"u8); - contextPtr->glProgramUniformMatrix3x2dv = LoadGLFunction(load, - "glProgramUniformMatrix3x2dv"u8); - contextPtr->glProgramUniformMatrix3x2fv = LoadGLFunction(load, - "glProgramUniformMatrix3x2fv"u8); - contextPtr->glProgramUniformMatrix3x4dv = LoadGLFunction(load, - "glProgramUniformMatrix3x4dv"u8); - contextPtr->glProgramUniformMatrix3x4fv = LoadGLFunction(load, - "glProgramUniformMatrix3x4fv"u8); - contextPtr->glProgramUniformMatrix4dv = LoadGLFunction(load, - "glProgramUniformMatrix4dv"u8); - contextPtr->glProgramUniformMatrix4fv = LoadGLFunction(load, - "glProgramUniformMatrix4fv"u8); - contextPtr->glProgramUniformMatrix4x2dv = LoadGLFunction(load, - "glProgramUniformMatrix4x2dv"u8); - contextPtr->glProgramUniformMatrix4x2fv = LoadGLFunction(load, - "glProgramUniformMatrix4x2fv"u8); - contextPtr->glProgramUniformMatrix4x3dv = LoadGLFunction(load, - "glProgramUniformMatrix4x3dv"u8); - contextPtr->glProgramUniformMatrix4x3fv = LoadGLFunction(load, - "glProgramUniformMatrix4x3fv"u8); - contextPtr->glReleaseShaderCompiler = LoadGLFunction(load, - "glReleaseShaderCompiler"u8); - contextPtr->glScissorArrayv = LoadGLFunction(load, - "glScissorArrayv"u8); - contextPtr->glScissorIndexed = LoadGLFunction(load, - "glScissorIndexed"u8); - contextPtr->glScissorIndexedv = LoadGLFunction(load, - "glScissorIndexedv"u8); - contextPtr->glShaderBinary = LoadGLFunction(load, - "glShaderBinary"u8); - contextPtr->glUseProgramStages = LoadGLFunction(load, - "glUseProgramStages"u8); - contextPtr->glValidateProgramPipeline = LoadGLFunction(load, - "glValidateProgramPipeline"u8); - contextPtr->glVertexAttribL1d = LoadGLFunction(load, - "glVertexAttribL1d"u8); - contextPtr->glVertexAttribL1dv = LoadGLFunction(load, - "glVertexAttribL1dv"u8); - contextPtr->glVertexAttribL2d = LoadGLFunction(load, - "glVertexAttribL2d"u8); - contextPtr->glVertexAttribL2dv = LoadGLFunction(load, - "glVertexAttribL2dv"u8); - contextPtr->glVertexAttribL3d = LoadGLFunction(load, - "glVertexAttribL3d"u8); - contextPtr->glVertexAttribL3dv = LoadGLFunction(load, - "glVertexAttribL3dv"u8); - contextPtr->glVertexAttribL4d = LoadGLFunction(load, - "glVertexAttribL4d"u8); - contextPtr->glVertexAttribL4dv = LoadGLFunction(load, - "glVertexAttribL4dv"u8); - contextPtr->glVertexAttribLPointer = LoadGLFunction(load, - "glVertexAttribLPointer"u8); - contextPtr->glViewportArrayv = LoadGLFunction(load, - "glViewportArrayv"u8); - contextPtr->glViewportIndexedf = LoadGLFunction(load, - "glViewportIndexedf"u8); - contextPtr->glViewportIndexedfv = LoadGLFunction(load, - "glViewportIndexedfv"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.1 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore42( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core42) - { - DefaultLog.InternalAppendLog("The core version 4.2 is not supported."); - return false; - } - - #region load - - contextPtr->glBindImageTexture = LoadGLFunction(load, - "glBindImageTexture"u8); - contextPtr->glDrawArraysInstancedBaseInstance = LoadGLFunction(load, - "glDrawArraysInstancedBaseInstance"u8); - contextPtr->glDrawElementsInstancedBaseInstance = LoadGLFunction(load, - "glDrawElementsInstancedBaseInstance"u8); - contextPtr->glDrawElementsInstancedBaseVertexBaseInstance = LoadGLFunction(load, - "glDrawElementsInstancedBaseVertexBaseInstance"u8); - contextPtr->glDrawTransformFeedbackInstanced = LoadGLFunction(load, - "glDrawTransformFeedbackInstanced"u8); - contextPtr->glDrawTransformFeedbackStreamInstanced = LoadGLFunction(load, - "glDrawTransformFeedbackStreamInstanced"u8); - contextPtr->glGetActiveAtomicCounterBufferiv = LoadGLFunction(load, - "glGetActiveAtomicCounterBufferiv"u8); - contextPtr->glGetInternalformativ = LoadGLFunction(load, - "glGetInternalformativ"u8); - contextPtr->glMemoryBarrier = LoadGLFunction(load, "glMemoryBarrier"u8); - contextPtr->glTexStorage1D = LoadGLFunction(load, - "glTexStorage1D"u8); - contextPtr->glTexStorage2D = LoadGLFunction(load, - "glTexStorage2D"u8); - contextPtr->glTexStorage3D = LoadGLFunction(load, - "glTexStorage3D"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.2 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore43( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core43) - { - DefaultLog.InternalAppendLog("The core version 4.3 is not supported."); - return false; - } - - #region load - - contextPtr->glBindVertexBuffer = LoadGLFunction(load, - "glBindVertexBuffer"u8); - contextPtr->glClearBufferData = LoadGLFunction(load, - "glClearBufferData"u8); - contextPtr->glClearBufferSubData = LoadGLFunction(load, - "glClearBufferSubData"u8); - contextPtr->glCopyImageSubData = LoadGLFunction(load, - "glCopyImageSubData"u8); - contextPtr->glDebugMessageCallback = LoadGLFunction(load, - "glDebugMessageCallback"u8); - contextPtr->glDebugMessageControl = LoadGLFunction(load, - "glDebugMessageControl"u8); - contextPtr->glDebugMessageInsert = LoadGLFunction(load, - "glDebugMessageInsert"u8); - contextPtr->glDispatchCompute = LoadGLFunction(load, - "glDispatchCompute"u8); - contextPtr->glDispatchComputeIndirect = LoadGLFunction(load, - "glDispatchComputeIndirect"u8); - contextPtr->glFramebufferParameteri = LoadGLFunction(load, - "glFramebufferParameteri"u8); - contextPtr->glGetDebugMessageLog = LoadGLFunction(load, - "glGetDebugMessageLog"u8); - contextPtr->glGetFramebufferParameteriv = LoadGLFunction(load, - "glGetFramebufferParameteriv"u8); - contextPtr->glGetInternalformati64v = LoadGLFunction(load, - "glGetInternalformati64v"u8); - contextPtr->glGetObjectLabel = LoadGLFunction(load, - "glGetObjectLabel"u8); - contextPtr->glGetObjectPtrLabel = LoadGLFunction(load, - "glGetObjectPtrLabel"u8); - - // contextPtr->glGetPointerv =LoadGLFunction(load,"glGetPointerv"u8); - contextPtr->glGetProgramInterfaceiv = LoadGLFunction(load, - "glGetProgramInterfaceiv"u8); - contextPtr->glGetProgramResourceIndex = LoadGLFunction(load, - "glGetProgramResourceIndex"u8); - contextPtr->glGetProgramResourceLocation = LoadGLFunction(load, - "glGetProgramResourceLocation"u8); - contextPtr->glGetProgramResourceLocationIndex = LoadGLFunction(load, - "glGetProgramResourceLocationIndex"u8); - contextPtr->glGetProgramResourceName = LoadGLFunction(load, - "glGetProgramResourceName"u8); - contextPtr->glGetProgramResourceiv = LoadGLFunction(load, - "glGetProgramResourceiv"u8); - contextPtr->glInvalidateBufferData = LoadGLFunction(load, - "glInvalidateBufferData"u8); - contextPtr->glInvalidateBufferSubData = LoadGLFunction(load, - "glInvalidateBufferSubData"u8); - contextPtr->glInvalidateFramebuffer = LoadGLFunction(load, - "glInvalidateFramebuffer"u8); - contextPtr->glInvalidateSubFramebuffer = LoadGLFunction(load, - "glInvalidateSubFramebuffer"u8); - contextPtr->glInvalidateTexImage = LoadGLFunction(load, - "glInvalidateTexImage"u8); - contextPtr->glInvalidateTexSubImage = LoadGLFunction(load, - "glInvalidateTexSubImage"u8); - contextPtr->glMultiDrawArraysIndirect = LoadGLFunction(load, - "glMultiDrawArraysIndirect"u8); - contextPtr->glMultiDrawElementsIndirect = LoadGLFunction(load, - "glMultiDrawElementsIndirect"u8); - contextPtr->glObjectLabel = LoadGLFunction(load, - "glObjectLabel"u8); - contextPtr->glObjectPtrLabel = LoadGLFunction(load, - "glObjectPtrLabel"u8); - contextPtr->glPopDebugGroup = LoadGLFunction(load, "glPopDebugGroup"u8); - contextPtr->glPushDebugGroup = LoadGLFunction(load, - "glPushDebugGroup"u8); - contextPtr->glShaderStorageBlockBinding = LoadGLFunction(load, - "glShaderStorageBlockBinding"u8); - contextPtr->glTexBufferRange = LoadGLFunction(load, - "glTexBufferRange"u8); - contextPtr->glTexStorage2DMultisample = LoadGLFunction(load, - "glTexStorage2DMultisample"u8); - contextPtr->glTexStorage3DMultisample = LoadGLFunction(load, - "glTexStorage3DMultisample"u8); - contextPtr->glTextureView = LoadGLFunction(load, - "glTextureView"u8); - contextPtr->glVertexAttribBinding = LoadGLFunction(load, - "glVertexAttribBinding"u8); - contextPtr->glVertexAttribFormat = LoadGLFunction(load, - "glVertexAttribFormat"u8); - contextPtr->glVertexAttribIFormat = LoadGLFunction(load, - "glVertexAttribIFormat"u8); - contextPtr->glClearBufferData = LoadGLFunction(load, - "glClearBufferData"u8); - contextPtr->glVertexBindingDivisor = LoadGLFunction(load, - "glVertexBindingDivisor"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.3 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore44( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core44) - { - DefaultLog.InternalAppendLog("The core version 4.4 is not supported."); - return false; - } - - #region load - - contextPtr->glBindBuffersBase = LoadGLFunction(load, - "glBindBuffersBase"u8); - contextPtr->glBindBuffersRange = LoadGLFunction(load, - "glBindBuffersRange"u8); - contextPtr->glBindImageTextures = LoadGLFunction(load, - "glBindImageTextures"u8); - contextPtr->glBindSamplers = LoadGLFunction(load, - "glBindSamplers"u8); - contextPtr->glBindTextures = LoadGLFunction(load, - "glBindTextures"u8); - contextPtr->glBindVertexBuffers = LoadGLFunction(load, - "glBindVertexBuffers"u8); - contextPtr->glBufferStorage = LoadGLFunction(load, - "glBufferStorage"u8); - contextPtr->glClearTexImage = LoadGLFunction(load, - "glClearTexImage"u8); - contextPtr->glClearTexSubImage = LoadGLFunction(load, - "glClearTexSubImage"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.4 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore45( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core45) - { - DefaultLog.InternalAppendLog("The core version 4.5 is not supported."); - return false; - } - - #region load - - contextPtr->glBindTextureUnit = LoadGLFunction(load, - "glBindTextureUnit"u8); - contextPtr->glBlitNamedFramebuffer = LoadGLFunction(load, - "glBlitNamedFramebuffer"u8); - contextPtr->glCheckNamedFramebufferStatus = LoadGLFunction(load, - "glCheckNamedFramebufferStatus"u8); - contextPtr->glClearNamedBufferData = LoadGLFunction(load, - "glClearNamedBufferData"u8); - contextPtr->glClearNamedBufferSubData = LoadGLFunction(load, - "glClearNamedBufferSubData"u8); - contextPtr->glClearNamedFramebufferfi = LoadGLFunction(load, - "glClearNamedFramebufferfi"u8); - contextPtr->glClearNamedFramebufferfv = LoadGLFunction(load, - "glClearNamedFramebufferfv"u8); - contextPtr->glClearNamedFramebufferiv = LoadGLFunction(load, - "glClearNamedFramebufferiv"u8); - contextPtr->glClearNamedFramebufferuiv = LoadGLFunction(load, - "glClearNamedFramebufferuiv"u8); - contextPtr->glClipControl = LoadGLFunction(load, "glClipControl"u8); - contextPtr->glCompressedTextureSubImage1D = LoadGLFunction(load, - "glCompressedTextureSubImage1D"u8); - contextPtr->glCompressedTextureSubImage2D = LoadGLFunction(load, - "glCompressedTextureSubImage2D"u8); - contextPtr->glCompressedTextureSubImage3D = LoadGLFunction(load, - "glCompressedTextureSubImage3D"u8); - contextPtr->glCopyNamedBufferSubData = LoadGLFunction(load, - "glCopyNamedBufferSubData"u8); - contextPtr->glCopyTextureSubImage1D = LoadGLFunction(load, - "glCopyTextureSubImage1D"u8); - contextPtr->glCopyTextureSubImage2D = LoadGLFunction(load, - "glCopyTextureSubImage2D"u8); - contextPtr->glCopyTextureSubImage3D = LoadGLFunction(load, - "glCopyTextureSubImage3D"u8); - contextPtr->glCreateBuffers = LoadGLFunction(load, "glCreateBuffers"u8); - contextPtr->glCreateFramebuffers = LoadGLFunction(load, - "glCreateFramebuffers"u8); - contextPtr->glCreateProgramPipelines = LoadGLFunction(load, - "glCreateProgramPipelines"u8); - contextPtr->glCreateQueries = LoadGLFunction(load, - "glCreateQueries"u8); - contextPtr->glCreateRenderbuffers = LoadGLFunction(load, - "glCreateRenderbuffers"u8); - contextPtr->glCreateSamplers = LoadGLFunction(load, - "glCreateSamplers"u8); - contextPtr->glCreateTextures = LoadGLFunction(load, - "glCreateTextures"u8); - contextPtr->glCreateTransformFeedbacks = LoadGLFunction(load, - "glCreateTransformFeedbacks"u8); - contextPtr->glCreateVertexArrays = LoadGLFunction(load, - "glCreateVertexArrays"u8); - contextPtr->glDisableVertexArrayAttrib = LoadGLFunction(load, - "glDisableVertexArrayAttrib"u8); - contextPtr->glEnableVertexArrayAttrib = LoadGLFunction(load, - "glEnableVertexArrayAttrib"u8); - contextPtr->glFlushMappedNamedBufferRange = LoadGLFunction(load, - "glFlushMappedNamedBufferRange"u8); - contextPtr->glGenerateTextureMipmap = LoadGLFunction(load, - "glGenerateTextureMipmap"u8); - contextPtr->glGetCompressedTextureImage = LoadGLFunction(load, - "glGetCompressedTextureImage"u8); - contextPtr->glGetCompressedTextureSubImage = LoadGLFunction(load, - "glGetCompressedTextureSubImage"u8); - contextPtr->glGetGraphicsResetStatus = LoadGLFunction(load, - "glGetGraphicsResetStatus"u8); - contextPtr->glGetNamedBufferParameteri64v = LoadGLFunction(load, - "glGetNamedBufferParameteri64v"u8); - contextPtr->glGetNamedBufferParameteriv = LoadGLFunction(load, - "glGetNamedBufferParameteriv"u8); - contextPtr->glGetNamedBufferPointerv = LoadGLFunction(load, - "glGetNamedBufferPointerv"u8); - contextPtr->glGetNamedBufferSubData = LoadGLFunction(load, - "glGetNamedBufferSubData"u8); - contextPtr->glGetNamedFramebufferAttachmentParameteriv = LoadGLFunction(load, - "glGetNamedFramebufferAttachmentParameteriv"u8); - contextPtr->glGetNamedFramebufferParameteriv = LoadGLFunction(load, - "glGetNamedFramebufferParameteriv"u8); - contextPtr->glGetNamedRenderbufferParameteriv = LoadGLFunction(load, - "glGetNamedRenderbufferParameteriv"u8); - contextPtr->glGetQueryBufferObjecti64v = LoadGLFunction(load, - "glGetQueryBufferObjecti64v"u8); - contextPtr->glGetQueryBufferObjectiv = LoadGLFunction(load, - "glGetQueryBufferObjectiv"u8); - contextPtr->glGetQueryBufferObjectui64v = LoadGLFunction(load, - "glGetQueryBufferObjectui64v"u8); - contextPtr->glGetQueryBufferObjectuiv = LoadGLFunction(load, - "glGetQueryBufferObjectuiv"u8); - contextPtr->glGetTextureImage = LoadGLFunction(load, - "glGetTextureImage"u8); - contextPtr->glGetTextureLevelParameterfv = LoadGLFunction(load, - "glGetTextureLevelParameterfv"u8); - contextPtr->glGetTextureLevelParameteriv = LoadGLFunction(load, - "glGetTextureLevelParameteriv"u8); - contextPtr->glGetTextureParameterIiv = LoadGLFunction(load, - "glGetTextureParameterIiv"u8); - contextPtr->glGetTextureParameterIuiv = LoadGLFunction(load, - "glGetTextureParameterIuiv"u8); - contextPtr->glGetTextureParameterfv = LoadGLFunction(load, - "glGetTextureParameterfv"u8); - contextPtr->glGetTextureParameteriv = LoadGLFunction(load, - "glGetTextureParameteriv"u8); - contextPtr->glGetTextureSubImage = LoadGLFunction(load, - "glGetTextureSubImage"u8); - contextPtr->glGetTransformFeedbacki64_v = LoadGLFunction(load, - "glGetTransformFeedbacki64_v"u8); - contextPtr->glGetTransformFeedbacki_v = LoadGLFunction(load, - "glGetTransformFeedbacki_v"u8); - contextPtr->glGetTransformFeedbackiv = LoadGLFunction(load, - "glGetTransformFeedbackiv"u8); - contextPtr->glGetVertexArrayIndexed64iv = LoadGLFunction(load, - "glGetVertexArrayIndexed64iv"u8); - contextPtr->glGetVertexArrayIndexediv = LoadGLFunction(load, - "glGetVertexArrayIndexediv"u8); - contextPtr->glGetVertexArrayiv = LoadGLFunction(load, - "glGetVertexArrayiv"u8); - contextPtr->glGetnCompressedTexImage = LoadGLFunction(load, - "glGetnCompressedTexImage"u8); - contextPtr->glGetnTexImage = LoadGLFunction(load, - "glGetnTexImage"u8); - contextPtr->glGetnUniformdv = LoadGLFunction(load, - "glGetnUniformdv"u8); - contextPtr->glGetnUniformfv = LoadGLFunction(load, - "glGetnUniformfv"u8); - contextPtr->glGetnUniformiv = LoadGLFunction(load, - "glGetnUniformiv"u8); - contextPtr->glGetnUniformuiv = LoadGLFunction(load, - "glGetnUniformuiv"u8); - contextPtr->glInvalidateNamedFramebufferData = LoadGLFunction(load, - "glInvalidateNamedFramebufferData"u8); - contextPtr->glInvalidateNamedFramebufferSubData = LoadGLFunction(load, - "glInvalidateNamedFramebufferSubData"u8); - contextPtr->glMapNamedBuffer = LoadGLFunction(load, - "glMapNamedBuffer"u8); - contextPtr->glMapNamedBufferRange = LoadGLFunction(load, - "glMapNamedBufferRange"u8); - contextPtr->glMemoryBarrierByRegion = LoadGLFunction(load, - "glMemoryBarrierByRegion"u8); - contextPtr->glNamedBufferData = LoadGLFunction(load, - "glNamedBufferData"u8); - contextPtr->glNamedBufferStorage = LoadGLFunction(load, - "glNamedBufferStorage"u8); - contextPtr->glNamedBufferSubData = LoadGLFunction(load, - "glNamedBufferSubData"u8); - contextPtr->glNamedFramebufferDrawBuffer = LoadGLFunction(load, - "glNamedFramebufferDrawBuffer"u8); - contextPtr->glNamedFramebufferDrawBuffers = LoadGLFunction(load, - "glNamedFramebufferDrawBuffers"u8); - contextPtr->glNamedFramebufferParameteri = LoadGLFunction(load, - "glNamedFramebufferParameteri"u8); - contextPtr->glNamedFramebufferReadBuffer = LoadGLFunction(load, - "glNamedFramebufferReadBuffer"u8); - contextPtr->glNamedFramebufferRenderbuffer = LoadGLFunction(load, - "glNamedFramebufferRenderbuffer"u8); - contextPtr->glNamedFramebufferTexture = LoadGLFunction(load, - "glNamedFramebufferTexture"u8); - contextPtr->glNamedFramebufferTextureLayer = LoadGLFunction(load, - "glNamedFramebufferTextureLayer"u8); - contextPtr->glNamedRenderbufferStorage = LoadGLFunction(load, - "glNamedRenderbufferStorage"u8); - contextPtr->glNamedRenderbufferStorageMultisample = LoadGLFunction(load, - "glNamedRenderbufferStorageMultisample"u8); - contextPtr->glReadnPixels = LoadGLFunction(load, - "glReadnPixels"u8); - contextPtr->glTextureBarrier = LoadGLFunction(load, "glTextureBarrier"u8); - contextPtr->glTextureBuffer = LoadGLFunction(load, - "glTextureBuffer"u8); - contextPtr->glTextureBufferRange = LoadGLFunction(load, - "glTextureBufferRange"u8); - contextPtr->glTextureParameterIiv = LoadGLFunction(load, - "glTextureParameterIiv"u8); - contextPtr->glTextureParameterIuiv = LoadGLFunction(load, - "glTextureParameterIuiv"u8); - contextPtr->glTextureParameterf = LoadGLFunction(load, - "glTextureParameterf"u8); - contextPtr->glTextureParameterfv = LoadGLFunction(load, - "glTextureParameterfv"u8); - contextPtr->glTextureParameteri = LoadGLFunction(load, - "glTextureParameteri"u8); - contextPtr->glTextureParameteriv = LoadGLFunction(load, - "glTextureParameteriv"u8); - contextPtr->glTextureStorage1D = LoadGLFunction(load, - "glTextureStorage1D"u8); - contextPtr->glTextureStorage2D = LoadGLFunction(load, - "glTextureStorage2D"u8); - contextPtr->glTextureStorage2DMultisample = LoadGLFunction(load, - "glTextureStorage2DMultisample"u8); - contextPtr->glTextureStorage3D = LoadGLFunction(load, - "glTextureStorage3D"u8); - contextPtr->glTextureStorage3DMultisample = LoadGLFunction(load, - "glTextureStorage3DMultisample"u8); - contextPtr->glTextureSubImage1D = LoadGLFunction(load, - "glTextureSubImage1D"u8); - contextPtr->glTextureSubImage2D = LoadGLFunction(load, - "glTextureSubImage2D"u8); - contextPtr->glTextureSubImage3D = LoadGLFunction(load, - "glTextureSubImage3D"u8); - contextPtr->glTransformFeedbackBufferBase = LoadGLFunction(load, - "glTransformFeedbackBufferBase"u8); - contextPtr->glTransformFeedbackBufferRange = LoadGLFunction(load, - "glTransformFeedbackBufferRange"u8); - contextPtr->glUnmapNamedBuffer = LoadGLFunction(load, "glUnmapNamedBuffer"u8); - contextPtr->glVertexArrayAttribBinding = LoadGLFunction(load, - "glVertexArrayAttribBinding"u8); - contextPtr->glVertexArrayAttribFormat = LoadGLFunction(load, - "glVertexArrayAttribFormat"u8); - contextPtr->glVertexArrayAttribIFormat = LoadGLFunction(load, - "glVertexArrayAttribIFormat"u8); - contextPtr->glVertexArrayAttribLFormat = LoadGLFunction(load, - "glVertexArrayAttribLFormat"u8); - contextPtr->glVertexArrayBindingDivisor = LoadGLFunction(load, - "glVertexArrayBindingDivisor"u8); - contextPtr->glVertexArrayElementBuffer = LoadGLFunction(load, - "glVertexArrayElementBuffer"u8); - contextPtr->glVertexArrayVertexBuffer = LoadGLFunction(load, - "glVertexArrayVertexBuffer"u8); - contextPtr->glVertexArrayVertexBuffers = LoadGLFunction(load, - "glVertexArrayVertexBuffers"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.5 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore46( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core46) - { - DefaultLog.InternalAppendLog("The core version 4.6 is not supported."); - return false; - } - - #region load - - contextPtr->glMultiDrawArraysIndirectCount = LoadGLFunction(load, - "glMultiDrawArraysIndirectCount"u8); - contextPtr->glMultiDrawElementsIndirectCount = LoadGLFunction(load, - "glMultiDrawElementsIndirectCount"u8); - contextPtr->glPolygonOffsetClamp = LoadGLFunction(load, - "glPolygonOffsetClamp"u8); - contextPtr->glSpecializeShader = LoadGLFunction(load, - "glSpecializeShader"u8); - - #endregion load - - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.6 APIs"); - return true; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static unsafe IntPtr LoadGLFunction( - delegate*, IntPtr> load, - ReadOnlySpan name - ) - { - IntPtr ptr = load(name); - if (ptr == IntPtr.Zero) { - DefaultLog.InternalAppendLog($"Failed to load proc {System.Text.Encoding.UTF8.GetString(name)}."); - } - return ptr; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glApiManager.Load" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Graphics.OpenGL +{ + public static partial class glManager + { + + internal static unsafe bool LoadGLcore10( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core10) + { + DefaultLog.InternalAppendLog("The core version 1.0 is not supported."); + return false; + } + + #region load + + contextPtr->glBlendFunc = LoadGLFunction(load, "glBlendFunc"u8); + contextPtr->glClear = LoadGLFunction(load, "glClear"u8); + contextPtr->glClearColor = LoadGLFunction(load, "glClearColor"u8); + contextPtr->glClearDepth = LoadGLFunction(load, "glClearDepth"u8); + contextPtr->glClearStencil = LoadGLFunction(load, "glClearStencil"u8); + contextPtr->glColorMask = LoadGLFunction(load, "glColorMask"u8); + contextPtr->glCullFace = LoadGLFunction(load, "glCullFace"u8); + contextPtr->glDepthFunc = LoadGLFunction(load, "glDepthFunc"u8); + contextPtr->glDepthMask = LoadGLFunction(load, "glDepthMask"u8); + contextPtr->glDepthRange = LoadGLFunction(load, "glDepthRange"u8); + contextPtr->glDisable = LoadGLFunction(load, "glDisable"u8); + contextPtr->glDrawBuffer = LoadGLFunction(load, "glDrawBuffer"u8); + contextPtr->glEnable = LoadGLFunction(load, "glEnable"u8); + contextPtr->glFinish = LoadGLFunction(load, "glFinish"u8); + contextPtr->glFlush = LoadGLFunction(load, "glFlush"u8); + contextPtr->glFrontFace = LoadGLFunction(load, "glFrontFace"u8); + contextPtr->glGetBooleanv = LoadGLFunction(load, "glGetBooleanv"u8); + contextPtr->glGetDoublev = LoadGLFunction(load, "glGetDoublev"u8); + contextPtr->glGetError = LoadGLFunction(load, "glGetError"u8); + contextPtr->glGetFloatv = LoadGLFunction(load, "glGetFloatv"u8); + contextPtr->glGetIntegerv = LoadGLFunction(load, "glGetIntegerv"u8); + contextPtr->glGetString = LoadGLFunction(load, "glGetString"u8); + contextPtr->glGetTexImage = LoadGLFunction(load, "glGetTexImage"u8); + contextPtr->glGetTexLevelParameterfv = LoadGLFunction(load, "glGetTexLevelParameterfv"u8); + contextPtr->glGetTexLevelParameteriv = LoadGLFunction(load, "glGetTexLevelParameteriv"u8); + contextPtr->glGetTexParameterfv = LoadGLFunction(load, "glGetTexParameterfv"u8); + contextPtr->glGetTexParameteriv = LoadGLFunction(load, "glGetTexParameteriv"u8); + contextPtr->glHint = LoadGLFunction(load, "glHint"u8); + contextPtr->glIsEnabled = LoadGLFunction(load, "glIsEnabled"u8); + contextPtr->glLineWidth = LoadGLFunction(load, "glLineWidth"u8); + contextPtr->glLogicOp = LoadGLFunction(load, "glLogicOp"u8); + contextPtr->glPixelStoref = LoadGLFunction(load, "glPixelStoref"u8); + contextPtr->glPixelStorei = LoadGLFunction(load, "glPixelStorei"u8); + contextPtr->glPointSize = LoadGLFunction(load, "glPointSize"u8); + contextPtr->glPolygonMode = LoadGLFunction(load, "glPolygonMode"u8); + contextPtr->glReadBuffer = LoadGLFunction(load, "glReadBuffer"u8); + contextPtr->glReadPixels = LoadGLFunction(load, "glReadPixels"u8); + contextPtr->glScissor = LoadGLFunction(load, "glScissor"u8); + contextPtr->glStencilFunc = LoadGLFunction(load, "glStencilFunc"u8); + contextPtr->glStencilMask = LoadGLFunction(load, "glStencilMask"u8); + contextPtr->glStencilOp = LoadGLFunction(load, "glStencilOp"u8); + contextPtr->glTexImage1D = LoadGLFunction(load, "glTexImage1D"u8); + contextPtr->glTexImage2D = LoadGLFunction(load, "glTexImage2D"u8); + contextPtr->glTexParameterf = LoadGLFunction(load, "glTexParameterf"u8); + contextPtr->glTexParameterfv = LoadGLFunction(load, "glTexParameterfv"u8); + contextPtr->glTexParameteri = LoadGLFunction(load, "glTexParameteri"u8); + contextPtr->glTexParameteriv = LoadGLFunction(load, "glTexParameteriv"u8); + contextPtr->glViewport = LoadGLFunction(load, "glViewport"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.0 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore11( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core11) + { + DefaultLog.InternalAppendLog("The core version 1.1 is not supported."); + return false; + } + + #region load + + contextPtr->glBindTexture = LoadGLFunction(load, "glBindTexture"u8); + contextPtr->glCopyTexImage1D = LoadGLFunction(load, + "glCopyTexImage1D"u8); + contextPtr->glCopyTexImage2D = LoadGLFunction(load, + "glCopyTexImage2D"u8); + contextPtr->glCopyTexSubImage1D = LoadGLFunction(load, + "glCopyTexSubImage1D"u8); + contextPtr->glCopyTexSubImage2D = LoadGLFunction(load, + "glCopyTexSubImage2D"u8); + contextPtr->glDeleteTextures = LoadGLFunction(load, + "glDeleteTextures"u8); + contextPtr->glDrawArrays = LoadGLFunction(load, "glDrawArrays"u8); + contextPtr->glDrawElements = LoadGLFunction(load, + "glDrawElements"u8); + contextPtr->glGenTextures = LoadGLFunction(load, "glGenTextures"u8); + + // contextPtr->glGetPointerv =LoadGLFunction(load,"glGetPointerv"u8); + contextPtr->glIsTexture = LoadGLFunction(load, "glIsTexture"u8); + contextPtr->glPolygonOffset = LoadGLFunction(load, "glPolygonOffset"u8); + contextPtr->glTexSubImage1D = LoadGLFunction(load, + "glTexSubImage1D"u8); + contextPtr->glTexSubImage2D = LoadGLFunction(load, + "glTexSubImage2D"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.1 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore12( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core12) + { + DefaultLog.InternalAppendLog("The core version 1.2 is not supported."); + return false; + } + + #region load + + contextPtr->glCopyTexSubImage3D = LoadGLFunction(load, + "glCopyTexSubImage3D"u8); + contextPtr->glDrawRangeElements = LoadGLFunction(load, + "glDrawRangeElements"u8); + contextPtr->glTexImage3D = LoadGLFunction(load, + "glTexImage3D"u8); + contextPtr->glTexSubImage3D = LoadGLFunction(load, + "glTexSubImage3D"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.2 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore13( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core13) + { + DefaultLog.InternalAppendLog("The core version 1.3 is not supported."); + return false; + } + + #region load + + contextPtr->glActiveTexture = LoadGLFunction(load, "glActiveTexture"u8); + contextPtr->glCompressedTexImage1D = LoadGLFunction(load, + "glCompressedTexImage1D"u8); + contextPtr->glCompressedTexImage2D = LoadGLFunction(load, + "glCompressedTexImage2D"u8); + contextPtr->glCompressedTexImage3D = LoadGLFunction(load, + "glCompressedTexImage3D"u8); + contextPtr->glCompressedTexSubImage1D = LoadGLFunction(load, + "glCompressedTexSubImage1D"u8); + contextPtr->glCompressedTexSubImage2D = LoadGLFunction(load, + "glCompressedTexSubImage2D"u8); + contextPtr->glCompressedTexSubImage3D = LoadGLFunction(load, + "glCompressedTexSubImage3D"u8); + contextPtr->glGetCompressedTexImage = LoadGLFunction(load, + "glGetCompressedTexImage"u8); + contextPtr->glSampleCoverage = LoadGLFunction(load, + "glSampleCoverage"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.3 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore14( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core14) + { + DefaultLog.InternalAppendLog("The core version 1.4 is not supported."); + return false; + } + + #region load + + contextPtr->glBlendColor = LoadGLFunction(load, + "glBlendColor"u8); + contextPtr->glBlendEquation = LoadGLFunction(load, "glBlendEquation"u8); + contextPtr->glBlendFuncSeparate = LoadGLFunction(load, + "glBlendFuncSeparate"u8); + contextPtr->glMultiDrawArrays = LoadGLFunction(load, + "glMultiDrawArrays"u8); + contextPtr->glMultiDrawElements = LoadGLFunction(load, + "glMultiDrawElements"u8); + contextPtr->glPointParameterf = LoadGLFunction(load, + "glPointParameterf"u8); + contextPtr->glPointParameterfv = LoadGLFunction(load, + "glPointParameterfv"u8); + contextPtr->glPointParameteri = LoadGLFunction(load, + "glPointParameteri"u8); + contextPtr->glPointParameteriv = LoadGLFunction(load, + "glPointParameteriv"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.4 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore15( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core15) + { + DefaultLog.InternalAppendLog("The core version 1.5 is not supported."); + return false; + } + + #region load + + contextPtr->glBeginQuery = LoadGLFunction(load, "glBeginQuery"u8); + contextPtr->glBindBuffer = LoadGLFunction(load, "glBindBuffer"u8); + contextPtr->glBufferData = LoadGLFunction(load, + "glBufferData"u8); + contextPtr->glBufferSubData = LoadGLFunction(load, + "glBufferSubData"u8); + contextPtr->glDeleteBuffers = LoadGLFunction(load, "glDeleteBuffers"u8); + contextPtr->glDeleteQueries = LoadGLFunction(load, "glDeleteQueries"u8); + contextPtr->glEndQuery = LoadGLFunction(load, "glEndQuery"u8); + contextPtr->glGenBuffers = LoadGLFunction(load, "glGenBuffers"u8); + contextPtr->glGenQueries = LoadGLFunction(load, "glGenQueries"u8); + contextPtr->glGetBufferParameteriv = LoadGLFunction(load, + "glGetBufferParameteriv"u8); + contextPtr->glGetBufferPointerv = LoadGLFunction(load, + "glGetBufferPointerv"u8); + contextPtr->glGetBufferSubData = LoadGLFunction(load, + "glGetBufferSubData"u8); + contextPtr->glGetQueryObjectiv = LoadGLFunction(load, + "glGetQueryObjectiv"u8); + contextPtr->glGetQueryObjectuiv = LoadGLFunction(load, + "glGetQueryObjectuiv"u8); + contextPtr->glGetQueryiv = LoadGLFunction(load, "glGetQueryiv"u8); + contextPtr->glIsBuffer = LoadGLFunction(load, "glIsBuffer"u8); + contextPtr->glIsQuery = LoadGLFunction(load, "glIsQuery"u8); + contextPtr->glMapBuffer = LoadGLFunction(load, "glMapBuffer"u8); + contextPtr->glUnmapBuffer = LoadGLFunction(load, "glUnmapBuffer"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.5 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore20( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core20) + { + DefaultLog.InternalAppendLog("The core version 2.0 is not supported."); + return false; + } + + #region load + + contextPtr->glAttachShader = LoadGLFunction(load, "glAttachShader"u8); + contextPtr->glBindAttribLocation = LoadGLFunction(load, + "glBindAttribLocation"u8); + contextPtr->glBlendEquationSeparate = LoadGLFunction(load, + "glBlendEquationSeparate"u8); + contextPtr->glCompileShader = LoadGLFunction(load, "glCompileShader"u8); + contextPtr->glCreateProgram = LoadGLFunction(load, "glCreateProgram"u8); + contextPtr->glCreateShader = LoadGLFunction(load, "glCreateShader"u8); + contextPtr->glDeleteProgram = LoadGLFunction(load, "glDeleteProgram"u8); + contextPtr->glDeleteShader = LoadGLFunction(load, "glDeleteShader"u8); + contextPtr->glDetachShader = LoadGLFunction(load, "glDetachShader"u8); + contextPtr->glDisableVertexAttribArray = LoadGLFunction(load, + "glDisableVertexAttribArray"u8); + contextPtr->glDrawBuffers = LoadGLFunction(load, "glDrawBuffers"u8); + contextPtr->glEnableVertexAttribArray = LoadGLFunction(load, + "glEnableVertexAttribArray"u8); + contextPtr->glGetActiveAttrib = LoadGLFunction(load, + "glGetActiveAttrib"u8); + contextPtr->glGetActiveUniform = LoadGLFunction(load, + "glGetActiveUniform"u8); + contextPtr->glGetAttachedShaders = LoadGLFunction(load, + "glGetAttachedShaders"u8); + contextPtr->glGetAttribLocation = LoadGLFunction(load, + "glGetAttribLocation"u8); + contextPtr->glGetProgramInfoLog = LoadGLFunction(load, + "glGetProgramInfoLog"u8); + contextPtr->glGetProgramiv = LoadGLFunction(load, + "glGetProgramiv"u8); + contextPtr->glGetShaderInfoLog = LoadGLFunction(load, + "glGetShaderInfoLog"u8); + contextPtr->glGetShaderSource = LoadGLFunction(load, + "glGetShaderSource"u8); + contextPtr->glGetShaderiv = LoadGLFunction(load, "glGetShaderiv"u8); + contextPtr->glGetUniformLocation = LoadGLFunction(load, + "glGetUniformLocation"u8); + contextPtr->glGetUniformfv = LoadGLFunction(load, + "glGetUniformfv"u8); + contextPtr->glGetUniformiv = LoadGLFunction(load, + "glGetUniformiv"u8); + contextPtr->glGetVertexAttribPointerv = LoadGLFunction(load, + "glGetVertexAttribPointerv"u8); + contextPtr->glGetVertexAttribdv = LoadGLFunction(load, + "glGetVertexAttribdv"u8); + contextPtr->glGetVertexAttribfv = LoadGLFunction(load, + "glGetVertexAttribfv"u8); + contextPtr->glGetVertexAttribiv = LoadGLFunction(load, + "glGetVertexAttribiv"u8); + contextPtr->glIsProgram = LoadGLFunction(load, "glIsProgram"u8); + contextPtr->glIsShader = LoadGLFunction(load, "glIsShader"u8); + contextPtr->glLinkProgram = LoadGLFunction(load, "glLinkProgram"u8); + contextPtr->glShaderSource = LoadGLFunction(load, + "glShaderSource"u8); + contextPtr->glStencilFuncSeparate = LoadGLFunction(load, + "glStencilFuncSeparate"u8); + contextPtr->glStencilMaskSeparate = LoadGLFunction(load, + "glStencilMaskSeparate"u8); + contextPtr->glStencilOpSeparate = LoadGLFunction(load, + "glStencilOpSeparate"u8); + contextPtr->glUniform1f = LoadGLFunction(load, "glUniform1f"u8); + contextPtr->glUniform1fv = LoadGLFunction(load, "glUniform1fv"u8); + contextPtr->glUniform1i = LoadGLFunction(load, "glUniform1i"u8); + contextPtr->glUniform1iv = LoadGLFunction(load, "glUniform1iv"u8); + contextPtr->glUniform2f = LoadGLFunction(load, "glUniform2f"u8); + contextPtr->glUniform2fv = LoadGLFunction(load, "glUniform2fv"u8); + contextPtr->glUniform2i = LoadGLFunction(load, "glUniform2i"u8); + contextPtr->glUniform2iv = LoadGLFunction(load, "glUniform2iv"u8); + contextPtr->glUniform3f = LoadGLFunction(load, + "glUniform3f"u8); + contextPtr->glUniform3fv = LoadGLFunction(load, "glUniform3fv"u8); + contextPtr->glUniform3i = LoadGLFunction(load, "glUniform3i"u8); + contextPtr->glUniform3iv = LoadGLFunction(load, "glUniform3iv"u8); + contextPtr->glUniform4f = LoadGLFunction(load, + "glUniform4f"u8); + contextPtr->glUniform4fv = LoadGLFunction(load, "glUniform4fv"u8); + contextPtr->glUniform4i = LoadGLFunction(load, + "glUniform4i"u8); + contextPtr->glUniform4iv = LoadGLFunction(load, "glUniform4iv"u8); + contextPtr->glUniformMatrix2fv = LoadGLFunction(load, + "glUniformMatrix2fv"u8); + contextPtr->glUniformMatrix3fv = LoadGLFunction(load, + "glUniformMatrix3fv"u8); + contextPtr->glUniformMatrix4fv = LoadGLFunction(load, + "glUniformMatrix4fv"u8); + contextPtr->glUseProgram = LoadGLFunction(load, "glUseProgram"u8); + contextPtr->glValidateProgram = LoadGLFunction(load, "glValidateProgram"u8); + contextPtr->glVertexAttrib1d = LoadGLFunction(load, + "glVertexAttrib1d"u8); + contextPtr->glVertexAttrib1dv = LoadGLFunction(load, + "glVertexAttrib1dv"u8); + contextPtr->glVertexAttrib1f = LoadGLFunction(load, + "glVertexAttrib1f"u8); + contextPtr->glVertexAttrib1fv = LoadGLFunction(load, + "glVertexAttrib1fv"u8); + contextPtr->glVertexAttrib1s = LoadGLFunction(load, + "glVertexAttrib1s"u8); + contextPtr->glVertexAttrib1sv = LoadGLFunction(load, + "glVertexAttrib1sv"u8); + contextPtr->glVertexAttrib2d = LoadGLFunction(load, + "glVertexAttrib2d"u8); + contextPtr->glVertexAttrib2dv = LoadGLFunction(load, + "glVertexAttrib2dv"u8); + contextPtr->glVertexAttrib2f = LoadGLFunction(load, + "glVertexAttrib2f"u8); + contextPtr->glVertexAttrib2fv = LoadGLFunction(load, + "glVertexAttrib2fv"u8); + contextPtr->glVertexAttrib2s = LoadGLFunction(load, + "glVertexAttrib2s"u8); + contextPtr->glVertexAttrib2sv = LoadGLFunction(load, + "glVertexAttrib2sv"u8); + contextPtr->glVertexAttrib3d = LoadGLFunction(load, + "glVertexAttrib3d"u8); + contextPtr->glVertexAttrib3dv = LoadGLFunction(load, + "glVertexAttrib3dv"u8); + contextPtr->glVertexAttrib3f = LoadGLFunction(load, + "glVertexAttrib3f"u8); + contextPtr->glVertexAttrib3fv = LoadGLFunction(load, + "glVertexAttrib3fv"u8); + contextPtr->glVertexAttrib3s = LoadGLFunction(load, + "glVertexAttrib3s"u8); + contextPtr->glVertexAttrib3sv = LoadGLFunction(load, + "glVertexAttrib3sv"u8); + contextPtr->glVertexAttrib4Nbv = LoadGLFunction(load, + "glVertexAttrib4Nbv"u8); + contextPtr->glVertexAttrib4Niv = LoadGLFunction(load, + "glVertexAttrib4Niv"u8); + contextPtr->glVertexAttrib4Nsv = LoadGLFunction(load, + "glVertexAttrib4Nsv"u8); + contextPtr->glVertexAttrib4Nub = LoadGLFunction(load, + "glVertexAttrib4Nub"u8); + contextPtr->glVertexAttrib4Nubv = LoadGLFunction(load, + "glVertexAttrib4Nubv"u8); + contextPtr->glVertexAttrib4Nuiv = LoadGLFunction(load, + "glVertexAttrib4Nuiv"u8); + contextPtr->glVertexAttrib4Nusv = LoadGLFunction(load, + "glVertexAttrib4Nusv"u8); + contextPtr->glVertexAttrib4bv = LoadGLFunction(load, + "glVertexAttrib4bv"u8); + contextPtr->glVertexAttrib4d = LoadGLFunction(load, + "glVertexAttrib4d"u8); + contextPtr->glVertexAttrib4dv = LoadGLFunction(load, + "glVertexAttrib4dv"u8); + contextPtr->glVertexAttrib4f = LoadGLFunction(load, + "glVertexAttrib4f"u8); + contextPtr->glVertexAttrib4fv = LoadGLFunction(load, + "glVertexAttrib4fv"u8); + contextPtr->glVertexAttrib4iv = LoadGLFunction(load, + "glVertexAttrib4iv"u8); + contextPtr->glVertexAttrib4s = LoadGLFunction(load, + "glVertexAttrib4s"u8); + contextPtr->glVertexAttrib4sv = LoadGLFunction(load, + "glVertexAttrib4sv"u8); + contextPtr->glVertexAttrib4ubv = LoadGLFunction(load, + "glVertexAttrib4ubv"u8); + contextPtr->glVertexAttrib4uiv = LoadGLFunction(load, + "glVertexAttrib4uiv"u8); + contextPtr->glVertexAttrib4usv = LoadGLFunction(load, + "glVertexAttrib4usv"u8); + contextPtr->glVertexAttribPointer = LoadGLFunction(load, + "glVertexAttribPointer"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 2.0 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore21( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core21) + { + DefaultLog.InternalAppendLog("The core version 2.1 is not supported."); + return false; + } + + #region load + + contextPtr->glUniformMatrix2x3fv = LoadGLFunction(load, + "glUniformMatrix2x3fv"u8); + contextPtr->glUniformMatrix2x4fv = LoadGLFunction(load, + "glUniformMatrix2x4fv"u8); + contextPtr->glUniformMatrix3x2fv = LoadGLFunction(load, + "glUniformMatrix3x2fv"u8); + contextPtr->glUniformMatrix3x4fv = LoadGLFunction(load, + "glUniformMatrix3x4fv"u8); + contextPtr->glUniformMatrix4x2fv = LoadGLFunction(load, + "glUniformMatrix4x2fv"u8); + contextPtr->glUniformMatrix4x3fv = LoadGLFunction(load, + "glUniformMatrix4x3fv"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 2.1 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore30( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core30) + { + DefaultLog.InternalAppendLog("The core version 3.0 is not supported."); + return false; + } + + #region load + + contextPtr->glBeginConditionalRender = LoadGLFunction(load, + "glBeginConditionalRender"u8); + contextPtr->glBeginTransformFeedback = LoadGLFunction(load, + "glBeginTransformFeedback"u8); + contextPtr->glBindBufferBase = LoadGLFunction(load, + "glBindBufferBase"u8); + contextPtr->glBindBufferRange = LoadGLFunction(load, + "glBindBufferRange"u8); + contextPtr->glBindFragDataLocation = LoadGLFunction(load, + "glBindFragDataLocation"u8); + contextPtr->glBindFramebuffer = LoadGLFunction(load, + "glBindFramebuffer"u8); + contextPtr->glBindRenderbuffer = LoadGLFunction(load, + "glBindRenderbuffer"u8); + contextPtr->glBindVertexArray = LoadGLFunction(load, "glBindVertexArray"u8); + contextPtr->glBlitFramebuffer = LoadGLFunction(load, + "glBlitFramebuffer"u8); + contextPtr->glCheckFramebufferStatus = LoadGLFunction(load, + "glCheckFramebufferStatus"u8); + contextPtr->glClampColor = LoadGLFunction(load, "glClampColor"u8); + contextPtr->glClearBufferfi = LoadGLFunction(load, + "glClearBufferfi"u8); + contextPtr->glClearBufferfv = LoadGLFunction(load, + "glClearBufferfv"u8); + contextPtr->glClearBufferiv = LoadGLFunction(load, + "glClearBufferiv"u8); + contextPtr->glClearBufferuiv = LoadGLFunction(load, + "glClearBufferuiv"u8); + contextPtr->glColorMaski = LoadGLFunction(load, + "glColorMaski"u8); + contextPtr->glDeleteFramebuffers = LoadGLFunction(load, + "glDeleteFramebuffers"u8); + contextPtr->glDeleteRenderbuffers = LoadGLFunction(load, + "glDeleteRenderbuffers"u8); + contextPtr->glDeleteVertexArrays = LoadGLFunction(load, + "glDeleteVertexArrays"u8); + contextPtr->glDisablei = LoadGLFunction(load, "glDisablei"u8); + contextPtr->glEnablei = LoadGLFunction(load, "glEnablei"u8); + contextPtr->glEndConditionalRender = LoadGLFunction(load, "glEndConditionalRender"u8); + contextPtr->glEndTransformFeedback = LoadGLFunction(load, "glEndTransformFeedback"u8); + contextPtr->glFlushMappedBufferRange = LoadGLFunction(load, + "glFlushMappedBufferRange"u8); + contextPtr->glFramebufferRenderbuffer = LoadGLFunction(load, + "glFramebufferRenderbuffer"u8); + contextPtr->glFramebufferTexture1D = LoadGLFunction(load, + "glFramebufferTexture1D"u8); + contextPtr->glFramebufferTexture2D = LoadGLFunction(load, + "glFramebufferTexture2D"u8); + contextPtr->glFramebufferTexture3D = LoadGLFunction(load, + "glFramebufferTexture3D"u8); + contextPtr->glFramebufferTextureLayer = LoadGLFunction(load, + "glFramebufferTextureLayer"u8); + contextPtr->glGenFramebuffers = LoadGLFunction(load, + "glGenFramebuffers"u8); + contextPtr->glGenRenderbuffers = LoadGLFunction(load, + "glGenRenderbuffers"u8); + contextPtr->glGenVertexArrays = LoadGLFunction(load, + "glGenVertexArrays"u8); + contextPtr->glGenerateMipmap = LoadGLFunction(load, "glGenerateMipmap"u8); + contextPtr->glGetBooleani_v = LoadGLFunction(load, + "glGetBooleani_v"u8); + contextPtr->glGetFragDataLocation = LoadGLFunction(load, + "glGetFragDataLocation"u8); + contextPtr->glGetFramebufferAttachmentParameteriv = LoadGLFunction(load, + "glGetFramebufferAttachmentParameteriv"u8); + contextPtr->glGetIntegeri_v = LoadGLFunction(load, + "glGetIntegeri_v"u8); + contextPtr->glGetRenderbufferParameteriv = LoadGLFunction(load, + "glGetRenderbufferParameteriv"u8); + contextPtr->glGetStringi = LoadGLFunction(load, "glGetStringi"u8); + contextPtr->glGetTexParameterIiv = LoadGLFunction(load, + "glGetTexParameterIiv"u8); + contextPtr->glGetTexParameterIuiv = LoadGLFunction(load, + "glGetTexParameterIuiv"u8); + contextPtr->glGetTransformFeedbackVarying = LoadGLFunction(load, + "glGetTransformFeedbackVarying"u8); + contextPtr->glGetUniformuiv = LoadGLFunction(load, + "glGetUniformuiv"u8); + contextPtr->glGetVertexAttribIiv = LoadGLFunction(load, + "glGetVertexAttribIiv"u8); + contextPtr->glGetVertexAttribIuiv = LoadGLFunction(load, + "glGetVertexAttribIuiv"u8); + contextPtr->glIsEnabledi = LoadGLFunction(load, "glIsEnabledi"u8); + contextPtr->glIsFramebuffer = LoadGLFunction(load, "glIsFramebuffer"u8); + contextPtr->glIsRenderbuffer = LoadGLFunction(load, "glIsRenderbuffer"u8); + contextPtr->glIsVertexArray = LoadGLFunction(load, "glIsVertexArray"u8); + contextPtr->glMapBufferRange = LoadGLFunction(load, + "glMapBufferRange"u8); + contextPtr->glRenderbufferStorage = LoadGLFunction(load, + "glRenderbufferStorage"u8); + contextPtr->glRenderbufferStorageMultisample = LoadGLFunction(load, + "glRenderbufferStorageMultisample"u8); + contextPtr->glTexParameterIiv = LoadGLFunction(load, + "glTexParameterIiv"u8); + contextPtr->glTexParameterIuiv = LoadGLFunction(load, + "glTexParameterIuiv"u8); + contextPtr->glTransformFeedbackVaryings = LoadGLFunction(load, + "glTransformFeedbackVaryings"u8); + contextPtr->glUniform1ui = LoadGLFunction(load, "glUniform1ui"u8); + contextPtr->glUniform1uiv = LoadGLFunction(load, "glUniform1uiv"u8); + contextPtr->glUniform2ui = LoadGLFunction(load, "glUniform2ui"u8); + contextPtr->glUniform2uiv = LoadGLFunction(load, "glUniform2uiv"u8); + contextPtr->glUniform3ui = LoadGLFunction(load, + "glUniform3ui"u8); + contextPtr->glUniform3uiv = LoadGLFunction(load, "glUniform3uiv"u8); + contextPtr->glUniform4ui = LoadGLFunction(load, + "glUniform4ui"u8); + contextPtr->glUniform4uiv = LoadGLFunction(load, "glUniform4uiv"u8); + contextPtr->glVertexAttribI1i = LoadGLFunction(load, + "glVertexAttribI1i"u8); + contextPtr->glVertexAttribI1iv = LoadGLFunction(load, + "glVertexAttribI1iv"u8); + contextPtr->glVertexAttribI1ui = LoadGLFunction(load, + "glVertexAttribI1ui"u8); + contextPtr->glVertexAttribI1uiv = LoadGLFunction(load, + "glVertexAttribI1uiv"u8); + contextPtr->glVertexAttribI2i = LoadGLFunction(load, + "glVertexAttribI2i"u8); + contextPtr->glVertexAttribI2iv = LoadGLFunction(load, + "glVertexAttribI2iv"u8); + contextPtr->glVertexAttribI2ui = LoadGLFunction(load, + "glVertexAttribI2ui"u8); + contextPtr->glVertexAttribI2uiv = LoadGLFunction(load, + "glVertexAttribI2uiv"u8); + contextPtr->glVertexAttribI3i = LoadGLFunction(load, + "glVertexAttribI3i"u8); + contextPtr->glVertexAttribI3iv = LoadGLFunction(load, + "glVertexAttribI3iv"u8); + contextPtr->glVertexAttribI3ui = LoadGLFunction(load, + "glVertexAttribI3ui"u8); + contextPtr->glVertexAttribI3uiv = LoadGLFunction(load, + "glVertexAttribI3uiv"u8); + contextPtr->glVertexAttribI4bv = LoadGLFunction(load, + "glVertexAttribI4bv"u8); + contextPtr->glVertexAttribI4i = LoadGLFunction(load, + "glVertexAttribI4i"u8); + contextPtr->glVertexAttribI4iv = LoadGLFunction(load, + "glVertexAttribI4iv"u8); + contextPtr->glVertexAttribI4sv = LoadGLFunction(load, + "glVertexAttribI4sv"u8); + contextPtr->glVertexAttribI4ubv = LoadGLFunction(load, + "glVertexAttribI4ubv"u8); + contextPtr->glVertexAttribI4ui = LoadGLFunction(load, + "glVertexAttribI4ui"u8); + contextPtr->glVertexAttribI4uiv = LoadGLFunction(load, + "glVertexAttribI4uiv"u8); + contextPtr->glVertexAttribI4usv = LoadGLFunction(load, + "glVertexAttribI4usv"u8); + contextPtr->glVertexAttribIPointer = LoadGLFunction(load, + "glVertexAttribIPointer"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 3.0 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore31( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core31) + { + DefaultLog.InternalAppendLog("The core version 3.1 is not supported."); + return false; + } + + #region load + + contextPtr->glBindBufferBase = LoadGLFunction(load, + "glBindBufferBase"u8); + contextPtr->glBindBufferRange = LoadGLFunction(load, + "glBindBufferRange"u8); + contextPtr->glCopyBufferSubData = LoadGLFunction(load, + "glCopyBufferSubData"u8); + contextPtr->glDrawArraysInstanced = LoadGLFunction(load, + "glDrawArraysInstanced"u8); + contextPtr->glDrawElementsInstanced = LoadGLFunction(load, + "glDrawElementsInstanced"u8); + contextPtr->glGetActiveUniformBlockName = LoadGLFunction(load, + "glGetActiveUniformBlockName"u8); + contextPtr->glGetActiveUniformBlockiv = LoadGLFunction(load, + "glGetActiveUniformBlockiv"u8); + contextPtr->glGetActiveUniformName = LoadGLFunction(load, + "glGetActiveUniformName"u8); + contextPtr->glGetActiveUniformsiv = LoadGLFunction(load, + "glGetActiveUniformsiv"u8); + contextPtr->glGetIntegeri_v = LoadGLFunction(load, + "glGetIntegeri_v"u8); + contextPtr->glGetUniformBlockIndex = LoadGLFunction(load, + "glGetUniformBlockIndex"u8); + contextPtr->glGetUniformIndices = LoadGLFunction(load, + "glGetUniformIndices"u8); + contextPtr->glPrimitiveRestartIndex = LoadGLFunction(load, + "glPrimitiveRestartIndex"u8); + contextPtr->glTexBuffer = LoadGLFunction(load, "glTexBuffer"u8); + contextPtr->glUniformBlockBinding = LoadGLFunction(load, + "glUniformBlockBinding"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 3.1 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore32( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core32) + { + DefaultLog.InternalAppendLog("The core version 3.2 is not supported."); + return false; + } + + #region load + + contextPtr->glClientWaitSync = LoadGLFunction(load, + "glClientWaitSync"u8); + contextPtr->glDeleteSync = LoadGLFunction(load, "glDeleteSync"u8); + contextPtr->glDrawElementsBaseVertex = LoadGLFunction(load, + "glDrawElementsBaseVertex"u8); + contextPtr->glDrawElementsInstancedBaseVertex = LoadGLFunction(load, + "glDrawElementsInstancedBaseVertex"u8); + contextPtr->glDrawRangeElementsBaseVertex = LoadGLFunction(load, + "glDrawRangeElementsBaseVertex"u8); + contextPtr->glFenceSync = LoadGLFunction(load, "glFenceSync"u8); + contextPtr->glFramebufferTexture = LoadGLFunction(load, + "glFramebufferTexture"u8); + contextPtr->glGetBufferParameteri64v = LoadGLFunction(load, + "glGetBufferParameteri64v"u8); + contextPtr->glGetInteger64i_v = LoadGLFunction(load, + "glGetInteger64i_v"u8); + contextPtr->glGetInteger64v = LoadGLFunction(load, "glGetInteger64v"u8); + contextPtr->glGetMultisamplefv = LoadGLFunction(load, + "glGetMultisamplefv"u8); + contextPtr->glGetSynciv = LoadGLFunction(load, + "glGetSynciv"u8); + contextPtr->glIsSync = LoadGLFunction(load, "glIsSync"u8); + contextPtr->glMultiDrawElementsBaseVertex = LoadGLFunction(load, + "glMultiDrawElementsBaseVertex"u8); + contextPtr->glProvokingVertex = LoadGLFunction(load, "glProvokingVertex"u8); + contextPtr->glSampleMaski = LoadGLFunction(load, "glSampleMaski"u8); + contextPtr->glTexImage2DMultisample = LoadGLFunction(load, + "glTexImage2DMultisample"u8); + contextPtr->glTexImage3DMultisample = LoadGLFunction(load, + "glTexImage3DMultisample"u8); + contextPtr->glWaitSync = LoadGLFunction(load, "glWaitSync"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 3.2 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore33( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core33) + { + DefaultLog.InternalAppendLog("The core version 3.3 is not supported."); + return false; + } + + #region load + + contextPtr->glBindFragDataLocationIndexed = LoadGLFunction(load, + "glBindFragDataLocationIndexed"u8); + contextPtr->glBindSampler = LoadGLFunction(load, "glBindSampler"u8); + contextPtr->glDeleteSamplers = LoadGLFunction(load, + "glDeleteSamplers"u8); + contextPtr->glGenSamplers = LoadGLFunction(load, "glGenSamplers"u8); + contextPtr->glGetFragDataIndex = LoadGLFunction(load, + "glGetFragDataIndex"u8); + contextPtr->glGetQueryObjecti64v = LoadGLFunction(load, + "glGetQueryObjecti64v"u8); + contextPtr->glGetQueryObjectui64v = LoadGLFunction(load, + "glGetQueryObjectui64v"u8); + contextPtr->glGetSamplerParameterIiv = LoadGLFunction(load, + "glGetSamplerParameterIiv"u8); + contextPtr->glGetSamplerParameterIuiv = LoadGLFunction(load, + "glGetSamplerParameterIuiv"u8); + contextPtr->glGetSamplerParameterfv = LoadGLFunction(load, + "glGetSamplerParameterfv"u8); + contextPtr->glGetSamplerParameteriv = LoadGLFunction(load, + "glGetSamplerParameteriv"u8); + contextPtr->glIsSampler = LoadGLFunction(load, "glIsSampler"u8); + contextPtr->glQueryCounter = LoadGLFunction(load, "glQueryCounter"u8); + contextPtr->glSamplerParameterIiv = LoadGLFunction(load, + "glSamplerParameterIiv"u8); + contextPtr->glSamplerParameterIuiv = LoadGLFunction(load, + "glSamplerParameterIuiv"u8); + contextPtr->glSamplerParameterf = LoadGLFunction(load, + "glSamplerParameterf"u8); + contextPtr->glSamplerParameterfv = LoadGLFunction(load, + "glSamplerParameterfv"u8); + contextPtr->glSamplerParameteri = LoadGLFunction(load, + "glSamplerParameteri"u8); + contextPtr->glSamplerParameteriv = LoadGLFunction(load, + "glSamplerParameteriv"u8); + contextPtr->glVertexAttribDivisor = LoadGLFunction(load, + "glVertexAttribDivisor"u8); + contextPtr->glVertexAttribP1ui = LoadGLFunction(load, + "glVertexAttribP1ui"u8); + contextPtr->glVertexAttribP1uiv = LoadGLFunction(load, + "glVertexAttribP1uiv"u8); + contextPtr->glVertexAttribP2ui = LoadGLFunction(load, + "glVertexAttribP2ui"u8); + contextPtr->glVertexAttribP2uiv = LoadGLFunction(load, + "glVertexAttribP2uiv"u8); + contextPtr->glVertexAttribP3ui = LoadGLFunction(load, + "glVertexAttribP3ui"u8); + contextPtr->glVertexAttribP3uiv = LoadGLFunction(load, + "glVertexAttribP3uiv"u8); + contextPtr->glVertexAttribP4ui = LoadGLFunction(load, + "glVertexAttribP4ui"u8); + contextPtr->glVertexAttribP4uiv = LoadGLFunction(load, + "glVertexAttribP4uiv"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 3.3 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore40( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core40) + { + DefaultLog.InternalAppendLog("The core version 4.0 is not supported."); + return false; + } + + #region load + + contextPtr->glBeginQueryIndexed = LoadGLFunction(load, + "glBeginQueryIndexed"u8); + contextPtr->glBindTransformFeedback = LoadGLFunction(load, + "glBindTransformFeedback"u8); + contextPtr->glBlendEquationSeparatei = LoadGLFunction(load, + "glBlendEquationSeparatei"u8); + contextPtr->glBlendEquationi = LoadGLFunction(load, "glBlendEquationi"u8); + contextPtr->glBlendFuncSeparatei = LoadGLFunction(load, + "glBlendFuncSeparatei"u8); + contextPtr->glBlendFunci = LoadGLFunction(load, "glBlendFunci"u8); + contextPtr->glDeleteTransformFeedbacks = LoadGLFunction(load, + "glDeleteTransformFeedbacks"u8); + contextPtr->glDrawArraysIndirect = LoadGLFunction(load, + "glDrawArraysIndirect"u8); + contextPtr->glDrawElementsIndirect = LoadGLFunction(load, + "glDrawElementsIndirect"u8); + contextPtr->glDrawTransformFeedback = LoadGLFunction(load, + "glDrawTransformFeedback"u8); + contextPtr->glDrawTransformFeedbackStream = LoadGLFunction(load, + "glDrawTransformFeedbackStream"u8); + contextPtr->glEndQueryIndexed = LoadGLFunction(load, + "glEndQueryIndexed"u8); + contextPtr->glGenTransformFeedbacks = LoadGLFunction(load, + "glGenTransformFeedbacks"u8); + contextPtr->glGetActiveSubroutineName = LoadGLFunction(load, + "glGetActiveSubroutineName"u8); + contextPtr->glGetActiveSubroutineUniformName = LoadGLFunction(load, + "glGetActiveSubroutineUniformName"u8); + contextPtr->glGetActiveSubroutineUniformiv = LoadGLFunction(load, + "glGetActiveSubroutineUniformiv"u8); + contextPtr->glGetProgramStageiv = LoadGLFunction(load, + "glGetProgramStageiv"u8); + contextPtr->glGetQueryIndexediv = LoadGLFunction(load, + "glGetQueryIndexediv"u8); + contextPtr->glGetSubroutineIndex = LoadGLFunction(load, + "glGetSubroutineIndex"u8); + contextPtr->glGetSubroutineUniformLocation = LoadGLFunction(load, + "glGetSubroutineUniformLocation"u8); + contextPtr->glGetUniformSubroutineuiv = LoadGLFunction(load, + "glGetUniformSubroutineuiv"u8); + contextPtr->glGetUniformdv = LoadGLFunction(load, + "glGetUniformdv"u8); + contextPtr->glIsTransformFeedback = LoadGLFunction(load, + "glIsTransformFeedback"u8); + contextPtr->glMinSampleShading = LoadGLFunction(load, "glMinSampleShading"u8); + contextPtr->glPatchParameterfv = LoadGLFunction(load, + "glPatchParameterfv"u8); + contextPtr->glPatchParameteri = LoadGLFunction(load, + "glPatchParameteri"u8); + contextPtr->glPauseTransformFeedback = LoadGLFunction(load, + "glPauseTransformFeedback"u8); + contextPtr->glResumeTransformFeedback = LoadGLFunction(load, + "glResumeTransformFeedback"u8); + contextPtr->glUniform1d = LoadGLFunction(load, "glUniform1d"u8); + contextPtr->glUniform1dv = LoadGLFunction(load, "glUniform1dv"u8); + contextPtr->glUniform2d = LoadGLFunction(load, "glUniform2d"u8); + contextPtr->glUniform2dv = LoadGLFunction(load, "glUniform2dv"u8); + contextPtr->glUniform3d = LoadGLFunction(load, + "glUniform3d"u8); + contextPtr->glUniform3dv = LoadGLFunction(load, "glUniform3dv"u8); + contextPtr->glUniform4d = LoadGLFunction(load, + "glUniform4d"u8); + contextPtr->glUniform4dv = LoadGLFunction(load, "glUniform4dv"u8); + contextPtr->glUniformMatrix2dv = LoadGLFunction(load, + "glUniformMatrix2dv"u8); + contextPtr->glUniformMatrix2x3dv = LoadGLFunction(load, + "glUniformMatrix2x3dv"u8); + contextPtr->glUniformMatrix2x4dv = LoadGLFunction(load, + "glUniformMatrix2x4dv"u8); + contextPtr->glUniformMatrix3dv = LoadGLFunction(load, + "glUniformMatrix3dv"u8); + contextPtr->glUniformMatrix3x2dv = LoadGLFunction(load, + "glUniformMatrix3x2dv"u8); + contextPtr->glUniformMatrix3x4dv = LoadGLFunction(load, + "glUniformMatrix3x4dv"u8); + contextPtr->glUniformMatrix4dv = LoadGLFunction(load, + "glUniformMatrix4dv"u8); + contextPtr->glUniformMatrix4x2dv = LoadGLFunction(load, + "glUniformMatrix4x2dv"u8); + contextPtr->glUniformMatrix4x3dv = LoadGLFunction(load, + "glUniformMatrix4x3dv"u8); + contextPtr->glUniformSubroutinesuiv = LoadGLFunction(load, + "glUniformSubroutinesuiv"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.0 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore41( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core41) + { + DefaultLog.InternalAppendLog("The core version 4.1 is not supported."); + return false; + } + + #region load + + contextPtr->glActiveShaderProgram = LoadGLFunction(load, + "glActiveShaderProgram"u8); + contextPtr->glBindProgramPipeline = LoadGLFunction(load, + "glBindProgramPipeline"u8); + contextPtr->glClearDepthf = LoadGLFunction(load, "glClearDepthf"u8); + contextPtr->glCreateShaderProgramv = LoadGLFunction(load, + "glCreateShaderProgramv"u8); + contextPtr->glDeleteProgramPipelines = LoadGLFunction(load, + "glDeleteProgramPipelines"u8); + contextPtr->glDepthRangeArrayv = LoadGLFunction(load, + "glDepthRangeArrayv"u8); + contextPtr->glDepthRangeIndexed = LoadGLFunction(load, + "glDepthRangeIndexed"u8); + contextPtr->glDepthRangef = LoadGLFunction(load, "glDepthRangef"u8); + contextPtr->glGenProgramPipelines = LoadGLFunction(load, + "glGenProgramPipelines"u8); + contextPtr->glGetDoublei_v = LoadGLFunction(load, + "glGetDoublei_v"u8); + contextPtr->glGetFloati_v = LoadGLFunction(load, + "glGetFloati_v"u8); + contextPtr->glGetProgramBinary = LoadGLFunction(load, + "glGetProgramBinary"u8); + contextPtr->glGetProgramPipelineInfoLog = LoadGLFunction(load, + "glGetProgramPipelineInfoLog"u8); + contextPtr->glGetProgramPipelineiv = LoadGLFunction(load, + "glGetProgramPipelineiv"u8); + contextPtr->glGetShaderPrecisionFormat = LoadGLFunction(load, + "glGetShaderPrecisionFormat"u8); + contextPtr->glGetVertexAttribLdv = LoadGLFunction(load, + "glGetVertexAttribLdv"u8); + contextPtr->glIsProgramPipeline = LoadGLFunction(load, "glIsProgramPipeline"u8); + contextPtr->glProgramBinary = LoadGLFunction(load, + "glProgramBinary"u8); + contextPtr->glProgramParameteri = LoadGLFunction(load, + "glProgramParameteri"u8); + contextPtr->glProgramUniform1d = LoadGLFunction(load, + "glProgramUniform1d"u8); + contextPtr->glProgramUniform1dv = LoadGLFunction(load, + "glProgramUniform1dv"u8); + contextPtr->glProgramUniform1f = LoadGLFunction(load, + "glProgramUniform1f"u8); + contextPtr->glProgramUniform1fv = LoadGLFunction(load, + "glProgramUniform1fv"u8); + contextPtr->glProgramUniform1i = LoadGLFunction(load, + "glProgramUniform1i"u8); + contextPtr->glProgramUniform1iv = LoadGLFunction(load, + "glProgramUniform1iv"u8); + contextPtr->glProgramUniform1ui = LoadGLFunction(load, + "glProgramUniform1ui"u8); + contextPtr->glProgramUniform1uiv = LoadGLFunction(load, + "glProgramUniform1uiv"u8); + contextPtr->glProgramUniform2d = LoadGLFunction(load, + "glProgramUniform2d"u8); + contextPtr->glProgramUniform2dv = LoadGLFunction(load, + "glProgramUniform2dv"u8); + contextPtr->glProgramUniform2f = LoadGLFunction(load, + "glProgramUniform2f"u8); + contextPtr->glProgramUniform2fv = LoadGLFunction(load, + "glProgramUniform2fv"u8); + contextPtr->glProgramUniform2i = LoadGLFunction(load, + "glProgramUniform2i"u8); + contextPtr->glProgramUniform2iv = LoadGLFunction(load, + "glProgramUniform2iv"u8); + contextPtr->glProgramUniform2ui = LoadGLFunction(load, + "glProgramUniform2ui"u8); + contextPtr->glProgramUniform2uiv = LoadGLFunction(load, + "glProgramUniform2uiv"u8); + contextPtr->glProgramUniform3d = LoadGLFunction(load, + "glProgramUniform3d"u8); + contextPtr->glProgramUniform3dv = LoadGLFunction(load, + "glProgramUniform3dv"u8); + contextPtr->glProgramUniform3f = LoadGLFunction(load, + "glProgramUniform3f"u8); + contextPtr->glProgramUniform3fv = LoadGLFunction(load, + "glProgramUniform3fv"u8); + contextPtr->glProgramUniform3i = LoadGLFunction(load, + "glProgramUniform3i"u8); + contextPtr->glProgramUniform3iv = LoadGLFunction(load, + "glProgramUniform3iv"u8); + contextPtr->glProgramUniform3ui = LoadGLFunction(load, + "glProgramUniform3ui"u8); + contextPtr->glProgramUniform3uiv = LoadGLFunction(load, + "glProgramUniform3uiv"u8); + contextPtr->glProgramUniform4d = LoadGLFunction(load, + "glProgramUniform4d"u8); + contextPtr->glProgramUniform4dv = LoadGLFunction(load, + "glProgramUniform4dv"u8); + contextPtr->glProgramUniform4f = LoadGLFunction(load, + "glProgramUniform4f"u8); + contextPtr->glProgramUniform4fv = LoadGLFunction(load, + "glProgramUniform4fv"u8); + contextPtr->glProgramUniform4i = LoadGLFunction(load, + "glProgramUniform4i"u8); + contextPtr->glProgramUniform4iv = LoadGLFunction(load, + "glProgramUniform4iv"u8); + contextPtr->glProgramUniform4ui = LoadGLFunction(load, + "glProgramUniform4ui"u8); + contextPtr->glProgramUniform4uiv = LoadGLFunction(load, + "glProgramUniform4uiv"u8); + contextPtr->glProgramUniformMatrix2dv = LoadGLFunction(load, + "glProgramUniformMatrix2dv"u8); + contextPtr->glProgramUniformMatrix2fv = LoadGLFunction(load, + "glProgramUniformMatrix2fv"u8); + contextPtr->glProgramUniformMatrix2x3dv = LoadGLFunction(load, + "glProgramUniformMatrix2x3dv"u8); + contextPtr->glProgramUniformMatrix2x3fv = LoadGLFunction(load, + "glProgramUniformMatrix2x3fv"u8); + contextPtr->glProgramUniformMatrix2x4dv = LoadGLFunction(load, + "glProgramUniformMatrix2x4dv"u8); + contextPtr->glProgramUniformMatrix2x4fv = LoadGLFunction(load, + "glProgramUniformMatrix2x4fv"u8); + contextPtr->glProgramUniformMatrix3dv = LoadGLFunction(load, + "glProgramUniformMatrix3dv"u8); + contextPtr->glProgramUniformMatrix3fv = LoadGLFunction(load, + "glProgramUniformMatrix3fv"u8); + contextPtr->glProgramUniformMatrix3x2dv = LoadGLFunction(load, + "glProgramUniformMatrix3x2dv"u8); + contextPtr->glProgramUniformMatrix3x2fv = LoadGLFunction(load, + "glProgramUniformMatrix3x2fv"u8); + contextPtr->glProgramUniformMatrix3x4dv = LoadGLFunction(load, + "glProgramUniformMatrix3x4dv"u8); + contextPtr->glProgramUniformMatrix3x4fv = LoadGLFunction(load, + "glProgramUniformMatrix3x4fv"u8); + contextPtr->glProgramUniformMatrix4dv = LoadGLFunction(load, + "glProgramUniformMatrix4dv"u8); + contextPtr->glProgramUniformMatrix4fv = LoadGLFunction(load, + "glProgramUniformMatrix4fv"u8); + contextPtr->glProgramUniformMatrix4x2dv = LoadGLFunction(load, + "glProgramUniformMatrix4x2dv"u8); + contextPtr->glProgramUniformMatrix4x2fv = LoadGLFunction(load, + "glProgramUniformMatrix4x2fv"u8); + contextPtr->glProgramUniformMatrix4x3dv = LoadGLFunction(load, + "glProgramUniformMatrix4x3dv"u8); + contextPtr->glProgramUniformMatrix4x3fv = LoadGLFunction(load, + "glProgramUniformMatrix4x3fv"u8); + contextPtr->glReleaseShaderCompiler = LoadGLFunction(load, + "glReleaseShaderCompiler"u8); + contextPtr->glScissorArrayv = LoadGLFunction(load, + "glScissorArrayv"u8); + contextPtr->glScissorIndexed = LoadGLFunction(load, + "glScissorIndexed"u8); + contextPtr->glScissorIndexedv = LoadGLFunction(load, + "glScissorIndexedv"u8); + contextPtr->glShaderBinary = LoadGLFunction(load, + "glShaderBinary"u8); + contextPtr->glUseProgramStages = LoadGLFunction(load, + "glUseProgramStages"u8); + contextPtr->glValidateProgramPipeline = LoadGLFunction(load, + "glValidateProgramPipeline"u8); + contextPtr->glVertexAttribL1d = LoadGLFunction(load, + "glVertexAttribL1d"u8); + contextPtr->glVertexAttribL1dv = LoadGLFunction(load, + "glVertexAttribL1dv"u8); + contextPtr->glVertexAttribL2d = LoadGLFunction(load, + "glVertexAttribL2d"u8); + contextPtr->glVertexAttribL2dv = LoadGLFunction(load, + "glVertexAttribL2dv"u8); + contextPtr->glVertexAttribL3d = LoadGLFunction(load, + "glVertexAttribL3d"u8); + contextPtr->glVertexAttribL3dv = LoadGLFunction(load, + "glVertexAttribL3dv"u8); + contextPtr->glVertexAttribL4d = LoadGLFunction(load, + "glVertexAttribL4d"u8); + contextPtr->glVertexAttribL4dv = LoadGLFunction(load, + "glVertexAttribL4dv"u8); + contextPtr->glVertexAttribLPointer = LoadGLFunction(load, + "glVertexAttribLPointer"u8); + contextPtr->glViewportArrayv = LoadGLFunction(load, + "glViewportArrayv"u8); + contextPtr->glViewportIndexedf = LoadGLFunction(load, + "glViewportIndexedf"u8); + contextPtr->glViewportIndexedfv = LoadGLFunction(load, + "glViewportIndexedfv"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.1 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore42( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core42) + { + DefaultLog.InternalAppendLog("The core version 4.2 is not supported."); + return false; + } + + #region load + + contextPtr->glBindImageTexture = LoadGLFunction(load, + "glBindImageTexture"u8); + contextPtr->glDrawArraysInstancedBaseInstance = LoadGLFunction(load, + "glDrawArraysInstancedBaseInstance"u8); + contextPtr->glDrawElementsInstancedBaseInstance = LoadGLFunction(load, + "glDrawElementsInstancedBaseInstance"u8); + contextPtr->glDrawElementsInstancedBaseVertexBaseInstance = LoadGLFunction(load, + "glDrawElementsInstancedBaseVertexBaseInstance"u8); + contextPtr->glDrawTransformFeedbackInstanced = LoadGLFunction(load, + "glDrawTransformFeedbackInstanced"u8); + contextPtr->glDrawTransformFeedbackStreamInstanced = LoadGLFunction(load, + "glDrawTransformFeedbackStreamInstanced"u8); + contextPtr->glGetActiveAtomicCounterBufferiv = LoadGLFunction(load, + "glGetActiveAtomicCounterBufferiv"u8); + contextPtr->glGetInternalformativ = LoadGLFunction(load, + "glGetInternalformativ"u8); + contextPtr->glMemoryBarrier = LoadGLFunction(load, "glMemoryBarrier"u8); + contextPtr->glTexStorage1D = LoadGLFunction(load, + "glTexStorage1D"u8); + contextPtr->glTexStorage2D = LoadGLFunction(load, + "glTexStorage2D"u8); + contextPtr->glTexStorage3D = LoadGLFunction(load, + "glTexStorage3D"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.2 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore43( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core43) + { + DefaultLog.InternalAppendLog("The core version 4.3 is not supported."); + return false; + } + + #region load + + contextPtr->glBindVertexBuffer = LoadGLFunction(load, + "glBindVertexBuffer"u8); + contextPtr->glClearBufferData = LoadGLFunction(load, + "glClearBufferData"u8); + contextPtr->glClearBufferSubData = LoadGLFunction(load, + "glClearBufferSubData"u8); + contextPtr->glCopyImageSubData = LoadGLFunction(load, + "glCopyImageSubData"u8); + contextPtr->glDebugMessageCallback = LoadGLFunction(load, + "glDebugMessageCallback"u8); + contextPtr->glDebugMessageControl = LoadGLFunction(load, + "glDebugMessageControl"u8); + contextPtr->glDebugMessageInsert = LoadGLFunction(load, + "glDebugMessageInsert"u8); + contextPtr->glDispatchCompute = LoadGLFunction(load, + "glDispatchCompute"u8); + contextPtr->glDispatchComputeIndirect = LoadGLFunction(load, + "glDispatchComputeIndirect"u8); + contextPtr->glFramebufferParameteri = LoadGLFunction(load, + "glFramebufferParameteri"u8); + contextPtr->glGetDebugMessageLog = LoadGLFunction(load, + "glGetDebugMessageLog"u8); + contextPtr->glGetFramebufferParameteriv = LoadGLFunction(load, + "glGetFramebufferParameteriv"u8); + contextPtr->glGetInternalformati64v = LoadGLFunction(load, + "glGetInternalformati64v"u8); + contextPtr->glGetObjectLabel = LoadGLFunction(load, + "glGetObjectLabel"u8); + contextPtr->glGetObjectPtrLabel = LoadGLFunction(load, + "glGetObjectPtrLabel"u8); + + // contextPtr->glGetPointerv =LoadGLFunction(load,"glGetPointerv"u8); + contextPtr->glGetProgramInterfaceiv = LoadGLFunction(load, + "glGetProgramInterfaceiv"u8); + contextPtr->glGetProgramResourceIndex = LoadGLFunction(load, + "glGetProgramResourceIndex"u8); + contextPtr->glGetProgramResourceLocation = LoadGLFunction(load, + "glGetProgramResourceLocation"u8); + contextPtr->glGetProgramResourceLocationIndex = LoadGLFunction(load, + "glGetProgramResourceLocationIndex"u8); + contextPtr->glGetProgramResourceName = LoadGLFunction(load, + "glGetProgramResourceName"u8); + contextPtr->glGetProgramResourceiv = LoadGLFunction(load, + "glGetProgramResourceiv"u8); + contextPtr->glInvalidateBufferData = LoadGLFunction(load, + "glInvalidateBufferData"u8); + contextPtr->glInvalidateBufferSubData = LoadGLFunction(load, + "glInvalidateBufferSubData"u8); + contextPtr->glInvalidateFramebuffer = LoadGLFunction(load, + "glInvalidateFramebuffer"u8); + contextPtr->glInvalidateSubFramebuffer = LoadGLFunction(load, + "glInvalidateSubFramebuffer"u8); + contextPtr->glInvalidateTexImage = LoadGLFunction(load, + "glInvalidateTexImage"u8); + contextPtr->glInvalidateTexSubImage = LoadGLFunction(load, + "glInvalidateTexSubImage"u8); + contextPtr->glMultiDrawArraysIndirect = LoadGLFunction(load, + "glMultiDrawArraysIndirect"u8); + contextPtr->glMultiDrawElementsIndirect = LoadGLFunction(load, + "glMultiDrawElementsIndirect"u8); + contextPtr->glObjectLabel = LoadGLFunction(load, + "glObjectLabel"u8); + contextPtr->glObjectPtrLabel = LoadGLFunction(load, + "glObjectPtrLabel"u8); + contextPtr->glPopDebugGroup = LoadGLFunction(load, "glPopDebugGroup"u8); + contextPtr->glPushDebugGroup = LoadGLFunction(load, + "glPushDebugGroup"u8); + contextPtr->glShaderStorageBlockBinding = LoadGLFunction(load, + "glShaderStorageBlockBinding"u8); + contextPtr->glTexBufferRange = LoadGLFunction(load, + "glTexBufferRange"u8); + contextPtr->glTexStorage2DMultisample = LoadGLFunction(load, + "glTexStorage2DMultisample"u8); + contextPtr->glTexStorage3DMultisample = LoadGLFunction(load, + "glTexStorage3DMultisample"u8); + contextPtr->glTextureView = LoadGLFunction(load, + "glTextureView"u8); + contextPtr->glVertexAttribBinding = LoadGLFunction(load, + "glVertexAttribBinding"u8); + contextPtr->glVertexAttribFormat = LoadGLFunction(load, + "glVertexAttribFormat"u8); + contextPtr->glVertexAttribIFormat = LoadGLFunction(load, + "glVertexAttribIFormat"u8); + contextPtr->glClearBufferData = LoadGLFunction(load, + "glClearBufferData"u8); + contextPtr->glVertexBindingDivisor = LoadGLFunction(load, + "glVertexBindingDivisor"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.3 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore44( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core44) + { + DefaultLog.InternalAppendLog("The core version 4.4 is not supported."); + return false; + } + + #region load + + contextPtr->glBindBuffersBase = LoadGLFunction(load, + "glBindBuffersBase"u8); + contextPtr->glBindBuffersRange = LoadGLFunction(load, + "glBindBuffersRange"u8); + contextPtr->glBindImageTextures = LoadGLFunction(load, + "glBindImageTextures"u8); + contextPtr->glBindSamplers = LoadGLFunction(load, + "glBindSamplers"u8); + contextPtr->glBindTextures = LoadGLFunction(load, + "glBindTextures"u8); + contextPtr->glBindVertexBuffers = LoadGLFunction(load, + "glBindVertexBuffers"u8); + contextPtr->glBufferStorage = LoadGLFunction(load, + "glBufferStorage"u8); + contextPtr->glClearTexImage = LoadGLFunction(load, + "glClearTexImage"u8); + contextPtr->glClearTexSubImage = LoadGLFunction(load, + "glClearTexSubImage"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.4 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore45( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core45) + { + DefaultLog.InternalAppendLog("The core version 4.5 is not supported."); + return false; + } + + #region load + + contextPtr->glBindTextureUnit = LoadGLFunction(load, + "glBindTextureUnit"u8); + contextPtr->glBlitNamedFramebuffer = LoadGLFunction(load, + "glBlitNamedFramebuffer"u8); + contextPtr->glCheckNamedFramebufferStatus = LoadGLFunction(load, + "glCheckNamedFramebufferStatus"u8); + contextPtr->glClearNamedBufferData = LoadGLFunction(load, + "glClearNamedBufferData"u8); + contextPtr->glClearNamedBufferSubData = LoadGLFunction(load, + "glClearNamedBufferSubData"u8); + contextPtr->glClearNamedFramebufferfi = LoadGLFunction(load, + "glClearNamedFramebufferfi"u8); + contextPtr->glClearNamedFramebufferfv = LoadGLFunction(load, + "glClearNamedFramebufferfv"u8); + contextPtr->glClearNamedFramebufferiv = LoadGLFunction(load, + "glClearNamedFramebufferiv"u8); + contextPtr->glClearNamedFramebufferuiv = LoadGLFunction(load, + "glClearNamedFramebufferuiv"u8); + contextPtr->glClipControl = LoadGLFunction(load, "glClipControl"u8); + contextPtr->glCompressedTextureSubImage1D = LoadGLFunction(load, + "glCompressedTextureSubImage1D"u8); + contextPtr->glCompressedTextureSubImage2D = LoadGLFunction(load, + "glCompressedTextureSubImage2D"u8); + contextPtr->glCompressedTextureSubImage3D = LoadGLFunction(load, + "glCompressedTextureSubImage3D"u8); + contextPtr->glCopyNamedBufferSubData = LoadGLFunction(load, + "glCopyNamedBufferSubData"u8); + contextPtr->glCopyTextureSubImage1D = LoadGLFunction(load, + "glCopyTextureSubImage1D"u8); + contextPtr->glCopyTextureSubImage2D = LoadGLFunction(load, + "glCopyTextureSubImage2D"u8); + contextPtr->glCopyTextureSubImage3D = LoadGLFunction(load, + "glCopyTextureSubImage3D"u8); + contextPtr->glCreateBuffers = LoadGLFunction(load, "glCreateBuffers"u8); + contextPtr->glCreateFramebuffers = LoadGLFunction(load, + "glCreateFramebuffers"u8); + contextPtr->glCreateProgramPipelines = LoadGLFunction(load, + "glCreateProgramPipelines"u8); + contextPtr->glCreateQueries = LoadGLFunction(load, + "glCreateQueries"u8); + contextPtr->glCreateRenderbuffers = LoadGLFunction(load, + "glCreateRenderbuffers"u8); + contextPtr->glCreateSamplers = LoadGLFunction(load, + "glCreateSamplers"u8); + contextPtr->glCreateTextures = LoadGLFunction(load, + "glCreateTextures"u8); + contextPtr->glCreateTransformFeedbacks = LoadGLFunction(load, + "glCreateTransformFeedbacks"u8); + contextPtr->glCreateVertexArrays = LoadGLFunction(load, + "glCreateVertexArrays"u8); + contextPtr->glDisableVertexArrayAttrib = LoadGLFunction(load, + "glDisableVertexArrayAttrib"u8); + contextPtr->glEnableVertexArrayAttrib = LoadGLFunction(load, + "glEnableVertexArrayAttrib"u8); + contextPtr->glFlushMappedNamedBufferRange = LoadGLFunction(load, + "glFlushMappedNamedBufferRange"u8); + contextPtr->glGenerateTextureMipmap = LoadGLFunction(load, + "glGenerateTextureMipmap"u8); + contextPtr->glGetCompressedTextureImage = LoadGLFunction(load, + "glGetCompressedTextureImage"u8); + contextPtr->glGetCompressedTextureSubImage = LoadGLFunction(load, + "glGetCompressedTextureSubImage"u8); + contextPtr->glGetGraphicsResetStatus = LoadGLFunction(load, + "glGetGraphicsResetStatus"u8); + contextPtr->glGetNamedBufferParameteri64v = LoadGLFunction(load, + "glGetNamedBufferParameteri64v"u8); + contextPtr->glGetNamedBufferParameteriv = LoadGLFunction(load, + "glGetNamedBufferParameteriv"u8); + contextPtr->glGetNamedBufferPointerv = LoadGLFunction(load, + "glGetNamedBufferPointerv"u8); + contextPtr->glGetNamedBufferSubData = LoadGLFunction(load, + "glGetNamedBufferSubData"u8); + contextPtr->glGetNamedFramebufferAttachmentParameteriv = LoadGLFunction(load, + "glGetNamedFramebufferAttachmentParameteriv"u8); + contextPtr->glGetNamedFramebufferParameteriv = LoadGLFunction(load, + "glGetNamedFramebufferParameteriv"u8); + contextPtr->glGetNamedRenderbufferParameteriv = LoadGLFunction(load, + "glGetNamedRenderbufferParameteriv"u8); + contextPtr->glGetQueryBufferObjecti64v = LoadGLFunction(load, + "glGetQueryBufferObjecti64v"u8); + contextPtr->glGetQueryBufferObjectiv = LoadGLFunction(load, + "glGetQueryBufferObjectiv"u8); + contextPtr->glGetQueryBufferObjectui64v = LoadGLFunction(load, + "glGetQueryBufferObjectui64v"u8); + contextPtr->glGetQueryBufferObjectuiv = LoadGLFunction(load, + "glGetQueryBufferObjectuiv"u8); + contextPtr->glGetTextureImage = LoadGLFunction(load, + "glGetTextureImage"u8); + contextPtr->glGetTextureLevelParameterfv = LoadGLFunction(load, + "glGetTextureLevelParameterfv"u8); + contextPtr->glGetTextureLevelParameteriv = LoadGLFunction(load, + "glGetTextureLevelParameteriv"u8); + contextPtr->glGetTextureParameterIiv = LoadGLFunction(load, + "glGetTextureParameterIiv"u8); + contextPtr->glGetTextureParameterIuiv = LoadGLFunction(load, + "glGetTextureParameterIuiv"u8); + contextPtr->glGetTextureParameterfv = LoadGLFunction(load, + "glGetTextureParameterfv"u8); + contextPtr->glGetTextureParameteriv = LoadGLFunction(load, + "glGetTextureParameteriv"u8); + contextPtr->glGetTextureSubImage = LoadGLFunction(load, + "glGetTextureSubImage"u8); + contextPtr->glGetTransformFeedbacki64_v = LoadGLFunction(load, + "glGetTransformFeedbacki64_v"u8); + contextPtr->glGetTransformFeedbacki_v = LoadGLFunction(load, + "glGetTransformFeedbacki_v"u8); + contextPtr->glGetTransformFeedbackiv = LoadGLFunction(load, + "glGetTransformFeedbackiv"u8); + contextPtr->glGetVertexArrayIndexed64iv = LoadGLFunction(load, + "glGetVertexArrayIndexed64iv"u8); + contextPtr->glGetVertexArrayIndexediv = LoadGLFunction(load, + "glGetVertexArrayIndexediv"u8); + contextPtr->glGetVertexArrayiv = LoadGLFunction(load, + "glGetVertexArrayiv"u8); + contextPtr->glGetnCompressedTexImage = LoadGLFunction(load, + "glGetnCompressedTexImage"u8); + contextPtr->glGetnTexImage = LoadGLFunction(load, + "glGetnTexImage"u8); + contextPtr->glGetnUniformdv = LoadGLFunction(load, + "glGetnUniformdv"u8); + contextPtr->glGetnUniformfv = LoadGLFunction(load, + "glGetnUniformfv"u8); + contextPtr->glGetnUniformiv = LoadGLFunction(load, + "glGetnUniformiv"u8); + contextPtr->glGetnUniformuiv = LoadGLFunction(load, + "glGetnUniformuiv"u8); + contextPtr->glInvalidateNamedFramebufferData = LoadGLFunction(load, + "glInvalidateNamedFramebufferData"u8); + contextPtr->glInvalidateNamedFramebufferSubData = LoadGLFunction(load, + "glInvalidateNamedFramebufferSubData"u8); + contextPtr->glMapNamedBuffer = LoadGLFunction(load, + "glMapNamedBuffer"u8); + contextPtr->glMapNamedBufferRange = LoadGLFunction(load, + "glMapNamedBufferRange"u8); + contextPtr->glMemoryBarrierByRegion = LoadGLFunction(load, + "glMemoryBarrierByRegion"u8); + contextPtr->glNamedBufferData = LoadGLFunction(load, + "glNamedBufferData"u8); + contextPtr->glNamedBufferStorage = LoadGLFunction(load, + "glNamedBufferStorage"u8); + contextPtr->glNamedBufferSubData = LoadGLFunction(load, + "glNamedBufferSubData"u8); + contextPtr->glNamedFramebufferDrawBuffer = LoadGLFunction(load, + "glNamedFramebufferDrawBuffer"u8); + contextPtr->glNamedFramebufferDrawBuffers = LoadGLFunction(load, + "glNamedFramebufferDrawBuffers"u8); + contextPtr->glNamedFramebufferParameteri = LoadGLFunction(load, + "glNamedFramebufferParameteri"u8); + contextPtr->glNamedFramebufferReadBuffer = LoadGLFunction(load, + "glNamedFramebufferReadBuffer"u8); + contextPtr->glNamedFramebufferRenderbuffer = LoadGLFunction(load, + "glNamedFramebufferRenderbuffer"u8); + contextPtr->glNamedFramebufferTexture = LoadGLFunction(load, + "glNamedFramebufferTexture"u8); + contextPtr->glNamedFramebufferTextureLayer = LoadGLFunction(load, + "glNamedFramebufferTextureLayer"u8); + contextPtr->glNamedRenderbufferStorage = LoadGLFunction(load, + "glNamedRenderbufferStorage"u8); + contextPtr->glNamedRenderbufferStorageMultisample = LoadGLFunction(load, + "glNamedRenderbufferStorageMultisample"u8); + contextPtr->glReadnPixels = LoadGLFunction(load, + "glReadnPixels"u8); + contextPtr->glTextureBarrier = LoadGLFunction(load, "glTextureBarrier"u8); + contextPtr->glTextureBuffer = LoadGLFunction(load, + "glTextureBuffer"u8); + contextPtr->glTextureBufferRange = LoadGLFunction(load, + "glTextureBufferRange"u8); + contextPtr->glTextureParameterIiv = LoadGLFunction(load, + "glTextureParameterIiv"u8); + contextPtr->glTextureParameterIuiv = LoadGLFunction(load, + "glTextureParameterIuiv"u8); + contextPtr->glTextureParameterf = LoadGLFunction(load, + "glTextureParameterf"u8); + contextPtr->glTextureParameterfv = LoadGLFunction(load, + "glTextureParameterfv"u8); + contextPtr->glTextureParameteri = LoadGLFunction(load, + "glTextureParameteri"u8); + contextPtr->glTextureParameteriv = LoadGLFunction(load, + "glTextureParameteriv"u8); + contextPtr->glTextureStorage1D = LoadGLFunction(load, + "glTextureStorage1D"u8); + contextPtr->glTextureStorage2D = LoadGLFunction(load, + "glTextureStorage2D"u8); + contextPtr->glTextureStorage2DMultisample = LoadGLFunction(load, + "glTextureStorage2DMultisample"u8); + contextPtr->glTextureStorage3D = LoadGLFunction(load, + "glTextureStorage3D"u8); + contextPtr->glTextureStorage3DMultisample = LoadGLFunction(load, + "glTextureStorage3DMultisample"u8); + contextPtr->glTextureSubImage1D = LoadGLFunction(load, + "glTextureSubImage1D"u8); + contextPtr->glTextureSubImage2D = LoadGLFunction(load, + "glTextureSubImage2D"u8); + contextPtr->glTextureSubImage3D = LoadGLFunction(load, + "glTextureSubImage3D"u8); + contextPtr->glTransformFeedbackBufferBase = LoadGLFunction(load, + "glTransformFeedbackBufferBase"u8); + contextPtr->glTransformFeedbackBufferRange = LoadGLFunction(load, + "glTransformFeedbackBufferRange"u8); + contextPtr->glUnmapNamedBuffer = LoadGLFunction(load, "glUnmapNamedBuffer"u8); + contextPtr->glVertexArrayAttribBinding = LoadGLFunction(load, + "glVertexArrayAttribBinding"u8); + contextPtr->glVertexArrayAttribFormat = LoadGLFunction(load, + "glVertexArrayAttribFormat"u8); + contextPtr->glVertexArrayAttribIFormat = LoadGLFunction(load, + "glVertexArrayAttribIFormat"u8); + contextPtr->glVertexArrayAttribLFormat = LoadGLFunction(load, + "glVertexArrayAttribLFormat"u8); + contextPtr->glVertexArrayBindingDivisor = LoadGLFunction(load, + "glVertexArrayBindingDivisor"u8); + contextPtr->glVertexArrayElementBuffer = LoadGLFunction(load, + "glVertexArrayElementBuffer"u8); + contextPtr->glVertexArrayVertexBuffer = LoadGLFunction(load, + "glVertexArrayVertexBuffer"u8); + contextPtr->glVertexArrayVertexBuffers = LoadGLFunction(load, + "glVertexArrayVertexBuffers"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.5 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore46( + glContextShadow* contextPtr, + delegate*, IntPtr> load + ) + { + if (!core46) + { + DefaultLog.InternalAppendLog("The core version 4.6 is not supported."); + return false; + } + + #region load + + contextPtr->glMultiDrawArraysIndirectCount = LoadGLFunction(load, + "glMultiDrawArraysIndirectCount"u8); + contextPtr->glMultiDrawElementsIndirectCount = LoadGLFunction(load, + "glMultiDrawElementsIndirectCount"u8); + contextPtr->glPolygonOffsetClamp = LoadGLFunction(load, + "glPolygonOffsetClamp"u8); + contextPtr->glSpecializeShader = LoadGLFunction(load, + "glSpecializeShader"u8); + + #endregion load + + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.6 APIs"); + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static unsafe IntPtr LoadGLFunction( + delegate*, IntPtr> load, + ReadOnlySpan name + ) + { + IntPtr ptr = load(name); + if (ptr == IntPtr.Zero) { + DefaultLog.InternalAppendLog($"Failed to load proc {System.Text.Encoding.UTF8.GetString(name)}."); + } + return ptr; + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glApiManager.cs b/StgsSharp.Graphics/OpenGL/glApiManager.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glApiManager.cs rename to StgsSharp.Graphics/OpenGL/glApiManager.cs index bfb32d94..75ec6163 100644 --- a/StgSharp.Common/Graphics/OpenGL/glApiManager.cs +++ b/StgsSharp.Graphics/OpenGL/glApiManager.cs @@ -1,3431 +1,3431 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glApiManager" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics; -using StgSharp.MVVM; -using StgSharp.MVVM; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - public static partial class glManager - { - - private const int glExtension = 0x1f03; - private const int glVersion = 0x1f02; - - private static readonly string[] glBranch = { - "OpenGL ES-CM ", - "OpenGL ES-CL ", - "OpenGL ES ", - "OpenGL SC " - }; - - private static string glExtensionList; - - - /// - /// Load all supported OpenGL APIs and bind them to given . - /// - /// - /// The handle to current OpenGL viewPortDisplay - /// - public static unsafe void LoadOpenGLApiTo( - IntPtr contextHandle - ) - { - OpenglContext* context = (OpenglContext*)contextHandle; - if (context->glGetString != null) { - return; - } - delegate*, IntPtr> loader = &GraphicFramework.glfwGetProcAddress; - IntPtr proc = GraphicFramework.glfwGetProcAddress("glGetString"u8); - if (proc == IntPtr.Zero) - { - #if DEBUG - Console.WriteLine("Cannot load GL."); - #endif - throw new NotSupportedException("Cannot load gl"); - } - context->glGetString = (delegate*)proc; - - string coreVersion; - if (context->glGetString(glVersion) == null) { - DefaultLog.InternalWriteLog("Failed to call glGetString", LogType.Error); - } - coreVersion = Marshal.PtrToStringAnsi((nint)context->glGetString(glVersion)) ?? - string.Empty; - - foreach (string branch in glBranch) - { - if (coreVersion.Contains(branch)) { - coreVersion.Replace(branch, string.Empty); - } - } - string[] versionSep = coreVersion!.Split('.'); - int majorVersion = int.Parse(versionSep[0]); - int minorVersion = int.Parse(versionSep[1]); - CheckCoreVersion(majorVersion, minorVersion); - - - if (LoadGLcore10((glContextShadow*)context, loader) && - LoadGLcore11((glContextShadow*)context, loader) && - LoadGLcore12((glContextShadow*)context, loader) && - LoadGLcore13((glContextShadow*)context, loader) && - LoadGLcore14((glContextShadow*)context, loader) && - LoadGLcore15((glContextShadow*)context, loader) && - LoadGLcore20((glContextShadow*)context, loader) && - LoadGLcore21((glContextShadow*)context, loader) && - LoadGLcore30((glContextShadow*)context, loader) && - LoadGLcore31((glContextShadow*)context, loader) && - LoadGLcore32((glContextShadow*)context, loader) && - LoadGLcore33((glContextShadow*)context, loader) && - LoadGLcore40((glContextShadow*)context, loader) && - LoadGLcore41((glContextShadow*)context, loader) && - LoadGLcore42((glContextShadow*)context, loader) && - LoadGLcore43((glContextShadow*)context, loader) && - LoadGLcore44((glContextShadow*)context, loader) && - LoadGLcore45((glContextShadow*)context, loader) && - LoadGLcore46((glContextShadow*)context, loader)) { } - - uint code = context->glGetError(); - if (code != 0) - { - Console.WriteLine(code); - throw new GlExecutionException(code); - } - - int extensionCount; - context->glGetIntegerv(glConst.NUM_EXTENSIONS, &extensionCount); - if (extensionCount == 0) - { - DefaultLog.InternalWriteLog( - "No supported OpenGL extensions are found.", LogType.Info); - return; - } - - HashSet extensions = []; - - for (uint i = 0; i < extensionCount; i++) - { - byte* strPtr = context->glGetStringi(glConst.EXTENSIONS, i); - extensions.Add(Marshal.PtrToStringAnsi((IntPtr)strPtr) ?? string.Empty); - } - - DefaultLog.InternalWriteLog( - $"{$"Find OpenGL extensions:"}{Environment.NewLine}{string.Join(';', extensions)}", - LogType.Info); - - #region checkGLextensions - - if (extensions.Contains("gl_4DFX_multisample")) - { - _4DFX_multisample = true; - extensions.Remove("gl_4DFX_multisample"); - } - if (extensions.Contains("gl_3DFX_tbuffer")) - { - _3DFX_tbuffer = true; - extensions.Remove("gl_3DFX_tbuffer"); - } - if (extensions.Contains("gl_3DFX_texture_compression_FXT1")) - { - _3DFX_texture_compression_FXT1 = true; - extensions.Remove("gl_3DFX_texture_compression_FXT1"); - } - if (extensions.Contains("gl_AMD_blend_minmax_factor")) - { - AMD_blend_minmax_factor = true; - extensions.Remove("glAMD_blend_minmax_factor"); - } - if (extensions.Contains("gl_AMD_conservative_depth")) - { - AMD_conservative_depth = true; - extensions.Remove("glAMD_conservative_depth"); - } - if (extensions.Contains("gl_AMD_debug_output")) - { - AMD_debug_output = true; - extensions.Remove("glAMD_debug_output"); - } - if (extensions.Contains("gl_AMD_depth_clamp_separate")) - { - AMD_depth_clamp_separate = true; - extensions.Remove("glAMD_depth_clamp_separate"); - } - if (extensions.Contains("gl_AMD_draw_buffers_blend")) - { - AMD_draw_buffers_blend = true; - extensions.Remove("glAMD_draw_buffers_blend"); - } - if (extensions.Contains("gl_AMD_framebuffer_multisample_advanced")) - { - AMD_framebuffer_multisample_advanced = true; - extensions.Remove("glAMD_framebuffer_multisample_advanced"); - } - if (extensions.Contains("gl_AMD_framebuffer_sample_positions")) - { - AMD_framebuffer_sample_positions = true; - extensions.Remove("glAMD_framebuffer_sample_positions"); - } - if (extensions.Contains("gl_AMD_gcn_shader")) - { - AMD_gcn_shader = true; - extensions.Remove("glAMD_gcn_shader"); - } - if (extensions.Contains("gl_AMD_gpu_shader_half_float")) - { - AMD_gpu_shader_half_float = true; - extensions.Remove("glAMD_gpu_shader_half_float"); - } - if (extensions.Contains("gl_AMD_gpu_shader_int16")) - { - AMD_gpu_shader_int16 = true; - extensions.Remove("glAMD_gpu_shader_int16"); - } - if (extensions.Contains("gl_AMD_gpu_shader_int64")) - { - AMD_gpu_shader_int64 = true; - extensions.Remove("glAMD_gpu_shader_int64"); - } - if (extensions.Contains("gl_AMD_interleaved_elements")) - { - AMD_interleaved_elements = true; - extensions.Remove("glAMD_interleaved_elements"); - } - if (extensions.Contains("gl_AMD_multi_draw_indirect")) - { - AMD_multi_draw_indirect = true; - extensions.Remove("glAMD_multi_draw_indirect"); - } - if (extensions.Contains("gl_AMD_name_gen_delete")) - { - AMD_name_gen_delete = true; - extensions.Remove("glAMD_name_gen_delete"); - } - if (extensions.Contains("gl_AMD_occlusion_query_event")) - { - AMD_occlusion_query_event = true; - extensions.Remove("glAMD_occlusion_query_event"); - } - if (extensions.Contains("gl_AMD_performance_monitor")) - { - AMD_performance_monitor = true; - extensions.Remove("glAMD_performance_monitor"); - } - if (extensions.Contains("gl_AMD_pinned_memory")) - { - AMD_pinned_memory = true; - extensions.Remove("glAMD_pinned_memory"); - } - if (extensions.Contains("gl_AMD_query_buffer_object")) - { - AMD_query_buffer_object = true; - extensions.Remove("glAMD_query_buffer_object"); - } - if (extensions.Contains("gl_AMD_sample_positions")) - { - AMD_sample_positions = true; - extensions.Remove("glAMD_sample_positions"); - } - if (extensions.Contains("gl_AMD_seamless_cubemap_per_texture")) - { - AMD_seamless_cubemap_per_texture = true; - extensions.Remove("glAMD_seamless_cubemap_per_texture"); - } - if (extensions.Contains("gl_AMD_shader_atomic_counter_ops")) - { - AMD_shader_atomic_counter_ops = true; - extensions.Remove("glAMD_shader_atomic_counter_ops"); - } - if (extensions.Contains("gl_AMD_shader_ballot")) - { - AMD_shader_ballot = true; - extensions.Remove("glAMD_shader_ballot"); - } - if (extensions.Contains("gl_AMD_shader_explicit_vertex_parameter")) - { - AMD_shader_explicit_vertex_parameter = true; - extensions.Remove("glAMD_shader_explicit_vertex_parameter"); - } - if (extensions.Contains("gl_AMD_shader_gpu_shader_half_float_fetch")) - { - AMD_shader_gpu_shader_half_float_fetch = true; - extensions.Remove("glAMD_shader_gpu_shader_half_float_fetch"); - } - if (extensions.Contains("gl_AMD_shader_image_load_store_lod")) - { - AMD_shader_image_load_store_lod = true; - extensions.Remove("glAMD_shader_image_load_store_lod"); - } - if (extensions.Contains("gl_AMD_shader_stencil_export")) - { - AMD_shader_stencil_export = true; - extensions.Remove("glAMD_shader_stencil_export"); - } - if (extensions.Contains("gl_AMD_shader_trinary_minmax")) - { - AMD_shader_trinary_minmax = true; - extensions.Remove("glAMD_shader_trinary_minmax"); - } - if (extensions.Contains("gl_AMD_sparse_texture")) - { - AMD_sparse_texture = true; - extensions.Remove("glAMD_sparse_texture"); - } - if (extensions.Contains("gl_AMD_stencil_operation_extended")) - { - AMD_stencil_operation_extended = true; - extensions.Remove("glAMD_stencil_operation_extended"); - } - if (extensions.Contains("gl_AMD_texture_gather_bias_lod")) - { - AMD_texture_gather_bias_lod = true; - extensions.Remove("glAMD_texture_gather_bias_lod"); - } - if (extensions.Contains("gl_AMD_texture_texture4")) - { - AMD_texture_texture4 = true; - extensions.Remove("glAMD_texture_texture4"); - } - if (extensions.Contains("gl_AMD_transform_feedback3_lines_triangles")) - { - AMD_transform_feedback3_lines_triangles = true; - extensions.Remove("glAMD_transform_feedback3_lines_triangles"); - } - if (extensions.Contains("gl_AMD_transform_feedback4")) - { - AMD_transform_feedback4 = true; - extensions.Remove("glAMD_transform_feedback4"); - } - if (extensions.Contains("gl_AMD_vertex_shader_layer")) - { - AMD_vertex_shader_layer = true; - extensions.Remove("glAMD_vertex_shader_layer"); - } - if (extensions.Contains("gl_AMD_vertex_shader_tessellator")) - { - AMD_vertex_shader_tessellator = true; - extensions.Remove("glAMD_vertex_shader_tessellator"); - } - if (extensions.Contains("gl_AMD_vertex_shader_viewport_index")) - { - AMD_vertex_shader_viewport_index = true; - extensions.Remove("glAMD_vertex_shader_viewport_index"); - } - if (extensions.Contains("gl_APPLE_aux_depth_stencil")) - { - APPLE_aux_depth_stencil = true; - extensions.Remove("glAPPLE_aux_depth_stencil"); - } - if (extensions.Contains("gl_APPLE_client_storage")) - { - APPLE_client_storage = true; - extensions.Remove("glAPPLE_client_storage"); - } - if (extensions.Contains("gl_APPLE_element_array")) - { - APPLE_element_array = true; - extensions.Remove("glAPPLE_element_array"); - } - if (extensions.Contains("gl_APPLE_fence")) - { - APPLE_fence = true; - extensions.Remove("glAPPLE_fence"); - } - if (extensions.Contains("gl_APPLE_float_pixels")) - { - APPLE_float_pixels = true; - extensions.Remove("glAPPLE_float_pixels"); - } - if (extensions.Contains("gl_APPLE_flush_buffer_range")) - { - APPLE_flush_buffer_range = true; - extensions.Remove("glAPPLE_flush_buffer_range"); - } - if (extensions.Contains("gl_APPLE_object_purgeable")) - { - APPLE_object_purgeable = true; - extensions.Remove("glAPPLE_object_purgeable"); - } - if (extensions.Contains("gl_APPLE_rgb_422")) - { - APPLE_rgb_422 = true; - extensions.Remove("glAPPLE_rgb_422"); - } - if (extensions.Contains("gl_APPLE_row_bytes")) - { - APPLE_row_bytes = true; - extensions.Remove("glAPPLE_row_bytes"); - } - if (extensions.Contains("gl_APPLE_specular_vector")) - { - APPLE_specular_vector = true; - extensions.Remove("glAPPLE_specular_vector"); - } - if (extensions.Contains("gl_APPLE_texture_range")) - { - APPLE_texture_range = true; - extensions.Remove("glAPPLE_texture_range"); - } - if (extensions.Contains("gl_APPLE_transform_hint")) - { - APPLE_transform_hint = true; - extensions.Remove("glAPPLE_transform_hint"); - } - if (extensions.Contains("gl_APPLE_vertex_array_object")) - { - APPLE_vertex_array_object = true; - extensions.Remove("glAPPLE_vertex_array_object"); - } - if (extensions.Contains("gl_APPLE_vertex_array_range")) - { - APPLE_vertex_array_range = true; - extensions.Remove("glAPPLE_vertex_array_range"); - } - if (extensions.Contains("gl_APPLE_vertex_program_evaluators")) - { - APPLE_vertex_program_evaluators = true; - extensions.Remove("glAPPLE_vertex_program_evaluators"); - } - if (extensions.Contains("gl_APPLE_ycbcr_422")) - { - APPLE_ycbcr_422 = true; - extensions.Remove("glAPPLE_ycbcr_422"); - } - if (extensions.Contains("gl_ARB_ES2_compatibility")) - { - ARB_ES2_compatibility = true; - extensions.Remove("glARB_ES2_compatibility"); - } - if (extensions.Contains("gl_ARB_ES3_1_compatibility")) - { - ARB_ES3_1_compatibility = true; - extensions.Remove("glARB_ES3_1_compatibility"); - } - if (extensions.Contains("gl_ARB_ES3_2_compatibility")) - { - ARB_ES3_2_compatibility = true; - extensions.Remove("glARB_ES3_2_compatibility"); - } - if (extensions.Contains("gl_ARB_ES3_compatibility")) - { - ARB_ES3_compatibility = true; - extensions.Remove("glARB_ES3_compatibility"); - } - if (extensions.Contains("gl_ARB_arrays_of_arrays")) - { - ARB_arrays_of_arrays = true; - extensions.Remove("glARB_arrays_of_arrays"); - } - if (extensions.Contains("gl_ARB_base_instance")) - { - ARB_base_instance = true; - extensions.Remove("glARB_base_instance"); - } - if (extensions.Contains("gl_ARB_bindless_texture")) - { - ARB_bindless_texture = true; - extensions.Remove("glARB_bindless_texture"); - } - if (extensions.Contains("gl_ARB_blend_func_extended")) - { - ARB_blend_func_extended = true; - extensions.Remove("glARB_blend_func_extended"); - } - if (extensions.Contains("gl_ARB_buffer_storage")) - { - ARB_buffer_storage = true; - extensions.Remove("glARB_buffer_storage"); - } - if (extensions.Contains("gl_ARB_cl_event")) - { - ARB_cl_event = true; - extensions.Remove("glARB_cl_event"); - } - if (extensions.Contains("gl_ARB_clear_buffer_object")) - { - ARB_clear_buffer_object = true; - extensions.Remove("glARB_clear_buffer_object"); - } - if (extensions.Contains("gl_ARB_clear_texture")) - { - ARB_clear_texture = true; - extensions.Remove("glARB_clear_texture"); - } - if (extensions.Contains("gl_ARB_clip_control")) - { - ARB_clip_control = true; - extensions.Remove("glARB_clip_control"); - } - if (extensions.Contains("gl_ARB_color_buffer_float")) - { - ARB_color_buffer_float = true; - extensions.Remove("glARB_color_buffer_float"); - } - if (extensions.Contains("gl_ARB_compatibility")) - { - ARB_compatibility = true; - extensions.Remove("glARB_compatibility"); - } - if (extensions.Contains("gl_ARB_compressed_texture_pixel_storage")) - { - ARB_compressed_texture_pixel_storage = true; - extensions.Remove("glARB_compressed_texture_pixel_storage"); - } - if (extensions.Contains("gl_ARB_compute_shader")) - { - ARB_compute_shader = true; - extensions.Remove("glARB_compute_shader"); - } - if (extensions.Contains("gl_ARB_compute_variable_group_size")) - { - ARB_compute_variable_group_size = true; - extensions.Remove("glARB_compute_variable_group_size"); - } - if (extensions.Contains("gl_ARB_conditional_render_inverted")) - { - ARB_conditional_render_inverted = true; - extensions.Remove("glARB_conditional_render_inverted"); - } - if (extensions.Contains("gl_ARB_conservative_depth")) - { - ARB_conservative_depth = true; - extensions.Remove("glARB_conservative_depth"); - } - if (extensions.Contains("gl_ARB_copy_buffer")) - { - ARB_copy_buffer = true; - extensions.Remove("glARB_copy_buffer"); - } - if (extensions.Contains("gl_ARB_copy_image")) - { - ARB_copy_image = true; - extensions.Remove("glARB_copy_image"); - } - if (extensions.Contains("gl_ARB_cull_distance")) - { - ARB_cull_distance = true; - extensions.Remove("glARB_cull_distance"); - } - if (extensions.Contains("gl_ARB_debug_output")) - { - ARB_debug_output = true; - extensions.Remove("glARB_debug_output"); - } - if (extensions.Contains("gl_ARB_depth_buffer_float")) - { - ARB_depth_buffer_float = true; - extensions.Remove("glARB_depth_buffer_float"); - } - if (extensions.Contains("gl_ARB_depth_clamp")) - { - ARB_depth_clamp = true; - extensions.Remove("glARB_depth_clamp"); - } - if (extensions.Contains("gl_ARB_depth_texture")) - { - ARB_depth_texture = true; - extensions.Remove("glARB_depth_texture"); - } - if (extensions.Contains("gl_ARB_derivative_control")) - { - ARB_derivative_control = true; - extensions.Remove("glARB_derivative_control"); - } - if (extensions.Contains("gl_ARB_direct_state_access")) - { - ARB_direct_state_access = true; - extensions.Remove("glARB_direct_state_access"); - } - if (extensions.Contains("gl_ARB_draw_buffers")) - { - ARB_draw_buffers = true; - extensions.Remove("glARB_draw_buffers"); - } - if (extensions.Contains("gl_ARB_draw_buffers_blend")) - { - ARB_draw_buffers_blend = true; - extensions.Remove("glARB_draw_buffers_blend"); - } - if (extensions.Contains("gl_ARB_draw_elements_base_vertex")) - { - ARB_draw_elements_base_vertex = true; - extensions.Remove("glARB_draw_elements_base_vertex"); - } - if (extensions.Contains("gl_ARB_draw_indirect")) - { - ARB_draw_indirect = true; - extensions.Remove("glARB_draw_indirect"); - } - if (extensions.Contains("gl_ARB_draw_instanced")) - { - ARB_draw_instanced = true; - extensions.Remove("glARB_draw_instanced"); - } - if (extensions.Contains("gl_ARB_enhanced_layouts")) - { - ARB_enhanced_layouts = true; - extensions.Remove("glARB_enhanced_layouts"); - } - if (extensions.Contains("gl_ARB_explicit_attrib_location")) - { - ARB_explicit_attrib_location = true; - extensions.Remove("glARB_explicit_attrib_location"); - } - if (extensions.Contains("gl_ARB_explicit_uniform_location")) - { - ARB_explicit_uniform_location = true; - extensions.Remove("glARB_explicit_uniform_location"); - } - if (extensions.Contains("gl_ARB_fragment_coord_conventions")) - { - ARB_fragment_coord_conventions = true; - extensions.Remove("glARB_fragment_coord_conventions"); - } - if (extensions.Contains("gl_ARB_fragment_layer_viewport")) - { - ARB_fragment_layer_viewport = true; - extensions.Remove("glARB_fragment_layer_viewport"); - } - if (extensions.Contains("gl_ARB_fragment_program")) - { - ARB_fragment_program = true; - extensions.Remove("glARB_fragment_program"); - } - if (extensions.Contains("gl_ARB_fragment_program_shadow")) - { - ARB_fragment_program_shadow = true; - extensions.Remove("glARB_fragment_program_shadow"); - } - if (extensions.Contains("gl_ARB_fragment_shader")) - { - ARB_fragment_shader = true; - extensions.Remove("glARB_fragment_shader"); - } - if (extensions.Contains("gl_ARB_fragment_shader_interlock")) - { - ARB_fragment_shader_interlock = true; - extensions.Remove("glARB_fragment_shader_interlock"); - } - if (extensions.Contains("gl_ARB_framebuffer_no_attachments")) - { - ARB_framebuffer_no_attachments = true; - extensions.Remove("glARB_framebuffer_no_attachments"); - } - if (extensions.Contains("gl_ARB_framebuffer_object")) - { - ARB_framebuffer_object = true; - extensions.Remove("glARB_framebuffer_object"); - } - if (extensions.Contains("gl_ARB_framebuffer_sRGB")) - { - ARB_framebuffer_sRGB = true; - extensions.Remove("glARB_framebuffer_sRGB"); - } - if (extensions.Contains("gl_ARB_geometry_shader4")) - { - ARB_geometry_shader4 = true; - extensions.Remove("glARB_geometry_shader4"); - } - if (extensions.Contains("gl_ARB_get_program_binary")) - { - ARB_get_program_binary = true; - extensions.Remove("glARB_get_program_binary"); - } - if (extensions.Contains("gl_ARB_get_texture_sub_image")) - { - ARB_get_texture_sub_image = true; - extensions.Remove("glARB_get_texture_sub_image"); - } - if (extensions.Contains("gl_ARB_gl_spirv")) - { - ARB_gl_spirv = true; - extensions.Remove("glARB_gl_spirv"); - } - if (extensions.Contains("gl_ARB_gpu_shader5")) - { - ARB_gpu_shader5 = true; - extensions.Remove("glARB_gpu_shader5"); - } - if (extensions.Contains("gl_ARB_gpu_shader_fp64")) - { - ARB_gpu_shader_fp64 = true; - extensions.Remove("glARB_gpu_shader_fp64"); - } - if (extensions.Contains("gl_ARB_gpu_shader_int64")) - { - ARB_gpu_shader_int64 = true; - extensions.Remove("glARB_gpu_shader_int64"); - } - if (extensions.Contains("gl_ARB_half_float_pixel")) - { - ARB_half_float_pixel = true; - extensions.Remove("glARB_half_float_pixel"); - } - if (extensions.Contains("gl_ARB_half_float_vertex")) - { - ARB_half_float_vertex = true; - extensions.Remove("glARB_half_float_vertex"); - } - if (extensions.Contains("gl_ARB_imaging")) - { - ARB_imaging = true; - extensions.Remove("glARB_imaging"); - } - if (extensions.Contains("gl_ARB_indirect_parameters")) - { - ARB_indirect_parameters = true; - extensions.Remove("glARB_indirect_parameters"); - } - if (extensions.Contains("gl_ARB_instanced_arrays")) - { - ARB_instanced_arrays = true; - extensions.Remove("glARB_instanced_arrays"); - } - if (extensions.Contains("gl_ARB_internalformat_query")) - { - ARB_internalformat_query = true; - extensions.Remove("glARB_internalformat_query"); - } - if (extensions.Contains("gl_ARB_internalformat_query2")) - { - ARB_internalformat_query2 = true; - extensions.Remove("glARB_internalformat_query2"); - } - if (extensions.Contains("gl_ARB_invalidate_subdata")) - { - ARB_invalidate_subdata = true; - extensions.Remove("glARB_invalidate_subdata"); - } - if (extensions.Contains("gl_ARB_map_buffer_alignment")) - { - ARB_map_buffer_alignment = true; - extensions.Remove("glARB_map_buffer_alignment"); - } - if (extensions.Contains("gl_ARB_map_buffer_range")) - { - ARB_map_buffer_range = true; - extensions.Remove("glARB_map_buffer_range"); - } - if (extensions.Contains("gl_ARB_matrix_palette")) - { - ARB_matrix_palette = true; - extensions.Remove("glARB_matrix_palette"); - } - if (extensions.Contains("gl_ARB_multi_bind")) - { - ARB_multi_bind = true; - extensions.Remove("glARB_multi_bind"); - } - if (extensions.Contains("gl_ARB_multi_draw_indirect")) - { - ARB_multi_draw_indirect = true; - extensions.Remove("glARB_multi_draw_indirect"); - } - if (extensions.Contains("gl_ARB_multisample")) - { - ARB_multisample = true; - extensions.Remove("glARB_multisample"); - } - if (extensions.Contains("gl_ARB_multitexture")) - { - ARB_multitexture = true; - extensions.Remove("glARB_multitexture"); - } - if (extensions.Contains("gl_ARB_occlusion_query")) - { - ARB_occlusion_query = true; - extensions.Remove("glARB_occlusion_query"); - } - if (extensions.Contains("gl_ARB_occlusion_query2")) - { - ARB_occlusion_query2 = true; - extensions.Remove("glARB_occlusion_query2"); - } - if (extensions.Contains("gl_ARB_parallel_shader_compile")) - { - ARB_parallel_shader_compile = true; - extensions.Remove("glARB_parallel_shader_compile"); - } - if (extensions.Contains("gl_ARB_pipeline_statistics_query")) - { - ARB_pipeline_statistics_query = true; - extensions.Remove("glARB_pipeline_statistics_query"); - } - if (extensions.Contains("gl_ARB_pixel_buffer_object")) - { - ARB_pixel_buffer_object = true; - extensions.Remove("glARB_pixel_buffer_object"); - } - if (extensions.Contains("gl_ARB_point_parameters")) - { - ARB_point_parameters = true; - extensions.Remove("glARB_point_parameters"); - } - if (extensions.Contains("gl_ARB_point_sprite")) - { - ARB_point_sprite = true; - extensions.Remove("glARB_point_sprite"); - } - if (extensions.Contains("gl_ARB_polygon_offset_clamp")) - { - ARB_polygon_offset_clamp = true; - extensions.Remove("glARB_polygon_offset_clamp"); - } - if (extensions.Contains("gl_ARB_post_depth_coverage")) - { - ARB_post_depth_coverage = true; - extensions.Remove("glARB_post_depth_coverage"); - } - if (extensions.Contains("gl_ARB_program_interface_query")) - { - ARB_program_interface_query = true; - extensions.Remove("glARB_program_interface_query"); - } - if (extensions.Contains("gl_ARB_provoking_vertex")) - { - ARB_provoking_vertex = true; - extensions.Remove("glARB_provoking_vertex"); - } - if (extensions.Contains("gl_ARB_query_buffer_object")) - { - ARB_query_buffer_object = true; - extensions.Remove("glARB_query_buffer_object"); - } - if (extensions.Contains("gl_ARB_robust_buffer_access_behavior")) - { - ARB_robust_buffer_access_behavior = true; - extensions.Remove("glARB_robust_buffer_access_behavior"); - } - if (extensions.Contains("gl_ARB_robustness")) - { - ARB_robustness = true; - extensions.Remove("glARB_robustness"); - } - if (extensions.Contains("gl_ARB_robustness_isolation")) - { - ARB_robustness_isolation = true; - extensions.Remove("glARB_robustness_isolation"); - } - if (extensions.Contains("gl_ARB_sample_locations")) - { - ARB_sample_locations = true; - extensions.Remove("glARB_sample_locations"); - } - if (extensions.Contains("gl_ARB_sample_shading")) - { - ARB_sample_shading = true; - extensions.Remove("glARB_sample_shading"); - } - if (extensions.Contains("gl_ARB_sampler_objects")) - { - ARB_sampler_objects = true; - extensions.Remove("glARB_sampler_objects"); - } - if (extensions.Contains("gl_ARB_seamless_cube_map")) - { - ARB_seamless_cube_map = true; - extensions.Remove("glARB_seamless_cube_map"); - } - if (extensions.Contains("gl_ARB_seamless_cubemap_per_texture")) - { - ARB_seamless_cubemap_per_texture = true; - extensions.Remove("glARB_seamless_cubemap_per_texture"); - } - if (extensions.Contains("gl_ARB_separate_shader_objects")) - { - ARB_separate_shader_objects = true; - extensions.Remove("glARB_separate_shader_objects"); - } - if (extensions.Contains("gl_ARB_shader_atomic_counter_ops")) - { - ARB_shader_atomic_counter_ops = true; - extensions.Remove("glARB_shader_atomic_counter_ops"); - } - if (extensions.Contains("gl_ARB_shader_atomic_counters")) - { - ARB_shader_atomic_counters = true; - extensions.Remove("glARB_shader_atomic_counters"); - } - if (extensions.Contains("gl_ARB_shader_ballot")) - { - ARB_shader_ballot = true; - extensions.Remove("glARB_shader_ballot"); - } - if (extensions.Contains("gl_ARB_shader_bit_encoding")) - { - ARB_shader_bit_encoding = true; - extensions.Remove("glARB_shader_bit_encoding"); - } - if (extensions.Contains("gl_ARB_shader_clock")) - { - ARB_shader_clock = true; - extensions.Remove("glARB_shader_clock"); - } - if (extensions.Contains("gl_ARB_shader_draw_parameters")) - { - ARB_shader_draw_parameters = true; - extensions.Remove("glARB_shader_draw_parameters"); - } - if (extensions.Contains("gl_ARB_shader_group_vote")) - { - ARB_shader_group_vote = true; - extensions.Remove("glARB_shader_group_vote"); - } - if (extensions.Contains("gl_ARB_shader_image_load_store")) - { - ARB_shader_image_load_store = true; - extensions.Remove("glARB_shader_image_load_store"); - } - if (extensions.Contains("gl_ARB_shader_image_size")) - { - ARB_shader_image_size = true; - extensions.Remove("glARB_shader_image_size"); - } - if (extensions.Contains("gl_ARB_shader_objects")) - { - ARB_shader_objects = true; - extensions.Remove("glARB_shader_objects"); - } - if (extensions.Contains("gl_ARB_shader_precision")) - { - ARB_shader_precision = true; - extensions.Remove("glARB_shader_precision"); - } - if (extensions.Contains("gl_ARB_shader_stencil_export")) - { - ARB_shader_stencil_export = true; - extensions.Remove("glARB_shader_stencil_export"); - } - if (extensions.Contains("gl_ARB_shader_storage_buffer_object")) - { - ARB_shader_storage_buffer_object = true; - extensions.Remove("glARB_shader_storage_buffer_object"); - } - if (extensions.Contains("gl_ARB_shader_subroutine")) - { - ARB_shader_subroutine = true; - extensions.Remove("glARB_shader_subroutine"); - } - if (extensions.Contains("gl_ARB_shader_texture_image_samples")) - { - ARB_shader_texture_image_samples = true; - extensions.Remove("glARB_shader_texture_image_samples"); - } - if (extensions.Contains("gl_ARB_shader_texture_lod")) - { - ARB_shader_texture_lod = true; - extensions.Remove("glARB_shader_texture_lod"); - } - if (extensions.Contains("gl_ARB_shader_viewport_layer_array")) - { - ARB_shader_viewport_layer_array = true; - extensions.Remove("glARB_shader_viewport_layer_array"); - } - if (extensions.Contains("gl_ARB_shading_language_100")) - { - ARB_shading_language_100 = true; - extensions.Remove("glARB_shading_language_100"); - } - if (extensions.Contains("gl_ARB_shading_language_420pack")) - { - ARB_shading_language_420pack = true; - extensions.Remove("glARB_shading_language_420pack"); - } - if (extensions.Contains("gl_ARB_shading_language_include")) - { - ARB_shading_language_include = true; - extensions.Remove("glARB_shading_language_include"); - } - if (extensions.Contains("gl_ARB_shading_language_packing")) - { - ARB_shading_language_packing = true; - extensions.Remove("glARB_shading_language_packing"); - } - if (extensions.Contains("gl_ARB_shadow")) - { - ARB_shadow = true; - extensions.Remove("glARB_shadow"); - } - if (extensions.Contains("gl_ARB_shadow_ambient")) - { - ARB_shadow_ambient = true; - extensions.Remove("glARB_shadow_ambient"); - } - if (extensions.Contains("gl_ARB_sparse_buffer")) - { - ARB_sparse_buffer = true; - extensions.Remove("glARB_sparse_buffer"); - } - if (extensions.Contains("gl_ARB_sparse_texture")) - { - ARB_sparse_texture = true; - extensions.Remove("glARB_sparse_texture"); - } - if (extensions.Contains("gl_ARB_sparse_texture2")) - { - ARB_sparse_texture2 = true; - extensions.Remove("glARB_sparse_texture2"); - } - if (extensions.Contains("gl_ARB_sparse_texture_clamp")) - { - ARB_sparse_texture_clamp = true; - extensions.Remove("glARB_sparse_texture_clamp"); - } - if (extensions.Contains("gl_ARB_spirv_extensions")) - { - ARB_spirv_extensions = true; - extensions.Remove("glARB_spirv_extensions"); - } - if (extensions.Contains("gl_ARB_stencil_texturing")) - { - ARB_stencil_texturing = true; - extensions.Remove("glARB_stencil_texturing"); - } - if (extensions.Contains("gl_ARB_sync")) - { - ARB_sync = true; - extensions.Remove("glARB_sync"); - } - if (extensions.Contains("gl_ARB_tessellation_shader")) - { - ARB_tessellation_shader = true; - extensions.Remove("glARB_tessellation_shader"); - } - if (extensions.Contains("gl_ARB_texture_barrier")) - { - ARB_texture_barrier = true; - extensions.Remove("glARB_texture_barrier"); - } - if (extensions.Contains("gl_ARB_texture_border_clamp")) - { - ARB_texture_border_clamp = true; - extensions.Remove("glARB_texture_border_clamp"); - } - if (extensions.Contains("gl_ARB_texture_buffer_object")) - { - ARB_texture_buffer_object = true; - extensions.Remove("glARB_texture_buffer_object"); - } - if (extensions.Contains("gl_ARB_texture_buffer_object_rgb32")) - { - ARB_texture_buffer_object_rgb32 = true; - extensions.Remove("glARB_texture_buffer_object_rgb32"); - } - if (extensions.Contains("gl_ARB_texture_buffer_range")) - { - ARB_texture_buffer_range = true; - extensions.Remove("glARB_texture_buffer_range"); - } - if (extensions.Contains("gl_ARB_texture_compression")) - { - ARB_texture_compression = true; - extensions.Remove("glARB_texture_compression"); - } - if (extensions.Contains("gl_ARB_texture_compression_bptc")) - { - ARB_texture_compression_bptc = true; - extensions.Remove("glARB_texture_compression_bptc"); - } - if (extensions.Contains("gl_ARB_texture_compression_rgtc")) - { - ARB_texture_compression_rgtc = true; - extensions.Remove("glARB_texture_compression_rgtc"); - } - if (extensions.Contains("gl_ARB_texture_cube_map")) - { - ARB_texture_cube_map = true; - extensions.Remove("glARB_texture_cube_map"); - } - if (extensions.Contains("gl_ARB_texture_cube_map_array")) - { - ARB_texture_cube_map_array = true; - extensions.Remove("glARB_texture_cube_map_array"); - } - if (extensions.Contains("gl_ARB_texture_env_add")) - { - ARB_texture_env_add = true; - extensions.Remove("glARB_texture_env_add"); - } - if (extensions.Contains("gl_ARB_texture_env_combine")) - { - ARB_texture_env_combine = true; - extensions.Remove("glARB_texture_env_combine"); - } - if (extensions.Contains("gl_ARB_texture_env_crossbar")) - { - ARB_texture_env_crossbar = true; - extensions.Remove("glARB_texture_env_crossbar"); - } - if (extensions.Contains("gl_ARB_texture_env_dot3")) - { - ARB_texture_env_dot3 = true; - extensions.Remove("glARB_texture_env_dot3"); - } - if (extensions.Contains("gl_ARB_texture_filter_anisotropic")) - { - ARB_texture_filter_anisotropic = true; - extensions.Remove("glARB_texture_filter_anisotropic"); - } - if (extensions.Contains("gl_ARB_texture_filter_minmax")) - { - ARB_texture_filter_minmax = true; - extensions.Remove("glARB_texture_filter_minmax"); - } - if (extensions.Contains("gl_ARB_texture_float")) - { - ARB_texture_float = true; - extensions.Remove("glARB_texture_float"); - } - if (extensions.Contains("gl_ARB_texture_gather")) - { - ARB_texture_gather = true; - extensions.Remove("glARB_texture_gather"); - } - if (extensions.Contains("gl_ARB_texture_mirror_clamp_to_edge")) - { - ARB_texture_mirror_clamp_to_edge = true; - extensions.Remove("glARB_texture_mirror_clamp_to_edge"); - } - if (extensions.Contains("gl_ARB_texture_mirrored_repeat")) - { - ARB_texture_mirrored_repeat = true; - extensions.Remove("glARB_texture_mirrored_repeat"); - } - if (extensions.Contains("gl_ARB_texture_multisample")) - { - ARB_texture_multisample = true; - extensions.Remove("glARB_texture_multisample"); - } - if (extensions.Contains("gl_ARB_texture_non_power_of_two")) - { - ARB_texture_non_power_of_two = true; - extensions.Remove("glARB_texture_non_power_of_two"); - } - if (extensions.Contains("gl_ARB_texture_query_levels")) - { - ARB_texture_query_levels = true; - extensions.Remove("glARB_texture_query_levels"); - } - if (extensions.Contains("gl_ARB_texture_query_lod")) - { - ARB_texture_query_lod = true; - extensions.Remove("glARB_texture_query_lod"); - } - if (extensions.Contains("gl_ARB_texture_rectangle")) - { - ARB_texture_rectangle = true; - extensions.Remove("glARB_texture_rectangle"); - } - if (extensions.Contains("gl_ARB_texture_rg")) - { - ARB_texture_rg = true; - extensions.Remove("glARB_texture_rg"); - } - if (extensions.Contains("gl_ARB_texture_rgb10_a2ui")) - { - ARB_texture_rgb10_a2ui = true; - extensions.Remove("glARB_texture_rgb10_a2ui"); - } - if (extensions.Contains("gl_ARB_texture_stencil8")) - { - ARB_texture_stencil8 = true; - extensions.Remove("glARB_texture_stencil8"); - } - if (extensions.Contains("gl_ARB_texture_storage")) - { - ARB_texture_storage = true; - extensions.Remove("glARB_texture_storage"); - } - if (extensions.Contains("gl_ARB_texture_storage_multisample")) - { - ARB_texture_storage_multisample = true; - extensions.Remove("glARB_texture_storage_multisample"); - } - if (extensions.Contains("gl_ARB_texture_swizzle")) - { - ARB_texture_swizzle = true; - extensions.Remove("glARB_texture_swizzle"); - } - if (extensions.Contains("gl_ARB_texture_view")) - { - ARB_texture_view = true; - extensions.Remove("glARB_texture_view"); - } - if (extensions.Contains("gl_ARB_timer_query")) - { - ARB_timer_query = true; - extensions.Remove("glARB_timer_query"); - } - if (extensions.Contains("gl_ARB_transform_feedback2")) - { - ARB_transform_feedback2 = true; - extensions.Remove("glARB_transform_feedback2"); - } - if (extensions.Contains("gl_ARB_transform_feedback3")) - { - ARB_transform_feedback3 = true; - extensions.Remove("glARB_transform_feedback3"); - } - if (extensions.Contains("gl_ARB_transform_feedback_instanced")) - { - ARB_transform_feedback_instanced = true; - extensions.Remove("glARB_transform_feedback_instanced"); - } - if (extensions.Contains("gl_ARB_transform_feedback_overflow_query")) - { - ARB_transform_feedback_overflow_query = true; - extensions.Remove("glARB_transform_feedback_overflow_query"); - } - if (extensions.Contains("gl_ARB_transpose_matrix")) - { - ARB_transpose_matrix = true; - extensions.Remove("glARB_transpose_matrix"); - } - if (extensions.Contains("gl_ARB_uniform_buffer_object")) - { - ARB_uniform_buffer_object = true; - extensions.Remove("glARB_uniform_buffer_object"); - } - if (extensions.Contains("gl_ARB_vertex_array_bgra")) - { - ARB_vertex_array_bgra = true; - extensions.Remove("glARB_vertex_array_bgra"); - } - if (extensions.Contains("gl_ARB_vertex_array_object")) - { - ARB_vertex_array_object = true; - extensions.Remove("glARB_vertex_array_object"); - } - if (extensions.Contains("gl_ARB_vertex_attrib_64bit")) - { - ARB_vertex_attrib_64bit = true; - extensions.Remove("glARB_vertex_attrib_64bit"); - } - if (extensions.Contains("gl_ARB_vertex_attrib_binding")) - { - ARB_vertex_attrib_binding = true; - extensions.Remove("glARB_vertex_attrib_binding"); - } - if (extensions.Contains("gl_ARB_vertex_blend")) - { - ARB_vertex_blend = true; - extensions.Remove("glARB_vertex_blend"); - } - if (extensions.Contains("gl_ARB_vertex_buffer_object")) - { - ARB_vertex_buffer_object = true; - extensions.Remove("glARB_vertex_buffer_object"); - } - if (extensions.Contains("gl_ARB_vertex_program")) - { - ARB_vertex_program = true; - extensions.Remove("glARB_vertex_program"); - } - if (extensions.Contains("gl_ARB_vertex_shader")) - { - ARB_vertex_shader = true; - extensions.Remove("glARB_vertex_shader"); - } - if (extensions.Contains("gl_ARB_vertex_type_10f_11f_11f_rev")) - { - ARB_vertex_type_10f_11f_11f_rev = true; - extensions.Remove("glARB_vertex_type_10f_11f_11f_rev"); - } - if (extensions.Contains("gl_ARB_vertex_type_2_10_10_10_rev")) - { - ARB_vertex_type_2_10_10_10_rev = true; - extensions.Remove("glARB_vertex_type_2_10_10_10_rev"); - } - if (extensions.Contains("gl_ARB_viewport_array")) - { - ARB_viewport_array = true; - extensions.Remove("glARB_viewport_array"); - } - if (extensions.Contains("gl_ARB_window_pos")) - { - ARB_window_pos = true; - extensions.Remove("glARB_window_pos"); - } - if (extensions.Contains("gl_ATI_draw_buffers")) - { - ATI_draw_buffers = true; - extensions.Remove("glATI_draw_buffers"); - } - if (extensions.Contains("gl_ATI_element_array")) - { - ATI_element_array = true; - extensions.Remove("glATI_element_array"); - } - if (extensions.Contains("gl_ATI_envmap_bumpmap")) - { - ATI_envmap_bumpmap = true; - extensions.Remove("glATI_envmap_bumpmap"); - } - if (extensions.Contains("gl_ATI_fragment_shader")) - { - ATI_fragment_shader = true; - extensions.Remove("glATI_fragment_shader"); - } - if (extensions.Contains("gl_ATI_map_object_buffer")) - { - ATI_map_object_buffer = true; - extensions.Remove("glATI_map_object_buffer"); - } - if (extensions.Contains("gl_ATI_meminfo")) - { - ATI_meminfo = true; - extensions.Remove("glATI_meminfo"); - } - if (extensions.Contains("gl_ATI_pixel_format_float")) - { - ATI_pixel_format_float = true; - extensions.Remove("glATI_pixel_format_float"); - } - if (extensions.Contains("gl_ATI_pn_triangles")) - { - ATI_pn_triangles = true; - extensions.Remove("glATI_pn_triangles"); - } - if (extensions.Contains("gl_ATI_separate_stencil")) - { - ATI_separate_stencil = true; - extensions.Remove("glATI_separate_stencil"); - } - if (extensions.Contains("gl_ATI_text_fragment_shader")) - { - ATI_text_fragment_shader = true; - extensions.Remove("glATI_text_fragment_shader"); - } - if (extensions.Contains("gl_ATI_texture_env_combine3")) - { - ATI_texture_env_combine3 = true; - extensions.Remove("glATI_texture_env_combine3"); - } - if (extensions.Contains("gl_ATI_texture_float")) - { - ATI_texture_float = true; - extensions.Remove("glATI_texture_float"); - } - if (extensions.Contains("gl_ATI_texture_mirror_once")) - { - ATI_texture_mirror_once = true; - extensions.Remove("glATI_texture_mirror_once"); - } - if (extensions.Contains("gl_ATI_vertex_array_object")) - { - ATI_vertex_array_object = true; - extensions.Remove("glATI_vertex_array_object"); - } - if (extensions.Contains("gl_ATI_vertex_attrib_array_object")) - { - ATI_vertex_attrib_array_object = true; - extensions.Remove("glATI_vertex_attrib_array_object"); - } - if (extensions.Contains("gl_ATI_vertex_streams")) - { - ATI_vertex_streams = true; - extensions.Remove("glATI_vertex_streams"); - } - if (extensions.Contains("gl_EXT_422_pixels")) - { - EXT_422_pixels = true; - extensions.Remove("glEXT_422_pixels"); - } - if (extensions.Contains("gl_EXT_EGL_image_storage")) - { - EXT_EGL_image_storage = true; - extensions.Remove("glEXT_EGL_image_storage"); - } - if (extensions.Contains("gl_EXT_EGL_sync")) - { - EXT_EGL_sync = true; - extensions.Remove("glEXT_EGL_sync"); - } - if (extensions.Contains("gl_EXT_abgr")) - { - EXT_abgr = true; - extensions.Remove("glEXT_abgr"); - } - if (extensions.Contains("gl_EXT_bgra")) - { - EXT_bgra = true; - extensions.Remove("glEXT_bgra"); - } - if (extensions.Contains("gl_EXT_bindable_uniform")) - { - EXT_bindable_uniform = true; - extensions.Remove("glEXT_bindable_uniform"); - } - if (extensions.Contains("gl_EXT_blend_color")) - { - EXT_blend_color = true; - extensions.Remove("glEXT_blend_color"); - } - if (extensions.Contains("gl_EXT_blend_equation_separate")) - { - EXT_blend_equation_separate = true; - extensions.Remove("glEXT_blend_equation_separate"); - } - if (extensions.Contains("gl_EXT_blend_func_separate")) - { - EXT_blend_func_separate = true; - extensions.Remove("glEXT_blend_func_separate"); - } - if (extensions.Contains("gl_EXT_blend_logic_op")) - { - EXT_blend_logic_op = true; - extensions.Remove("glEXT_blend_logic_op"); - } - if (extensions.Contains("gl_EXT_blend_minmax")) - { - EXT_blend_minmax = true; - extensions.Remove("glEXT_blend_minmax"); - } - if (extensions.Contains("gl_EXT_blend_subtract")) - { - EXT_blend_subtract = true; - extensions.Remove("glEXT_blend_subtract"); - } - if (extensions.Contains("gl_EXT_clip_volume_hint")) - { - EXT_clip_volume_hint = true; - extensions.Remove("glEXT_clip_volume_hint"); - } - if (extensions.Contains("gl_EXT_cmyka")) - { - EXT_cmyka = true; - extensions.Remove("glEXT_cmyka"); - } - if (extensions.Contains("gl_EXT_color_subtable")) - { - EXT_color_subtable = true; - extensions.Remove("glEXT_color_subtable"); - } - if (extensions.Contains("gl_EXT_compiled_vertex_array")) - { - EXT_compiled_vertex_array = true; - extensions.Remove("glEXT_compiled_vertex_array"); - } - if (extensions.Contains("gl_EXT_convolution")) - { - EXT_convolution = true; - extensions.Remove("glEXT_convolution"); - } - if (extensions.Contains("gl_EXT_coordinate_frame")) - { - EXT_coordinate_frame = true; - extensions.Remove("glEXT_coordinate_frame"); - } - if (extensions.Contains("gl_EXT_copy_texture")) - { - EXT_copy_texture = true; - extensions.Remove("glEXT_copy_texture"); - } - if (extensions.Contains("gl_EXT_cull_vertex")) - { - EXT_cull_vertex = true; - extensions.Remove("glEXT_cull_vertex"); - } - if (extensions.Contains("gl_EXT_debug_label")) - { - EXT_debug_label = true; - extensions.Remove("glEXT_debug_label"); - } - if (extensions.Contains("gl_EXT_debug_marker")) - { - EXT_debug_marker = true; - extensions.Remove("glEXT_debug_marker"); - } - if (extensions.Contains("gl_EXT_depth_bounds_test")) - { - EXT_depth_bounds_test = true; - extensions.Remove("glEXT_depth_bounds_test"); - } - if (extensions.Contains("gl_EXT_direct_state_access")) - { - EXT_direct_state_access = true; - extensions.Remove("glEXT_direct_state_access"); - } - if (extensions.Contains("gl_EXT_draw_buffers2")) - { - EXT_draw_buffers2 = true; - extensions.Remove("glEXT_draw_buffers2"); - } - if (extensions.Contains("gl_EXT_draw_instanced")) - { - EXT_draw_instanced = true; - extensions.Remove("glEXT_draw_instanced"); - } - if (extensions.Contains("gl_EXT_draw_range_elements")) - { - EXT_draw_range_elements = true; - extensions.Remove("glEXT_draw_range_elements"); - } - if (extensions.Contains("gl_EXT_external_buffer")) - { - EXT_external_buffer = true; - extensions.Remove("glEXT_external_buffer"); - } - if (extensions.Contains("gl_EXT_fog_coord")) - { - EXT_fog_coord = true; - extensions.Remove("glEXT_fog_coord"); - } - if (extensions.Contains("gl_EXT_framebuffer_blit")) - { - EXT_framebuffer_blit = true; - extensions.Remove("glEXT_framebuffer_blit"); - } - if (extensions.Contains("gl_EXT_framebuffer_blit_layers")) - { - EXT_framebuffer_blit_layers = true; - extensions.Remove("glEXT_framebuffer_blit_layers"); - } - if (extensions.Contains("gl_EXT_framebuffer_multisample")) - { - EXT_framebuffer_multisample = true; - extensions.Remove("glEXT_framebuffer_multisample"); - } - if (extensions.Contains("gl_EXT_framebuffer_multisample_blit_scaled")) - { - EXT_framebuffer_multisample_blit_scaled = true; - extensions.Remove("glEXT_framebuffer_multisample_blit_scaled"); - } - if (extensions.Contains("gl_EXT_framebuffer_object")) - { - EXT_framebuffer_object = true; - extensions.Remove("glEXT_framebuffer_object"); - } - if (extensions.Contains("gl_EXT_framebuffer_sRGB")) - { - EXT_framebuffer_sRGB = true; - extensions.Remove("glEXT_framebuffer_sRGB"); - } - if (extensions.Contains("gl_EXT_geometry_shader4")) - { - EXT_geometry_shader4 = true; - extensions.Remove("glEXT_geometry_shader4"); - } - if (extensions.Contains("gl_EXT_gpu_program_parameters")) - { - EXT_gpu_program_parameters = true; - extensions.Remove("glEXT_gpu_program_parameters"); - } - if (extensions.Contains("gl_EXT_gpu_shader4")) - { - EXT_gpu_shader4 = true; - extensions.Remove("glEXT_gpu_shader4"); - } - if (extensions.Contains("gl_EXT_histogram")) - { - EXT_histogram = true; - extensions.Remove("glEXT_histogram"); - } - if (extensions.Contains("gl_EXT_index_array_formats")) - { - EXT_index_array_formats = true; - extensions.Remove("glEXT_index_array_formats"); - } - if (extensions.Contains("gl_EXT_index_func")) - { - EXT_index_func = true; - extensions.Remove("glEXT_index_func"); - } - if (extensions.Contains("gl_EXT_index_material")) - { - EXT_index_material = true; - extensions.Remove("glEXT_index_material"); - } - if (extensions.Contains("gl_EXT_index_texture")) - { - EXT_index_texture = true; - extensions.Remove("glEXT_index_texture"); - } - if (extensions.Contains("gl_EXT_light_texture")) - { - EXT_light_texture = true; - extensions.Remove("glEXT_light_texture"); - } - if (extensions.Contains("gl_EXT_memory_object")) - { - EXT_memory_object = true; - extensions.Remove("glEXT_memory_object"); - } - if (extensions.Contains("gl_EXT_memory_object_fd")) - { - EXT_memory_object_fd = true; - extensions.Remove("glEXT_memory_object_fd"); - } - if (extensions.Contains("gl_EXT_memory_object_win32")) - { - EXT_memory_object_win32 = true; - extensions.Remove("glEXT_memory_object_win32"); - } - if (extensions.Contains("gl_EXT_misc_attribute")) - { - EXT_misc_attribute = true; - extensions.Remove("glEXT_misc_attribute"); - } - if (extensions.Contains("gl_EXT_multi_draw_arrays")) - { - EXT_multi_draw_arrays = true; - extensions.Remove("glEXT_multi_draw_arrays"); - } - if (extensions.Contains("gl_EXT_multisample")) - { - EXT_multisample = true; - extensions.Remove("glEXT_multisample"); - } - if (extensions.Contains("gl_EXT_multiview_tessellation_geometry_shader")) - { - EXT_multiview_tessellation_geometry_shader = true; - extensions.Remove("glEXT_multiview_tessellation_geometry_shader"); - } - if (extensions.Contains("gl_EXT_multiview_texture_multisample")) - { - EXT_multiview_texture_multisample = true; - extensions.Remove("glEXT_multiview_texture_multisample"); - } - if (extensions.Contains("gl_EXT_multiview_timer_query")) - { - EXT_multiview_timer_query = true; - extensions.Remove("glEXT_multiview_timer_query"); - } - if (extensions.Contains("gl_EXT_packed_depth_stencil")) - { - EXT_packed_depth_stencil = true; - extensions.Remove("glEXT_packed_depth_stencil"); - } - if (extensions.Contains("gl_EXT_packed_float")) - { - EXT_packed_float = true; - extensions.Remove("glEXT_packed_float"); - } - if (extensions.Contains("gl_EXT_packed_pixels")) - { - EXT_packed_pixels = true; - extensions.Remove("glEXT_packed_pixels"); - } - if (extensions.Contains("gl_EXT_paletted_texture")) - { - EXT_paletted_texture = true; - extensions.Remove("glEXT_paletted_texture"); - } - if (extensions.Contains("gl_EXT_pixel_buffer_object")) - { - EXT_pixel_buffer_object = true; - extensions.Remove("glEXT_pixel_buffer_object"); - } - if (extensions.Contains("gl_EXT_pixel_transform")) - { - EXT_pixel_transform = true; - extensions.Remove("glEXT_pixel_transform"); - } - if (extensions.Contains("gl_EXT_pixel_transform_color_table")) - { - EXT_pixel_transform_color_table = true; - extensions.Remove("glEXT_pixel_transform_color_table"); - } - if (extensions.Contains("gl_EXT_point_parameters")) - { - EXT_point_parameters = true; - extensions.Remove("glEXT_point_parameters"); - } - if (extensions.Contains("gl_EXT_polygon_offset")) - { - EXT_polygon_offset = true; - extensions.Remove("glEXT_polygon_offset"); - } - if (extensions.Contains("gl_EXT_polygon_offset_clamp")) - { - EXT_polygon_offset_clamp = true; - extensions.Remove("glEXT_polygon_offset_clamp"); - } - if (extensions.Contains("gl_EXT_post_depth_coverage")) - { - EXT_post_depth_coverage = true; - extensions.Remove("glEXT_post_depth_coverage"); - } - if (extensions.Contains("gl_EXT_provoking_vertex")) - { - EXT_provoking_vertex = true; - extensions.Remove("glEXT_provoking_vertex"); - } - if (extensions.Contains("gl_EXT_raster_multisample")) - { - EXT_raster_multisample = true; - extensions.Remove("glEXT_raster_multisample"); - } - if (extensions.Contains("gl_EXT_rescale_normal")) - { - EXT_rescale_normal = true; - extensions.Remove("glEXT_rescale_normal"); - } - if (extensions.Contains("gl_EXT_secondary_color")) - { - EXT_secondary_color = true; - extensions.Remove("glEXT_secondary_color"); - } - if (extensions.Contains("gl_EXT_semaphore")) - { - EXT_semaphore = true; - extensions.Remove("glEXT_semaphore"); - } - if (extensions.Contains("gl_EXT_semaphore_fd")) - { - EXT_semaphore_fd = true; - extensions.Remove("glEXT_semaphore_fd"); - } - if (extensions.Contains("gl_EXT_semaphore_win32")) - { - EXT_semaphore_win32 = true; - extensions.Remove("glEXT_semaphore_win32"); - } - if (extensions.Contains("gl_EXT_separate_shader_objects")) - { - EXT_separate_shader_objects = true; - extensions.Remove("glEXT_separate_shader_objects"); - } - if (extensions.Contains("gl_EXT_separate_specular_color")) - { - EXT_separate_specular_color = true; - extensions.Remove("glEXT_separate_specular_color"); - } - if (extensions.Contains("gl_EXT_shader_framebuffer_fetch")) - { - EXT_shader_framebuffer_fetch = true; - extensions.Remove("glEXT_shader_framebuffer_fetch"); - } - if (extensions.Contains("gl_EXT_shader_framebuffer_fetch_non_coherent")) - { - EXT_shader_framebuffer_fetch_non_coherent = true; - extensions.Remove("glEXT_shader_framebuffer_fetch_non_coherent"); - } - if (extensions.Contains("gl_EXT_shader_image_load_formatted")) - { - EXT_shader_image_load_formatted = true; - extensions.Remove("glEXT_shader_image_load_formatted"); - } - if (extensions.Contains("gl_EXT_shader_image_load_store")) - { - EXT_shader_image_load_store = true; - extensions.Remove("glEXT_shader_image_load_store"); - } - if (extensions.Contains("gl_EXT_shader_integer_mix")) - { - EXT_shader_integer_mix = true; - extensions.Remove("glEXT_shader_integer_mix"); - } - if (extensions.Contains("gl_EXT_shader_samples_identical")) - { - EXT_shader_samples_identical = true; - extensions.Remove("glEXT_shader_samples_identical"); - } - if (extensions.Contains("gl_EXT_shadow_funcs")) - { - EXT_shadow_funcs = true; - extensions.Remove("glEXT_shadow_funcs"); - } - if (extensions.Contains("gl_EXT_shared_texture_palette")) - { - EXT_shared_texture_palette = true; - extensions.Remove("glEXT_shared_texture_palette"); - } - if (extensions.Contains("gl_EXT_sparse_texture2")) - { - EXT_sparse_texture2 = true; - extensions.Remove("glEXT_sparse_texture2"); - } - if (extensions.Contains("gl_EXT_stencil_clear_tag")) - { - EXT_stencil_clear_tag = true; - extensions.Remove("glEXT_stencil_clear_tag"); - } - if (extensions.Contains("gl_EXT_stencil_two_side")) - { - EXT_stencil_two_side = true; - extensions.Remove("glEXT_stencil_two_side"); - } - if (extensions.Contains("gl_EXT_stencil_wrap")) - { - EXT_stencil_wrap = true; - extensions.Remove("glEXT_stencil_wrap"); - } - if (extensions.Contains("gl_EXT_subtexture")) - { - EXT_subtexture = true; - extensions.Remove("glEXT_subtexture"); - } - if (extensions.Contains("gl_EXT_texture")) - { - EXT_texture = true; - extensions.Remove("glEXT_texture"); - } - if (extensions.Contains("gl_EXT_texture3D")) - { - EXT_texture3D = true; - extensions.Remove("glEXT_texture3D"); - } - if (extensions.Contains("gl_EXT_texture_array")) - { - EXT_texture_array = true; - extensions.Remove("glEXT_texture_array"); - } - if (extensions.Contains("gl_EXT_texture_buffer_object")) - { - EXT_texture_buffer_object = true; - extensions.Remove("glEXT_texture_buffer_object"); - } - if (extensions.Contains("gl_EXT_texture_compression_latc")) - { - EXT_texture_compression_latc = true; - extensions.Remove("glEXT_texture_compression_latc"); - } - if (extensions.Contains("gl_EXT_texture_compression_rgtc")) - { - EXT_texture_compression_rgtc = true; - extensions.Remove("glEXT_texture_compression_rgtc"); - } - if (extensions.Contains("gl_EXT_texture_compression_s3tc")) - { - EXT_texture_compression_s3tc = true; - extensions.Remove("glEXT_texture_compression_s3tc"); - } - if (extensions.Contains("gl_EXT_texture_cube_map")) - { - EXT_texture_cube_map = true; - extensions.Remove("glEXT_texture_cube_map"); - } - if (extensions.Contains("gl_EXT_texture_env_add")) - { - EXT_texture_env_add = true; - extensions.Remove("glEXT_texture_env_add"); - } - if (extensions.Contains("gl_EXT_texture_env_combine")) - { - EXT_texture_env_combine = true; - extensions.Remove("glEXT_texture_env_combine"); - } - if (extensions.Contains("gl_EXT_texture_env_dot3")) - { - EXT_texture_env_dot3 = true; - extensions.Remove("glEXT_texture_env_dot3"); - } - if (extensions.Contains("gl_EXT_texture_filter_anisotropic")) - { - EXT_texture_filter_anisotropic = true; - extensions.Remove("glEXT_texture_filter_anisotropic"); - } - if (extensions.Contains("gl_EXT_texture_filter_minmax")) - { - EXT_texture_filter_minmax = true; - extensions.Remove("glEXT_texture_filter_minmax"); - } - if (extensions.Contains("gl_EXT_texture_integer")) - { - EXT_texture_integer = true; - extensions.Remove("glEXT_texture_integer"); - } - if (extensions.Contains("gl_EXT_texture_lod_bias")) - { - EXT_texture_lod_bias = true; - extensions.Remove("glEXT_texture_lod_bias"); - } - if (extensions.Contains("gl_EXT_texture_mirror_clamp")) - { - EXT_texture_mirror_clamp = true; - extensions.Remove("glEXT_texture_mirror_clamp"); - } - if (extensions.Contains("gl_EXT_texture_object")) - { - EXT_texture_object = true; - extensions.Remove("glEXT_texture_object"); - } - if (extensions.Contains("gl_EXT_texture_perturb_normal")) - { - EXT_texture_perturb_normal = true; - extensions.Remove("glEXT_texture_perturb_normal"); - } - if (extensions.Contains("gl_EXT_texture_sRGB")) - { - EXT_texture_sRGB = true; - extensions.Remove("glEXT_texture_sRGB"); - } - if (extensions.Contains("gl_EXT_texture_sRGB_R8")) - { - EXT_texture_sRGB_R8 = true; - extensions.Remove("glEXT_texture_sRGB_R8"); - } - if (extensions.Contains("gl_EXT_texture_sRGB_RG8")) - { - EXT_texture_sRGB_RG8 = true; - extensions.Remove("glEXT_texture_sRGB_RG8"); - } - if (extensions.Contains("gl_EXT_texture_sRGB_decode")) - { - EXT_texture_sRGB_decode = true; - extensions.Remove("glEXT_texture_sRGB_decode"); - } - if (extensions.Contains("gl_EXT_texture_shadow_lod")) - { - EXT_texture_shadow_lod = true; - extensions.Remove("glEXT_texture_shadow_lod"); - } - if (extensions.Contains("gl_EXT_texture_shared_exponent")) - { - EXT_texture_shared_exponent = true; - extensions.Remove("glEXT_texture_shared_exponent"); - } - if (extensions.Contains("gl_EXT_texture_snorm")) - { - EXT_texture_snorm = true; - extensions.Remove("glEXT_texture_snorm"); - } - if (extensions.Contains("gl_EXT_texture_storage")) - { - EXT_texture_storage = true; - extensions.Remove("glEXT_texture_storage"); - } - if (extensions.Contains("gl_EXT_texture_swizzle")) - { - EXT_texture_swizzle = true; - extensions.Remove("glEXT_texture_swizzle"); - } - if (extensions.Contains("gl_EXT_timer_query")) - { - EXT_timer_query = true; - extensions.Remove("glEXT_timer_query"); - } - if (extensions.Contains("gl_EXT_transform_feedback")) - { - EXT_transform_feedback = true; - extensions.Remove("glEXT_transform_feedback"); - } - if (extensions.Contains("gl_EXT_vertex_array")) - { - EXT_vertex_array = true; - extensions.Remove("glEXT_vertex_array"); - } - if (extensions.Contains("gl_EXT_vertex_array_bgra")) - { - EXT_vertex_array_bgra = true; - extensions.Remove("glEXT_vertex_array_bgra"); - } - if (extensions.Contains("gl_EXT_vertex_attrib_64bit")) - { - EXT_vertex_attrib_64bit = true; - extensions.Remove("glEXT_vertex_attrib_64bit"); - } - if (extensions.Contains("gl_EXT_vertex_shader")) - { - EXT_vertex_shader = true; - extensions.Remove("glEXT_vertex_shader"); - } - if (extensions.Contains("gl_EXT_vertex_weighting")) - { - EXT_vertex_weighting = true; - extensions.Remove("glEXT_vertex_weighting"); - } - if (extensions.Contains("gl_EXT_win32_keyed_mutex")) - { - EXT_win32_keyed_mutex = true; - extensions.Remove("glEXT_win32_keyed_mutex"); - } - if (extensions.Contains("gl_EXT_window_rectangles")) - { - EXT_window_rectangles = true; - extensions.Remove("glEXT_window_rectangles"); - } - if (extensions.Contains("gl_EXT_x11_sync_object")) - { - EXT_x11_sync_object = true; - extensions.Remove("glEXT_x11_sync_object"); - } - if (extensions.Contains("gl_GREMEDY_frame_terminator")) - { - GREMEDY_frame_terminator = true; - extensions.Remove("glGREMEDY_frame_terminator"); - } - if (extensions.Contains("gl_GREMEDY_string_marker")) - { - GREMEDY_string_marker = true; - extensions.Remove("glGREMEDY_string_marker"); - } - if (extensions.Contains("gl_HP_convolution_border_modes")) - { - HP_convolution_border_modes = true; - extensions.Remove("glHP_convolution_border_modes"); - } - if (extensions.Contains("gl_HP_image_transform")) - { - HP_image_transform = true; - extensions.Remove("glHP_image_transform"); - } - if (extensions.Contains("gl_HP_occlusion_test")) - { - HP_occlusion_test = true; - extensions.Remove("glHP_occlusion_test"); - } - if (extensions.Contains("gl_HP_texture_lighting")) - { - HP_texture_lighting = true; - extensions.Remove("glHP_texture_lighting"); - } - if (extensions.Contains("gl_IBM_cull_vertex")) - { - IBM_cull_vertex = true; - extensions.Remove("glIBM_cull_vertex"); - } - if (extensions.Contains("gl_IBM_multimode_draw_arrays")) - { - IBM_multimode_draw_arrays = true; - extensions.Remove("glIBM_multimode_draw_arrays"); - } - if (extensions.Contains("gl_IBM_rasterpos_clip")) - { - IBM_rasterpos_clip = true; - extensions.Remove("glIBM_rasterpos_clip"); - } - if (extensions.Contains("gl_IBM_static_data")) - { - IBM_static_data = true; - extensions.Remove("glIBM_static_data"); - } - if (extensions.Contains("gl_IBM_texture_mirrored_repeat")) - { - IBM_texture_mirrored_repeat = true; - extensions.Remove("glIBM_texture_mirrored_repeat"); - } - if (extensions.Contains("gl_IBM_vertex_array_lists")) - { - IBM_vertex_array_lists = true; - extensions.Remove("glIBM_vertex_array_lists"); - } - if (extensions.Contains("gl_INGR_blend_func_separate")) - { - INGR_blend_func_separate = true; - extensions.Remove("glINGR_blend_func_separate"); - } - if (extensions.Contains("gl_INGR_color_clamp")) - { - INGR_color_clamp = true; - extensions.Remove("glINGR_color_clamp"); - } - if (extensions.Contains("gl_INGR_interlace_read")) - { - INGR_interlace_read = true; - extensions.Remove("glINGR_interlace_read"); - } - if (extensions.Contains("gl_INTEL_blackhole_render")) - { - INTEL_blackhole_render = true; - extensions.Remove("glINTEL_blackhole_render"); - } - if (extensions.Contains("gl_INTEL_conservative_rasterization")) - { - INTEL_conservative_rasterization = true; - extensions.Remove("glINTEL_conservative_rasterization"); - } - if (extensions.Contains("gl_INTEL_fragment_shader_ordering")) - { - INTEL_fragment_shader_ordering = true; - extensions.Remove("glINTEL_fragment_shader_ordering"); - } - if (extensions.Contains("gl_INTEL_framebuffer_CMAA")) - { - INTEL_framebuffer_CMAA = true; - extensions.Remove("glINTEL_framebuffer_CMAA"); - } - if (extensions.Contains("gl_INTEL_map_texture")) - { - INTEL_map_texture = true; - extensions.Remove("glINTEL_map_texture"); - } - if (extensions.Contains("gl_INTEL_parallel_arrays")) - { - INTEL_parallel_arrays = true; - extensions.Remove("glINTEL_parallel_arrays"); - } - if (extensions.Contains("gl_INTEL_performance_query")) - { - INTEL_performance_query = true; - extensions.Remove("glINTEL_performance_query"); - } - if (extensions.Contains("gl_KHR_blend_equation_advanced")) - { - KHR_blend_equation_advanced = true; - extensions.Remove("glKHR_blend_equation_advanced"); - } - if (extensions.Contains("gl_KHR_blend_equation_advanced_coherent")) - { - KHR_blend_equation_advanced_coherent = true; - extensions.Remove("glKHR_blend_equation_advanced_coherent"); - } - if (extensions.Contains("gl_KHR_context_flush_control")) - { - KHR_context_flush_control = true; - extensions.Remove("glKHR_context_flush_control"); - } - if (extensions.Contains("gl_KHR_debug")) - { - KHR_debug = true; - extensions.Remove("glKHR_debug"); - } - if (extensions.Contains("gl_KHR_no_error")) - { - KHR_no_error = true; - extensions.Remove("glKHR_no_error"); - } - if (extensions.Contains("gl_KHR_parallel_shader_compile")) - { - KHR_parallel_shader_compile = true; - extensions.Remove("glKHR_parallel_shader_compile"); - } - if (extensions.Contains("gl_KHR_robust_buffer_access_behavior")) - { - KHR_robust_buffer_access_behavior = true; - extensions.Remove("glKHR_robust_buffer_access_behavior"); - } - if (extensions.Contains("gl_KHR_robustness")) - { - KHR_robustness = true; - extensions.Remove("glKHR_robustness"); - } - if (extensions.Contains("gl_KHR_shader_subgroup")) - { - KHR_shader_subgroup = true; - extensions.Remove("glKHR_shader_subgroup"); - } - if (extensions.Contains("gl_KHR_texture_compression_astc_hdr")) - { - KHR_texture_compression_astc_hdr = true; - extensions.Remove("glKHR_texture_compression_astc_hdr"); - } - if (extensions.Contains("gl_KHR_texture_compression_astc_ldr")) - { - KHR_texture_compression_astc_ldr = true; - extensions.Remove("glKHR_texture_compression_astc_ldr"); - } - if (extensions.Contains("gl_KHR_texture_compression_astc_sliced_3d")) - { - KHR_texture_compression_astc_sliced_3d = true; - extensions.Remove("glKHR_texture_compression_astc_sliced_3d"); - } - if (extensions.Contains("gl_MESAX_texture_stack")) - { - MESAX_texture_stack = true; - extensions.Remove("glMESAX_texture_stack"); - } - if (extensions.Contains("gl_MESA_framebuffer_flip_x")) - { - MESA_framebuffer_flip_x = true; - extensions.Remove("glMESA_framebuffer_flip_x"); - } - if (extensions.Contains("gl_MESA_framebuffer_flip_y")) - { - MESA_framebuffer_flip_y = true; - extensions.Remove("glMESA_framebuffer_flip_y"); - } - if (extensions.Contains("gl_MESA_framebuffer_swap_xy")) - { - MESA_framebuffer_swap_xy = true; - extensions.Remove("glMESA_framebuffer_swap_xy"); - } - if (extensions.Contains("gl_MESA_pack_invert")) - { - MESA_pack_invert = true; - extensions.Remove("glMESA_pack_invert"); - } - if (extensions.Contains("gl_MESA_program_binary_formats")) - { - MESA_program_binary_formats = true; - extensions.Remove("glMESA_program_binary_formats"); - } - if (extensions.Contains("gl_MESA_resize_buffers")) - { - MESA_resize_buffers = true; - extensions.Remove("glMESA_resize_buffers"); - } - if (extensions.Contains("gl_MESA_shader_integer_functions")) - { - MESA_shader_integer_functions = true; - extensions.Remove("glMESA_shader_integer_functions"); - } - if (extensions.Contains("gl_MESA_tile_raster_order")) - { - MESA_tile_raster_order = true; - extensions.Remove("glMESA_tile_raster_order"); - } - if (extensions.Contains("gl_MESA_window_pos")) - { - MESA_window_pos = true; - extensions.Remove("glMESA_window_pos"); - } - if (extensions.Contains("gl_MESA_ycbcr_texture")) - { - MESA_ycbcr_texture = true; - extensions.Remove("glMESA_ycbcr_texture"); - } - if (extensions.Contains("gl_NVX_blend_equation_advanced_multi_draw_buffers")) - { - NVX_blend_equation_advanced_multi_draw_buffers = true; - extensions.Remove("glNVX_blend_equation_advanced_multi_draw_buffers"); - } - if (extensions.Contains("gl_NVX_conditional_render")) - { - NVX_conditional_render = true; - extensions.Remove("glNVX_conditional_render"); - } - if (extensions.Contains("gl_NVX_gpu_memory_info")) - { - NVX_gpu_memory_info = true; - extensions.Remove("glNVX_gpu_memory_info"); - } - if (extensions.Contains("gl_NVX_gpu_multicast2")) - { - NVX_gpu_multicast2 = true; - extensions.Remove("glNVX_gpu_multicast2"); - } - if (extensions.Contains("gl_NVX_linked_gpu_multicast")) - { - NVX_linked_gpu_multicast = true; - extensions.Remove("glNVX_linked_gpu_multicast"); - } - if (extensions.Contains("gl_NVX_progress_fence")) - { - NVX_progress_fence = true; - extensions.Remove("glNVX_progress_fence"); - } - if (extensions.Contains("gl_NV_alpha_to_coverage_dither_control")) - { - NV_alpha_to_coverage_dither_control = true; - extensions.Remove("glNV_alpha_to_coverage_dither_control"); - } - if (extensions.Contains("gl_NV_bindless_multi_draw_indirect")) - { - NV_bindless_multi_draw_indirect = true; - extensions.Remove("glNV_bindless_multi_draw_indirect"); - } - if (extensions.Contains("gl_NV_bindless_multi_draw_indirect_count")) - { - NV_bindless_multi_draw_indirect_count = true; - extensions.Remove("glNV_bindless_multi_draw_indirect_count"); - } - if (extensions.Contains("gl_NV_bindless_texture")) - { - NV_bindless_texture = true; - extensions.Remove("glNV_bindless_texture"); - } - if (extensions.Contains("gl_NV_blend_equation_advanced")) - { - NV_blend_equation_advanced = true; - extensions.Remove("glNV_blend_equation_advanced"); - } - if (extensions.Contains("gl_NV_blend_equation_advanced_coherent")) - { - NV_blend_equation_advanced_coherent = true; - extensions.Remove("glNV_blend_equation_advanced_coherent"); - } - if (extensions.Contains("gl_NV_blend_minmax_factor")) - { - NV_blend_minmax_factor = true; - extensions.Remove("glNV_blend_minmax_factor"); - } - if (extensions.Contains("gl_NV_blend_square")) - { - NV_blend_square = true; - extensions.Remove("glNV_blend_square"); - } - if (extensions.Contains("gl_NV_clip_space_w_scaling")) - { - NV_clip_space_w_scaling = true; - extensions.Remove("glNV_clip_space_w_scaling"); - } - if (extensions.Contains("gl_NV_command_list")) - { - NV_command_list = true; - extensions.Remove("glNV_command_list"); - } - if (extensions.Contains("gl_NV_compute_program5")) - { - NV_compute_program5 = true; - extensions.Remove("glNV_compute_program5"); - } - if (extensions.Contains("gl_NV_compute_shader_derivatives")) - { - NV_compute_shader_derivatives = true; - extensions.Remove("glNV_compute_shader_derivatives"); - } - if (extensions.Contains("gl_NV_conditional_render")) - { - NV_conditional_render = true; - extensions.Remove("glNV_conditional_render"); - } - if (extensions.Contains("gl_NV_conservative_raster")) - { - NV_conservative_raster = true; - extensions.Remove("glNV_conservative_raster"); - } - if (extensions.Contains("gl_NV_conservative_raster_dilate")) - { - NV_conservative_raster_dilate = true; - extensions.Remove("glNV_conservative_raster_dilate"); - } - if (extensions.Contains("gl_NV_conservative_raster_pre_snap")) - { - NV_conservative_raster_pre_snap = true; - extensions.Remove("glNV_conservative_raster_pre_snap"); - } - if (extensions.Contains("gl_NV_conservative_raster_pre_snap_triangles")) - { - NV_conservative_raster_pre_snap_triangles = true; - extensions.Remove("glNV_conservative_raster_pre_snap_triangles"); - } - if (extensions.Contains("gl_NV_conservative_raster_underestimation")) - { - NV_conservative_raster_underestimation = true; - extensions.Remove("glNV_conservative_raster_underestimation"); - } - if (extensions.Contains("gl_NV_copy_depth_to_color")) - { - NV_copy_depth_to_color = true; - extensions.Remove("glNV_copy_depth_to_color"); - } - if (extensions.Contains("gl_NV_copy_image")) - { - NV_copy_image = true; - extensions.Remove("glNV_copy_image"); - } - if (extensions.Contains("gl_NV_deep_texture3D")) - { - NV_deep_texture3D = true; - extensions.Remove("glNV_deep_texture3D"); - } - if (extensions.Contains("gl_NV_depth_buffer_float")) - { - NV_depth_buffer_float = true; - extensions.Remove("glNV_depth_buffer_float"); - } - if (extensions.Contains("gl_NV_depth_clamp")) - { - NV_depth_clamp = true; - extensions.Remove("glNV_depth_clamp"); - } - if (extensions.Contains("gl_NV_draw_texture")) - { - NV_draw_texture = true; - extensions.Remove("glNV_draw_texture"); - } - if (extensions.Contains("gl_NV_draw_vulkan_image")) - { - NV_draw_vulkan_image = true; - extensions.Remove("glNV_draw_vulkan_image"); - } - if (extensions.Contains("gl_NV_evaluators")) - { - NV_evaluators = true; - extensions.Remove("glNV_evaluators"); - } - if (extensions.Contains("gl_NV_explicit_multisample")) - { - NV_explicit_multisample = true; - extensions.Remove("glNV_explicit_multisample"); - } - if (extensions.Contains("gl_NV_fence")) - { - NV_fence = true; - extensions.Remove("glNV_fence"); - } - if (extensions.Contains("gl_NV_fill_rectangle")) - { - NV_fill_rectangle = true; - extensions.Remove("glNV_fill_rectangle"); - } - if (extensions.Contains("gl_NV_float_buffer")) - { - NV_float_buffer = true; - extensions.Remove("glNV_float_buffer"); - } - if (extensions.Contains("gl_NV_fog_distance")) - { - NV_fog_distance = true; - extensions.Remove("glNV_fog_distance"); - } - if (extensions.Contains("gl_NV_fragment_coverage_to_color")) - { - NV_fragment_coverage_to_color = true; - extensions.Remove("glNV_fragment_coverage_to_color"); - } - if (extensions.Contains("gl_NV_fragment_program")) - { - NV_fragment_program = true; - extensions.Remove("glNV_fragment_program"); - } - if (extensions.Contains("gl_NV_fragment_program2")) - { - NV_fragment_program2 = true; - extensions.Remove("glNV_fragment_program2"); - } - if (extensions.Contains("gl_NV_fragment_program4")) - { - NV_fragment_program4 = true; - extensions.Remove("glNV_fragment_program4"); - } - if (extensions.Contains("gl_NV_fragment_program_option")) - { - NV_fragment_program_option = true; - extensions.Remove("glNV_fragment_program_option"); - } - if (extensions.Contains("gl_NV_fragment_shader_barycentric")) - { - NV_fragment_shader_barycentric = true; - extensions.Remove("glNV_fragment_shader_barycentric"); - } - if (extensions.Contains("gl_NV_fragment_shader_interlock")) - { - NV_fragment_shader_interlock = true; - extensions.Remove("glNV_fragment_shader_interlock"); - } - if (extensions.Contains("gl_NV_framebuffer_mixed_samples")) - { - NV_framebuffer_mixed_samples = true; - extensions.Remove("glNV_framebuffer_mixed_samples"); - } - if (extensions.Contains("gl_NV_framebuffer_multisample_coverage")) - { - NV_framebuffer_multisample_coverage = true; - extensions.Remove("glNV_framebuffer_multisample_coverage"); - } - if (extensions.Contains("gl_NV_geometry_program4")) - { - NV_geometry_program4 = true; - extensions.Remove("glNV_geometry_program4"); - } - if (extensions.Contains("gl_NV_geometry_shader4")) - { - NV_geometry_shader4 = true; - extensions.Remove("glNV_geometry_shader4"); - } - if (extensions.Contains("gl_NV_geometry_shader_passthrough")) - { - NV_geometry_shader_passthrough = true; - extensions.Remove("glNV_geometry_shader_passthrough"); - } - if (extensions.Contains("gl_NV_gpu_multicast")) - { - NV_gpu_multicast = true; - extensions.Remove("glNV_gpu_multicast"); - } - if (extensions.Contains("gl_NV_gpu_program4")) - { - NV_gpu_program4 = true; - extensions.Remove("glNV_gpu_program4"); - } - if (extensions.Contains("gl_NV_gpu_program5")) - { - NV_gpu_program5 = true; - extensions.Remove("glNV_gpu_program5"); - } - if (extensions.Contains("gl_NV_gpu_program5_mem_extended")) - { - NV_gpu_program5_mem_extended = true; - extensions.Remove("glNV_gpu_program5_mem_extended"); - } - if (extensions.Contains("gl_NV_gpu_shader5")) - { - NV_gpu_shader5 = true; - extensions.Remove("glNV_gpu_shader5"); - } - if (extensions.Contains("gl_NV_half_float")) - { - NV_half_float = true; - extensions.Remove("glNV_half_float"); - } - if (extensions.Contains("gl_NV_internalformat_sample_query")) - { - NV_internalformat_sample_query = true; - extensions.Remove("glNV_internalformat_sample_query"); - } - if (extensions.Contains("gl_NV_light_max_exponent")) - { - NV_light_max_exponent = true; - extensions.Remove("glNV_light_max_exponent"); - } - if (extensions.Contains("gl_NV_memory_attachment")) - { - NV_memory_attachment = true; - extensions.Remove("glNV_memory_attachment"); - } - if (extensions.Contains("gl_NV_memory_object_sparse")) - { - NV_memory_object_sparse = true; - extensions.Remove("glNV_memory_object_sparse"); - } - if (extensions.Contains("gl_NV_mesh_shader")) - { - NV_mesh_shader = true; - extensions.Remove("glNV_mesh_shader"); - } - if (extensions.Contains("gl_NV_multisample_coverage")) - { - NV_multisample_coverage = true; - extensions.Remove("glNV_multisample_coverage"); - } - if (extensions.Contains("gl_NV_multisample_filter_hint")) - { - NV_multisample_filter_hint = true; - extensions.Remove("glNV_multisample_filter_hint"); - } - if (extensions.Contains("gl_NV_occlusion_query")) - { - NV_occlusion_query = true; - extensions.Remove("glNV_occlusion_query"); - } - if (extensions.Contains("gl_NV_packed_depth_stencil")) - { - NV_packed_depth_stencil = true; - extensions.Remove("glNV_packed_depth_stencil"); - } - if (extensions.Contains("gl_NV_parameter_buffer_object")) - { - NV_parameter_buffer_object = true; - extensions.Remove("glNV_parameter_buffer_object"); - } - if (extensions.Contains("gl_NV_parameter_buffer_object2")) - { - NV_parameter_buffer_object2 = true; - extensions.Remove("glNV_parameter_buffer_object2"); - } - if (extensions.Contains("gl_NV_path_rendering")) - { - NV_path_rendering = true; - extensions.Remove("glNV_path_rendering"); - } - if (extensions.Contains("gl_NV_path_rendering_shared_edge")) - { - NV_path_rendering_shared_edge = true; - extensions.Remove("glNV_path_rendering_shared_edge"); - } - if (extensions.Contains("gl_NV_pixel_data_range")) - { - NV_pixel_data_range = true; - extensions.Remove("glNV_pixel_data_range"); - } - if (extensions.Contains("gl_NV_point_sprite")) - { - NV_point_sprite = true; - extensions.Remove("glNV_point_sprite"); - } - if (extensions.Contains("gl_NV_present_video")) - { - NV_present_video = true; - extensions.Remove("glNV_present_video"); - } - if (extensions.Contains("gl_NV_primitive_restart")) - { - NV_primitive_restart = true; - extensions.Remove("glNV_primitive_restart"); - } - if (extensions.Contains("gl_NV_primitive_shading_rate")) - { - NV_primitive_shading_rate = true; - extensions.Remove("glNV_primitive_shading_rate"); - } - if (extensions.Contains("gl_NV_query_resource")) - { - NV_query_resource = true; - extensions.Remove("glNV_query_resource"); - } - if (extensions.Contains("gl_NV_query_resource_tag")) - { - NV_query_resource_tag = true; - extensions.Remove("glNV_query_resource_tag"); - } - if (extensions.Contains("gl_NV_register_combiners")) - { - NV_register_combiners = true; - extensions.Remove("glNV_register_combiners"); - } - if (extensions.Contains("gl_NV_register_combiners2")) - { - NV_register_combiners2 = true; - extensions.Remove("glNV_register_combiners2"); - } - if (extensions.Contains("gl_NV_representative_fragment_test")) - { - NV_representative_fragment_test = true; - extensions.Remove("glNV_representative_fragment_test"); - } - if (extensions.Contains("gl_NV_robustness_video_memory_purge")) - { - NV_robustness_video_memory_purge = true; - extensions.Remove("glNV_robustness_video_memory_purge"); - } - if (extensions.Contains("gl_NV_sample_locations")) - { - NV_sample_locations = true; - extensions.Remove("glNV_sample_locations"); - } - if (extensions.Contains("gl_NV_sample_mask_override_coverage")) - { - NV_sample_mask_override_coverage = true; - extensions.Remove("glNV_sample_mask_override_coverage"); - } - if (extensions.Contains("gl_NV_scissor_exclusive")) - { - NV_scissor_exclusive = true; - extensions.Remove("glNV_scissor_exclusive"); - } - if (extensions.Contains("gl_NV_shader_atomic_counters")) - { - NV_shader_atomic_counters = true; - extensions.Remove("glNV_shader_atomic_counters"); - } - if (extensions.Contains("gl_NV_shader_atomic_float")) - { - NV_shader_atomic_float = true; - extensions.Remove("glNV_shader_atomic_float"); - } - if (extensions.Contains("gl_NV_shader_atomic_float64")) - { - NV_shader_atomic_float64 = true; - extensions.Remove("glNV_shader_atomic_float64"); - } - if (extensions.Contains("gl_NV_shader_atomic_fp16_vector")) - { - NV_shader_atomic_fp16_vector = true; - extensions.Remove("glNV_shader_atomic_fp16_vector"); - } - if (extensions.Contains("gl_NV_shader_atomic_int64")) - { - NV_shader_atomic_int64 = true; - extensions.Remove("glNV_shader_atomic_int64"); - } - if (extensions.Contains("gl_NV_shader_buffer_load")) - { - NV_shader_buffer_load = true; - extensions.Remove("glNV_shader_buffer_load"); - } - if (extensions.Contains("gl_NV_shader_buffer_store")) - { - NV_shader_buffer_store = true; - extensions.Remove("glNV_shader_buffer_store"); - } - if (extensions.Contains("gl_NV_shader_storage_buffer_object")) - { - NV_shader_storage_buffer_object = true; - extensions.Remove("glNV_shader_storage_buffer_object"); - } - if (extensions.Contains("gl_NV_shader_subgroup_partitioned")) - { - NV_shader_subgroup_partitioned = true; - extensions.Remove("glNV_shader_subgroup_partitioned"); - } - if (extensions.Contains("gl_NV_shader_texture_footprint")) - { - NV_shader_texture_footprint = true; - extensions.Remove("glNV_shader_texture_footprint"); - } - if (extensions.Contains("gl_NV_shader_thread_group")) - { - NV_shader_thread_group = true; - extensions.Remove("glNV_shader_thread_group"); - } - if (extensions.Contains("gl_NV_shader_thread_shuffle")) - { - NV_shader_thread_shuffle = true; - extensions.Remove("glNV_shader_thread_shuffle"); - } - if (extensions.Contains("gl_NV_shading_rate_image")) - { - NV_shading_rate_image = true; - extensions.Remove("glNV_shading_rate_image"); - } - if (extensions.Contains("gl_NV_stereo_view_rendering")) - { - NV_stereo_view_rendering = true; - extensions.Remove("glNV_stereo_view_rendering"); - } - if (extensions.Contains("gl_NV_tessellation_program5")) - { - NV_tessellation_program5 = true; - extensions.Remove("glNV_tessellation_program5"); - } - if (extensions.Contains("gl_NV_texgen_emboss")) - { - NV_texgen_emboss = true; - extensions.Remove("glNV_texgen_emboss"); - } - if (extensions.Contains("gl_NV_texgen_reflection")) - { - NV_texgen_reflection = true; - extensions.Remove("glNV_texgen_reflection"); - } - if (extensions.Contains("gl_NV_texture_barrier")) - { - NV_texture_barrier = true; - extensions.Remove("glNV_texture_barrier"); - } - if (extensions.Contains("gl_NV_texture_compression_vtc")) - { - NV_texture_compression_vtc = true; - extensions.Remove("glNV_texture_compression_vtc"); - } - if (extensions.Contains("gl_NV_texture_env_combine4")) - { - NV_texture_env_combine4 = true; - extensions.Remove("glNV_texture_env_combine4"); - } - if (extensions.Contains("gl_NV_texture_expand_normal")) - { - NV_texture_expand_normal = true; - extensions.Remove("glNV_texture_expand_normal"); - } - if (extensions.Contains("gl_NV_texture_multisample")) - { - NV_texture_multisample = true; - extensions.Remove("glNV_texture_multisample"); - } - if (extensions.Contains("gl_NV_texture_rectangle")) - { - NV_texture_rectangle = true; - extensions.Remove("glNV_texture_rectangle"); - } - if (extensions.Contains("gl_NV_texture_rectangle_compressed")) - { - NV_texture_rectangle_compressed = true; - extensions.Remove("glNV_texture_rectangle_compressed"); - } - if (extensions.Contains("gl_NV_texture_shader")) - { - NV_texture_shader = true; - extensions.Remove("glNV_texture_shader"); - } - if (extensions.Contains("gl_NV_texture_shader2")) - { - NV_texture_shader2 = true; - extensions.Remove("glNV_texture_shader2"); - } - if (extensions.Contains("gl_NV_texture_shader3")) - { - NV_texture_shader3 = true; - extensions.Remove("glNV_texture_shader3"); - } - if (extensions.Contains("gl_NV_timeline_semaphore")) - { - NV_timeline_semaphore = true; - extensions.Remove("glNV_timeline_semaphore"); - } - if (extensions.Contains("gl_NV_transform_feedback")) - { - NV_transform_feedback = true; - extensions.Remove("glNV_transform_feedback"); - } - if (extensions.Contains("gl_NV_transform_feedback2")) - { - NV_transform_feedback2 = true; - extensions.Remove("glNV_transform_feedback2"); - } - if (extensions.Contains("gl_NV_uniform_buffer_std430_layout")) - { - NV_uniform_buffer_std430_layout = true; - extensions.Remove("glNV_uniform_buffer_std430_layout"); - } - if (extensions.Contains("gl_NV_uniform_buffer_unified_memory")) - { - NV_uniform_buffer_unified_memory = true; - extensions.Remove("glNV_uniform_buffer_unified_memory"); - } - if (extensions.Contains("gl_NV_vdpau_interop")) - { - NV_vdpau_interop = true; - extensions.Remove("glNV_vdpau_interop"); - } - if (extensions.Contains("gl_NV_vdpau_interop2")) - { - NV_vdpau_interop2 = true; - extensions.Remove("glNV_vdpau_interop2"); - } - if (extensions.Contains("gl_NV_vertex_array_range")) - { - NV_vertex_array_range = true; - extensions.Remove("glNV_vertex_array_range"); - } - if (extensions.Contains("gl_NV_vertex_array_range2")) - { - NV_vertex_array_range2 = true; - extensions.Remove("glNV_vertex_array_range2"); - } - if (extensions.Contains("gl_NV_vertex_attrib_integer_64bit")) - { - NV_vertex_attrib_integer_64bit = true; - extensions.Remove("glNV_vertex_attrib_integer_64bit"); - } - if (extensions.Contains("gl_NV_vertex_buffer_unified_memory")) - { - NV_vertex_buffer_unified_memory = true; - extensions.Remove("glNV_vertex_buffer_unified_memory"); - } - if (extensions.Contains("gl_NV_vertex_program")) - { - NV_vertex_program = true; - extensions.Remove("glNV_vertex_program"); - } - if (extensions.Contains("gl_NV_vertex_program1_1")) - { - NV_vertex_program1_1 = true; - extensions.Remove("glNV_vertex_program1_1"); - } - if (extensions.Contains("gl_NV_vertex_program2")) - { - NV_vertex_program2 = true; - extensions.Remove("glNV_vertex_program2"); - } - if (extensions.Contains("gl_NV_vertex_program2_option")) - { - NV_vertex_program2_option = true; - extensions.Remove("glNV_vertex_program2_option"); - } - if (extensions.Contains("gl_NV_vertex_program3")) - { - NV_vertex_program3 = true; - extensions.Remove("glNV_vertex_program3"); - } - if (extensions.Contains("gl_NV_vertex_program4")) - { - NV_vertex_program4 = true; - extensions.Remove("glNV_vertex_program4"); - } - if (extensions.Contains("gl_NV_video_capture")) - { - NV_video_capture = true; - extensions.Remove("glNV_video_capture"); - } - if (extensions.Contains("gl_NV_viewport_array2")) - { - NV_viewport_array2 = true; - extensions.Remove("glNV_viewport_array2"); - } - if (extensions.Contains("gl_NV_viewport_swizzle")) - { - NV_viewport_swizzle = true; - extensions.Remove("glNV_viewport_swizzle"); - } - if (extensions.Contains("gl_OES_byte_coordinates")) - { - OES_byte_coordinates = true; - extensions.Remove("glOES_byte_coordinates"); - } - if (extensions.Contains("gl_OES_compressed_paletted_texture")) - { - OES_compressed_paletted_texture = true; - extensions.Remove("glOES_compressed_paletted_texture"); - } - if (extensions.Contains("gl_OES_fixed_point")) - { - OES_fixed_point = true; - extensions.Remove("glOES_fixed_point"); - } - if (extensions.Contains("gl_OES_query_matrix")) - { - OES_query_matrix = true; - extensions.Remove("glOES_query_matrix"); - } - if (extensions.Contains("gl_OES_read_format")) - { - OES_read_format = true; - extensions.Remove("glOES_read_format"); - } - if (extensions.Contains("gl_OES_single_precision")) - { - OES_single_precision = true; - extensions.Remove("glOES_single_precision"); - } - if (extensions.Contains("gl_OML_interlace")) - { - OML_interlace = true; - extensions.Remove("glOML_interlace"); - } - if (extensions.Contains("gl_OML_resample")) - { - OML_resample = true; - extensions.Remove("glOML_resample"); - } - if (extensions.Contains("gl_OML_subsample")) - { - OML_subsample = true; - extensions.Remove("glOML_subsample"); - } - if (extensions.Contains("gl_OVR_multiview")) - { - OVR_multiview = true; - extensions.Remove("glOVR_multiview"); - } - if (extensions.Contains("gl_OVR_multiview2")) - { - OVR_multiview2 = true; - extensions.Remove("glOVR_multiview2"); - } - if (extensions.Contains("gl_PGI_misc_hints")) - { - PGI_misc_hints = true; - extensions.Remove("glPGI_misc_hints"); - } - if (extensions.Contains("gl_PGI_vertex_hints")) - { - PGI_vertex_hints = true; - extensions.Remove("glPGI_vertex_hints"); - } - if (extensions.Contains("gl_REND_screen_coordinates")) - { - REND_screen_coordinates = true; - extensions.Remove("glREND_screen_coordinates"); - } - if (extensions.Contains("gl_S3_s3tc")) - { - S3_s3tc = true; - extensions.Remove("glS3_s3tc"); - } - if (extensions.Contains("gl_SGIS_detail_texture")) - { - SGIS_detail_texture = true; - extensions.Remove("glSGIS_detail_texture"); - } - if (extensions.Contains("gl_SGIS_fog_function")) - { - SGIS_fog_function = true; - extensions.Remove("glSGIS_fog_function"); - } - if (extensions.Contains("gl_SGIS_generate_mipmap")) - { - SGIS_generate_mipmap = true; - extensions.Remove("glSGIS_generate_mipmap"); - } - if (extensions.Contains("gl_SGIS_multisample")) - { - SGIS_multisample = true; - extensions.Remove("glSGIS_multisample"); - } - if (extensions.Contains("gl_SGIS_pixel_texture")) - { - SGIS_pixel_texture = true; - extensions.Remove("glSGIS_pixel_texture"); - } - if (extensions.Contains("gl_SGIS_point_line_texgen")) - { - SGIS_point_line_texgen = true; - extensions.Remove("glSGIS_point_line_texgen"); - } - if (extensions.Contains("gl_SGIS_point_parameters")) - { - SGIS_point_parameters = true; - extensions.Remove("glSGIS_point_parameters"); - } - if (extensions.Contains("gl_SGIS_sharpen_texture")) - { - SGIS_sharpen_texture = true; - extensions.Remove("glSGIS_sharpen_texture"); - } - if (extensions.Contains("gl_SGIS_texture4D")) - { - SGIS_texture4D = true; - extensions.Remove("glSGIS_texture4D"); - } - if (extensions.Contains("gl_SGIS_texture_border_clamp")) - { - SGIS_texture_border_clamp = true; - extensions.Remove("glSGIS_texture_border_clamp"); - } - if (extensions.Contains("gl_SGIS_texture_color_mask")) - { - SGIS_texture_color_mask = true; - extensions.Remove("glSGIS_texture_color_mask"); - } - if (extensions.Contains("gl_SGIS_texture_edge_clamp")) - { - SGIS_texture_edge_clamp = true; - extensions.Remove("glSGIS_texture_edge_clamp"); - } - if (extensions.Contains("gl_SGIS_texture_filter4")) - { - SGIS_texture_filter4 = true; - extensions.Remove("glSGIS_texture_filter4"); - } - if (extensions.Contains("gl_SGIS_texture_lod")) - { - SGIS_texture_lod = true; - extensions.Remove("glSGIS_texture_lod"); - } - if (extensions.Contains("gl_SGIS_texture_select")) - { - SGIS_texture_select = true; - extensions.Remove("glSGIS_texture_select"); - } - if (extensions.Contains("gl_SGIX_async")) - { - SGIX_async = true; - extensions.Remove("glSGIX_async"); - } - if (extensions.Contains("gl_SGIX_async_histogram")) - { - SGIX_async_histogram = true; - extensions.Remove("glSGIX_async_histogram"); - } - if (extensions.Contains("gl_SGIX_async_pixel")) - { - SGIX_async_pixel = true; - extensions.Remove("glSGIX_async_pixel"); - } - if (extensions.Contains("gl_SGIX_blend_alpha_minmax")) - { - SGIX_blend_alpha_minmax = true; - extensions.Remove("glSGIX_blend_alpha_minmax"); - } - if (extensions.Contains("gl_SGIX_calligraphic_fragment")) - { - SGIX_calligraphic_fragment = true; - extensions.Remove("glSGIX_calligraphic_fragment"); - } - if (extensions.Contains("gl_SGIX_clipmap")) - { - SGIX_clipmap = true; - extensions.Remove("glSGIX_clipmap"); - } - if (extensions.Contains("gl_SGIX_convolution_accuracy")) - { - SGIX_convolution_accuracy = true; - extensions.Remove("glSGIX_convolution_accuracy"); - } - if (extensions.Contains("gl_SGIX_depth_pass_instrument")) - { - SGIX_depth_pass_instrument = true; - extensions.Remove("glSGIX_depth_pass_instrument"); - } - if (extensions.Contains("gl_SGIX_depth_texture")) - { - SGIX_depth_texture = true; - extensions.Remove("glSGIX_depth_texture"); - } - if (extensions.Contains("gl_SGIX_flush_raster")) - { - SGIX_flush_raster = true; - extensions.Remove("glSGIX_flush_raster"); - } - if (extensions.Contains("gl_SGIX_fog_offset")) - { - SGIX_fog_offset = true; - extensions.Remove("glSGIX_fog_offset"); - } - if (extensions.Contains("gl_SGIX_fragment_lighting")) - { - SGIX_fragment_lighting = true; - extensions.Remove("glSGIX_fragment_lighting"); - } - if (extensions.Contains("gl_SGIX_framezoom")) - { - SGIX_framezoom = true; - extensions.Remove("glSGIX_framezoom"); - } - if (extensions.Contains("gl_SGIX_igloo_interface")) - { - SGIX_igloo_interface = true; - extensions.Remove("glSGIX_igloo_interface"); - } - if (extensions.Contains("gl_SGIX_instruments")) - { - SGIX_instruments = true; - extensions.Remove("glSGIX_instruments"); - } - if (extensions.Contains("gl_SGIX_interlace")) - { - SGIX_interlace = true; - extensions.Remove("glSGIX_interlace"); - } - if (extensions.Contains("gl_SGIX_ir_instrument1")) - { - SGIX_ir_instrument1 = true; - extensions.Remove("glSGIX_ir_instrument1"); - } - if (extensions.Contains("gl_SGIX_list_priority")) - { - SGIX_list_priority = true; - extensions.Remove("glSGIX_list_priority"); - } - if (extensions.Contains("gl_SGIX_pixel_texture")) - { - SGIX_pixel_texture = true; - extensions.Remove("glSGIX_pixel_texture"); - } - if (extensions.Contains("gl_SGIX_pixel_tiles")) - { - SGIX_pixel_tiles = true; - extensions.Remove("glSGIX_pixel_tiles"); - } - if (extensions.Contains("gl_SGIX_polynomial_ffd")) - { - SGIX_polynomial_ffd = true; - extensions.Remove("glSGIX_polynomial_ffd"); - } - if (extensions.Contains("gl_SGIX_reference_plane")) - { - SGIX_reference_plane = true; - extensions.Remove("glSGIX_reference_plane"); - } - if (extensions.Contains("gl_SGIX_resample")) - { - SGIX_resample = true; - extensions.Remove("glSGIX_resample"); - } - if (extensions.Contains("gl_SGIX_scalebias_hint")) - { - SGIX_scalebias_hint = true; - extensions.Remove("glSGIX_scalebias_hint"); - } - if (extensions.Contains("gl_SGIX_shadow")) - { - SGIX_shadow = true; - extensions.Remove("glSGIX_shadow"); - } - if (extensions.Contains("gl_SGIX_shadow_ambient")) - { - SGIX_shadow_ambient = true; - extensions.Remove("glSGIX_shadow_ambient"); - } - if (extensions.Contains("gl_SGIX_sprite")) - { - SGIX_sprite = true; - extensions.Remove("glSGIX_sprite"); - } - if (extensions.Contains("gl_SGIX_subsample")) - { - SGIX_subsample = true; - extensions.Remove("glSGIX_subsample"); - } - if (extensions.Contains("gl_SGIX_tag_sample_buffer")) - { - SGIX_tag_sample_buffer = true; - extensions.Remove("glSGIX_tag_sample_buffer"); - } - if (extensions.Contains("gl_SGIX_texture_add_env")) - { - SGIX_texture_add_env = true; - extensions.Remove("glSGIX_texture_add_env"); - } - if (extensions.Contains("gl_SGIX_texture_coordinate_clamp")) - { - SGIX_texture_coordinate_clamp = true; - extensions.Remove("glSGIX_texture_coordinate_clamp"); - } - if (extensions.Contains("gl_SGIX_texture_lod_bias")) - { - SGIX_texture_lod_bias = true; - extensions.Remove("glSGIX_texture_lod_bias"); - } - if (extensions.Contains("gl_SGIX_texture_multi_buffer")) - { - SGIX_texture_multi_buffer = true; - extensions.Remove("glSGIX_texture_multi_buffer"); - } - if (extensions.Contains("gl_SGIX_texture_scale_bias")) - { - SGIX_texture_scale_bias = true; - extensions.Remove("glSGIX_texture_scale_bias"); - } - if (extensions.Contains("gl_SGIX_vertex_preclip")) - { - SGIX_vertex_preclip = true; - extensions.Remove("glSGIX_vertex_preclip"); - } - if (extensions.Contains("gl_SGIX_ycrcb")) - { - SGIX_ycrcb = true; - extensions.Remove("glSGIX_ycrcb"); - } - if (extensions.Contains("gl_SGIX_ycrcb_subsample")) - { - SGIX_ycrcb_subsample = true; - extensions.Remove("glSGIX_ycrcb_subsample"); - } - if (extensions.Contains("gl_SGIX_ycrcba")) - { - SGIX_ycrcba = true; - extensions.Remove("glSGIX_ycrcba"); - } - if (extensions.Contains("gl_SGI_color_matrix")) - { - SGI_color_matrix = true; - extensions.Remove("glSGI_color_matrix"); - } - if (extensions.Contains("gl_SGI_color_table")) - { - SGI_color_table = true; - extensions.Remove("glSGI_color_table"); - } - if (extensions.Contains("gl_SGI_texture_color_table")) - { - SGI_texture_color_table = true; - extensions.Remove("glSGI_texture_color_table"); - } - if (extensions.Contains("gl_SUNX_constant_data")) - { - SUNX_constant_data = true; - extensions.Remove("glSUNX_constant_data"); - } - if (extensions.Contains("gl_SUN_convolution_border_modes")) - { - SUN_convolution_border_modes = true; - extensions.Remove("glSUN_convolution_border_modes"); - } - if (extensions.Contains("gl_SUN_global_alpha")) - { - SUN_global_alpha = true; - extensions.Remove("glSUN_global_alpha"); - } - if (extensions.Contains("gl_SUN_mesh_array")) - { - SUN_mesh_array = true; - extensions.Remove("glSUN_mesh_array"); - } - if (extensions.Contains("gl_SUN_slice_accum")) - { - SUN_slice_accum = true; - extensions.Remove("glSUN_slice_accum"); - } - if (extensions.Contains("gl_SUN_triangle_list")) - { - SUN_triangle_list = true; - extensions.Remove("glSUN_triangle_list"); - } - if (extensions.Contains("gl_SUN_vertex")) - { - SUN_vertex = true; - extensions.Remove("glSUN_vertex"); - } - if (extensions.Contains("gl_WIN_phong_shading")) - { - WIN_phong_shading = true; - extensions.Remove("glWIN_phong_shading"); - } - if (extensions.Contains("gl_WIN_specular_fog")) - { - WIN_specular_fog = true; - extensions.Remove("glWIN_specular_fog"); - } - - #endregion checkGLextensions - } - - internal static void CheckCoreVersion( - int majorVersion, - int minorVersion - ) - { - if (majorVersion < 3) { - throw new InvalidOperationException( - "StgSharp does not support OpenGL immediate mode."); - } - - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 0))) - { - core10 = true; - } else - { - goto log; - } - - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 1))) - { - core11 = true; - } else - { - goto log; - } - - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 2))) - { - core12 = true; - } else - { - goto log; - } - - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 3))) - { - core13 = true; - } else - { - goto log; - } - - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 4))) - { - core14 = true; - } else - { - goto log; - } - - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 5))) - { - core15 = true; - } else - { - goto log; - } - - if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 0))) - { - core20 = true; - } else - { - goto log; - } - - if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 1))) - { - core21 = true; - } else - { - goto log; - } - - if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 0))) - { - core30 = true; - } else - { - goto log; - } - - if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 1))) - { - core31 = true; - } else - { - goto log; - } - - if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 2))) - { - core32 = true; - } else - { - goto log; - } - - if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 3))) - { - core33 = true; - } else - { - goto log; - } - - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 0))) - { - core40 = true; - } else - { - goto log; - } - - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 1))) - { - core41 = true; - } else - { - goto log; - } - - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 2))) - { - core42 = true; - } else - { - goto log; - } - - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 3))) - { - core43 = true; - } else - { - goto log; - } - - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 4))) - { - core44 = true; - } else - { - goto log; - } - - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 5))) - { - core45 = true; - } else - { - goto log; - } - - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 6))) - { - core46 = true; - } else - { - goto log; - } - - log: - { - DefaultLog.InternalWriteLog("Find core OpenGL version.", LogType.Info); - return; - } - } - - internal static unsafe string GetExtensions( - this OpenglContext context - ) - { - if (context.glGetString == null) { - return string.Empty; - } - return Marshal.PtrToStringAnsi((nint)context.glGetString(glExtension))!; - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glApiManager" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.HighPerformance; +using StgSharp.Mathematics; +using StgSharp.MVVM; +using StgSharp.MVVM; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + public static partial class glManager + { + + private const int glExtension = 0x1f03; + private const int glVersion = 0x1f02; + + private static readonly string[] glBranch = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + "OpenGL SC " + }; + + private static string glExtensionList; + + + /// + /// Load all supported OpenGL APIs and bind them to given . + /// + /// + /// The handle to current OpenGL viewPortDisplay + /// + public static unsafe void LoadOpenGLApiTo( + IntPtr contextHandle + ) + { + OpenglContext* context = (OpenglContext*)contextHandle; + if (context->glGetString != null) { + return; + } + delegate*, IntPtr> loader = &GraphicFramework.glfwGetProcAddress; + IntPtr proc = GraphicFramework.glfwGetProcAddress("glGetString"u8); + if (proc == IntPtr.Zero) + { + #if DEBUG + Console.WriteLine("Cannot load GL."); + #endif + throw new NotSupportedException("Cannot load gl"); + } + context->glGetString = (delegate*)proc; + + string coreVersion; + if (context->glGetString(glVersion) == null) { + DefaultLog.InternalWriteLog("Failed to call glGetString", LogType.Error); + } + coreVersion = Marshal.PtrToStringAnsi((nint)context->glGetString(glVersion)) ?? + string.Empty; + + foreach (string branch in glBranch) + { + if (coreVersion.Contains(branch)) { + coreVersion.Replace(branch, string.Empty); + } + } + string[] versionSep = coreVersion!.Split('.'); + int majorVersion = int.Parse(versionSep[0]); + int minorVersion = int.Parse(versionSep[1]); + CheckCoreVersion(majorVersion, minorVersion); + + + if (LoadGLcore10((glContextShadow*)context, loader) && + LoadGLcore11((glContextShadow*)context, loader) && + LoadGLcore12((glContextShadow*)context, loader) && + LoadGLcore13((glContextShadow*)context, loader) && + LoadGLcore14((glContextShadow*)context, loader) && + LoadGLcore15((glContextShadow*)context, loader) && + LoadGLcore20((glContextShadow*)context, loader) && + LoadGLcore21((glContextShadow*)context, loader) && + LoadGLcore30((glContextShadow*)context, loader) && + LoadGLcore31((glContextShadow*)context, loader) && + LoadGLcore32((glContextShadow*)context, loader) && + LoadGLcore33((glContextShadow*)context, loader) && + LoadGLcore40((glContextShadow*)context, loader) && + LoadGLcore41((glContextShadow*)context, loader) && + LoadGLcore42((glContextShadow*)context, loader) && + LoadGLcore43((glContextShadow*)context, loader) && + LoadGLcore44((glContextShadow*)context, loader) && + LoadGLcore45((glContextShadow*)context, loader) && + LoadGLcore46((glContextShadow*)context, loader)) { } + + uint code = context->glGetError(); + if (code != 0) + { + Console.WriteLine(code); + throw new GlExecutionException(code); + } + + int extensionCount; + context->glGetIntegerv(glConst.NUM_EXTENSIONS, &extensionCount); + if (extensionCount == 0) + { + DefaultLog.InternalWriteLog( + "No supported OpenGL extensions are found.", LogType.Info); + return; + } + + HashSet extensions = []; + + for (uint i = 0; i < extensionCount; i++) + { + byte* strPtr = context->glGetStringi(glConst.EXTENSIONS, i); + extensions.Add(Marshal.PtrToStringAnsi((IntPtr)strPtr) ?? string.Empty); + } + + DefaultLog.InternalWriteLog( + $"{$"Find OpenGL extensions:"}{Environment.NewLine}{string.Join(';', extensions)}", + LogType.Info); + + #region checkGLextensions + + if (extensions.Contains("gl_4DFX_multisample")) + { + _4DFX_multisample = true; + extensions.Remove("gl_4DFX_multisample"); + } + if (extensions.Contains("gl_3DFX_tbuffer")) + { + _3DFX_tbuffer = true; + extensions.Remove("gl_3DFX_tbuffer"); + } + if (extensions.Contains("gl_3DFX_texture_compression_FXT1")) + { + _3DFX_texture_compression_FXT1 = true; + extensions.Remove("gl_3DFX_texture_compression_FXT1"); + } + if (extensions.Contains("gl_AMD_blend_minmax_factor")) + { + AMD_blend_minmax_factor = true; + extensions.Remove("glAMD_blend_minmax_factor"); + } + if (extensions.Contains("gl_AMD_conservative_depth")) + { + AMD_conservative_depth = true; + extensions.Remove("glAMD_conservative_depth"); + } + if (extensions.Contains("gl_AMD_debug_output")) + { + AMD_debug_output = true; + extensions.Remove("glAMD_debug_output"); + } + if (extensions.Contains("gl_AMD_depth_clamp_separate")) + { + AMD_depth_clamp_separate = true; + extensions.Remove("glAMD_depth_clamp_separate"); + } + if (extensions.Contains("gl_AMD_draw_buffers_blend")) + { + AMD_draw_buffers_blend = true; + extensions.Remove("glAMD_draw_buffers_blend"); + } + if (extensions.Contains("gl_AMD_framebuffer_multisample_advanced")) + { + AMD_framebuffer_multisample_advanced = true; + extensions.Remove("glAMD_framebuffer_multisample_advanced"); + } + if (extensions.Contains("gl_AMD_framebuffer_sample_positions")) + { + AMD_framebuffer_sample_positions = true; + extensions.Remove("glAMD_framebuffer_sample_positions"); + } + if (extensions.Contains("gl_AMD_gcn_shader")) + { + AMD_gcn_shader = true; + extensions.Remove("glAMD_gcn_shader"); + } + if (extensions.Contains("gl_AMD_gpu_shader_half_float")) + { + AMD_gpu_shader_half_float = true; + extensions.Remove("glAMD_gpu_shader_half_float"); + } + if (extensions.Contains("gl_AMD_gpu_shader_int16")) + { + AMD_gpu_shader_int16 = true; + extensions.Remove("glAMD_gpu_shader_int16"); + } + if (extensions.Contains("gl_AMD_gpu_shader_int64")) + { + AMD_gpu_shader_int64 = true; + extensions.Remove("glAMD_gpu_shader_int64"); + } + if (extensions.Contains("gl_AMD_interleaved_elements")) + { + AMD_interleaved_elements = true; + extensions.Remove("glAMD_interleaved_elements"); + } + if (extensions.Contains("gl_AMD_multi_draw_indirect")) + { + AMD_multi_draw_indirect = true; + extensions.Remove("glAMD_multi_draw_indirect"); + } + if (extensions.Contains("gl_AMD_name_gen_delete")) + { + AMD_name_gen_delete = true; + extensions.Remove("glAMD_name_gen_delete"); + } + if (extensions.Contains("gl_AMD_occlusion_query_event")) + { + AMD_occlusion_query_event = true; + extensions.Remove("glAMD_occlusion_query_event"); + } + if (extensions.Contains("gl_AMD_performance_monitor")) + { + AMD_performance_monitor = true; + extensions.Remove("glAMD_performance_monitor"); + } + if (extensions.Contains("gl_AMD_pinned_memory")) + { + AMD_pinned_memory = true; + extensions.Remove("glAMD_pinned_memory"); + } + if (extensions.Contains("gl_AMD_query_buffer_object")) + { + AMD_query_buffer_object = true; + extensions.Remove("glAMD_query_buffer_object"); + } + if (extensions.Contains("gl_AMD_sample_positions")) + { + AMD_sample_positions = true; + extensions.Remove("glAMD_sample_positions"); + } + if (extensions.Contains("gl_AMD_seamless_cubemap_per_texture")) + { + AMD_seamless_cubemap_per_texture = true; + extensions.Remove("glAMD_seamless_cubemap_per_texture"); + } + if (extensions.Contains("gl_AMD_shader_atomic_counter_ops")) + { + AMD_shader_atomic_counter_ops = true; + extensions.Remove("glAMD_shader_atomic_counter_ops"); + } + if (extensions.Contains("gl_AMD_shader_ballot")) + { + AMD_shader_ballot = true; + extensions.Remove("glAMD_shader_ballot"); + } + if (extensions.Contains("gl_AMD_shader_explicit_vertex_parameter")) + { + AMD_shader_explicit_vertex_parameter = true; + extensions.Remove("glAMD_shader_explicit_vertex_parameter"); + } + if (extensions.Contains("gl_AMD_shader_gpu_shader_half_float_fetch")) + { + AMD_shader_gpu_shader_half_float_fetch = true; + extensions.Remove("glAMD_shader_gpu_shader_half_float_fetch"); + } + if (extensions.Contains("gl_AMD_shader_image_load_store_lod")) + { + AMD_shader_image_load_store_lod = true; + extensions.Remove("glAMD_shader_image_load_store_lod"); + } + if (extensions.Contains("gl_AMD_shader_stencil_export")) + { + AMD_shader_stencil_export = true; + extensions.Remove("glAMD_shader_stencil_export"); + } + if (extensions.Contains("gl_AMD_shader_trinary_minmax")) + { + AMD_shader_trinary_minmax = true; + extensions.Remove("glAMD_shader_trinary_minmax"); + } + if (extensions.Contains("gl_AMD_sparse_texture")) + { + AMD_sparse_texture = true; + extensions.Remove("glAMD_sparse_texture"); + } + if (extensions.Contains("gl_AMD_stencil_operation_extended")) + { + AMD_stencil_operation_extended = true; + extensions.Remove("glAMD_stencil_operation_extended"); + } + if (extensions.Contains("gl_AMD_texture_gather_bias_lod")) + { + AMD_texture_gather_bias_lod = true; + extensions.Remove("glAMD_texture_gather_bias_lod"); + } + if (extensions.Contains("gl_AMD_texture_texture4")) + { + AMD_texture_texture4 = true; + extensions.Remove("glAMD_texture_texture4"); + } + if (extensions.Contains("gl_AMD_transform_feedback3_lines_triangles")) + { + AMD_transform_feedback3_lines_triangles = true; + extensions.Remove("glAMD_transform_feedback3_lines_triangles"); + } + if (extensions.Contains("gl_AMD_transform_feedback4")) + { + AMD_transform_feedback4 = true; + extensions.Remove("glAMD_transform_feedback4"); + } + if (extensions.Contains("gl_AMD_vertex_shader_layer")) + { + AMD_vertex_shader_layer = true; + extensions.Remove("glAMD_vertex_shader_layer"); + } + if (extensions.Contains("gl_AMD_vertex_shader_tessellator")) + { + AMD_vertex_shader_tessellator = true; + extensions.Remove("glAMD_vertex_shader_tessellator"); + } + if (extensions.Contains("gl_AMD_vertex_shader_viewport_index")) + { + AMD_vertex_shader_viewport_index = true; + extensions.Remove("glAMD_vertex_shader_viewport_index"); + } + if (extensions.Contains("gl_APPLE_aux_depth_stencil")) + { + APPLE_aux_depth_stencil = true; + extensions.Remove("glAPPLE_aux_depth_stencil"); + } + if (extensions.Contains("gl_APPLE_client_storage")) + { + APPLE_client_storage = true; + extensions.Remove("glAPPLE_client_storage"); + } + if (extensions.Contains("gl_APPLE_element_array")) + { + APPLE_element_array = true; + extensions.Remove("glAPPLE_element_array"); + } + if (extensions.Contains("gl_APPLE_fence")) + { + APPLE_fence = true; + extensions.Remove("glAPPLE_fence"); + } + if (extensions.Contains("gl_APPLE_float_pixels")) + { + APPLE_float_pixels = true; + extensions.Remove("glAPPLE_float_pixels"); + } + if (extensions.Contains("gl_APPLE_flush_buffer_range")) + { + APPLE_flush_buffer_range = true; + extensions.Remove("glAPPLE_flush_buffer_range"); + } + if (extensions.Contains("gl_APPLE_object_purgeable")) + { + APPLE_object_purgeable = true; + extensions.Remove("glAPPLE_object_purgeable"); + } + if (extensions.Contains("gl_APPLE_rgb_422")) + { + APPLE_rgb_422 = true; + extensions.Remove("glAPPLE_rgb_422"); + } + if (extensions.Contains("gl_APPLE_row_bytes")) + { + APPLE_row_bytes = true; + extensions.Remove("glAPPLE_row_bytes"); + } + if (extensions.Contains("gl_APPLE_specular_vector")) + { + APPLE_specular_vector = true; + extensions.Remove("glAPPLE_specular_vector"); + } + if (extensions.Contains("gl_APPLE_texture_range")) + { + APPLE_texture_range = true; + extensions.Remove("glAPPLE_texture_range"); + } + if (extensions.Contains("gl_APPLE_transform_hint")) + { + APPLE_transform_hint = true; + extensions.Remove("glAPPLE_transform_hint"); + } + if (extensions.Contains("gl_APPLE_vertex_array_object")) + { + APPLE_vertex_array_object = true; + extensions.Remove("glAPPLE_vertex_array_object"); + } + if (extensions.Contains("gl_APPLE_vertex_array_range")) + { + APPLE_vertex_array_range = true; + extensions.Remove("glAPPLE_vertex_array_range"); + } + if (extensions.Contains("gl_APPLE_vertex_program_evaluators")) + { + APPLE_vertex_program_evaluators = true; + extensions.Remove("glAPPLE_vertex_program_evaluators"); + } + if (extensions.Contains("gl_APPLE_ycbcr_422")) + { + APPLE_ycbcr_422 = true; + extensions.Remove("glAPPLE_ycbcr_422"); + } + if (extensions.Contains("gl_ARB_ES2_compatibility")) + { + ARB_ES2_compatibility = true; + extensions.Remove("glARB_ES2_compatibility"); + } + if (extensions.Contains("gl_ARB_ES3_1_compatibility")) + { + ARB_ES3_1_compatibility = true; + extensions.Remove("glARB_ES3_1_compatibility"); + } + if (extensions.Contains("gl_ARB_ES3_2_compatibility")) + { + ARB_ES3_2_compatibility = true; + extensions.Remove("glARB_ES3_2_compatibility"); + } + if (extensions.Contains("gl_ARB_ES3_compatibility")) + { + ARB_ES3_compatibility = true; + extensions.Remove("glARB_ES3_compatibility"); + } + if (extensions.Contains("gl_ARB_arrays_of_arrays")) + { + ARB_arrays_of_arrays = true; + extensions.Remove("glARB_arrays_of_arrays"); + } + if (extensions.Contains("gl_ARB_base_instance")) + { + ARB_base_instance = true; + extensions.Remove("glARB_base_instance"); + } + if (extensions.Contains("gl_ARB_bindless_texture")) + { + ARB_bindless_texture = true; + extensions.Remove("glARB_bindless_texture"); + } + if (extensions.Contains("gl_ARB_blend_func_extended")) + { + ARB_blend_func_extended = true; + extensions.Remove("glARB_blend_func_extended"); + } + if (extensions.Contains("gl_ARB_buffer_storage")) + { + ARB_buffer_storage = true; + extensions.Remove("glARB_buffer_storage"); + } + if (extensions.Contains("gl_ARB_cl_event")) + { + ARB_cl_event = true; + extensions.Remove("glARB_cl_event"); + } + if (extensions.Contains("gl_ARB_clear_buffer_object")) + { + ARB_clear_buffer_object = true; + extensions.Remove("glARB_clear_buffer_object"); + } + if (extensions.Contains("gl_ARB_clear_texture")) + { + ARB_clear_texture = true; + extensions.Remove("glARB_clear_texture"); + } + if (extensions.Contains("gl_ARB_clip_control")) + { + ARB_clip_control = true; + extensions.Remove("glARB_clip_control"); + } + if (extensions.Contains("gl_ARB_color_buffer_float")) + { + ARB_color_buffer_float = true; + extensions.Remove("glARB_color_buffer_float"); + } + if (extensions.Contains("gl_ARB_compatibility")) + { + ARB_compatibility = true; + extensions.Remove("glARB_compatibility"); + } + if (extensions.Contains("gl_ARB_compressed_texture_pixel_storage")) + { + ARB_compressed_texture_pixel_storage = true; + extensions.Remove("glARB_compressed_texture_pixel_storage"); + } + if (extensions.Contains("gl_ARB_compute_shader")) + { + ARB_compute_shader = true; + extensions.Remove("glARB_compute_shader"); + } + if (extensions.Contains("gl_ARB_compute_variable_group_size")) + { + ARB_compute_variable_group_size = true; + extensions.Remove("glARB_compute_variable_group_size"); + } + if (extensions.Contains("gl_ARB_conditional_render_inverted")) + { + ARB_conditional_render_inverted = true; + extensions.Remove("glARB_conditional_render_inverted"); + } + if (extensions.Contains("gl_ARB_conservative_depth")) + { + ARB_conservative_depth = true; + extensions.Remove("glARB_conservative_depth"); + } + if (extensions.Contains("gl_ARB_copy_buffer")) + { + ARB_copy_buffer = true; + extensions.Remove("glARB_copy_buffer"); + } + if (extensions.Contains("gl_ARB_copy_image")) + { + ARB_copy_image = true; + extensions.Remove("glARB_copy_image"); + } + if (extensions.Contains("gl_ARB_cull_distance")) + { + ARB_cull_distance = true; + extensions.Remove("glARB_cull_distance"); + } + if (extensions.Contains("gl_ARB_debug_output")) + { + ARB_debug_output = true; + extensions.Remove("glARB_debug_output"); + } + if (extensions.Contains("gl_ARB_depth_buffer_float")) + { + ARB_depth_buffer_float = true; + extensions.Remove("glARB_depth_buffer_float"); + } + if (extensions.Contains("gl_ARB_depth_clamp")) + { + ARB_depth_clamp = true; + extensions.Remove("glARB_depth_clamp"); + } + if (extensions.Contains("gl_ARB_depth_texture")) + { + ARB_depth_texture = true; + extensions.Remove("glARB_depth_texture"); + } + if (extensions.Contains("gl_ARB_derivative_control")) + { + ARB_derivative_control = true; + extensions.Remove("glARB_derivative_control"); + } + if (extensions.Contains("gl_ARB_direct_state_access")) + { + ARB_direct_state_access = true; + extensions.Remove("glARB_direct_state_access"); + } + if (extensions.Contains("gl_ARB_draw_buffers")) + { + ARB_draw_buffers = true; + extensions.Remove("glARB_draw_buffers"); + } + if (extensions.Contains("gl_ARB_draw_buffers_blend")) + { + ARB_draw_buffers_blend = true; + extensions.Remove("glARB_draw_buffers_blend"); + } + if (extensions.Contains("gl_ARB_draw_elements_base_vertex")) + { + ARB_draw_elements_base_vertex = true; + extensions.Remove("glARB_draw_elements_base_vertex"); + } + if (extensions.Contains("gl_ARB_draw_indirect")) + { + ARB_draw_indirect = true; + extensions.Remove("glARB_draw_indirect"); + } + if (extensions.Contains("gl_ARB_draw_instanced")) + { + ARB_draw_instanced = true; + extensions.Remove("glARB_draw_instanced"); + } + if (extensions.Contains("gl_ARB_enhanced_layouts")) + { + ARB_enhanced_layouts = true; + extensions.Remove("glARB_enhanced_layouts"); + } + if (extensions.Contains("gl_ARB_explicit_attrib_location")) + { + ARB_explicit_attrib_location = true; + extensions.Remove("glARB_explicit_attrib_location"); + } + if (extensions.Contains("gl_ARB_explicit_uniform_location")) + { + ARB_explicit_uniform_location = true; + extensions.Remove("glARB_explicit_uniform_location"); + } + if (extensions.Contains("gl_ARB_fragment_coord_conventions")) + { + ARB_fragment_coord_conventions = true; + extensions.Remove("glARB_fragment_coord_conventions"); + } + if (extensions.Contains("gl_ARB_fragment_layer_viewport")) + { + ARB_fragment_layer_viewport = true; + extensions.Remove("glARB_fragment_layer_viewport"); + } + if (extensions.Contains("gl_ARB_fragment_program")) + { + ARB_fragment_program = true; + extensions.Remove("glARB_fragment_program"); + } + if (extensions.Contains("gl_ARB_fragment_program_shadow")) + { + ARB_fragment_program_shadow = true; + extensions.Remove("glARB_fragment_program_shadow"); + } + if (extensions.Contains("gl_ARB_fragment_shader")) + { + ARB_fragment_shader = true; + extensions.Remove("glARB_fragment_shader"); + } + if (extensions.Contains("gl_ARB_fragment_shader_interlock")) + { + ARB_fragment_shader_interlock = true; + extensions.Remove("glARB_fragment_shader_interlock"); + } + if (extensions.Contains("gl_ARB_framebuffer_no_attachments")) + { + ARB_framebuffer_no_attachments = true; + extensions.Remove("glARB_framebuffer_no_attachments"); + } + if (extensions.Contains("gl_ARB_framebuffer_object")) + { + ARB_framebuffer_object = true; + extensions.Remove("glARB_framebuffer_object"); + } + if (extensions.Contains("gl_ARB_framebuffer_sRGB")) + { + ARB_framebuffer_sRGB = true; + extensions.Remove("glARB_framebuffer_sRGB"); + } + if (extensions.Contains("gl_ARB_geometry_shader4")) + { + ARB_geometry_shader4 = true; + extensions.Remove("glARB_geometry_shader4"); + } + if (extensions.Contains("gl_ARB_get_program_binary")) + { + ARB_get_program_binary = true; + extensions.Remove("glARB_get_program_binary"); + } + if (extensions.Contains("gl_ARB_get_texture_sub_image")) + { + ARB_get_texture_sub_image = true; + extensions.Remove("glARB_get_texture_sub_image"); + } + if (extensions.Contains("gl_ARB_gl_spirv")) + { + ARB_gl_spirv = true; + extensions.Remove("glARB_gl_spirv"); + } + if (extensions.Contains("gl_ARB_gpu_shader5")) + { + ARB_gpu_shader5 = true; + extensions.Remove("glARB_gpu_shader5"); + } + if (extensions.Contains("gl_ARB_gpu_shader_fp64")) + { + ARB_gpu_shader_fp64 = true; + extensions.Remove("glARB_gpu_shader_fp64"); + } + if (extensions.Contains("gl_ARB_gpu_shader_int64")) + { + ARB_gpu_shader_int64 = true; + extensions.Remove("glARB_gpu_shader_int64"); + } + if (extensions.Contains("gl_ARB_half_float_pixel")) + { + ARB_half_float_pixel = true; + extensions.Remove("glARB_half_float_pixel"); + } + if (extensions.Contains("gl_ARB_half_float_vertex")) + { + ARB_half_float_vertex = true; + extensions.Remove("glARB_half_float_vertex"); + } + if (extensions.Contains("gl_ARB_imaging")) + { + ARB_imaging = true; + extensions.Remove("glARB_imaging"); + } + if (extensions.Contains("gl_ARB_indirect_parameters")) + { + ARB_indirect_parameters = true; + extensions.Remove("glARB_indirect_parameters"); + } + if (extensions.Contains("gl_ARB_instanced_arrays")) + { + ARB_instanced_arrays = true; + extensions.Remove("glARB_instanced_arrays"); + } + if (extensions.Contains("gl_ARB_internalformat_query")) + { + ARB_internalformat_query = true; + extensions.Remove("glARB_internalformat_query"); + } + if (extensions.Contains("gl_ARB_internalformat_query2")) + { + ARB_internalformat_query2 = true; + extensions.Remove("glARB_internalformat_query2"); + } + if (extensions.Contains("gl_ARB_invalidate_subdata")) + { + ARB_invalidate_subdata = true; + extensions.Remove("glARB_invalidate_subdata"); + } + if (extensions.Contains("gl_ARB_map_buffer_alignment")) + { + ARB_map_buffer_alignment = true; + extensions.Remove("glARB_map_buffer_alignment"); + } + if (extensions.Contains("gl_ARB_map_buffer_range")) + { + ARB_map_buffer_range = true; + extensions.Remove("glARB_map_buffer_range"); + } + if (extensions.Contains("gl_ARB_matrix_palette")) + { + ARB_matrix_palette = true; + extensions.Remove("glARB_matrix_palette"); + } + if (extensions.Contains("gl_ARB_multi_bind")) + { + ARB_multi_bind = true; + extensions.Remove("glARB_multi_bind"); + } + if (extensions.Contains("gl_ARB_multi_draw_indirect")) + { + ARB_multi_draw_indirect = true; + extensions.Remove("glARB_multi_draw_indirect"); + } + if (extensions.Contains("gl_ARB_multisample")) + { + ARB_multisample = true; + extensions.Remove("glARB_multisample"); + } + if (extensions.Contains("gl_ARB_multitexture")) + { + ARB_multitexture = true; + extensions.Remove("glARB_multitexture"); + } + if (extensions.Contains("gl_ARB_occlusion_query")) + { + ARB_occlusion_query = true; + extensions.Remove("glARB_occlusion_query"); + } + if (extensions.Contains("gl_ARB_occlusion_query2")) + { + ARB_occlusion_query2 = true; + extensions.Remove("glARB_occlusion_query2"); + } + if (extensions.Contains("gl_ARB_parallel_shader_compile")) + { + ARB_parallel_shader_compile = true; + extensions.Remove("glARB_parallel_shader_compile"); + } + if (extensions.Contains("gl_ARB_pipeline_statistics_query")) + { + ARB_pipeline_statistics_query = true; + extensions.Remove("glARB_pipeline_statistics_query"); + } + if (extensions.Contains("gl_ARB_pixel_buffer_object")) + { + ARB_pixel_buffer_object = true; + extensions.Remove("glARB_pixel_buffer_object"); + } + if (extensions.Contains("gl_ARB_point_parameters")) + { + ARB_point_parameters = true; + extensions.Remove("glARB_point_parameters"); + } + if (extensions.Contains("gl_ARB_point_sprite")) + { + ARB_point_sprite = true; + extensions.Remove("glARB_point_sprite"); + } + if (extensions.Contains("gl_ARB_polygon_offset_clamp")) + { + ARB_polygon_offset_clamp = true; + extensions.Remove("glARB_polygon_offset_clamp"); + } + if (extensions.Contains("gl_ARB_post_depth_coverage")) + { + ARB_post_depth_coverage = true; + extensions.Remove("glARB_post_depth_coverage"); + } + if (extensions.Contains("gl_ARB_program_interface_query")) + { + ARB_program_interface_query = true; + extensions.Remove("glARB_program_interface_query"); + } + if (extensions.Contains("gl_ARB_provoking_vertex")) + { + ARB_provoking_vertex = true; + extensions.Remove("glARB_provoking_vertex"); + } + if (extensions.Contains("gl_ARB_query_buffer_object")) + { + ARB_query_buffer_object = true; + extensions.Remove("glARB_query_buffer_object"); + } + if (extensions.Contains("gl_ARB_robust_buffer_access_behavior")) + { + ARB_robust_buffer_access_behavior = true; + extensions.Remove("glARB_robust_buffer_access_behavior"); + } + if (extensions.Contains("gl_ARB_robustness")) + { + ARB_robustness = true; + extensions.Remove("glARB_robustness"); + } + if (extensions.Contains("gl_ARB_robustness_isolation")) + { + ARB_robustness_isolation = true; + extensions.Remove("glARB_robustness_isolation"); + } + if (extensions.Contains("gl_ARB_sample_locations")) + { + ARB_sample_locations = true; + extensions.Remove("glARB_sample_locations"); + } + if (extensions.Contains("gl_ARB_sample_shading")) + { + ARB_sample_shading = true; + extensions.Remove("glARB_sample_shading"); + } + if (extensions.Contains("gl_ARB_sampler_objects")) + { + ARB_sampler_objects = true; + extensions.Remove("glARB_sampler_objects"); + } + if (extensions.Contains("gl_ARB_seamless_cube_map")) + { + ARB_seamless_cube_map = true; + extensions.Remove("glARB_seamless_cube_map"); + } + if (extensions.Contains("gl_ARB_seamless_cubemap_per_texture")) + { + ARB_seamless_cubemap_per_texture = true; + extensions.Remove("glARB_seamless_cubemap_per_texture"); + } + if (extensions.Contains("gl_ARB_separate_shader_objects")) + { + ARB_separate_shader_objects = true; + extensions.Remove("glARB_separate_shader_objects"); + } + if (extensions.Contains("gl_ARB_shader_atomic_counter_ops")) + { + ARB_shader_atomic_counter_ops = true; + extensions.Remove("glARB_shader_atomic_counter_ops"); + } + if (extensions.Contains("gl_ARB_shader_atomic_counters")) + { + ARB_shader_atomic_counters = true; + extensions.Remove("glARB_shader_atomic_counters"); + } + if (extensions.Contains("gl_ARB_shader_ballot")) + { + ARB_shader_ballot = true; + extensions.Remove("glARB_shader_ballot"); + } + if (extensions.Contains("gl_ARB_shader_bit_encoding")) + { + ARB_shader_bit_encoding = true; + extensions.Remove("glARB_shader_bit_encoding"); + } + if (extensions.Contains("gl_ARB_shader_clock")) + { + ARB_shader_clock = true; + extensions.Remove("glARB_shader_clock"); + } + if (extensions.Contains("gl_ARB_shader_draw_parameters")) + { + ARB_shader_draw_parameters = true; + extensions.Remove("glARB_shader_draw_parameters"); + } + if (extensions.Contains("gl_ARB_shader_group_vote")) + { + ARB_shader_group_vote = true; + extensions.Remove("glARB_shader_group_vote"); + } + if (extensions.Contains("gl_ARB_shader_image_load_store")) + { + ARB_shader_image_load_store = true; + extensions.Remove("glARB_shader_image_load_store"); + } + if (extensions.Contains("gl_ARB_shader_image_size")) + { + ARB_shader_image_size = true; + extensions.Remove("glARB_shader_image_size"); + } + if (extensions.Contains("gl_ARB_shader_objects")) + { + ARB_shader_objects = true; + extensions.Remove("glARB_shader_objects"); + } + if (extensions.Contains("gl_ARB_shader_precision")) + { + ARB_shader_precision = true; + extensions.Remove("glARB_shader_precision"); + } + if (extensions.Contains("gl_ARB_shader_stencil_export")) + { + ARB_shader_stencil_export = true; + extensions.Remove("glARB_shader_stencil_export"); + } + if (extensions.Contains("gl_ARB_shader_storage_buffer_object")) + { + ARB_shader_storage_buffer_object = true; + extensions.Remove("glARB_shader_storage_buffer_object"); + } + if (extensions.Contains("gl_ARB_shader_subroutine")) + { + ARB_shader_subroutine = true; + extensions.Remove("glARB_shader_subroutine"); + } + if (extensions.Contains("gl_ARB_shader_texture_image_samples")) + { + ARB_shader_texture_image_samples = true; + extensions.Remove("glARB_shader_texture_image_samples"); + } + if (extensions.Contains("gl_ARB_shader_texture_lod")) + { + ARB_shader_texture_lod = true; + extensions.Remove("glARB_shader_texture_lod"); + } + if (extensions.Contains("gl_ARB_shader_viewport_layer_array")) + { + ARB_shader_viewport_layer_array = true; + extensions.Remove("glARB_shader_viewport_layer_array"); + } + if (extensions.Contains("gl_ARB_shading_language_100")) + { + ARB_shading_language_100 = true; + extensions.Remove("glARB_shading_language_100"); + } + if (extensions.Contains("gl_ARB_shading_language_420pack")) + { + ARB_shading_language_420pack = true; + extensions.Remove("glARB_shading_language_420pack"); + } + if (extensions.Contains("gl_ARB_shading_language_include")) + { + ARB_shading_language_include = true; + extensions.Remove("glARB_shading_language_include"); + } + if (extensions.Contains("gl_ARB_shading_language_packing")) + { + ARB_shading_language_packing = true; + extensions.Remove("glARB_shading_language_packing"); + } + if (extensions.Contains("gl_ARB_shadow")) + { + ARB_shadow = true; + extensions.Remove("glARB_shadow"); + } + if (extensions.Contains("gl_ARB_shadow_ambient")) + { + ARB_shadow_ambient = true; + extensions.Remove("glARB_shadow_ambient"); + } + if (extensions.Contains("gl_ARB_sparse_buffer")) + { + ARB_sparse_buffer = true; + extensions.Remove("glARB_sparse_buffer"); + } + if (extensions.Contains("gl_ARB_sparse_texture")) + { + ARB_sparse_texture = true; + extensions.Remove("glARB_sparse_texture"); + } + if (extensions.Contains("gl_ARB_sparse_texture2")) + { + ARB_sparse_texture2 = true; + extensions.Remove("glARB_sparse_texture2"); + } + if (extensions.Contains("gl_ARB_sparse_texture_clamp")) + { + ARB_sparse_texture_clamp = true; + extensions.Remove("glARB_sparse_texture_clamp"); + } + if (extensions.Contains("gl_ARB_spirv_extensions")) + { + ARB_spirv_extensions = true; + extensions.Remove("glARB_spirv_extensions"); + } + if (extensions.Contains("gl_ARB_stencil_texturing")) + { + ARB_stencil_texturing = true; + extensions.Remove("glARB_stencil_texturing"); + } + if (extensions.Contains("gl_ARB_sync")) + { + ARB_sync = true; + extensions.Remove("glARB_sync"); + } + if (extensions.Contains("gl_ARB_tessellation_shader")) + { + ARB_tessellation_shader = true; + extensions.Remove("glARB_tessellation_shader"); + } + if (extensions.Contains("gl_ARB_texture_barrier")) + { + ARB_texture_barrier = true; + extensions.Remove("glARB_texture_barrier"); + } + if (extensions.Contains("gl_ARB_texture_border_clamp")) + { + ARB_texture_border_clamp = true; + extensions.Remove("glARB_texture_border_clamp"); + } + if (extensions.Contains("gl_ARB_texture_buffer_object")) + { + ARB_texture_buffer_object = true; + extensions.Remove("glARB_texture_buffer_object"); + } + if (extensions.Contains("gl_ARB_texture_buffer_object_rgb32")) + { + ARB_texture_buffer_object_rgb32 = true; + extensions.Remove("glARB_texture_buffer_object_rgb32"); + } + if (extensions.Contains("gl_ARB_texture_buffer_range")) + { + ARB_texture_buffer_range = true; + extensions.Remove("glARB_texture_buffer_range"); + } + if (extensions.Contains("gl_ARB_texture_compression")) + { + ARB_texture_compression = true; + extensions.Remove("glARB_texture_compression"); + } + if (extensions.Contains("gl_ARB_texture_compression_bptc")) + { + ARB_texture_compression_bptc = true; + extensions.Remove("glARB_texture_compression_bptc"); + } + if (extensions.Contains("gl_ARB_texture_compression_rgtc")) + { + ARB_texture_compression_rgtc = true; + extensions.Remove("glARB_texture_compression_rgtc"); + } + if (extensions.Contains("gl_ARB_texture_cube_map")) + { + ARB_texture_cube_map = true; + extensions.Remove("glARB_texture_cube_map"); + } + if (extensions.Contains("gl_ARB_texture_cube_map_array")) + { + ARB_texture_cube_map_array = true; + extensions.Remove("glARB_texture_cube_map_array"); + } + if (extensions.Contains("gl_ARB_texture_env_add")) + { + ARB_texture_env_add = true; + extensions.Remove("glARB_texture_env_add"); + } + if (extensions.Contains("gl_ARB_texture_env_combine")) + { + ARB_texture_env_combine = true; + extensions.Remove("glARB_texture_env_combine"); + } + if (extensions.Contains("gl_ARB_texture_env_crossbar")) + { + ARB_texture_env_crossbar = true; + extensions.Remove("glARB_texture_env_crossbar"); + } + if (extensions.Contains("gl_ARB_texture_env_dot3")) + { + ARB_texture_env_dot3 = true; + extensions.Remove("glARB_texture_env_dot3"); + } + if (extensions.Contains("gl_ARB_texture_filter_anisotropic")) + { + ARB_texture_filter_anisotropic = true; + extensions.Remove("glARB_texture_filter_anisotropic"); + } + if (extensions.Contains("gl_ARB_texture_filter_minmax")) + { + ARB_texture_filter_minmax = true; + extensions.Remove("glARB_texture_filter_minmax"); + } + if (extensions.Contains("gl_ARB_texture_float")) + { + ARB_texture_float = true; + extensions.Remove("glARB_texture_float"); + } + if (extensions.Contains("gl_ARB_texture_gather")) + { + ARB_texture_gather = true; + extensions.Remove("glARB_texture_gather"); + } + if (extensions.Contains("gl_ARB_texture_mirror_clamp_to_edge")) + { + ARB_texture_mirror_clamp_to_edge = true; + extensions.Remove("glARB_texture_mirror_clamp_to_edge"); + } + if (extensions.Contains("gl_ARB_texture_mirrored_repeat")) + { + ARB_texture_mirrored_repeat = true; + extensions.Remove("glARB_texture_mirrored_repeat"); + } + if (extensions.Contains("gl_ARB_texture_multisample")) + { + ARB_texture_multisample = true; + extensions.Remove("glARB_texture_multisample"); + } + if (extensions.Contains("gl_ARB_texture_non_power_of_two")) + { + ARB_texture_non_power_of_two = true; + extensions.Remove("glARB_texture_non_power_of_two"); + } + if (extensions.Contains("gl_ARB_texture_query_levels")) + { + ARB_texture_query_levels = true; + extensions.Remove("glARB_texture_query_levels"); + } + if (extensions.Contains("gl_ARB_texture_query_lod")) + { + ARB_texture_query_lod = true; + extensions.Remove("glARB_texture_query_lod"); + } + if (extensions.Contains("gl_ARB_texture_rectangle")) + { + ARB_texture_rectangle = true; + extensions.Remove("glARB_texture_rectangle"); + } + if (extensions.Contains("gl_ARB_texture_rg")) + { + ARB_texture_rg = true; + extensions.Remove("glARB_texture_rg"); + } + if (extensions.Contains("gl_ARB_texture_rgb10_a2ui")) + { + ARB_texture_rgb10_a2ui = true; + extensions.Remove("glARB_texture_rgb10_a2ui"); + } + if (extensions.Contains("gl_ARB_texture_stencil8")) + { + ARB_texture_stencil8 = true; + extensions.Remove("glARB_texture_stencil8"); + } + if (extensions.Contains("gl_ARB_texture_storage")) + { + ARB_texture_storage = true; + extensions.Remove("glARB_texture_storage"); + } + if (extensions.Contains("gl_ARB_texture_storage_multisample")) + { + ARB_texture_storage_multisample = true; + extensions.Remove("glARB_texture_storage_multisample"); + } + if (extensions.Contains("gl_ARB_texture_swizzle")) + { + ARB_texture_swizzle = true; + extensions.Remove("glARB_texture_swizzle"); + } + if (extensions.Contains("gl_ARB_texture_view")) + { + ARB_texture_view = true; + extensions.Remove("glARB_texture_view"); + } + if (extensions.Contains("gl_ARB_timer_query")) + { + ARB_timer_query = true; + extensions.Remove("glARB_timer_query"); + } + if (extensions.Contains("gl_ARB_transform_feedback2")) + { + ARB_transform_feedback2 = true; + extensions.Remove("glARB_transform_feedback2"); + } + if (extensions.Contains("gl_ARB_transform_feedback3")) + { + ARB_transform_feedback3 = true; + extensions.Remove("glARB_transform_feedback3"); + } + if (extensions.Contains("gl_ARB_transform_feedback_instanced")) + { + ARB_transform_feedback_instanced = true; + extensions.Remove("glARB_transform_feedback_instanced"); + } + if (extensions.Contains("gl_ARB_transform_feedback_overflow_query")) + { + ARB_transform_feedback_overflow_query = true; + extensions.Remove("glARB_transform_feedback_overflow_query"); + } + if (extensions.Contains("gl_ARB_transpose_matrix")) + { + ARB_transpose_matrix = true; + extensions.Remove("glARB_transpose_matrix"); + } + if (extensions.Contains("gl_ARB_uniform_buffer_object")) + { + ARB_uniform_buffer_object = true; + extensions.Remove("glARB_uniform_buffer_object"); + } + if (extensions.Contains("gl_ARB_vertex_array_bgra")) + { + ARB_vertex_array_bgra = true; + extensions.Remove("glARB_vertex_array_bgra"); + } + if (extensions.Contains("gl_ARB_vertex_array_object")) + { + ARB_vertex_array_object = true; + extensions.Remove("glARB_vertex_array_object"); + } + if (extensions.Contains("gl_ARB_vertex_attrib_64bit")) + { + ARB_vertex_attrib_64bit = true; + extensions.Remove("glARB_vertex_attrib_64bit"); + } + if (extensions.Contains("gl_ARB_vertex_attrib_binding")) + { + ARB_vertex_attrib_binding = true; + extensions.Remove("glARB_vertex_attrib_binding"); + } + if (extensions.Contains("gl_ARB_vertex_blend")) + { + ARB_vertex_blend = true; + extensions.Remove("glARB_vertex_blend"); + } + if (extensions.Contains("gl_ARB_vertex_buffer_object")) + { + ARB_vertex_buffer_object = true; + extensions.Remove("glARB_vertex_buffer_object"); + } + if (extensions.Contains("gl_ARB_vertex_program")) + { + ARB_vertex_program = true; + extensions.Remove("glARB_vertex_program"); + } + if (extensions.Contains("gl_ARB_vertex_shader")) + { + ARB_vertex_shader = true; + extensions.Remove("glARB_vertex_shader"); + } + if (extensions.Contains("gl_ARB_vertex_type_10f_11f_11f_rev")) + { + ARB_vertex_type_10f_11f_11f_rev = true; + extensions.Remove("glARB_vertex_type_10f_11f_11f_rev"); + } + if (extensions.Contains("gl_ARB_vertex_type_2_10_10_10_rev")) + { + ARB_vertex_type_2_10_10_10_rev = true; + extensions.Remove("glARB_vertex_type_2_10_10_10_rev"); + } + if (extensions.Contains("gl_ARB_viewport_array")) + { + ARB_viewport_array = true; + extensions.Remove("glARB_viewport_array"); + } + if (extensions.Contains("gl_ARB_window_pos")) + { + ARB_window_pos = true; + extensions.Remove("glARB_window_pos"); + } + if (extensions.Contains("gl_ATI_draw_buffers")) + { + ATI_draw_buffers = true; + extensions.Remove("glATI_draw_buffers"); + } + if (extensions.Contains("gl_ATI_element_array")) + { + ATI_element_array = true; + extensions.Remove("glATI_element_array"); + } + if (extensions.Contains("gl_ATI_envmap_bumpmap")) + { + ATI_envmap_bumpmap = true; + extensions.Remove("glATI_envmap_bumpmap"); + } + if (extensions.Contains("gl_ATI_fragment_shader")) + { + ATI_fragment_shader = true; + extensions.Remove("glATI_fragment_shader"); + } + if (extensions.Contains("gl_ATI_map_object_buffer")) + { + ATI_map_object_buffer = true; + extensions.Remove("glATI_map_object_buffer"); + } + if (extensions.Contains("gl_ATI_meminfo")) + { + ATI_meminfo = true; + extensions.Remove("glATI_meminfo"); + } + if (extensions.Contains("gl_ATI_pixel_format_float")) + { + ATI_pixel_format_float = true; + extensions.Remove("glATI_pixel_format_float"); + } + if (extensions.Contains("gl_ATI_pn_triangles")) + { + ATI_pn_triangles = true; + extensions.Remove("glATI_pn_triangles"); + } + if (extensions.Contains("gl_ATI_separate_stencil")) + { + ATI_separate_stencil = true; + extensions.Remove("glATI_separate_stencil"); + } + if (extensions.Contains("gl_ATI_text_fragment_shader")) + { + ATI_text_fragment_shader = true; + extensions.Remove("glATI_text_fragment_shader"); + } + if (extensions.Contains("gl_ATI_texture_env_combine3")) + { + ATI_texture_env_combine3 = true; + extensions.Remove("glATI_texture_env_combine3"); + } + if (extensions.Contains("gl_ATI_texture_float")) + { + ATI_texture_float = true; + extensions.Remove("glATI_texture_float"); + } + if (extensions.Contains("gl_ATI_texture_mirror_once")) + { + ATI_texture_mirror_once = true; + extensions.Remove("glATI_texture_mirror_once"); + } + if (extensions.Contains("gl_ATI_vertex_array_object")) + { + ATI_vertex_array_object = true; + extensions.Remove("glATI_vertex_array_object"); + } + if (extensions.Contains("gl_ATI_vertex_attrib_array_object")) + { + ATI_vertex_attrib_array_object = true; + extensions.Remove("glATI_vertex_attrib_array_object"); + } + if (extensions.Contains("gl_ATI_vertex_streams")) + { + ATI_vertex_streams = true; + extensions.Remove("glATI_vertex_streams"); + } + if (extensions.Contains("gl_EXT_422_pixels")) + { + EXT_422_pixels = true; + extensions.Remove("glEXT_422_pixels"); + } + if (extensions.Contains("gl_EXT_EGL_image_storage")) + { + EXT_EGL_image_storage = true; + extensions.Remove("glEXT_EGL_image_storage"); + } + if (extensions.Contains("gl_EXT_EGL_sync")) + { + EXT_EGL_sync = true; + extensions.Remove("glEXT_EGL_sync"); + } + if (extensions.Contains("gl_EXT_abgr")) + { + EXT_abgr = true; + extensions.Remove("glEXT_abgr"); + } + if (extensions.Contains("gl_EXT_bgra")) + { + EXT_bgra = true; + extensions.Remove("glEXT_bgra"); + } + if (extensions.Contains("gl_EXT_bindable_uniform")) + { + EXT_bindable_uniform = true; + extensions.Remove("glEXT_bindable_uniform"); + } + if (extensions.Contains("gl_EXT_blend_color")) + { + EXT_blend_color = true; + extensions.Remove("glEXT_blend_color"); + } + if (extensions.Contains("gl_EXT_blend_equation_separate")) + { + EXT_blend_equation_separate = true; + extensions.Remove("glEXT_blend_equation_separate"); + } + if (extensions.Contains("gl_EXT_blend_func_separate")) + { + EXT_blend_func_separate = true; + extensions.Remove("glEXT_blend_func_separate"); + } + if (extensions.Contains("gl_EXT_blend_logic_op")) + { + EXT_blend_logic_op = true; + extensions.Remove("glEXT_blend_logic_op"); + } + if (extensions.Contains("gl_EXT_blend_minmax")) + { + EXT_blend_minmax = true; + extensions.Remove("glEXT_blend_minmax"); + } + if (extensions.Contains("gl_EXT_blend_subtract")) + { + EXT_blend_subtract = true; + extensions.Remove("glEXT_blend_subtract"); + } + if (extensions.Contains("gl_EXT_clip_volume_hint")) + { + EXT_clip_volume_hint = true; + extensions.Remove("glEXT_clip_volume_hint"); + } + if (extensions.Contains("gl_EXT_cmyka")) + { + EXT_cmyka = true; + extensions.Remove("glEXT_cmyka"); + } + if (extensions.Contains("gl_EXT_color_subtable")) + { + EXT_color_subtable = true; + extensions.Remove("glEXT_color_subtable"); + } + if (extensions.Contains("gl_EXT_compiled_vertex_array")) + { + EXT_compiled_vertex_array = true; + extensions.Remove("glEXT_compiled_vertex_array"); + } + if (extensions.Contains("gl_EXT_convolution")) + { + EXT_convolution = true; + extensions.Remove("glEXT_convolution"); + } + if (extensions.Contains("gl_EXT_coordinate_frame")) + { + EXT_coordinate_frame = true; + extensions.Remove("glEXT_coordinate_frame"); + } + if (extensions.Contains("gl_EXT_copy_texture")) + { + EXT_copy_texture = true; + extensions.Remove("glEXT_copy_texture"); + } + if (extensions.Contains("gl_EXT_cull_vertex")) + { + EXT_cull_vertex = true; + extensions.Remove("glEXT_cull_vertex"); + } + if (extensions.Contains("gl_EXT_debug_label")) + { + EXT_debug_label = true; + extensions.Remove("glEXT_debug_label"); + } + if (extensions.Contains("gl_EXT_debug_marker")) + { + EXT_debug_marker = true; + extensions.Remove("glEXT_debug_marker"); + } + if (extensions.Contains("gl_EXT_depth_bounds_test")) + { + EXT_depth_bounds_test = true; + extensions.Remove("glEXT_depth_bounds_test"); + } + if (extensions.Contains("gl_EXT_direct_state_access")) + { + EXT_direct_state_access = true; + extensions.Remove("glEXT_direct_state_access"); + } + if (extensions.Contains("gl_EXT_draw_buffers2")) + { + EXT_draw_buffers2 = true; + extensions.Remove("glEXT_draw_buffers2"); + } + if (extensions.Contains("gl_EXT_draw_instanced")) + { + EXT_draw_instanced = true; + extensions.Remove("glEXT_draw_instanced"); + } + if (extensions.Contains("gl_EXT_draw_range_elements")) + { + EXT_draw_range_elements = true; + extensions.Remove("glEXT_draw_range_elements"); + } + if (extensions.Contains("gl_EXT_external_buffer")) + { + EXT_external_buffer = true; + extensions.Remove("glEXT_external_buffer"); + } + if (extensions.Contains("gl_EXT_fog_coord")) + { + EXT_fog_coord = true; + extensions.Remove("glEXT_fog_coord"); + } + if (extensions.Contains("gl_EXT_framebuffer_blit")) + { + EXT_framebuffer_blit = true; + extensions.Remove("glEXT_framebuffer_blit"); + } + if (extensions.Contains("gl_EXT_framebuffer_blit_layers")) + { + EXT_framebuffer_blit_layers = true; + extensions.Remove("glEXT_framebuffer_blit_layers"); + } + if (extensions.Contains("gl_EXT_framebuffer_multisample")) + { + EXT_framebuffer_multisample = true; + extensions.Remove("glEXT_framebuffer_multisample"); + } + if (extensions.Contains("gl_EXT_framebuffer_multisample_blit_scaled")) + { + EXT_framebuffer_multisample_blit_scaled = true; + extensions.Remove("glEXT_framebuffer_multisample_blit_scaled"); + } + if (extensions.Contains("gl_EXT_framebuffer_object")) + { + EXT_framebuffer_object = true; + extensions.Remove("glEXT_framebuffer_object"); + } + if (extensions.Contains("gl_EXT_framebuffer_sRGB")) + { + EXT_framebuffer_sRGB = true; + extensions.Remove("glEXT_framebuffer_sRGB"); + } + if (extensions.Contains("gl_EXT_geometry_shader4")) + { + EXT_geometry_shader4 = true; + extensions.Remove("glEXT_geometry_shader4"); + } + if (extensions.Contains("gl_EXT_gpu_program_parameters")) + { + EXT_gpu_program_parameters = true; + extensions.Remove("glEXT_gpu_program_parameters"); + } + if (extensions.Contains("gl_EXT_gpu_shader4")) + { + EXT_gpu_shader4 = true; + extensions.Remove("glEXT_gpu_shader4"); + } + if (extensions.Contains("gl_EXT_histogram")) + { + EXT_histogram = true; + extensions.Remove("glEXT_histogram"); + } + if (extensions.Contains("gl_EXT_index_array_formats")) + { + EXT_index_array_formats = true; + extensions.Remove("glEXT_index_array_formats"); + } + if (extensions.Contains("gl_EXT_index_func")) + { + EXT_index_func = true; + extensions.Remove("glEXT_index_func"); + } + if (extensions.Contains("gl_EXT_index_material")) + { + EXT_index_material = true; + extensions.Remove("glEXT_index_material"); + } + if (extensions.Contains("gl_EXT_index_texture")) + { + EXT_index_texture = true; + extensions.Remove("glEXT_index_texture"); + } + if (extensions.Contains("gl_EXT_light_texture")) + { + EXT_light_texture = true; + extensions.Remove("glEXT_light_texture"); + } + if (extensions.Contains("gl_EXT_memory_object")) + { + EXT_memory_object = true; + extensions.Remove("glEXT_memory_object"); + } + if (extensions.Contains("gl_EXT_memory_object_fd")) + { + EXT_memory_object_fd = true; + extensions.Remove("glEXT_memory_object_fd"); + } + if (extensions.Contains("gl_EXT_memory_object_win32")) + { + EXT_memory_object_win32 = true; + extensions.Remove("glEXT_memory_object_win32"); + } + if (extensions.Contains("gl_EXT_misc_attribute")) + { + EXT_misc_attribute = true; + extensions.Remove("glEXT_misc_attribute"); + } + if (extensions.Contains("gl_EXT_multi_draw_arrays")) + { + EXT_multi_draw_arrays = true; + extensions.Remove("glEXT_multi_draw_arrays"); + } + if (extensions.Contains("gl_EXT_multisample")) + { + EXT_multisample = true; + extensions.Remove("glEXT_multisample"); + } + if (extensions.Contains("gl_EXT_multiview_tessellation_geometry_shader")) + { + EXT_multiview_tessellation_geometry_shader = true; + extensions.Remove("glEXT_multiview_tessellation_geometry_shader"); + } + if (extensions.Contains("gl_EXT_multiview_texture_multisample")) + { + EXT_multiview_texture_multisample = true; + extensions.Remove("glEXT_multiview_texture_multisample"); + } + if (extensions.Contains("gl_EXT_multiview_timer_query")) + { + EXT_multiview_timer_query = true; + extensions.Remove("glEXT_multiview_timer_query"); + } + if (extensions.Contains("gl_EXT_packed_depth_stencil")) + { + EXT_packed_depth_stencil = true; + extensions.Remove("glEXT_packed_depth_stencil"); + } + if (extensions.Contains("gl_EXT_packed_float")) + { + EXT_packed_float = true; + extensions.Remove("glEXT_packed_float"); + } + if (extensions.Contains("gl_EXT_packed_pixels")) + { + EXT_packed_pixels = true; + extensions.Remove("glEXT_packed_pixels"); + } + if (extensions.Contains("gl_EXT_paletted_texture")) + { + EXT_paletted_texture = true; + extensions.Remove("glEXT_paletted_texture"); + } + if (extensions.Contains("gl_EXT_pixel_buffer_object")) + { + EXT_pixel_buffer_object = true; + extensions.Remove("glEXT_pixel_buffer_object"); + } + if (extensions.Contains("gl_EXT_pixel_transform")) + { + EXT_pixel_transform = true; + extensions.Remove("glEXT_pixel_transform"); + } + if (extensions.Contains("gl_EXT_pixel_transform_color_table")) + { + EXT_pixel_transform_color_table = true; + extensions.Remove("glEXT_pixel_transform_color_table"); + } + if (extensions.Contains("gl_EXT_point_parameters")) + { + EXT_point_parameters = true; + extensions.Remove("glEXT_point_parameters"); + } + if (extensions.Contains("gl_EXT_polygon_offset")) + { + EXT_polygon_offset = true; + extensions.Remove("glEXT_polygon_offset"); + } + if (extensions.Contains("gl_EXT_polygon_offset_clamp")) + { + EXT_polygon_offset_clamp = true; + extensions.Remove("glEXT_polygon_offset_clamp"); + } + if (extensions.Contains("gl_EXT_post_depth_coverage")) + { + EXT_post_depth_coverage = true; + extensions.Remove("glEXT_post_depth_coverage"); + } + if (extensions.Contains("gl_EXT_provoking_vertex")) + { + EXT_provoking_vertex = true; + extensions.Remove("glEXT_provoking_vertex"); + } + if (extensions.Contains("gl_EXT_raster_multisample")) + { + EXT_raster_multisample = true; + extensions.Remove("glEXT_raster_multisample"); + } + if (extensions.Contains("gl_EXT_rescale_normal")) + { + EXT_rescale_normal = true; + extensions.Remove("glEXT_rescale_normal"); + } + if (extensions.Contains("gl_EXT_secondary_color")) + { + EXT_secondary_color = true; + extensions.Remove("glEXT_secondary_color"); + } + if (extensions.Contains("gl_EXT_semaphore")) + { + EXT_semaphore = true; + extensions.Remove("glEXT_semaphore"); + } + if (extensions.Contains("gl_EXT_semaphore_fd")) + { + EXT_semaphore_fd = true; + extensions.Remove("glEXT_semaphore_fd"); + } + if (extensions.Contains("gl_EXT_semaphore_win32")) + { + EXT_semaphore_win32 = true; + extensions.Remove("glEXT_semaphore_win32"); + } + if (extensions.Contains("gl_EXT_separate_shader_objects")) + { + EXT_separate_shader_objects = true; + extensions.Remove("glEXT_separate_shader_objects"); + } + if (extensions.Contains("gl_EXT_separate_specular_color")) + { + EXT_separate_specular_color = true; + extensions.Remove("glEXT_separate_specular_color"); + } + if (extensions.Contains("gl_EXT_shader_framebuffer_fetch")) + { + EXT_shader_framebuffer_fetch = true; + extensions.Remove("glEXT_shader_framebuffer_fetch"); + } + if (extensions.Contains("gl_EXT_shader_framebuffer_fetch_non_coherent")) + { + EXT_shader_framebuffer_fetch_non_coherent = true; + extensions.Remove("glEXT_shader_framebuffer_fetch_non_coherent"); + } + if (extensions.Contains("gl_EXT_shader_image_load_formatted")) + { + EXT_shader_image_load_formatted = true; + extensions.Remove("glEXT_shader_image_load_formatted"); + } + if (extensions.Contains("gl_EXT_shader_image_load_store")) + { + EXT_shader_image_load_store = true; + extensions.Remove("glEXT_shader_image_load_store"); + } + if (extensions.Contains("gl_EXT_shader_integer_mix")) + { + EXT_shader_integer_mix = true; + extensions.Remove("glEXT_shader_integer_mix"); + } + if (extensions.Contains("gl_EXT_shader_samples_identical")) + { + EXT_shader_samples_identical = true; + extensions.Remove("glEXT_shader_samples_identical"); + } + if (extensions.Contains("gl_EXT_shadow_funcs")) + { + EXT_shadow_funcs = true; + extensions.Remove("glEXT_shadow_funcs"); + } + if (extensions.Contains("gl_EXT_shared_texture_palette")) + { + EXT_shared_texture_palette = true; + extensions.Remove("glEXT_shared_texture_palette"); + } + if (extensions.Contains("gl_EXT_sparse_texture2")) + { + EXT_sparse_texture2 = true; + extensions.Remove("glEXT_sparse_texture2"); + } + if (extensions.Contains("gl_EXT_stencil_clear_tag")) + { + EXT_stencil_clear_tag = true; + extensions.Remove("glEXT_stencil_clear_tag"); + } + if (extensions.Contains("gl_EXT_stencil_two_side")) + { + EXT_stencil_two_side = true; + extensions.Remove("glEXT_stencil_two_side"); + } + if (extensions.Contains("gl_EXT_stencil_wrap")) + { + EXT_stencil_wrap = true; + extensions.Remove("glEXT_stencil_wrap"); + } + if (extensions.Contains("gl_EXT_subtexture")) + { + EXT_subtexture = true; + extensions.Remove("glEXT_subtexture"); + } + if (extensions.Contains("gl_EXT_texture")) + { + EXT_texture = true; + extensions.Remove("glEXT_texture"); + } + if (extensions.Contains("gl_EXT_texture3D")) + { + EXT_texture3D = true; + extensions.Remove("glEXT_texture3D"); + } + if (extensions.Contains("gl_EXT_texture_array")) + { + EXT_texture_array = true; + extensions.Remove("glEXT_texture_array"); + } + if (extensions.Contains("gl_EXT_texture_buffer_object")) + { + EXT_texture_buffer_object = true; + extensions.Remove("glEXT_texture_buffer_object"); + } + if (extensions.Contains("gl_EXT_texture_compression_latc")) + { + EXT_texture_compression_latc = true; + extensions.Remove("glEXT_texture_compression_latc"); + } + if (extensions.Contains("gl_EXT_texture_compression_rgtc")) + { + EXT_texture_compression_rgtc = true; + extensions.Remove("glEXT_texture_compression_rgtc"); + } + if (extensions.Contains("gl_EXT_texture_compression_s3tc")) + { + EXT_texture_compression_s3tc = true; + extensions.Remove("glEXT_texture_compression_s3tc"); + } + if (extensions.Contains("gl_EXT_texture_cube_map")) + { + EXT_texture_cube_map = true; + extensions.Remove("glEXT_texture_cube_map"); + } + if (extensions.Contains("gl_EXT_texture_env_add")) + { + EXT_texture_env_add = true; + extensions.Remove("glEXT_texture_env_add"); + } + if (extensions.Contains("gl_EXT_texture_env_combine")) + { + EXT_texture_env_combine = true; + extensions.Remove("glEXT_texture_env_combine"); + } + if (extensions.Contains("gl_EXT_texture_env_dot3")) + { + EXT_texture_env_dot3 = true; + extensions.Remove("glEXT_texture_env_dot3"); + } + if (extensions.Contains("gl_EXT_texture_filter_anisotropic")) + { + EXT_texture_filter_anisotropic = true; + extensions.Remove("glEXT_texture_filter_anisotropic"); + } + if (extensions.Contains("gl_EXT_texture_filter_minmax")) + { + EXT_texture_filter_minmax = true; + extensions.Remove("glEXT_texture_filter_minmax"); + } + if (extensions.Contains("gl_EXT_texture_integer")) + { + EXT_texture_integer = true; + extensions.Remove("glEXT_texture_integer"); + } + if (extensions.Contains("gl_EXT_texture_lod_bias")) + { + EXT_texture_lod_bias = true; + extensions.Remove("glEXT_texture_lod_bias"); + } + if (extensions.Contains("gl_EXT_texture_mirror_clamp")) + { + EXT_texture_mirror_clamp = true; + extensions.Remove("glEXT_texture_mirror_clamp"); + } + if (extensions.Contains("gl_EXT_texture_object")) + { + EXT_texture_object = true; + extensions.Remove("glEXT_texture_object"); + } + if (extensions.Contains("gl_EXT_texture_perturb_normal")) + { + EXT_texture_perturb_normal = true; + extensions.Remove("glEXT_texture_perturb_normal"); + } + if (extensions.Contains("gl_EXT_texture_sRGB")) + { + EXT_texture_sRGB = true; + extensions.Remove("glEXT_texture_sRGB"); + } + if (extensions.Contains("gl_EXT_texture_sRGB_R8")) + { + EXT_texture_sRGB_R8 = true; + extensions.Remove("glEXT_texture_sRGB_R8"); + } + if (extensions.Contains("gl_EXT_texture_sRGB_RG8")) + { + EXT_texture_sRGB_RG8 = true; + extensions.Remove("glEXT_texture_sRGB_RG8"); + } + if (extensions.Contains("gl_EXT_texture_sRGB_decode")) + { + EXT_texture_sRGB_decode = true; + extensions.Remove("glEXT_texture_sRGB_decode"); + } + if (extensions.Contains("gl_EXT_texture_shadow_lod")) + { + EXT_texture_shadow_lod = true; + extensions.Remove("glEXT_texture_shadow_lod"); + } + if (extensions.Contains("gl_EXT_texture_shared_exponent")) + { + EXT_texture_shared_exponent = true; + extensions.Remove("glEXT_texture_shared_exponent"); + } + if (extensions.Contains("gl_EXT_texture_snorm")) + { + EXT_texture_snorm = true; + extensions.Remove("glEXT_texture_snorm"); + } + if (extensions.Contains("gl_EXT_texture_storage")) + { + EXT_texture_storage = true; + extensions.Remove("glEXT_texture_storage"); + } + if (extensions.Contains("gl_EXT_texture_swizzle")) + { + EXT_texture_swizzle = true; + extensions.Remove("glEXT_texture_swizzle"); + } + if (extensions.Contains("gl_EXT_timer_query")) + { + EXT_timer_query = true; + extensions.Remove("glEXT_timer_query"); + } + if (extensions.Contains("gl_EXT_transform_feedback")) + { + EXT_transform_feedback = true; + extensions.Remove("glEXT_transform_feedback"); + } + if (extensions.Contains("gl_EXT_vertex_array")) + { + EXT_vertex_array = true; + extensions.Remove("glEXT_vertex_array"); + } + if (extensions.Contains("gl_EXT_vertex_array_bgra")) + { + EXT_vertex_array_bgra = true; + extensions.Remove("glEXT_vertex_array_bgra"); + } + if (extensions.Contains("gl_EXT_vertex_attrib_64bit")) + { + EXT_vertex_attrib_64bit = true; + extensions.Remove("glEXT_vertex_attrib_64bit"); + } + if (extensions.Contains("gl_EXT_vertex_shader")) + { + EXT_vertex_shader = true; + extensions.Remove("glEXT_vertex_shader"); + } + if (extensions.Contains("gl_EXT_vertex_weighting")) + { + EXT_vertex_weighting = true; + extensions.Remove("glEXT_vertex_weighting"); + } + if (extensions.Contains("gl_EXT_win32_keyed_mutex")) + { + EXT_win32_keyed_mutex = true; + extensions.Remove("glEXT_win32_keyed_mutex"); + } + if (extensions.Contains("gl_EXT_window_rectangles")) + { + EXT_window_rectangles = true; + extensions.Remove("glEXT_window_rectangles"); + } + if (extensions.Contains("gl_EXT_x11_sync_object")) + { + EXT_x11_sync_object = true; + extensions.Remove("glEXT_x11_sync_object"); + } + if (extensions.Contains("gl_GREMEDY_frame_terminator")) + { + GREMEDY_frame_terminator = true; + extensions.Remove("glGREMEDY_frame_terminator"); + } + if (extensions.Contains("gl_GREMEDY_string_marker")) + { + GREMEDY_string_marker = true; + extensions.Remove("glGREMEDY_string_marker"); + } + if (extensions.Contains("gl_HP_convolution_border_modes")) + { + HP_convolution_border_modes = true; + extensions.Remove("glHP_convolution_border_modes"); + } + if (extensions.Contains("gl_HP_image_transform")) + { + HP_image_transform = true; + extensions.Remove("glHP_image_transform"); + } + if (extensions.Contains("gl_HP_occlusion_test")) + { + HP_occlusion_test = true; + extensions.Remove("glHP_occlusion_test"); + } + if (extensions.Contains("gl_HP_texture_lighting")) + { + HP_texture_lighting = true; + extensions.Remove("glHP_texture_lighting"); + } + if (extensions.Contains("gl_IBM_cull_vertex")) + { + IBM_cull_vertex = true; + extensions.Remove("glIBM_cull_vertex"); + } + if (extensions.Contains("gl_IBM_multimode_draw_arrays")) + { + IBM_multimode_draw_arrays = true; + extensions.Remove("glIBM_multimode_draw_arrays"); + } + if (extensions.Contains("gl_IBM_rasterpos_clip")) + { + IBM_rasterpos_clip = true; + extensions.Remove("glIBM_rasterpos_clip"); + } + if (extensions.Contains("gl_IBM_static_data")) + { + IBM_static_data = true; + extensions.Remove("glIBM_static_data"); + } + if (extensions.Contains("gl_IBM_texture_mirrored_repeat")) + { + IBM_texture_mirrored_repeat = true; + extensions.Remove("glIBM_texture_mirrored_repeat"); + } + if (extensions.Contains("gl_IBM_vertex_array_lists")) + { + IBM_vertex_array_lists = true; + extensions.Remove("glIBM_vertex_array_lists"); + } + if (extensions.Contains("gl_INGR_blend_func_separate")) + { + INGR_blend_func_separate = true; + extensions.Remove("glINGR_blend_func_separate"); + } + if (extensions.Contains("gl_INGR_color_clamp")) + { + INGR_color_clamp = true; + extensions.Remove("glINGR_color_clamp"); + } + if (extensions.Contains("gl_INGR_interlace_read")) + { + INGR_interlace_read = true; + extensions.Remove("glINGR_interlace_read"); + } + if (extensions.Contains("gl_INTEL_blackhole_render")) + { + INTEL_blackhole_render = true; + extensions.Remove("glINTEL_blackhole_render"); + } + if (extensions.Contains("gl_INTEL_conservative_rasterization")) + { + INTEL_conservative_rasterization = true; + extensions.Remove("glINTEL_conservative_rasterization"); + } + if (extensions.Contains("gl_INTEL_fragment_shader_ordering")) + { + INTEL_fragment_shader_ordering = true; + extensions.Remove("glINTEL_fragment_shader_ordering"); + } + if (extensions.Contains("gl_INTEL_framebuffer_CMAA")) + { + INTEL_framebuffer_CMAA = true; + extensions.Remove("glINTEL_framebuffer_CMAA"); + } + if (extensions.Contains("gl_INTEL_map_texture")) + { + INTEL_map_texture = true; + extensions.Remove("glINTEL_map_texture"); + } + if (extensions.Contains("gl_INTEL_parallel_arrays")) + { + INTEL_parallel_arrays = true; + extensions.Remove("glINTEL_parallel_arrays"); + } + if (extensions.Contains("gl_INTEL_performance_query")) + { + INTEL_performance_query = true; + extensions.Remove("glINTEL_performance_query"); + } + if (extensions.Contains("gl_KHR_blend_equation_advanced")) + { + KHR_blend_equation_advanced = true; + extensions.Remove("glKHR_blend_equation_advanced"); + } + if (extensions.Contains("gl_KHR_blend_equation_advanced_coherent")) + { + KHR_blend_equation_advanced_coherent = true; + extensions.Remove("glKHR_blend_equation_advanced_coherent"); + } + if (extensions.Contains("gl_KHR_context_flush_control")) + { + KHR_context_flush_control = true; + extensions.Remove("glKHR_context_flush_control"); + } + if (extensions.Contains("gl_KHR_debug")) + { + KHR_debug = true; + extensions.Remove("glKHR_debug"); + } + if (extensions.Contains("gl_KHR_no_error")) + { + KHR_no_error = true; + extensions.Remove("glKHR_no_error"); + } + if (extensions.Contains("gl_KHR_parallel_shader_compile")) + { + KHR_parallel_shader_compile = true; + extensions.Remove("glKHR_parallel_shader_compile"); + } + if (extensions.Contains("gl_KHR_robust_buffer_access_behavior")) + { + KHR_robust_buffer_access_behavior = true; + extensions.Remove("glKHR_robust_buffer_access_behavior"); + } + if (extensions.Contains("gl_KHR_robustness")) + { + KHR_robustness = true; + extensions.Remove("glKHR_robustness"); + } + if (extensions.Contains("gl_KHR_shader_subgroup")) + { + KHR_shader_subgroup = true; + extensions.Remove("glKHR_shader_subgroup"); + } + if (extensions.Contains("gl_KHR_texture_compression_astc_hdr")) + { + KHR_texture_compression_astc_hdr = true; + extensions.Remove("glKHR_texture_compression_astc_hdr"); + } + if (extensions.Contains("gl_KHR_texture_compression_astc_ldr")) + { + KHR_texture_compression_astc_ldr = true; + extensions.Remove("glKHR_texture_compression_astc_ldr"); + } + if (extensions.Contains("gl_KHR_texture_compression_astc_sliced_3d")) + { + KHR_texture_compression_astc_sliced_3d = true; + extensions.Remove("glKHR_texture_compression_astc_sliced_3d"); + } + if (extensions.Contains("gl_MESAX_texture_stack")) + { + MESAX_texture_stack = true; + extensions.Remove("glMESAX_texture_stack"); + } + if (extensions.Contains("gl_MESA_framebuffer_flip_x")) + { + MESA_framebuffer_flip_x = true; + extensions.Remove("glMESA_framebuffer_flip_x"); + } + if (extensions.Contains("gl_MESA_framebuffer_flip_y")) + { + MESA_framebuffer_flip_y = true; + extensions.Remove("glMESA_framebuffer_flip_y"); + } + if (extensions.Contains("gl_MESA_framebuffer_swap_xy")) + { + MESA_framebuffer_swap_xy = true; + extensions.Remove("glMESA_framebuffer_swap_xy"); + } + if (extensions.Contains("gl_MESA_pack_invert")) + { + MESA_pack_invert = true; + extensions.Remove("glMESA_pack_invert"); + } + if (extensions.Contains("gl_MESA_program_binary_formats")) + { + MESA_program_binary_formats = true; + extensions.Remove("glMESA_program_binary_formats"); + } + if (extensions.Contains("gl_MESA_resize_buffers")) + { + MESA_resize_buffers = true; + extensions.Remove("glMESA_resize_buffers"); + } + if (extensions.Contains("gl_MESA_shader_integer_functions")) + { + MESA_shader_integer_functions = true; + extensions.Remove("glMESA_shader_integer_functions"); + } + if (extensions.Contains("gl_MESA_tile_raster_order")) + { + MESA_tile_raster_order = true; + extensions.Remove("glMESA_tile_raster_order"); + } + if (extensions.Contains("gl_MESA_window_pos")) + { + MESA_window_pos = true; + extensions.Remove("glMESA_window_pos"); + } + if (extensions.Contains("gl_MESA_ycbcr_texture")) + { + MESA_ycbcr_texture = true; + extensions.Remove("glMESA_ycbcr_texture"); + } + if (extensions.Contains("gl_NVX_blend_equation_advanced_multi_draw_buffers")) + { + NVX_blend_equation_advanced_multi_draw_buffers = true; + extensions.Remove("glNVX_blend_equation_advanced_multi_draw_buffers"); + } + if (extensions.Contains("gl_NVX_conditional_render")) + { + NVX_conditional_render = true; + extensions.Remove("glNVX_conditional_render"); + } + if (extensions.Contains("gl_NVX_gpu_memory_info")) + { + NVX_gpu_memory_info = true; + extensions.Remove("glNVX_gpu_memory_info"); + } + if (extensions.Contains("gl_NVX_gpu_multicast2")) + { + NVX_gpu_multicast2 = true; + extensions.Remove("glNVX_gpu_multicast2"); + } + if (extensions.Contains("gl_NVX_linked_gpu_multicast")) + { + NVX_linked_gpu_multicast = true; + extensions.Remove("glNVX_linked_gpu_multicast"); + } + if (extensions.Contains("gl_NVX_progress_fence")) + { + NVX_progress_fence = true; + extensions.Remove("glNVX_progress_fence"); + } + if (extensions.Contains("gl_NV_alpha_to_coverage_dither_control")) + { + NV_alpha_to_coverage_dither_control = true; + extensions.Remove("glNV_alpha_to_coverage_dither_control"); + } + if (extensions.Contains("gl_NV_bindless_multi_draw_indirect")) + { + NV_bindless_multi_draw_indirect = true; + extensions.Remove("glNV_bindless_multi_draw_indirect"); + } + if (extensions.Contains("gl_NV_bindless_multi_draw_indirect_count")) + { + NV_bindless_multi_draw_indirect_count = true; + extensions.Remove("glNV_bindless_multi_draw_indirect_count"); + } + if (extensions.Contains("gl_NV_bindless_texture")) + { + NV_bindless_texture = true; + extensions.Remove("glNV_bindless_texture"); + } + if (extensions.Contains("gl_NV_blend_equation_advanced")) + { + NV_blend_equation_advanced = true; + extensions.Remove("glNV_blend_equation_advanced"); + } + if (extensions.Contains("gl_NV_blend_equation_advanced_coherent")) + { + NV_blend_equation_advanced_coherent = true; + extensions.Remove("glNV_blend_equation_advanced_coherent"); + } + if (extensions.Contains("gl_NV_blend_minmax_factor")) + { + NV_blend_minmax_factor = true; + extensions.Remove("glNV_blend_minmax_factor"); + } + if (extensions.Contains("gl_NV_blend_square")) + { + NV_blend_square = true; + extensions.Remove("glNV_blend_square"); + } + if (extensions.Contains("gl_NV_clip_space_w_scaling")) + { + NV_clip_space_w_scaling = true; + extensions.Remove("glNV_clip_space_w_scaling"); + } + if (extensions.Contains("gl_NV_command_list")) + { + NV_command_list = true; + extensions.Remove("glNV_command_list"); + } + if (extensions.Contains("gl_NV_compute_program5")) + { + NV_compute_program5 = true; + extensions.Remove("glNV_compute_program5"); + } + if (extensions.Contains("gl_NV_compute_shader_derivatives")) + { + NV_compute_shader_derivatives = true; + extensions.Remove("glNV_compute_shader_derivatives"); + } + if (extensions.Contains("gl_NV_conditional_render")) + { + NV_conditional_render = true; + extensions.Remove("glNV_conditional_render"); + } + if (extensions.Contains("gl_NV_conservative_raster")) + { + NV_conservative_raster = true; + extensions.Remove("glNV_conservative_raster"); + } + if (extensions.Contains("gl_NV_conservative_raster_dilate")) + { + NV_conservative_raster_dilate = true; + extensions.Remove("glNV_conservative_raster_dilate"); + } + if (extensions.Contains("gl_NV_conservative_raster_pre_snap")) + { + NV_conservative_raster_pre_snap = true; + extensions.Remove("glNV_conservative_raster_pre_snap"); + } + if (extensions.Contains("gl_NV_conservative_raster_pre_snap_triangles")) + { + NV_conservative_raster_pre_snap_triangles = true; + extensions.Remove("glNV_conservative_raster_pre_snap_triangles"); + } + if (extensions.Contains("gl_NV_conservative_raster_underestimation")) + { + NV_conservative_raster_underestimation = true; + extensions.Remove("glNV_conservative_raster_underestimation"); + } + if (extensions.Contains("gl_NV_copy_depth_to_color")) + { + NV_copy_depth_to_color = true; + extensions.Remove("glNV_copy_depth_to_color"); + } + if (extensions.Contains("gl_NV_copy_image")) + { + NV_copy_image = true; + extensions.Remove("glNV_copy_image"); + } + if (extensions.Contains("gl_NV_deep_texture3D")) + { + NV_deep_texture3D = true; + extensions.Remove("glNV_deep_texture3D"); + } + if (extensions.Contains("gl_NV_depth_buffer_float")) + { + NV_depth_buffer_float = true; + extensions.Remove("glNV_depth_buffer_float"); + } + if (extensions.Contains("gl_NV_depth_clamp")) + { + NV_depth_clamp = true; + extensions.Remove("glNV_depth_clamp"); + } + if (extensions.Contains("gl_NV_draw_texture")) + { + NV_draw_texture = true; + extensions.Remove("glNV_draw_texture"); + } + if (extensions.Contains("gl_NV_draw_vulkan_image")) + { + NV_draw_vulkan_image = true; + extensions.Remove("glNV_draw_vulkan_image"); + } + if (extensions.Contains("gl_NV_evaluators")) + { + NV_evaluators = true; + extensions.Remove("glNV_evaluators"); + } + if (extensions.Contains("gl_NV_explicit_multisample")) + { + NV_explicit_multisample = true; + extensions.Remove("glNV_explicit_multisample"); + } + if (extensions.Contains("gl_NV_fence")) + { + NV_fence = true; + extensions.Remove("glNV_fence"); + } + if (extensions.Contains("gl_NV_fill_rectangle")) + { + NV_fill_rectangle = true; + extensions.Remove("glNV_fill_rectangle"); + } + if (extensions.Contains("gl_NV_float_buffer")) + { + NV_float_buffer = true; + extensions.Remove("glNV_float_buffer"); + } + if (extensions.Contains("gl_NV_fog_distance")) + { + NV_fog_distance = true; + extensions.Remove("glNV_fog_distance"); + } + if (extensions.Contains("gl_NV_fragment_coverage_to_color")) + { + NV_fragment_coverage_to_color = true; + extensions.Remove("glNV_fragment_coverage_to_color"); + } + if (extensions.Contains("gl_NV_fragment_program")) + { + NV_fragment_program = true; + extensions.Remove("glNV_fragment_program"); + } + if (extensions.Contains("gl_NV_fragment_program2")) + { + NV_fragment_program2 = true; + extensions.Remove("glNV_fragment_program2"); + } + if (extensions.Contains("gl_NV_fragment_program4")) + { + NV_fragment_program4 = true; + extensions.Remove("glNV_fragment_program4"); + } + if (extensions.Contains("gl_NV_fragment_program_option")) + { + NV_fragment_program_option = true; + extensions.Remove("glNV_fragment_program_option"); + } + if (extensions.Contains("gl_NV_fragment_shader_barycentric")) + { + NV_fragment_shader_barycentric = true; + extensions.Remove("glNV_fragment_shader_barycentric"); + } + if (extensions.Contains("gl_NV_fragment_shader_interlock")) + { + NV_fragment_shader_interlock = true; + extensions.Remove("glNV_fragment_shader_interlock"); + } + if (extensions.Contains("gl_NV_framebuffer_mixed_samples")) + { + NV_framebuffer_mixed_samples = true; + extensions.Remove("glNV_framebuffer_mixed_samples"); + } + if (extensions.Contains("gl_NV_framebuffer_multisample_coverage")) + { + NV_framebuffer_multisample_coverage = true; + extensions.Remove("glNV_framebuffer_multisample_coverage"); + } + if (extensions.Contains("gl_NV_geometry_program4")) + { + NV_geometry_program4 = true; + extensions.Remove("glNV_geometry_program4"); + } + if (extensions.Contains("gl_NV_geometry_shader4")) + { + NV_geometry_shader4 = true; + extensions.Remove("glNV_geometry_shader4"); + } + if (extensions.Contains("gl_NV_geometry_shader_passthrough")) + { + NV_geometry_shader_passthrough = true; + extensions.Remove("glNV_geometry_shader_passthrough"); + } + if (extensions.Contains("gl_NV_gpu_multicast")) + { + NV_gpu_multicast = true; + extensions.Remove("glNV_gpu_multicast"); + } + if (extensions.Contains("gl_NV_gpu_program4")) + { + NV_gpu_program4 = true; + extensions.Remove("glNV_gpu_program4"); + } + if (extensions.Contains("gl_NV_gpu_program5")) + { + NV_gpu_program5 = true; + extensions.Remove("glNV_gpu_program5"); + } + if (extensions.Contains("gl_NV_gpu_program5_mem_extended")) + { + NV_gpu_program5_mem_extended = true; + extensions.Remove("glNV_gpu_program5_mem_extended"); + } + if (extensions.Contains("gl_NV_gpu_shader5")) + { + NV_gpu_shader5 = true; + extensions.Remove("glNV_gpu_shader5"); + } + if (extensions.Contains("gl_NV_half_float")) + { + NV_half_float = true; + extensions.Remove("glNV_half_float"); + } + if (extensions.Contains("gl_NV_internalformat_sample_query")) + { + NV_internalformat_sample_query = true; + extensions.Remove("glNV_internalformat_sample_query"); + } + if (extensions.Contains("gl_NV_light_max_exponent")) + { + NV_light_max_exponent = true; + extensions.Remove("glNV_light_max_exponent"); + } + if (extensions.Contains("gl_NV_memory_attachment")) + { + NV_memory_attachment = true; + extensions.Remove("glNV_memory_attachment"); + } + if (extensions.Contains("gl_NV_memory_object_sparse")) + { + NV_memory_object_sparse = true; + extensions.Remove("glNV_memory_object_sparse"); + } + if (extensions.Contains("gl_NV_mesh_shader")) + { + NV_mesh_shader = true; + extensions.Remove("glNV_mesh_shader"); + } + if (extensions.Contains("gl_NV_multisample_coverage")) + { + NV_multisample_coverage = true; + extensions.Remove("glNV_multisample_coverage"); + } + if (extensions.Contains("gl_NV_multisample_filter_hint")) + { + NV_multisample_filter_hint = true; + extensions.Remove("glNV_multisample_filter_hint"); + } + if (extensions.Contains("gl_NV_occlusion_query")) + { + NV_occlusion_query = true; + extensions.Remove("glNV_occlusion_query"); + } + if (extensions.Contains("gl_NV_packed_depth_stencil")) + { + NV_packed_depth_stencil = true; + extensions.Remove("glNV_packed_depth_stencil"); + } + if (extensions.Contains("gl_NV_parameter_buffer_object")) + { + NV_parameter_buffer_object = true; + extensions.Remove("glNV_parameter_buffer_object"); + } + if (extensions.Contains("gl_NV_parameter_buffer_object2")) + { + NV_parameter_buffer_object2 = true; + extensions.Remove("glNV_parameter_buffer_object2"); + } + if (extensions.Contains("gl_NV_path_rendering")) + { + NV_path_rendering = true; + extensions.Remove("glNV_path_rendering"); + } + if (extensions.Contains("gl_NV_path_rendering_shared_edge")) + { + NV_path_rendering_shared_edge = true; + extensions.Remove("glNV_path_rendering_shared_edge"); + } + if (extensions.Contains("gl_NV_pixel_data_range")) + { + NV_pixel_data_range = true; + extensions.Remove("glNV_pixel_data_range"); + } + if (extensions.Contains("gl_NV_point_sprite")) + { + NV_point_sprite = true; + extensions.Remove("glNV_point_sprite"); + } + if (extensions.Contains("gl_NV_present_video")) + { + NV_present_video = true; + extensions.Remove("glNV_present_video"); + } + if (extensions.Contains("gl_NV_primitive_restart")) + { + NV_primitive_restart = true; + extensions.Remove("glNV_primitive_restart"); + } + if (extensions.Contains("gl_NV_primitive_shading_rate")) + { + NV_primitive_shading_rate = true; + extensions.Remove("glNV_primitive_shading_rate"); + } + if (extensions.Contains("gl_NV_query_resource")) + { + NV_query_resource = true; + extensions.Remove("glNV_query_resource"); + } + if (extensions.Contains("gl_NV_query_resource_tag")) + { + NV_query_resource_tag = true; + extensions.Remove("glNV_query_resource_tag"); + } + if (extensions.Contains("gl_NV_register_combiners")) + { + NV_register_combiners = true; + extensions.Remove("glNV_register_combiners"); + } + if (extensions.Contains("gl_NV_register_combiners2")) + { + NV_register_combiners2 = true; + extensions.Remove("glNV_register_combiners2"); + } + if (extensions.Contains("gl_NV_representative_fragment_test")) + { + NV_representative_fragment_test = true; + extensions.Remove("glNV_representative_fragment_test"); + } + if (extensions.Contains("gl_NV_robustness_video_memory_purge")) + { + NV_robustness_video_memory_purge = true; + extensions.Remove("glNV_robustness_video_memory_purge"); + } + if (extensions.Contains("gl_NV_sample_locations")) + { + NV_sample_locations = true; + extensions.Remove("glNV_sample_locations"); + } + if (extensions.Contains("gl_NV_sample_mask_override_coverage")) + { + NV_sample_mask_override_coverage = true; + extensions.Remove("glNV_sample_mask_override_coverage"); + } + if (extensions.Contains("gl_NV_scissor_exclusive")) + { + NV_scissor_exclusive = true; + extensions.Remove("glNV_scissor_exclusive"); + } + if (extensions.Contains("gl_NV_shader_atomic_counters")) + { + NV_shader_atomic_counters = true; + extensions.Remove("glNV_shader_atomic_counters"); + } + if (extensions.Contains("gl_NV_shader_atomic_float")) + { + NV_shader_atomic_float = true; + extensions.Remove("glNV_shader_atomic_float"); + } + if (extensions.Contains("gl_NV_shader_atomic_float64")) + { + NV_shader_atomic_float64 = true; + extensions.Remove("glNV_shader_atomic_float64"); + } + if (extensions.Contains("gl_NV_shader_atomic_fp16_vector")) + { + NV_shader_atomic_fp16_vector = true; + extensions.Remove("glNV_shader_atomic_fp16_vector"); + } + if (extensions.Contains("gl_NV_shader_atomic_int64")) + { + NV_shader_atomic_int64 = true; + extensions.Remove("glNV_shader_atomic_int64"); + } + if (extensions.Contains("gl_NV_shader_buffer_load")) + { + NV_shader_buffer_load = true; + extensions.Remove("glNV_shader_buffer_load"); + } + if (extensions.Contains("gl_NV_shader_buffer_store")) + { + NV_shader_buffer_store = true; + extensions.Remove("glNV_shader_buffer_store"); + } + if (extensions.Contains("gl_NV_shader_storage_buffer_object")) + { + NV_shader_storage_buffer_object = true; + extensions.Remove("glNV_shader_storage_buffer_object"); + } + if (extensions.Contains("gl_NV_shader_subgroup_partitioned")) + { + NV_shader_subgroup_partitioned = true; + extensions.Remove("glNV_shader_subgroup_partitioned"); + } + if (extensions.Contains("gl_NV_shader_texture_footprint")) + { + NV_shader_texture_footprint = true; + extensions.Remove("glNV_shader_texture_footprint"); + } + if (extensions.Contains("gl_NV_shader_thread_group")) + { + NV_shader_thread_group = true; + extensions.Remove("glNV_shader_thread_group"); + } + if (extensions.Contains("gl_NV_shader_thread_shuffle")) + { + NV_shader_thread_shuffle = true; + extensions.Remove("glNV_shader_thread_shuffle"); + } + if (extensions.Contains("gl_NV_shading_rate_image")) + { + NV_shading_rate_image = true; + extensions.Remove("glNV_shading_rate_image"); + } + if (extensions.Contains("gl_NV_stereo_view_rendering")) + { + NV_stereo_view_rendering = true; + extensions.Remove("glNV_stereo_view_rendering"); + } + if (extensions.Contains("gl_NV_tessellation_program5")) + { + NV_tessellation_program5 = true; + extensions.Remove("glNV_tessellation_program5"); + } + if (extensions.Contains("gl_NV_texgen_emboss")) + { + NV_texgen_emboss = true; + extensions.Remove("glNV_texgen_emboss"); + } + if (extensions.Contains("gl_NV_texgen_reflection")) + { + NV_texgen_reflection = true; + extensions.Remove("glNV_texgen_reflection"); + } + if (extensions.Contains("gl_NV_texture_barrier")) + { + NV_texture_barrier = true; + extensions.Remove("glNV_texture_barrier"); + } + if (extensions.Contains("gl_NV_texture_compression_vtc")) + { + NV_texture_compression_vtc = true; + extensions.Remove("glNV_texture_compression_vtc"); + } + if (extensions.Contains("gl_NV_texture_env_combine4")) + { + NV_texture_env_combine4 = true; + extensions.Remove("glNV_texture_env_combine4"); + } + if (extensions.Contains("gl_NV_texture_expand_normal")) + { + NV_texture_expand_normal = true; + extensions.Remove("glNV_texture_expand_normal"); + } + if (extensions.Contains("gl_NV_texture_multisample")) + { + NV_texture_multisample = true; + extensions.Remove("glNV_texture_multisample"); + } + if (extensions.Contains("gl_NV_texture_rectangle")) + { + NV_texture_rectangle = true; + extensions.Remove("glNV_texture_rectangle"); + } + if (extensions.Contains("gl_NV_texture_rectangle_compressed")) + { + NV_texture_rectangle_compressed = true; + extensions.Remove("glNV_texture_rectangle_compressed"); + } + if (extensions.Contains("gl_NV_texture_shader")) + { + NV_texture_shader = true; + extensions.Remove("glNV_texture_shader"); + } + if (extensions.Contains("gl_NV_texture_shader2")) + { + NV_texture_shader2 = true; + extensions.Remove("glNV_texture_shader2"); + } + if (extensions.Contains("gl_NV_texture_shader3")) + { + NV_texture_shader3 = true; + extensions.Remove("glNV_texture_shader3"); + } + if (extensions.Contains("gl_NV_timeline_semaphore")) + { + NV_timeline_semaphore = true; + extensions.Remove("glNV_timeline_semaphore"); + } + if (extensions.Contains("gl_NV_transform_feedback")) + { + NV_transform_feedback = true; + extensions.Remove("glNV_transform_feedback"); + } + if (extensions.Contains("gl_NV_transform_feedback2")) + { + NV_transform_feedback2 = true; + extensions.Remove("glNV_transform_feedback2"); + } + if (extensions.Contains("gl_NV_uniform_buffer_std430_layout")) + { + NV_uniform_buffer_std430_layout = true; + extensions.Remove("glNV_uniform_buffer_std430_layout"); + } + if (extensions.Contains("gl_NV_uniform_buffer_unified_memory")) + { + NV_uniform_buffer_unified_memory = true; + extensions.Remove("glNV_uniform_buffer_unified_memory"); + } + if (extensions.Contains("gl_NV_vdpau_interop")) + { + NV_vdpau_interop = true; + extensions.Remove("glNV_vdpau_interop"); + } + if (extensions.Contains("gl_NV_vdpau_interop2")) + { + NV_vdpau_interop2 = true; + extensions.Remove("glNV_vdpau_interop2"); + } + if (extensions.Contains("gl_NV_vertex_array_range")) + { + NV_vertex_array_range = true; + extensions.Remove("glNV_vertex_array_range"); + } + if (extensions.Contains("gl_NV_vertex_array_range2")) + { + NV_vertex_array_range2 = true; + extensions.Remove("glNV_vertex_array_range2"); + } + if (extensions.Contains("gl_NV_vertex_attrib_integer_64bit")) + { + NV_vertex_attrib_integer_64bit = true; + extensions.Remove("glNV_vertex_attrib_integer_64bit"); + } + if (extensions.Contains("gl_NV_vertex_buffer_unified_memory")) + { + NV_vertex_buffer_unified_memory = true; + extensions.Remove("glNV_vertex_buffer_unified_memory"); + } + if (extensions.Contains("gl_NV_vertex_program")) + { + NV_vertex_program = true; + extensions.Remove("glNV_vertex_program"); + } + if (extensions.Contains("gl_NV_vertex_program1_1")) + { + NV_vertex_program1_1 = true; + extensions.Remove("glNV_vertex_program1_1"); + } + if (extensions.Contains("gl_NV_vertex_program2")) + { + NV_vertex_program2 = true; + extensions.Remove("glNV_vertex_program2"); + } + if (extensions.Contains("gl_NV_vertex_program2_option")) + { + NV_vertex_program2_option = true; + extensions.Remove("glNV_vertex_program2_option"); + } + if (extensions.Contains("gl_NV_vertex_program3")) + { + NV_vertex_program3 = true; + extensions.Remove("glNV_vertex_program3"); + } + if (extensions.Contains("gl_NV_vertex_program4")) + { + NV_vertex_program4 = true; + extensions.Remove("glNV_vertex_program4"); + } + if (extensions.Contains("gl_NV_video_capture")) + { + NV_video_capture = true; + extensions.Remove("glNV_video_capture"); + } + if (extensions.Contains("gl_NV_viewport_array2")) + { + NV_viewport_array2 = true; + extensions.Remove("glNV_viewport_array2"); + } + if (extensions.Contains("gl_NV_viewport_swizzle")) + { + NV_viewport_swizzle = true; + extensions.Remove("glNV_viewport_swizzle"); + } + if (extensions.Contains("gl_OES_byte_coordinates")) + { + OES_byte_coordinates = true; + extensions.Remove("glOES_byte_coordinates"); + } + if (extensions.Contains("gl_OES_compressed_paletted_texture")) + { + OES_compressed_paletted_texture = true; + extensions.Remove("glOES_compressed_paletted_texture"); + } + if (extensions.Contains("gl_OES_fixed_point")) + { + OES_fixed_point = true; + extensions.Remove("glOES_fixed_point"); + } + if (extensions.Contains("gl_OES_query_matrix")) + { + OES_query_matrix = true; + extensions.Remove("glOES_query_matrix"); + } + if (extensions.Contains("gl_OES_read_format")) + { + OES_read_format = true; + extensions.Remove("glOES_read_format"); + } + if (extensions.Contains("gl_OES_single_precision")) + { + OES_single_precision = true; + extensions.Remove("glOES_single_precision"); + } + if (extensions.Contains("gl_OML_interlace")) + { + OML_interlace = true; + extensions.Remove("glOML_interlace"); + } + if (extensions.Contains("gl_OML_resample")) + { + OML_resample = true; + extensions.Remove("glOML_resample"); + } + if (extensions.Contains("gl_OML_subsample")) + { + OML_subsample = true; + extensions.Remove("glOML_subsample"); + } + if (extensions.Contains("gl_OVR_multiview")) + { + OVR_multiview = true; + extensions.Remove("glOVR_multiview"); + } + if (extensions.Contains("gl_OVR_multiview2")) + { + OVR_multiview2 = true; + extensions.Remove("glOVR_multiview2"); + } + if (extensions.Contains("gl_PGI_misc_hints")) + { + PGI_misc_hints = true; + extensions.Remove("glPGI_misc_hints"); + } + if (extensions.Contains("gl_PGI_vertex_hints")) + { + PGI_vertex_hints = true; + extensions.Remove("glPGI_vertex_hints"); + } + if (extensions.Contains("gl_REND_screen_coordinates")) + { + REND_screen_coordinates = true; + extensions.Remove("glREND_screen_coordinates"); + } + if (extensions.Contains("gl_S3_s3tc")) + { + S3_s3tc = true; + extensions.Remove("glS3_s3tc"); + } + if (extensions.Contains("gl_SGIS_detail_texture")) + { + SGIS_detail_texture = true; + extensions.Remove("glSGIS_detail_texture"); + } + if (extensions.Contains("gl_SGIS_fog_function")) + { + SGIS_fog_function = true; + extensions.Remove("glSGIS_fog_function"); + } + if (extensions.Contains("gl_SGIS_generate_mipmap")) + { + SGIS_generate_mipmap = true; + extensions.Remove("glSGIS_generate_mipmap"); + } + if (extensions.Contains("gl_SGIS_multisample")) + { + SGIS_multisample = true; + extensions.Remove("glSGIS_multisample"); + } + if (extensions.Contains("gl_SGIS_pixel_texture")) + { + SGIS_pixel_texture = true; + extensions.Remove("glSGIS_pixel_texture"); + } + if (extensions.Contains("gl_SGIS_point_line_texgen")) + { + SGIS_point_line_texgen = true; + extensions.Remove("glSGIS_point_line_texgen"); + } + if (extensions.Contains("gl_SGIS_point_parameters")) + { + SGIS_point_parameters = true; + extensions.Remove("glSGIS_point_parameters"); + } + if (extensions.Contains("gl_SGIS_sharpen_texture")) + { + SGIS_sharpen_texture = true; + extensions.Remove("glSGIS_sharpen_texture"); + } + if (extensions.Contains("gl_SGIS_texture4D")) + { + SGIS_texture4D = true; + extensions.Remove("glSGIS_texture4D"); + } + if (extensions.Contains("gl_SGIS_texture_border_clamp")) + { + SGIS_texture_border_clamp = true; + extensions.Remove("glSGIS_texture_border_clamp"); + } + if (extensions.Contains("gl_SGIS_texture_color_mask")) + { + SGIS_texture_color_mask = true; + extensions.Remove("glSGIS_texture_color_mask"); + } + if (extensions.Contains("gl_SGIS_texture_edge_clamp")) + { + SGIS_texture_edge_clamp = true; + extensions.Remove("glSGIS_texture_edge_clamp"); + } + if (extensions.Contains("gl_SGIS_texture_filter4")) + { + SGIS_texture_filter4 = true; + extensions.Remove("glSGIS_texture_filter4"); + } + if (extensions.Contains("gl_SGIS_texture_lod")) + { + SGIS_texture_lod = true; + extensions.Remove("glSGIS_texture_lod"); + } + if (extensions.Contains("gl_SGIS_texture_select")) + { + SGIS_texture_select = true; + extensions.Remove("glSGIS_texture_select"); + } + if (extensions.Contains("gl_SGIX_async")) + { + SGIX_async = true; + extensions.Remove("glSGIX_async"); + } + if (extensions.Contains("gl_SGIX_async_histogram")) + { + SGIX_async_histogram = true; + extensions.Remove("glSGIX_async_histogram"); + } + if (extensions.Contains("gl_SGIX_async_pixel")) + { + SGIX_async_pixel = true; + extensions.Remove("glSGIX_async_pixel"); + } + if (extensions.Contains("gl_SGIX_blend_alpha_minmax")) + { + SGIX_blend_alpha_minmax = true; + extensions.Remove("glSGIX_blend_alpha_minmax"); + } + if (extensions.Contains("gl_SGIX_calligraphic_fragment")) + { + SGIX_calligraphic_fragment = true; + extensions.Remove("glSGIX_calligraphic_fragment"); + } + if (extensions.Contains("gl_SGIX_clipmap")) + { + SGIX_clipmap = true; + extensions.Remove("glSGIX_clipmap"); + } + if (extensions.Contains("gl_SGIX_convolution_accuracy")) + { + SGIX_convolution_accuracy = true; + extensions.Remove("glSGIX_convolution_accuracy"); + } + if (extensions.Contains("gl_SGIX_depth_pass_instrument")) + { + SGIX_depth_pass_instrument = true; + extensions.Remove("glSGIX_depth_pass_instrument"); + } + if (extensions.Contains("gl_SGIX_depth_texture")) + { + SGIX_depth_texture = true; + extensions.Remove("glSGIX_depth_texture"); + } + if (extensions.Contains("gl_SGIX_flush_raster")) + { + SGIX_flush_raster = true; + extensions.Remove("glSGIX_flush_raster"); + } + if (extensions.Contains("gl_SGIX_fog_offset")) + { + SGIX_fog_offset = true; + extensions.Remove("glSGIX_fog_offset"); + } + if (extensions.Contains("gl_SGIX_fragment_lighting")) + { + SGIX_fragment_lighting = true; + extensions.Remove("glSGIX_fragment_lighting"); + } + if (extensions.Contains("gl_SGIX_framezoom")) + { + SGIX_framezoom = true; + extensions.Remove("glSGIX_framezoom"); + } + if (extensions.Contains("gl_SGIX_igloo_interface")) + { + SGIX_igloo_interface = true; + extensions.Remove("glSGIX_igloo_interface"); + } + if (extensions.Contains("gl_SGIX_instruments")) + { + SGIX_instruments = true; + extensions.Remove("glSGIX_instruments"); + } + if (extensions.Contains("gl_SGIX_interlace")) + { + SGIX_interlace = true; + extensions.Remove("glSGIX_interlace"); + } + if (extensions.Contains("gl_SGIX_ir_instrument1")) + { + SGIX_ir_instrument1 = true; + extensions.Remove("glSGIX_ir_instrument1"); + } + if (extensions.Contains("gl_SGIX_list_priority")) + { + SGIX_list_priority = true; + extensions.Remove("glSGIX_list_priority"); + } + if (extensions.Contains("gl_SGIX_pixel_texture")) + { + SGIX_pixel_texture = true; + extensions.Remove("glSGIX_pixel_texture"); + } + if (extensions.Contains("gl_SGIX_pixel_tiles")) + { + SGIX_pixel_tiles = true; + extensions.Remove("glSGIX_pixel_tiles"); + } + if (extensions.Contains("gl_SGIX_polynomial_ffd")) + { + SGIX_polynomial_ffd = true; + extensions.Remove("glSGIX_polynomial_ffd"); + } + if (extensions.Contains("gl_SGIX_reference_plane")) + { + SGIX_reference_plane = true; + extensions.Remove("glSGIX_reference_plane"); + } + if (extensions.Contains("gl_SGIX_resample")) + { + SGIX_resample = true; + extensions.Remove("glSGIX_resample"); + } + if (extensions.Contains("gl_SGIX_scalebias_hint")) + { + SGIX_scalebias_hint = true; + extensions.Remove("glSGIX_scalebias_hint"); + } + if (extensions.Contains("gl_SGIX_shadow")) + { + SGIX_shadow = true; + extensions.Remove("glSGIX_shadow"); + } + if (extensions.Contains("gl_SGIX_shadow_ambient")) + { + SGIX_shadow_ambient = true; + extensions.Remove("glSGIX_shadow_ambient"); + } + if (extensions.Contains("gl_SGIX_sprite")) + { + SGIX_sprite = true; + extensions.Remove("glSGIX_sprite"); + } + if (extensions.Contains("gl_SGIX_subsample")) + { + SGIX_subsample = true; + extensions.Remove("glSGIX_subsample"); + } + if (extensions.Contains("gl_SGIX_tag_sample_buffer")) + { + SGIX_tag_sample_buffer = true; + extensions.Remove("glSGIX_tag_sample_buffer"); + } + if (extensions.Contains("gl_SGIX_texture_add_env")) + { + SGIX_texture_add_env = true; + extensions.Remove("glSGIX_texture_add_env"); + } + if (extensions.Contains("gl_SGIX_texture_coordinate_clamp")) + { + SGIX_texture_coordinate_clamp = true; + extensions.Remove("glSGIX_texture_coordinate_clamp"); + } + if (extensions.Contains("gl_SGIX_texture_lod_bias")) + { + SGIX_texture_lod_bias = true; + extensions.Remove("glSGIX_texture_lod_bias"); + } + if (extensions.Contains("gl_SGIX_texture_multi_buffer")) + { + SGIX_texture_multi_buffer = true; + extensions.Remove("glSGIX_texture_multi_buffer"); + } + if (extensions.Contains("gl_SGIX_texture_scale_bias")) + { + SGIX_texture_scale_bias = true; + extensions.Remove("glSGIX_texture_scale_bias"); + } + if (extensions.Contains("gl_SGIX_vertex_preclip")) + { + SGIX_vertex_preclip = true; + extensions.Remove("glSGIX_vertex_preclip"); + } + if (extensions.Contains("gl_SGIX_ycrcb")) + { + SGIX_ycrcb = true; + extensions.Remove("glSGIX_ycrcb"); + } + if (extensions.Contains("gl_SGIX_ycrcb_subsample")) + { + SGIX_ycrcb_subsample = true; + extensions.Remove("glSGIX_ycrcb_subsample"); + } + if (extensions.Contains("gl_SGIX_ycrcba")) + { + SGIX_ycrcba = true; + extensions.Remove("glSGIX_ycrcba"); + } + if (extensions.Contains("gl_SGI_color_matrix")) + { + SGI_color_matrix = true; + extensions.Remove("glSGI_color_matrix"); + } + if (extensions.Contains("gl_SGI_color_table")) + { + SGI_color_table = true; + extensions.Remove("glSGI_color_table"); + } + if (extensions.Contains("gl_SGI_texture_color_table")) + { + SGI_texture_color_table = true; + extensions.Remove("glSGI_texture_color_table"); + } + if (extensions.Contains("gl_SUNX_constant_data")) + { + SUNX_constant_data = true; + extensions.Remove("glSUNX_constant_data"); + } + if (extensions.Contains("gl_SUN_convolution_border_modes")) + { + SUN_convolution_border_modes = true; + extensions.Remove("glSUN_convolution_border_modes"); + } + if (extensions.Contains("gl_SUN_global_alpha")) + { + SUN_global_alpha = true; + extensions.Remove("glSUN_global_alpha"); + } + if (extensions.Contains("gl_SUN_mesh_array")) + { + SUN_mesh_array = true; + extensions.Remove("glSUN_mesh_array"); + } + if (extensions.Contains("gl_SUN_slice_accum")) + { + SUN_slice_accum = true; + extensions.Remove("glSUN_slice_accum"); + } + if (extensions.Contains("gl_SUN_triangle_list")) + { + SUN_triangle_list = true; + extensions.Remove("glSUN_triangle_list"); + } + if (extensions.Contains("gl_SUN_vertex")) + { + SUN_vertex = true; + extensions.Remove("glSUN_vertex"); + } + if (extensions.Contains("gl_WIN_phong_shading")) + { + WIN_phong_shading = true; + extensions.Remove("glWIN_phong_shading"); + } + if (extensions.Contains("gl_WIN_specular_fog")) + { + WIN_specular_fog = true; + extensions.Remove("glWIN_specular_fog"); + } + + #endregion checkGLextensions + } + + internal static void CheckCoreVersion( + int majorVersion, + int minorVersion + ) + { + if (majorVersion < 3) { + throw new InvalidOperationException( + "StgSharp does not support OpenGL immediate mode."); + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 0))) + { + core10 = true; + } else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 1))) + { + core11 = true; + } else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 2))) + { + core12 = true; + } else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 3))) + { + core13 = true; + } else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 4))) + { + core14 = true; + } else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 5))) + { + core15 = true; + } else + { + goto log; + } + + if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 0))) + { + core20 = true; + } else + { + goto log; + } + + if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 1))) + { + core21 = true; + } else + { + goto log; + } + + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 0))) + { + core30 = true; + } else + { + goto log; + } + + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 1))) + { + core31 = true; + } else + { + goto log; + } + + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 2))) + { + core32 = true; + } else + { + goto log; + } + + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 3))) + { + core33 = true; + } else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 0))) + { + core40 = true; + } else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 1))) + { + core41 = true; + } else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 2))) + { + core42 = true; + } else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 3))) + { + core43 = true; + } else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 4))) + { + core44 = true; + } else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 5))) + { + core45 = true; + } else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 6))) + { + core46 = true; + } else + { + goto log; + } + + log: + { + DefaultLog.InternalWriteLog("Find core OpenGL version.", LogType.Info); + return; + } + } + + internal static unsafe string GetExtensions( + this OpenglContext context + ) + { + if (context.glGetString == null) { + return string.Empty; + } + return Marshal.PtrToStringAnsi((nint)context.glGetString(glExtension))!; + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/glConst.cs b/StgsSharp.Graphics/OpenGL/glConst.cs similarity index 98% rename from StgSharp.Common/Graphics/OpenGL/glConst.cs rename to StgsSharp.Graphics/OpenGL/glConst.cs index 9208b504..d2719020 100644 --- a/StgSharp.Common/Graphics/OpenGL/glConst.cs +++ b/StgsSharp.Graphics/OpenGL/glConst.cs @@ -1,4563 +1,4563 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glConst" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Drawing; - -namespace StgSharp.Graphics.OpenGL -{ - // rename types in style of glConst - - public static unsafe class glConst - { - - #region glad - - public const int _1PASS_EXT = 0x80A1; - public const int _1PASS_SGIS = 0x80A1; - public const int _2PASS_0_EXT = 0x80A2; - public const int _2PASS_0_SGIS = 0x80A2; - public const int _2PASS_1_EXT = 0x80A3; - public const int _2PASS_1_SGIS = 0x80A3; - public const int _2X_BIT_ATI = 0x00000001; - public const int _422_AVERAGE_EXT = 0x80CE; - public const int _422_EXT = 0x80CC; - public const int _422_REV_AVERAGE_EXT = 0x80CF; - public const int _422_REV_EXT = 0x80CD; - public const int _4PASS_0_EXT = 0x80A4; - public const int _4PASS_0_SGIS = 0x80A4; - public const int _4PASS_1_EXT = 0x80A5; - public const int _4PASS_1_SGIS = 0x80A5; - public const int _4PASS_2_EXT = 0x80A6; - public const int _4PASS_2_SGIS = 0x80A6; - public const int _4PASS_3_EXT = 0x80A7; - public const int _4PASS_3_SGIS = 0x80A7; - public const int _4X_BIT_ATI = 0x00000002; - public const int _8X_BIT_ATI = 0x00000004; - public const int ABGR_EXT = 0x8000; - public const int ACCUM_ADJACENT_PAIRS_NV = 0x90AD; - public const int ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; - public const int ACTIVE_ATTRIBUTES = 0x8B89; - public const int ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; - public const int ACTIVE_PROGRAM = 0x8259; - public const int ACTIVE_PROGRAM_EXT = 0x8B8D; - public const int ACTIVE_RESOURCES = 0x92F5; - public const int ACTIVE_STENCIL_FACE_EXT = 0x8911; - public const int ACTIVE_SUBROUTINES = 0x8DE5; - public const int ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48; - public const int ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6; - public const int ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47; - public const int ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; - public const int ACTIVE_TEXTURE = 0x84E0; - public const int ACTIVE_TEXTURE_ARB = 0x84E0; - public const int ACTIVE_UNIFORMS = 0x8B86; - public const int ACTIVE_UNIFORM_BLOCKS = 0x8A36; - public const int ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35; - public const int ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; - public const int ACTIVE_VARIABLES = 0x9305; - public const int ACTIVE_VARYINGS_NV = 0x8C81; - public const int ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82; - public const int ACTIVE_VERTEX_UNITS_ARB = 0x86A5; - public const int ADD_ATI = 0x8963; - public const int ADD_SIGNED_ARB = 0x8574; - public const int ADD_SIGNED_EXT = 0x8574; - public const int ADJACENT_PAIRS_NV = 0x90AE; - public const int AFFINE_2D_NV = 0x9092; - public const int AFFINE_3D_NV = 0x9094; - public const int ALIASED_LINE_WIDTH_RANGE = 0x846E; - public const int ALLOW_DRAW_FRG_HINT_PGI = 0x1A210; - public const int ALLOW_DRAW_MEM_HINT_PGI = 0x1A211; - public const int ALLOW_DRAW_OBJ_HINT_PGI = 0x1A20E; - public const int ALLOW_DRAW_WIN_HINT_PGI = 0x1A20F; - public const uint ALL_BARRIER_BITS = 0xFFFFFFFF; - public const uint ALL_BARRIER_BITS_EXT = 0xFFFFFFFF; - public const int ALL_COMPLETED_NV = 0x84F2; - public const uint ALL_PIXELS_AMD = 0xFFFFFFFF; - public const uint ALL_SHADER_BITS = 0xFFFFFFFF; - public const int ALL_STATIC_DATA_IBM = 103060; - public const int ALPHA = 0x1906; - public const int ALPHA12_EXT = 0x803D; - public const int ALPHA16F_ARB = 0x881C; - public const int ALPHA16F_EXT = 0x881C; - public const int ALPHA16I_EXT = 0x8D8A; - public const int ALPHA16UI_EXT = 0x8D78; - public const int ALPHA16_EXT = 0x803E; - public const int ALPHA16_SNORM = 0x9018; - public const int ALPHA32F_ARB = 0x8816; - public const int ALPHA32F_EXT = 0x8816; - public const int ALPHA32I_EXT = 0x8D84; - public const int ALPHA32UI_EXT = 0x8D72; - public const int ALPHA4_EXT = 0x803B; - public const int ALPHA8I_EXT = 0x8D90; - public const int ALPHA8UI_EXT = 0x8D7E; - public const int ALPHA8_EXT = 0x803C; - public const int ALPHA8_SNORM = 0x9014; - public const int ALPHA_FLOAT16_APPLE = 0x881C; - public const int ALPHA_FLOAT16_ATI = 0x881C; - public const int ALPHA_FLOAT32_APPLE = 0x8816; - public const int ALPHA_FLOAT32_ATI = 0x8816; - public const int ALPHA_INTEGER_EXT = 0x8D97; - public const int ALPHA_MAX_CLAMP_INGR = 0x8567; - public const int ALPHA_MAX_SGIX = 0x8321; - public const int ALPHA_MIN_CLAMP_INGR = 0x8563; - public const int ALPHA_MIN_SGIX = 0x8320; - public const int ALPHA_REF_COMMAND_NV = 0x000F; - public const int ALPHA_SNORM = 0x9010; - public const int ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV = 0x934D; - public const int ALPHA_TO_COVERAGE_DITHER_DISABLE_NV = 0x934F; - public const int ALPHA_TO_COVERAGE_DITHER_ENABLE_NV = 0x934E; - public const int ALPHA_TO_COVERAGE_DITHER_MODE_NV = 0x92BF; - public const int ALREADY_SIGNALED = 0x911A; - public const int ALWAYS = 0x0207; - public const int ALWAYS_FAST_HINT_PGI = 0x1A20C; - public const int ALWAYS_SOFT_HINT_PGI = 0x1A20D; - public const int AND = 0x1501; - public const int AND_INVERTED = 0x1504; - public const int AND_REVERSE = 0x1502; - public const int ANY_SAMPLES_PASSED = 0x8C2F; - public const int ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; - public const int ARC_TO_NV = 0xFE; - public const int ARRAY_BUFFER = 0x8892; - public const int ARRAY_BUFFER_ARB = 0x8892; - public const int ARRAY_BUFFER_BINDING = 0x8894; - public const int ARRAY_BUFFER_BINDING_ARB = 0x8894; - public const int ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9; - public const int ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8; - public const int ARRAY_OBJECT_BUFFER_ATI = 0x8766; - public const int ARRAY_OBJECT_OFFSET_ATI = 0x8767; - public const int ARRAY_SIZE = 0x92FB; - public const int ARRAY_STRIDE = 0x92FE; - public const int ASYNC_DRAW_PIXELS_SGIX = 0x835D; - public const int ASYNC_HISTOGRAM_SGIX = 0x832C; - public const int ASYNC_MARKER_SGIX = 0x8329; - public const int ASYNC_READ_PIXELS_SGIX = 0x835E; - public const int ASYNC_TEX_IMAGE_SGIX = 0x835C; - public const int ATOMIC_COUNTER_BARRIER_BIT = 0x00001000; - public const int ATOMIC_COUNTER_BARRIER_BIT_EXT = 0x00001000; - public const int ATOMIC_COUNTER_BUFFER = 0x92C0; - public const int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5; - public const int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6; - public const int ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; - public const int ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4; - public const int ATOMIC_COUNTER_BUFFER_INDEX = 0x9301; - public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; - public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; - public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA; - public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV = 0x959E; - public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV = 0x959F; - public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8; - public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9; - public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7; - public const int ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; - public const int ATOMIC_COUNTER_BUFFER_START = 0x92C2; - public const int ATTACHED_MEMORY_OBJECT_NV = 0x95A4; - public const int ATTACHED_MEMORY_OFFSET_NV = 0x95A5; - public const int ATTACHED_SHADERS = 0x8B85; - public const int ATTENUATION_EXT = 0x834D; - public const int ATTRIBUTE_ADDRESS_COMMAND_NV = 0x0009; - public const int ATTRIB_ARRAY_POINTER_NV = 0x8645; - public const int ATTRIB_ARRAY_SIZE_NV = 0x8623; - public const int ATTRIB_ARRAY_STRIDE_NV = 0x8624; - public const int ATTRIB_ARRAY_TYPE_NV = 0x8625; - public const int AUTO_GENERATE_MIPMAP = 0x8295; - public const int AUX_DEPTH_STENCIL_APPLE = 0x8A14; - public const int AVERAGE_EXT = 0x8335; - public const int AVERAGE_HP = 0x8160; - public const int BACK = 0x0405; - public const int BACK_LEFT = 0x0402; - public const int BACK_NORMALS_HINT_PGI = 0x1A223; - public const int BACK_PRIMARY_COLOR_NV = 0x8C77; - public const int BACK_RIGHT = 0x0403; - public const int BACK_SECONDARY_COLOR_NV = 0x8C78; - public const int BEVEL_NV = 0x90A6; - public const int BGR = 0x80E0; - public const int BGRA = 0x80E1; - public const int BGRA8_EXT = 0x93A1; - public const int BGRA_EXT = 0x80E1; - public const int BGRA_INTEGER = 0x8D9B; - public const int BGRA_INTEGER_EXT = 0x8D9B; - public const int BGR_EXT = 0x80E0; - public const int BGR_INTEGER = 0x8D9A; - public const int BGR_INTEGER_EXT = 0x8D9A; - public const int BIAS_BIT_ATI = 0x00000008; - public const int BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541; - public const int BINORMAL_ARRAY_EXT = 0x843A; - public const int BINORMAL_ARRAY_POINTER_EXT = 0x8443; - public const int BINORMAL_ARRAY_STRIDE_EXT = 0x8441; - public const int BINORMAL_ARRAY_TYPE_EXT = 0x8440; - public const int BLACKHOLE_RENDER_INTEL = 0x83FC; - public const int BLEND = 0x0BE2; - public const int BLEND_ADVANCED_COHERENT_KHR = 0x9285; - public const int BLEND_ADVANCED_COHERENT_NV = 0x9285; - public const int BLEND_COLOR = 0x8005; - public const int BLEND_COLOR_COMMAND_NV = 0x000B; - public const int BLEND_COLOR_EXT = 0x8005; - public const int BLEND_DST = 0x0BE0; - public const int BLEND_DST_ALPHA = 0x80CA; - public const int BLEND_DST_ALPHA_EXT = 0x80CA; - public const int BLEND_DST_RGB = 0x80C8; - public const int BLEND_DST_RGB_EXT = 0x80C8; - public const int BLEND_EQUATION = 0x8009; - public const int BLEND_EQUATION_ALPHA = 0x883D; - public const int BLEND_EQUATION_ALPHA_EXT = 0x883D; - public const int BLEND_EQUATION_EXT = 0x8009; - public const int BLEND_EQUATION_RGB = 0x8009; - public const int BLEND_EQUATION_RGB_EXT = 0x8009; - public const int BLEND_OVERLAP_NV = 0x9281; - public const int BLEND_PREMULTIPLIED_SRC_NV = 0x9280; - public const int BLEND_SRC = 0x0BE1; - public const int BLEND_SRC_ALPHA = 0x80CB; - public const int BLEND_SRC_ALPHA_EXT = 0x80CB; - public const int BLEND_SRC_RGB = 0x80C9; - public const int BLEND_SRC_RGB_EXT = 0x80C9; - public const int BLOCK_INDEX = 0x92FD; - public const int BLUE = 0x1905; - public const int BLUE_BIT_ATI = 0x00000004; - public const int BLUE_INTEGER = 0x8D96; - public const int BLUE_INTEGER_EXT = 0x8D96; - public const int BLUE_MAX_CLAMP_INGR = 0x8566; - public const int BLUE_MIN_CLAMP_INGR = 0x8562; - public const int BLUE_NV = 0x1905; - public const int BOLD_BIT_NV = 0x01; - public const int BOOL = 0x8B56; - public const int BOOL_ARB = 0x8B56; - public const int BOOL_VEC2 = 0x8B57; - public const int BOOL_VEC2_ARB = 0x8B57; - public const int BOOL_VEC3 = 0x8B58; - public const int BOOL_VEC3_ARB = 0x8B58; - public const int BOOL_VEC4 = 0x8B59; - public const int BOOL_VEC4_ARB = 0x8B59; - public const int BOUNDING_BOX_NV = 0x908D; - public const int BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C; - public const int BUFFER = 0x82E0; - public const int BUFFER_ACCESS = 0x88BB; - public const int BUFFER_ACCESS_ARB = 0x88BB; - public const int BUFFER_ACCESS_FLAGS = 0x911F; - public const int BUFFER_BINDING = 0x9302; - public const int BUFFER_DATA_SIZE = 0x9303; - public const int BUFFER_FLUSHING_UNMAP_APPLE = 0x8A13; - public const int BUFFER_GPU_ADDRESS_NV = 0x8F1D; - public const int BUFFER_IMMUTABLE_STORAGE = 0x821F; - public const int BUFFER_MAPPED = 0x88BC; - public const int BUFFER_MAPPED_ARB = 0x88BC; - public const int BUFFER_MAP_LENGTH = 0x9120; - public const int BUFFER_MAP_OFFSET = 0x9121; - public const int BUFFER_MAP_POINTER = 0x88BD; - public const int BUFFER_MAP_POINTER_ARB = 0x88BD; - public const int BUFFER_OBJECT_APPLE = 0x85B3; - public const int BUFFER_OBJECT_EXT = 0x9151; - public const int BUFFER_SERIALIZED_MODIFY_APPLE = 0x8A12; - public const int BUFFER_SIZE = 0x8764; - public const int BUFFER_SIZE_ARB = 0x8764; - public const int BUFFER_STORAGE_FLAGS = 0x8220; - public const int BUFFER_UPDATE_BARRIER_BIT = 0x00000200; - public const int BUFFER_UPDATE_BARRIER_BIT_EXT = 0x00000200; - public const int BUFFER_USAGE = 0x8765; - public const int BUFFER_USAGE_ARB = 0x8765; - public const int BUFFER_VARIABLE = 0x92E5; - public const int BUMP_ENVMAP_ATI = 0x877B; - public const int BUMP_NUM_TEX_UNITS_ATI = 0x8777; - public const int BUMP_ROT_MATRIX_ATI = 0x8775; - public const int BUMP_ROT_MATRIX_SIZE_ATI = 0x8776; - public const int BUMP_TARGET_ATI = 0x877C; - public const int BUMP_TEX_UNITS_ATI = 0x8778; - public const int BYTE = 0x1400; - public const int CALLIGRAPHIC_FRAGMENT_SGIX = 0x8183; - public const int CAVEAT_SUPPORT = 0x82B8; - public const int CCW = 0x0901; - public const int CIRCULAR_CCW_ARC_TO_NV = 0xF8; - public const int CIRCULAR_CW_ARC_TO_NV = 0xFA; - public const int CIRCULAR_TANGENT_ARC_TO_NV = 0xFC; - public const int CLAMP_FRAGMENT_COLOR_ARB = 0x891B; - public const int CLAMP_READ_COLOR = 0x891C; - public const int CLAMP_READ_COLOR_ARB = 0x891C; - public const int CLAMP_TO_BORDER = 0x812D; - public const int CLAMP_TO_BORDER_ARB = 0x812D; - public const int CLAMP_TO_BORDER_SGIS = 0x812D; - public const int CLAMP_TO_EDGE = 0x812F; - public const int CLAMP_TO_EDGE_SGIS = 0x812F; - public const int CLAMP_VERTEX_COLOR_ARB = 0x891A; - public const int CLEAR = 0x1500; - public const int CLEAR_BUFFER = 0x82B4; - public const int CLEAR_TEXTURE = 0x9365; - public const int CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1; - public const int CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000; - public const int CLIENT_STORAGE_BIT = 0x0200; - public const int CLIPPING_INPUT_PRIMITIVES = 0x82F6; - public const int CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6; - public const int CLIPPING_OUTPUT_PRIMITIVES = 0x82F7; - public const int CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7; - public const int CLIP_DEPTH_MODE = 0x935D; - public const int CLIP_DISTANCE0 = 0x3000; - public const int CLIP_DISTANCE1 = 0x3001; - public const int CLIP_DISTANCE2 = 0x3002; - public const int CLIP_DISTANCE3 = 0x3003; - public const int CLIP_DISTANCE4 = 0x3004; - public const int CLIP_DISTANCE5 = 0x3005; - public const int CLIP_DISTANCE6 = 0x3006; - public const int CLIP_DISTANCE7 = 0x3007; - public const int CLIP_DISTANCE_NV = 0x8C7A; - public const int CLIP_FAR_HINT_PGI = 0x1A221; - public const int CLIP_NEAR_HINT_PGI = 0x1A220; - public const int CLIP_ORIGIN = 0x935C; - public const int CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0; - public const int CLOSE_PATH_NV = 0x00; - public const int CMYKA_EXT = 0x800D; - public const int CMYK_EXT = 0x800C; - public const int CND0_ATI = 0x896B; - public const int CND_ATI = 0x896A; - public const int COLOR = 0x1800; - public const int COLOR3_BIT_PGI = 0x00010000; - public const int COLOR4_BIT_PGI = 0x00020000; - public const int COLORBURN_KHR = 0x929A; - public const int COLORBURN_NV = 0x929A; - public const int COLORDODGE_KHR = 0x9299; - public const int COLORDODGE_NV = 0x9299; - public const int COLOR_ALPHA_PAIRING_ATI = 0x8975; - public const int COLOR_ARRAY_ADDRESS_NV = 0x8F23; - public const int COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898; - public const int COLOR_ARRAY_COUNT_EXT = 0x8084; - public const int COLOR_ARRAY_EXT = 0x8076; - public const int COLOR_ARRAY_LENGTH_NV = 0x8F2D; - public const int COLOR_ARRAY_LIST_IBM = 103072; - public const int COLOR_ARRAY_LIST_STRIDE_IBM = 103082; - public const int COLOR_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F7; - public const int COLOR_ARRAY_POINTER_EXT = 0x8090; - public const int COLOR_ARRAY_SIZE_EXT = 0x8081; - public const int COLOR_ARRAY_STRIDE_EXT = 0x8083; - public const int COLOR_ARRAY_TYPE_EXT = 0x8082; - public const int COLOR_ATTACHMENT0 = 0x8CE0; - public const int COLOR_ATTACHMENT0_EXT = 0x8CE0; - public const int COLOR_ATTACHMENT1 = 0x8CE1; - public const int COLOR_ATTACHMENT10 = 0x8CEA; - public const int COLOR_ATTACHMENT10_EXT = 0x8CEA; - public const int COLOR_ATTACHMENT11 = 0x8CEB; - public const int COLOR_ATTACHMENT11_EXT = 0x8CEB; - public const int COLOR_ATTACHMENT12 = 0x8CEC; - public const int COLOR_ATTACHMENT12_EXT = 0x8CEC; - public const int COLOR_ATTACHMENT13 = 0x8CED; - public const int COLOR_ATTACHMENT13_EXT = 0x8CED; - public const int COLOR_ATTACHMENT14 = 0x8CEE; - public const int COLOR_ATTACHMENT14_EXT = 0x8CEE; - public const int COLOR_ATTACHMENT15 = 0x8CEF; - public const int COLOR_ATTACHMENT15_EXT = 0x8CEF; - public const int COLOR_ATTACHMENT16 = 0x8CF0; - public const int COLOR_ATTACHMENT17 = 0x8CF1; - public const int COLOR_ATTACHMENT18 = 0x8CF2; - public const int COLOR_ATTACHMENT19 = 0x8CF3; - public const int COLOR_ATTACHMENT1_EXT = 0x8CE1; - public const int COLOR_ATTACHMENT2 = 0x8CE2; - public const int COLOR_ATTACHMENT20 = 0x8CF4; - public const int COLOR_ATTACHMENT21 = 0x8CF5; - public const int COLOR_ATTACHMENT22 = 0x8CF6; - public const int COLOR_ATTACHMENT23 = 0x8CF7; - public const int COLOR_ATTACHMENT24 = 0x8CF8; - public const int COLOR_ATTACHMENT25 = 0x8CF9; - public const int COLOR_ATTACHMENT26 = 0x8CFA; - public const int COLOR_ATTACHMENT27 = 0x8CFB; - public const int COLOR_ATTACHMENT28 = 0x8CFC; - public const int COLOR_ATTACHMENT29 = 0x8CFD; - public const int COLOR_ATTACHMENT2_EXT = 0x8CE2; - public const int COLOR_ATTACHMENT3 = 0x8CE3; - public const int COLOR_ATTACHMENT30 = 0x8CFE; - public const int COLOR_ATTACHMENT31 = 0x8CFF; - public const int COLOR_ATTACHMENT3_EXT = 0x8CE3; - public const int COLOR_ATTACHMENT4 = 0x8CE4; - public const int COLOR_ATTACHMENT4_EXT = 0x8CE4; - public const int COLOR_ATTACHMENT5 = 0x8CE5; - public const int COLOR_ATTACHMENT5_EXT = 0x8CE5; - public const int COLOR_ATTACHMENT6 = 0x8CE6; - public const int COLOR_ATTACHMENT6_EXT = 0x8CE6; - public const int COLOR_ATTACHMENT7 = 0x8CE7; - public const int COLOR_ATTACHMENT7_EXT = 0x8CE7; - public const int COLOR_ATTACHMENT8 = 0x8CE8; - public const int COLOR_ATTACHMENT8_EXT = 0x8CE8; - public const int COLOR_ATTACHMENT9 = 0x8CE9; - public const int COLOR_ATTACHMENT9_EXT = 0x8CE9; - public const int COLOR_BUFFER_BIT = 0x00004000; - public const int COLOR_CLEAR_UNCLAMPED_VALUE_ATI = 0x8835; - public const int COLOR_CLEAR_VALUE = 0x0C22; - public const int COLOR_COMPONENTS = 0x8283; - public const int COLOR_ENCODING = 0x8296; - public const int COLOR_FLOAT_APPLE = 0x8A0F; - public const int COLOR_INDEX12_EXT = 0x80E6; - public const int COLOR_INDEX16_EXT = 0x80E7; - public const int COLOR_INDEX1_EXT = 0x80E2; - public const int COLOR_INDEX2_EXT = 0x80E3; - public const int COLOR_INDEX4_EXT = 0x80E4; - public const int COLOR_INDEX8_EXT = 0x80E5; - public const int COLOR_LOGIC_OP = 0x0BF2; - public const int COLOR_MATRIX_SGI = 0x80B1; - public const int COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B2; - public const int COLOR_RENDERABLE = 0x8286; - public const int COLOR_SAMPLES_NV = 0x8E20; - public const int COLOR_SUM_ARB = 0x8458; - public const int COLOR_SUM_CLAMP_NV = 0x854F; - public const int COLOR_SUM_EXT = 0x8458; - public const int COLOR_TABLE_ALPHA_SIZE_SGI = 0x80DD; - public const int COLOR_TABLE_BIAS_SGI = 0x80D7; - public const int COLOR_TABLE_BLUE_SIZE_SGI = 0x80DC; - public const int COLOR_TABLE_FORMAT_SGI = 0x80D8; - public const int COLOR_TABLE_GREEN_SIZE_SGI = 0x80DB; - public const int COLOR_TABLE_INTENSITY_SIZE_SGI = 0x80DF; - public const int COLOR_TABLE_LUMINANCE_SIZE_SGI = 0x80DE; - public const int COLOR_TABLE_RED_SIZE_SGI = 0x80DA; - public const int COLOR_TABLE_SCALE_SGI = 0x80D6; - public const int COLOR_TABLE_SGI = 0x80D0; - public const int COLOR_TABLE_WIDTH_SGI = 0x80D9; - public const int COLOR_WRITEMASK = 0x0C23; - public const int COMBINE4_NV = 0x8503; - public const int COMBINER0_NV = 0x8550; - public const int COMBINER1_NV = 0x8551; - public const int COMBINER2_NV = 0x8552; - public const int COMBINER3_NV = 0x8553; - public const int COMBINER4_NV = 0x8554; - public const int COMBINER5_NV = 0x8555; - public const int COMBINER6_NV = 0x8556; - public const int COMBINER7_NV = 0x8557; - public const int COMBINER_AB_DOT_PRODUCT_NV = 0x8545; - public const int COMBINER_AB_OUTPUT_NV = 0x854A; - public const int COMBINER_BIAS_NV = 0x8549; - public const int COMBINER_CD_DOT_PRODUCT_NV = 0x8546; - public const int COMBINER_CD_OUTPUT_NV = 0x854B; - public const int COMBINER_COMPONENT_USAGE_NV = 0x8544; - public const int COMBINER_INPUT_NV = 0x8542; - public const int COMBINER_MAPPING_NV = 0x8543; - public const int COMBINER_MUX_SUM_NV = 0x8547; - public const int COMBINER_SCALE_NV = 0x8548; - public const int COMBINER_SUM_OUTPUT_NV = 0x854C; - public const int COMBINE_ALPHA_ARB = 0x8572; - public const int COMBINE_ALPHA_EXT = 0x8572; - public const int COMBINE_ARB = 0x8570; - public const int COMBINE_EXT = 0x8570; - public const int COMBINE_RGB_ARB = 0x8571; - public const int COMBINE_RGB_EXT = 0x8571; - public const int COMMAND_BARRIER_BIT = 0x00000040; - public const int COMMAND_BARRIER_BIT_EXT = 0x00000040; - public const int COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E; - public const int COMPARE_REF_TO_TEXTURE = 0x884E; - public const int COMPARE_R_TO_TEXTURE_ARB = 0x884E; - public const int COMPATIBLE_SUBROUTINES = 0x8E4B; - public const int COMPILE_STATUS = 0x8B81; - public const int COMPLETION_STATUS_ARB = 0x91B1; - public const int COMPLETION_STATUS_KHR = 0x91B1; - public const int COMPRESSED_ALPHA_ARB = 0x84E9; - public const int COMPRESSED_INTENSITY_ARB = 0x84EC; - public const int COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB; - public const int COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C72; - public const int COMPRESSED_LUMINANCE_ARB = 0x84EA; - public const int COMPRESSED_LUMINANCE_LATC1_EXT = 0x8C70; - public const int COMPRESSED_R11_EAC = 0x9270; - public const int COMPRESSED_RED = 0x8225; - public const int COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD; - public const int COMPRESSED_RED_RGTC1 = 0x8DBB; - public const int COMPRESSED_RED_RGTC1_EXT = 0x8DBB; - public const int COMPRESSED_RG = 0x8226; - public const int COMPRESSED_RG11_EAC = 0x9272; - public const int COMPRESSED_RGB = 0x84ED; - public const int COMPRESSED_RGB8_ETC2 = 0x9274; - public const int COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276; - public const int COMPRESSED_RGBA = 0x84EE; - public const int COMPRESSED_RGBA8_ETC2_EAC = 0x9278; - public const int COMPRESSED_RGBA_ARB = 0x84EE; - public const int COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB; - public const int COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8; - public const int COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9; - public const int COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA; - public const int COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC; - public const int COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD; - public const int COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0; - public const int COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1; - public const int COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2; - public const int COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3; - public const int COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4; - public const int COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5; - public const int COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6; - public const int COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7; - public const int COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C; - public const int COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C; - public const int COMPRESSED_RGBA_FXT1_3DFX = 0x86B1; - public const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; - public const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; - public const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; - public const int COMPRESSED_RGB_ARB = 0x84ED; - public const int COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E; - public const int COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E; - public const int COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; - public const int COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F; - public const int COMPRESSED_RGB_FXT1_3DFX = 0x86B0; - public const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; - public const int COMPRESSED_RG_RGTC2 = 0x8DBD; - public const int COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C73; - public const int COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT = 0x8C71; - public const int COMPRESSED_SIGNED_R11_EAC = 0x9271; - public const int COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE; - public const int COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC; - public const int COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC; - public const int COMPRESSED_SIGNED_RG11_EAC = 0x9273; - public const int COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; - public const int COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B; - public const int COMPRESSED_SLUMINANCE_EXT = 0x8C4A; - public const int COMPRESSED_SRGB = 0x8C48; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6; - public const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7; - public const int COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279; - public const int COMPRESSED_SRGB8_ETC2 = 0x9275; - public const int COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277; - public const int COMPRESSED_SRGB_ALPHA = 0x8C49; - public const int COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D; - public const int COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D; - public const int COMPRESSED_SRGB_ALPHA_EXT = 0x8C49; - public const int COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D; - public const int COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E; - public const int COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F; - public const int COMPRESSED_SRGB_EXT = 0x8C48; - public const int COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C; - public const int COMPRESSED_TEXTURE_FORMATS = 0x86A3; - public const int COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; - public const int COMPUTE_PROGRAM_NV = 0x90FB; - public const int COMPUTE_PROGRAM_PARAMETER_BUFFER_NV = 0x90FC; - public const int COMPUTE_SHADER = 0x91B9; - public const int COMPUTE_SHADER_BIT = 0x00000020; - public const int COMPUTE_SHADER_INVOCATIONS = 0x82F5; - public const int COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5; - public const int COMPUTE_SUBROUTINE = 0x92ED; - public const int COMPUTE_SUBROUTINE_UNIFORM = 0x92F3; - public const int COMPUTE_TEXTURE = 0x82A0; - public const int COMPUTE_WORK_GROUP_SIZE = 0x8267; - public const int COMP_BIT_ATI = 0x00000002; - public const int CONDITION_SATISFIED = 0x911C; - public const int CONFORMANT_NV = 0x9374; - public const int CONIC_CURVE_TO_NV = 0x1A; - public const int CONJOINT_NV = 0x9284; - public const int CONSERVATIVE_RASTERIZATION_INTEL = 0x83FE; - public const int CONSERVATIVE_RASTERIZATION_NV = 0x9346; - public const int CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = 0x937B; - public const int CONSERVATIVE_RASTER_DILATE_NV = 0x9379; - public const int CONSERVATIVE_RASTER_DILATE_RANGE_NV = 0x937A; - public const int CONSERVATIVE_RASTER_MODE_NV = 0x954D; - public const int CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = 0x954E; - public const int CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = 0x9550; - public const int CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = 0x954F; - public const int CONSERVE_MEMORY_HINT_PGI = 0x1A1FD; - public const int CONSTANT_ALPHA = 0x8003; - public const int CONSTANT_ALPHA_EXT = 0x8003; - public const int CONSTANT_ARB = 0x8576; - public const int CONSTANT_BORDER_HP = 0x8151; - public const int CONSTANT_COLOR = 0x8001; - public const int CONSTANT_COLOR0_NV = 0x852A; - public const int CONSTANT_COLOR1_NV = 0x852B; - public const int CONSTANT_COLOR_EXT = 0x8001; - public const int CONSTANT_EXT = 0x8576; - public const int CONST_EYE_NV = 0x86E5; - public const int CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002; - public const int CONTEXT_CORE_PROFILE_BIT = 0x00000001; - public const int CONTEXT_FLAGS = 0x821E; - public const int CONTEXT_FLAG_DEBUG_BIT = 0x00000002; - public const int CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001; - public const int CONTEXT_FLAG_NO_ERROR_BIT = 0x00000008; - public const int CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x00000008; - public const int CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004; - public const int CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004; - public const int CONTEXT_LOST = 0x0507; - public const int CONTEXT_PROFILE_MASK = 0x9126; - public const int CONTEXT_RELEASE_BEHAVIOR = 0x82FB; - public const int CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; - public const int CONTEXT_ROBUST_ACCESS = 0x90F3; - public const int CONTINUOUS_AMD = 0x9007; - public const int CONTRAST_NV = 0x92A1; - public const int CONVEX_HULL_NV = 0x908B; - public const int CONVOLUTION_1D_EXT = 0x8010; - public const int CONVOLUTION_2D_EXT = 0x8011; - public const int CONVOLUTION_BORDER_COLOR_HP = 0x8154; - public const int CONVOLUTION_BORDER_MODE_EXT = 0x8013; - public const int CONVOLUTION_FILTER_BIAS_EXT = 0x8015; - public const int CONVOLUTION_FILTER_SCALE_EXT = 0x8014; - public const int CONVOLUTION_FORMAT_EXT = 0x8017; - public const int CONVOLUTION_HEIGHT_EXT = 0x8019; - public const int CONVOLUTION_HINT_SGIX = 0x8316; - public const int CONVOLUTION_WIDTH_EXT = 0x8018; - public const int CON_0_ATI = 0x8941; - public const int CON_10_ATI = 0x894B; - public const int CON_11_ATI = 0x894C; - public const int CON_12_ATI = 0x894D; - public const int CON_13_ATI = 0x894E; - public const int CON_14_ATI = 0x894F; - public const int CON_15_ATI = 0x8950; - public const int CON_16_ATI = 0x8951; - public const int CON_17_ATI = 0x8952; - public const int CON_18_ATI = 0x8953; - public const int CON_19_ATI = 0x8954; - public const int CON_1_ATI = 0x8942; - public const int CON_20_ATI = 0x8955; - public const int CON_21_ATI = 0x8956; - public const int CON_22_ATI = 0x8957; - public const int CON_23_ATI = 0x8958; - public const int CON_24_ATI = 0x8959; - public const int CON_25_ATI = 0x895A; - public const int CON_26_ATI = 0x895B; - public const int CON_27_ATI = 0x895C; - public const int CON_28_ATI = 0x895D; - public const int CON_29_ATI = 0x895E; - public const int CON_2_ATI = 0x8943; - public const int CON_30_ATI = 0x895F; - public const int CON_31_ATI = 0x8960; - public const int CON_3_ATI = 0x8944; - public const int CON_4_ATI = 0x8945; - public const int CON_5_ATI = 0x8946; - public const int CON_6_ATI = 0x8947; - public const int CON_7_ATI = 0x8948; - public const int CON_8_ATI = 0x8949; - public const int CON_9_ATI = 0x894A; - public const int COORD_REPLACE_ARB = 0x8862; - public const int COORD_REPLACE_NV = 0x8862; - public const int COPY = 0x1503; - public const int COPY_INVERTED = 0x150C; - public const int COPY_READ_BUFFER = 0x8F36; - public const int COPY_READ_BUFFER_BINDING = 0x8F36; - public const int COPY_WRITE_BUFFER = 0x8F37; - public const int COPY_WRITE_BUFFER_BINDING = 0x8F37; - public const int COUNTER_RANGE_AMD = 0x8BC1; - public const int COUNTER_TYPE_AMD = 0x8BC0; - public const int COUNT_DOWN_NV = 0x9089; - public const int COUNT_UP_NV = 0x9088; - public const int COVERAGE_MODULATION_NV = 0x9332; - public const int COVERAGE_MODULATION_TABLE_NV = 0x9331; - public const int COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333; - public const int CUBIC_CURVE_TO_NV = 0x0C; - public const int CUBIC_EXT = 0x8334; - public const int CUBIC_HP = 0x815F; - public const int CULL_FACE = 0x0B44; - public const int CULL_FACE_MODE = 0x0B45; - public const int CULL_FRAGMENT_NV = 0x86E7; - public const int CULL_MODES_NV = 0x86E0; - public const int CULL_VERTEX_EXT = 0x81AA; - public const int CULL_VERTEX_EYE_POSITION_EXT = 0x81AB; - public const int CULL_VERTEX_IBM = 103050; - public const int CULL_VERTEX_OBJECT_POSITION_EXT = 0x81AC; - public const int CURRENT_ATTRIB_NV = 0x8626; - public const int CURRENT_BINORMAL_EXT = 0x843C; - public const int CURRENT_FOG_COORDINATE_EXT = 0x8453; - public const int CURRENT_MATRIX_ARB = 0x8641; - public const int CURRENT_MATRIX_INDEX_ARB = 0x8845; - public const int CURRENT_MATRIX_NV = 0x8641; - public const int CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; - public const int CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; - public const int CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865; - public const int CURRENT_PALETTE_MATRIX_ARB = 0x8843; - public const int CURRENT_PROGRAM = 0x8B8D; - public const int CURRENT_QUERY = 0x8865; - public const int CURRENT_QUERY_ARB = 0x8865; - public const int CURRENT_RASTER_NORMAL_SGIX = 0x8406; - public const int CURRENT_SECONDARY_COLOR_EXT = 0x8459; - public const int CURRENT_TANGENT_EXT = 0x843B; - public const int CURRENT_TIME_NV = 0x8E28; - public const int CURRENT_VERTEX_ATTRIB = 0x8626; - public const int CURRENT_VERTEX_ATTRIB_ARB = 0x8626; - public const int CURRENT_VERTEX_EXT = 0x87E2; - public const int CURRENT_VERTEX_WEIGHT_EXT = 0x850B; - public const int CURRENT_WEIGHT_ARB = 0x86A8; - public const int CW = 0x0900; - public const int D3D12_FENCE_VALUE_EXT = 0x9595; - public const int DARKEN_KHR = 0x9297; - public const int DARKEN_NV = 0x9297; - public const int DATA_BUFFER_AMD = 0x9151; - public const int DEBUG_CALLBACK_FUNCTION = 0x8244; - public const int DEBUG_CALLBACK_FUNCTION_ARB = 0x8244; - public const int DEBUG_CALLBACK_USER_PARAM = 0x8245; - public const int DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245; - public const int DEBUG_CATEGORY_API_ERROR_AMD = 0x9149; - public const int DEBUG_CATEGORY_APPLICATION_AMD = 0x914F; - public const int DEBUG_CATEGORY_DEPRECATION_AMD = 0x914B; - public const int DEBUG_CATEGORY_OTHER_AMD = 0x9150; - public const int DEBUG_CATEGORY_PERFORMANCE_AMD = 0x914D; - public const int DEBUG_CATEGORY_SHADER_COMPILER_AMD = 0x914E; - public const int DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD = 0x914C; - public const int DEBUG_CATEGORY_WINDOW_SYSTEM_AMD = 0x914A; - public const int DEBUG_GROUP_STACK_DEPTH = 0x826D; - public const int DEBUG_LOGGED_MESSAGES = 0x9145; - public const int DEBUG_LOGGED_MESSAGES_AMD = 0x9145; - public const int DEBUG_LOGGED_MESSAGES_ARB = 0x9145; - public const int DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243; - public const int DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243; - public const int DEBUG_OUTPUT = 0x92E0; - public const int DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; - public const int DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242; - public const int DEBUG_SEVERITY_HIGH = 0x9146; - public const int DEBUG_SEVERITY_HIGH_AMD = 0x9146; - public const int DEBUG_SEVERITY_HIGH_ARB = 0x9146; - public const int DEBUG_SEVERITY_LOW = 0x9148; - public const int DEBUG_SEVERITY_LOW_AMD = 0x9148; - public const int DEBUG_SEVERITY_LOW_ARB = 0x9148; - public const int DEBUG_SEVERITY_MEDIUM = 0x9147; - public const int DEBUG_SEVERITY_MEDIUM_AMD = 0x9147; - public const int DEBUG_SEVERITY_MEDIUM_ARB = 0x9147; - public const int DEBUG_SEVERITY_NOTIFICATION = 0x826B; - public const int DEBUG_SOURCE_API = 0x8246; - public const int DEBUG_SOURCE_API_ARB = 0x8246; - public const int DEBUG_SOURCE_APPLICATION = 0x824A; - public const int DEBUG_SOURCE_APPLICATION_ARB = 0x824A; - public const int DEBUG_SOURCE_OTHER = 0x824B; - public const int DEBUG_SOURCE_OTHER_ARB = 0x824B; - public const int DEBUG_SOURCE_SHADER_COMPILER = 0x8248; - public const int DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248; - public const int DEBUG_SOURCE_THIRD_PARTY = 0x8249; - public const int DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249; - public const int DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247; - public const int DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247; - public const int DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D; - public const int DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D; - public const int DEBUG_TYPE_ERROR = 0x824C; - public const int DEBUG_TYPE_ERROR_ARB = 0x824C; - public const int DEBUG_TYPE_MARKER = 0x8268; - public const int DEBUG_TYPE_OTHER = 0x8251; - public const int DEBUG_TYPE_OTHER_ARB = 0x8251; - public const int DEBUG_TYPE_PERFORMANCE = 0x8250; - public const int DEBUG_TYPE_PERFORMANCE_ARB = 0x8250; - public const int DEBUG_TYPE_POP_GROUP = 0x826A; - public const int DEBUG_TYPE_PORTABILITY = 0x824F; - public const int DEBUG_TYPE_PORTABILITY_ARB = 0x824F; - public const int DEBUG_TYPE_PUSH_GROUP = 0x8269; - public const int DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E; - public const int DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E; - public const int DECODE_EXT = 0x8A49; - public const int DECR = 0x1E03; - public const int DECR_WRAP = 0x8508; - public const int DECR_WRAP_EXT = 0x8508; - public const int DEDICATED_MEMORY_OBJECT_EXT = 0x9581; - public const int DEFORMATIONS_MASK_SGIX = 0x8196; - public const int DELETE_STATUS = 0x8B80; - public const int DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9; - public const int DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA; - public const int DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858; - public const int DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859; - public const int DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A; - public const int DEPTH = 0x1801; - public const int DEPTH24_STENCIL8 = 0x88F0; - public const int DEPTH24_STENCIL8_EXT = 0x88F0; - public const int DEPTH32F_STENCIL8 = 0x8CAD; - public const int DEPTH32F_STENCIL8_NV = 0x8DAC; - public const int DEPTH_ATTACHMENT = 0x8D00; - public const int DEPTH_ATTACHMENT_EXT = 0x8D00; - public const int DEPTH_BOUNDS_EXT = 0x8891; - public const int DEPTH_BOUNDS_TEST_EXT = 0x8890; - public const int DEPTH_BUFFER_BIT = 0x00000100; - public const int DEPTH_BUFFER_FLOAT_MODE_NV = 0x8DAF; - public const int DEPTH_CLAMP = 0x864F; - public const int DEPTH_CLAMP_FAR_AMD = 0x901F; - public const int DEPTH_CLAMP_NEAR_AMD = 0x901E; - public const int DEPTH_CLAMP_NV = 0x864F; - public const int DEPTH_CLEAR_VALUE = 0x0B73; - public const int DEPTH_COMPONENT = 0x1902; - public const int DEPTH_COMPONENT16 = 0x81A5; - public const int DEPTH_COMPONENT16_ARB = 0x81A5; - public const int DEPTH_COMPONENT16_SGIX = 0x81A5; - public const int DEPTH_COMPONENT24 = 0x81A6; - public const int DEPTH_COMPONENT24_ARB = 0x81A6; - public const int DEPTH_COMPONENT24_SGIX = 0x81A6; - public const int DEPTH_COMPONENT32 = 0x81A7; - public const int DEPTH_COMPONENT32F = 0x8CAC; - public const int DEPTH_COMPONENT32F_NV = 0x8DAB; - public const int DEPTH_COMPONENT32_ARB = 0x81A7; - public const int DEPTH_COMPONENT32_SGIX = 0x81A7; - public const int DEPTH_COMPONENTS = 0x8284; - public const int DEPTH_FUNC = 0x0B74; - public const int DEPTH_RANGE = 0x0B70; - public const int DEPTH_RENDERABLE = 0x8287; - public const int DEPTH_SAMPLES_NV = 0x932D; - public const int DEPTH_STENCIL = 0x84F9; - public const int DEPTH_STENCIL_ATTACHMENT = 0x821A; - public const int DEPTH_STENCIL_EXT = 0x84F9; - public const int DEPTH_STENCIL_NV = 0x84F9; - public const int DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; - public const int DEPTH_STENCIL_TO_BGRA_NV = 0x886F; - public const int DEPTH_STENCIL_TO_RGBA_NV = 0x886E; - public const int DEPTH_TEST = 0x0B71; - public const int DEPTH_TEXTURE_MODE_ARB = 0x884B; - public const int DEPTH_WRITEMASK = 0x0B72; - public const int DETACHED_BUFFERS_NV = 0x95AB; - public const int DETACHED_MEMORY_INCARNATION_NV = 0x95A9; - public const int DETACHED_TEXTURES_NV = 0x95AA; - public const int DETAIL_TEXTURE_2D_BINDING_SGIS = 0x8096; - public const int DETAIL_TEXTURE_2D_SGIS = 0x8095; - public const int DETAIL_TEXTURE_FUNC_POINTS_SGIS = 0x809C; - public const int DETAIL_TEXTURE_LEVEL_SGIS = 0x809A; - public const int DETAIL_TEXTURE_MODE_SGIS = 0x809B; - public const int DEVICE_LUID_EXT = 0x9599; - public const int DEVICE_NODE_MASK_EXT = 0x959A; - public const int DEVICE_UUID_EXT = 0x9597; - public const int DIFFERENCE_KHR = 0x929E; - public const int DIFFERENCE_NV = 0x929E; - public const int DISCARD_ATI = 0x8763; - public const int DISCARD_NV = 0x8530; - public const int DISCRETE_AMD = 0x9006; - public const int DISJOINT_NV = 0x9283; - public const int DISPATCH_INDIRECT_BUFFER = 0x90EE; - public const int DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; - public const int DISTANCE_ATTENUATION_EXT = 0x8129; - public const int DISTANCE_ATTENUATION_SGIS = 0x8129; - public const int DITHER = 0x0BD0; - public const int DONT_CARE = 0x1100; - public const int DOT2_ADD_ATI = 0x896C; - public const int DOT3_ATI = 0x8966; - public const int DOT3_RGBA_ARB = 0x86AF; - public const int DOT3_RGBA_EXT = 0x8741; - public const int DOT3_RGB_ARB = 0x86AE; - public const int DOT3_RGB_EXT = 0x8740; - public const int DOT4_ATI = 0x8967; - public const int DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D; - public const int DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3; - public const int DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED; - public const int DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1; - public const int DOT_PRODUCT_NV = 0x86EC; - public const int DOT_PRODUCT_PASS_THROUGH_NV = 0x885B; - public const int DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2; - public const int DOT_PRODUCT_TEXTURE_1D_NV = 0x885C; - public const int DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE; - public const int DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF; - public const int DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0; - public const int DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E; - public const int DOUBLE = 0x140A; - public const int DOUBLEBUFFER = 0x0C32; - public const int DOUBLE_MAT2 = 0x8F46; - public const int DOUBLE_MAT2_EXT = 0x8F46; - public const int DOUBLE_MAT2x3 = 0x8F49; - public const int DOUBLE_MAT2x3_EXT = 0x8F49; - public const int DOUBLE_MAT2x4 = 0x8F4A; - public const int DOUBLE_MAT2x4_EXT = 0x8F4A; - public const int DOUBLE_MAT3 = 0x8F47; - public const int DOUBLE_MAT3_EXT = 0x8F47; - public const int DOUBLE_MAT3x2 = 0x8F4B; - public const int DOUBLE_MAT3x2_EXT = 0x8F4B; - public const int DOUBLE_MAT3x4 = 0x8F4C; - public const int DOUBLE_MAT3x4_EXT = 0x8F4C; - public const int DOUBLE_MAT4 = 0x8F48; - public const int DOUBLE_MAT4_EXT = 0x8F48; - public const int DOUBLE_MAT4x2 = 0x8F4D; - public const int DOUBLE_MAT4x2_EXT = 0x8F4D; - public const int DOUBLE_MAT4x3 = 0x8F4E; - public const int DOUBLE_MAT4x3_EXT = 0x8F4E; - public const int DOUBLE_VEC2 = 0x8FFC; - public const int DOUBLE_VEC2_EXT = 0x8FFC; - public const int DOUBLE_VEC3 = 0x8FFD; - public const int DOUBLE_VEC3_EXT = 0x8FFD; - public const int DOUBLE_VEC4 = 0x8FFE; - public const int DOUBLE_VEC4_EXT = 0x8FFE; - public const int DRAW_ARRAYS_COMMAND_NV = 0x0003; - public const int DRAW_ARRAYS_INSTANCED_COMMAND_NV = 0x0007; - public const int DRAW_ARRAYS_STRIP_COMMAND_NV = 0x0005; - public const int DRAW_BUFFER = 0x0C01; - public const int DRAW_BUFFER0 = 0x8825; - public const int DRAW_BUFFER0_ARB = 0x8825; - public const int DRAW_BUFFER0_ATI = 0x8825; - public const int DRAW_BUFFER1 = 0x8826; - public const int DRAW_BUFFER10 = 0x882F; - public const int DRAW_BUFFER10_ARB = 0x882F; - public const int DRAW_BUFFER10_ATI = 0x882F; - public const int DRAW_BUFFER11 = 0x8830; - public const int DRAW_BUFFER11_ARB = 0x8830; - public const int DRAW_BUFFER11_ATI = 0x8830; - public const int DRAW_BUFFER12 = 0x8831; - public const int DRAW_BUFFER12_ARB = 0x8831; - public const int DRAW_BUFFER12_ATI = 0x8831; - public const int DRAW_BUFFER13 = 0x8832; - public const int DRAW_BUFFER13_ARB = 0x8832; - public const int DRAW_BUFFER13_ATI = 0x8832; - public const int DRAW_BUFFER14 = 0x8833; - public const int DRAW_BUFFER14_ARB = 0x8833; - public const int DRAW_BUFFER14_ATI = 0x8833; - public const int DRAW_BUFFER15 = 0x8834; - public const int DRAW_BUFFER15_ARB = 0x8834; - public const int DRAW_BUFFER15_ATI = 0x8834; - public const int DRAW_BUFFER1_ARB = 0x8826; - public const int DRAW_BUFFER1_ATI = 0x8826; - public const int DRAW_BUFFER2 = 0x8827; - public const int DRAW_BUFFER2_ARB = 0x8827; - public const int DRAW_BUFFER2_ATI = 0x8827; - public const int DRAW_BUFFER3 = 0x8828; - public const int DRAW_BUFFER3_ARB = 0x8828; - public const int DRAW_BUFFER3_ATI = 0x8828; - public const int DRAW_BUFFER4 = 0x8829; - public const int DRAW_BUFFER4_ARB = 0x8829; - public const int DRAW_BUFFER4_ATI = 0x8829; - public const int DRAW_BUFFER5 = 0x882A; - public const int DRAW_BUFFER5_ARB = 0x882A; - public const int DRAW_BUFFER5_ATI = 0x882A; - public const int DRAW_BUFFER6 = 0x882B; - public const int DRAW_BUFFER6_ARB = 0x882B; - public const int DRAW_BUFFER6_ATI = 0x882B; - public const int DRAW_BUFFER7 = 0x882C; - public const int DRAW_BUFFER7_ARB = 0x882C; - public const int DRAW_BUFFER7_ATI = 0x882C; - public const int DRAW_BUFFER8 = 0x882D; - public const int DRAW_BUFFER8_ARB = 0x882D; - public const int DRAW_BUFFER8_ATI = 0x882D; - public const int DRAW_BUFFER9 = 0x882E; - public const int DRAW_BUFFER9_ARB = 0x882E; - public const int DRAW_BUFFER9_ATI = 0x882E; - public const int DRAW_ELEMENTS_COMMAND_NV = 0x0002; - public const int DRAW_ELEMENTS_INSTANCED_COMMAND_NV = 0x0006; - public const int DRAW_ELEMENTS_STRIP_COMMAND_NV = 0x0004; - public const int DRAW_FRAMEBUFFER = 0x8CA9; - public const int DRAW_FRAMEBUFFER_BINDING = 0x8CA6; - public const int DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6; - public const int DRAW_FRAMEBUFFER_EXT = 0x8CA9; - public const int DRAW_INDIRECT_ADDRESS_NV = 0x8F41; - public const int DRAW_INDIRECT_BUFFER = 0x8F3F; - public const int DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; - public const int DRAW_INDIRECT_LENGTH_NV = 0x8F42; - public const int DRAW_INDIRECT_UNIFIED_NV = 0x8F40; - public const int DRAW_PIXELS_APPLE = 0x8A0A; - public const int DRIVER_UUID_EXT = 0x9598; - public const int DSDT8_MAG8_INTENSITY8_NV = 0x870B; - public const int DSDT8_MAG8_NV = 0x870A; - public const int DSDT8_NV = 0x8709; - public const int DSDT_MAG_INTENSITY_NV = 0x86DC; - public const int DSDT_MAG_NV = 0x86F6; - public const int DSDT_MAG_VIB_NV = 0x86F7; - public const int DSDT_NV = 0x86F5; - public const int DST_ALPHA = 0x0304; - public const int DST_ATOP_NV = 0x928F; - public const int DST_COLOR = 0x0306; - public const int DST_IN_NV = 0x928B; - public const int DST_NV = 0x9287; - public const int DST_OUT_NV = 0x928D; - public const int DST_OVER_NV = 0x9289; - public const int DS_BIAS_NV = 0x8716; - public const int DS_SCALE_NV = 0x8710; - public const int DT_BIAS_NV = 0x8717; - public const int DT_SCALE_NV = 0x8711; - public const int DU8DV8_ATI = 0x877A; - public const int DUAL_ALPHA12_SGIS = 0x8112; - public const int DUAL_ALPHA16_SGIS = 0x8113; - public const int DUAL_ALPHA4_SGIS = 0x8110; - public const int DUAL_ALPHA8_SGIS = 0x8111; - public const int DUAL_INTENSITY12_SGIS = 0x811A; - public const int DUAL_INTENSITY16_SGIS = 0x811B; - public const int DUAL_INTENSITY4_SGIS = 0x8118; - public const int DUAL_INTENSITY8_SGIS = 0x8119; - public const int DUAL_LUMINANCE12_SGIS = 0x8116; - public const int DUAL_LUMINANCE16_SGIS = 0x8117; - public const int DUAL_LUMINANCE4_SGIS = 0x8114; - public const int DUAL_LUMINANCE8_SGIS = 0x8115; - public const int DUAL_LUMINANCE_ALPHA4_SGIS = 0x811C; - public const int DUAL_LUMINANCE_ALPHA8_SGIS = 0x811D; - public const int DUAL_TEXTURE_SELECT_SGIS = 0x8124; - public const int DUDV_ATI = 0x8779; - public const int DUP_FIRST_CUBIC_CURVE_TO_NV = 0xF2; - public const int DUP_LAST_CUBIC_CURVE_TO_NV = 0xF4; - public const int DYNAMIC_ATI = 0x8761; - public const int DYNAMIC_COPY = 0x88EA; - public const int DYNAMIC_COPY_ARB = 0x88EA; - public const int DYNAMIC_DRAW = 0x88E8; - public const int DYNAMIC_DRAW_ARB = 0x88E8; - public const int DYNAMIC_READ = 0x88E9; - public const int DYNAMIC_READ_ARB = 0x88E9; - public const int DYNAMIC_STORAGE_BIT = 0x0100; - public const int EDGEFLAG_BIT_PGI = 0x00040000; - public const int EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26; - public const int EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B; - public const int EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; - public const int EDGE_FLAG_ARRAY_EXT = 0x8079; - public const int EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30; - public const int EDGE_FLAG_ARRAY_LIST_IBM = 103075; - public const int EDGE_FLAG_ARRAY_LIST_STRIDE_IBM = 103085; - public const int EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; - public const int EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; - public const int EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C; - public const int EIGHTH_BIT_ATI = 0x00000020; - public const int ELEMENT_ADDRESS_COMMAND_NV = 0x0008; - public const int ELEMENT_ARRAY_ADDRESS_NV = 0x8F29; - public const int ELEMENT_ARRAY_APPLE = 0x8A0C; - public const int ELEMENT_ARRAY_ATI = 0x8768; - public const int ELEMENT_ARRAY_BARRIER_BIT = 0x00000002; - public const int ELEMENT_ARRAY_BARRIER_BIT_EXT = 0x00000002; - public const int ELEMENT_ARRAY_BUFFER = 0x8893; - public const int ELEMENT_ARRAY_BUFFER_ARB = 0x8893; - public const int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; - public const int ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895; - public const int ELEMENT_ARRAY_LENGTH_NV = 0x8F33; - public const int ELEMENT_ARRAY_POINTER_APPLE = 0x8A0E; - public const int ELEMENT_ARRAY_POINTER_ATI = 0x876A; - public const int ELEMENT_ARRAY_TYPE_APPLE = 0x8A0D; - public const int ELEMENT_ARRAY_TYPE_ATI = 0x8769; - public const int ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F; - public const int EMBOSS_CONSTANT_NV = 0x855E; - public const int EMBOSS_LIGHT_NV = 0x855D; - public const int EMBOSS_MAP_NV = 0x855F; - public const int EQUAL = 0x0202; - public const int EQUIV = 0x1509; - public const int EVAL_2D_NV = 0x86C0; - public const int EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5; - public const int EVAL_TRIANGULAR_2D_NV = 0x86C1; - public const int EVAL_VERTEX_ATTRIB0_NV = 0x86C6; - public const int EVAL_VERTEX_ATTRIB10_NV = 0x86D0; - public const int EVAL_VERTEX_ATTRIB11_NV = 0x86D1; - public const int EVAL_VERTEX_ATTRIB12_NV = 0x86D2; - public const int EVAL_VERTEX_ATTRIB13_NV = 0x86D3; - public const int EVAL_VERTEX_ATTRIB14_NV = 0x86D4; - public const int EVAL_VERTEX_ATTRIB15_NV = 0x86D5; - public const int EVAL_VERTEX_ATTRIB1_NV = 0x86C7; - public const int EVAL_VERTEX_ATTRIB2_NV = 0x86C8; - public const int EVAL_VERTEX_ATTRIB3_NV = 0x86C9; - public const int EVAL_VERTEX_ATTRIB4_NV = 0x86CA; - public const int EVAL_VERTEX_ATTRIB5_NV = 0x86CB; - public const int EVAL_VERTEX_ATTRIB6_NV = 0x86CC; - public const int EVAL_VERTEX_ATTRIB7_NV = 0x86CD; - public const int EVAL_VERTEX_ATTRIB8_NV = 0x86CE; - public const int EVAL_VERTEX_ATTRIB9_NV = 0x86CF; - public const int EXCLUSION_KHR = 0x92A0; - public const int EXCLUSION_NV = 0x92A0; - public const int EXCLUSIVE_EXT = 0x8F11; - public const int EXPAND_NEGATE_NV = 0x8539; - public const int EXPAND_NORMAL_NV = 0x8538; - public const int EXTENSIONS = 0x1F03; - public const int EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD = 0x9160; - public const int EYE_DISTANCE_TO_LINE_SGIS = 0x81F2; - public const int EYE_DISTANCE_TO_POINT_SGIS = 0x81F0; - public const int EYE_LINE_SGIS = 0x81F6; - public const int EYE_PLANE = 0x2502; - public const int EYE_PLANE_ABSOLUTE_NV = 0x855C; - public const int EYE_POINT_SGIS = 0x81F4; - public const int EYE_RADIAL_NV = 0x855B; - public const int E_TIMES_F_NV = 0x8531; - public const int FACTOR_MAX_AMD = 0x901D; - public const int FACTOR_MIN_AMD = 0x901C; - public const int FAILURE_NV = 0x9030; - public const int FALSE = 0; - public const int FASTEST = 0x1101; - public const int FENCE_APPLE = 0x8A0B; - public const int FENCE_CONDITION_NV = 0x84F4; - public const int FENCE_STATUS_NV = 0x84F3; - public const int FIELDS_NV = 0x8E27; - public const int FIELD_LOWER_NV = 0x9023; - public const int FIELD_UPPER_NV = 0x9022; - public const int FILE_NAME_NV = 0x9074; - public const int FILL = 0x1B02; - public const int FILL_RECTANGLE_NV = 0x933C; - public const int FILTER = 0x829A; - public const int FILTER4_SGIS = 0x8146; - public const int FIRST_TO_REST_NV = 0x90AF; - public const int FIRST_VERTEX_CONVENTION = 0x8E4D; - public const int FIRST_VERTEX_CONVENTION_EXT = 0x8E4D; - public const int FIXED = 0x140C; - public const int FIXED_OES = 0x140C; - public const int FIXED_ONLY = 0x891D; - public const int FIXED_ONLY_ARB = 0x891D; - public const int FLOAT = 0x1406; - public const int FLOAT16_MAT2_AMD = 0x91C5; - public const int FLOAT16_MAT2x3_AMD = 0x91C8; - public const int FLOAT16_MAT2x4_AMD = 0x91C9; - public const int FLOAT16_MAT3_AMD = 0x91C6; - public const int FLOAT16_MAT3x2_AMD = 0x91CA; - public const int FLOAT16_MAT3x4_AMD = 0x91CB; - public const int FLOAT16_MAT4_AMD = 0x91C7; - public const int FLOAT16_MAT4x2_AMD = 0x91CC; - public const int FLOAT16_MAT4x3_AMD = 0x91CD; - public const int FLOAT16_NV = 0x8FF8; - public const int FLOAT16_VEC2_NV = 0x8FF9; - public const int FLOAT16_VEC3_NV = 0x8FFA; - public const int FLOAT16_VEC4_NV = 0x8FFB; - public const int FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; - public const int FLOAT_32_UNSIGNED_INT_24_8_REV_NV = 0x8DAD; - public const int FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D; - public const int FLOAT_MAT2 = 0x8B5A; - public const int FLOAT_MAT2_ARB = 0x8B5A; - public const int FLOAT_MAT2x3 = 0x8B65; - public const int FLOAT_MAT2x4 = 0x8B66; - public const int FLOAT_MAT3 = 0x8B5B; - public const int FLOAT_MAT3_ARB = 0x8B5B; - public const int FLOAT_MAT3x2 = 0x8B67; - public const int FLOAT_MAT3x4 = 0x8B68; - public const int FLOAT_MAT4 = 0x8B5C; - public const int FLOAT_MAT4_ARB = 0x8B5C; - public const int FLOAT_MAT4x2 = 0x8B69; - public const int FLOAT_MAT4x3 = 0x8B6A; - public const int FLOAT_R16_NV = 0x8884; - public const int FLOAT_R32_NV = 0x8885; - public const int FLOAT_RG16_NV = 0x8886; - public const int FLOAT_RG32_NV = 0x8887; - public const int FLOAT_RGB16_NV = 0x8888; - public const int FLOAT_RGB32_NV = 0x8889; - public const int FLOAT_RGBA16_NV = 0x888A; - public const int FLOAT_RGBA32_NV = 0x888B; - public const int FLOAT_RGBA_MODE_NV = 0x888E; - public const int FLOAT_RGBA_NV = 0x8883; - public const int FLOAT_RGB_NV = 0x8882; - public const int FLOAT_RG_NV = 0x8881; - public const int FLOAT_R_NV = 0x8880; - public const int FLOAT_VEC2 = 0x8B50; - public const int FLOAT_VEC2_ARB = 0x8B50; - public const int FLOAT_VEC3 = 0x8B51; - public const int FLOAT_VEC3_ARB = 0x8B51; - public const int FLOAT_VEC4 = 0x8B52; - public const int FLOAT_VEC4_ARB = 0x8B52; - public const int FOG = 0x0B60; - public const int FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D; - public const int FOG_COORDINATE_ARRAY_EXT = 0x8457; - public const int FOG_COORDINATE_ARRAY_LIST_IBM = 103076; - public const int FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM = 103086; - public const int FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456; - public const int FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455; - public const int FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454; - public const int FOG_COORDINATE_EXT = 0x8451; - public const int FOG_COORDINATE_SOURCE_EXT = 0x8450; - public const int FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28; - public const int FOG_COORD_ARRAY_LENGTH_NV = 0x8F32; - public const int FOG_DISTANCE_MODE_NV = 0x855A; - public const int FOG_FUNC_POINTS_SGIS = 0x812B; - public const int FOG_FUNC_SGIS = 0x812A; - public const int FOG_OFFSET_SGIX = 0x8198; - public const int FOG_OFFSET_VALUE_SGIX = 0x8199; - public const int FOG_SPECULAR_TEXTURE_WIN = 0x80EC; - public const int FONT_ASCENDER_BIT_NV = 0x00200000; - public const int FONT_DESCENDER_BIT_NV = 0x00400000; - public const int FONT_GLYPHS_AVAILABLE_NV = 0x9368; - public const int FONT_HAS_KERNING_BIT_NV = 0x10000000; - public const int FONT_HEIGHT_BIT_NV = 0x00800000; - public const int FONT_MAX_ADVANCE_HEIGHT_BIT_NV = 0x02000000; - public const int FONT_MAX_ADVANCE_WIDTH_BIT_NV = 0x01000000; - public const int FONT_NUM_GLYPH_INDICES_BIT_NV = 0x20000000; - public const int FONT_TARGET_UNAVAILABLE_NV = 0x9369; - public const int FONT_UNAVAILABLE_NV = 0x936A; - public const int FONT_UNDERLINE_POSITION_BIT_NV = 0x04000000; - public const int FONT_UNDERLINE_THICKNESS_BIT_NV = 0x08000000; - public const int FONT_UNINTELLIGIBLE_NV = 0x936B; - public const int FONT_UNITS_PER_EM_BIT_NV = 0x00100000; - public const int FONT_X_MAX_BOUNDS_BIT_NV = 0x00040000; - public const int FONT_X_MIN_BOUNDS_BIT_NV = 0x00010000; - public const int FONT_Y_MAX_BOUNDS_BIT_NV = 0x00080000; - public const int FONT_Y_MIN_BOUNDS_BIT_NV = 0x00020000; - public const int FORCE_BLUE_TO_ONE_NV = 0x8860; - public const int FORMAT_SUBSAMPLE_244_244_OML = 0x8983; - public const int FORMAT_SUBSAMPLE_24_24_OML = 0x8982; - public const int FRACTIONAL_EVEN = 0x8E7C; - public const int FRACTIONAL_ODD = 0x8E7B; - public const int FRAGMENT_COLOR_EXT = 0x834C; - public const int FRAGMENT_COLOR_MATERIAL_FACE_SGIX = 0x8402; - public const int FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX = 0x8403; - public const int FRAGMENT_COLOR_MATERIAL_SGIX = 0x8401; - public const int FRAGMENT_COVERAGE_COLOR_NV = 0x92DE; - public const int FRAGMENT_COVERAGE_TO_COLOR_NV = 0x92DD; - public const int FRAGMENT_DEPTH_EXT = 0x8452; - public const int FRAGMENT_INPUT_NV = 0x936D; - public const int FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D; - public const int FRAGMENT_LIGHT0_SGIX = 0x840C; - public const int FRAGMENT_LIGHT1_SGIX = 0x840D; - public const int FRAGMENT_LIGHT2_SGIX = 0x840E; - public const int FRAGMENT_LIGHT3_SGIX = 0x840F; - public const int FRAGMENT_LIGHT4_SGIX = 0x8410; - public const int FRAGMENT_LIGHT5_SGIX = 0x8411; - public const int FRAGMENT_LIGHT6_SGIX = 0x8412; - public const int FRAGMENT_LIGHT7_SGIX = 0x8413; - public const int FRAGMENT_LIGHTING_SGIX = 0x8400; - public const int FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX = 0x840A; - public const int FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX = 0x8408; - public const int FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX = 0x840B; - public const int FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX = 0x8409; - public const int FRAGMENT_MATERIAL_EXT = 0x8349; - public const int FRAGMENT_NORMAL_EXT = 0x834A; - public const int FRAGMENT_PROGRAM_ARB = 0x8804; - public const int FRAGMENT_PROGRAM_BINDING_NV = 0x8873; - public const int FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV = 0x8E5D; - public const int FRAGMENT_PROGRAM_NV = 0x8870; - public const int FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA4; - public const int FRAGMENT_SHADER = 0x8B30; - public const int FRAGMENT_SHADER_ARB = 0x8B30; - public const int FRAGMENT_SHADER_ATI = 0x8920; - public const int FRAGMENT_SHADER_BIT = 0x00000002; - public const int FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; - public const int FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B; - public const int FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52; - public const int FRAGMENT_SHADER_INVOCATIONS = 0x82F4; - public const int FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4; - public const int FRAGMENT_SUBROUTINE = 0x92EC; - public const int FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2; - public const int FRAGMENT_TEXTURE = 0x829F; - public const int FRAMEBUFFER = 0x8D40; - public const int FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215; - public const int FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214; - public const int FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210; - public const int FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211; - public const int FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216; - public const int FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213; - public const int FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7; - public const int FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = 0x8DA7; - public const int FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 0x8DA7; - public const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; - public const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1; - public const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; - public const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0; - public const int FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212; - public const int FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; - public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4; - public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632; - public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; - public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3; - public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; - public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4; - public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; - public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2; - public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630; - public const int FRAMEBUFFER_BARRIER_BIT = 0x00000400; - public const int FRAMEBUFFER_BARRIER_BIT_EXT = 0x00000400; - public const int FRAMEBUFFER_BINDING = 0x8CA6; - public const int FRAMEBUFFER_BINDING_EXT = 0x8CA6; - public const int FRAMEBUFFER_BLEND = 0x828B; - public const int FRAMEBUFFER_COMPLETE = 0x8CD5; - public const int FRAMEBUFFER_COMPLETE_EXT = 0x8CD5; - public const int FRAMEBUFFER_DEFAULT = 0x8218; - public const int FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; - public const int FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311; - public const int FRAMEBUFFER_DEFAULT_LAYERS = 0x9312; - public const int FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313; - public const int FRAMEBUFFER_DEFAULT_WIDTH = 0x9310; - public const int FRAMEBUFFER_EXT = 0x8D40; - public const int FRAMEBUFFER_FLIP_X_MESA = 0x8BBC; - public const int FRAMEBUFFER_FLIP_Y_MESA = 0x8BBB; - public const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; - public const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6; - public const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9; - public const int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB; - public const int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB; - public const int FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA; - public const int FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = 0x8DA9; - public const int FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT = 0x8DA9; - public const int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8; - public const int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = 0x8DA8; - public const int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 0x8DA8; - public const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; - public const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7; - public const int FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56; - public const int FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56; - public const int FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC; - public const int FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC; - public const int FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633; - public const int FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = 0x9342; - public const int FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = 0x9342; - public const int FRAMEBUFFER_RENDERABLE = 0x8289; - public const int FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A; - public const int FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = 0x9343; - public const int FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = 0x9343; - public const int FRAMEBUFFER_SRGB = 0x8DB9; - public const int FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8DBA; - public const int FRAMEBUFFER_SRGB_EXT = 0x8DB9; - public const int FRAMEBUFFER_SWAP_XY_MESA = 0x8BBD; - public const int FRAMEBUFFER_UNDEFINED = 0x8219; - public const int FRAMEBUFFER_UNSUPPORTED = 0x8CDD; - public const int FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD; - public const int FRAMEZOOM_FACTOR_SGIX = 0x818C; - public const int FRAMEZOOM_SGIX = 0x818B; - public const int FRAME_NV = 0x8E26; - public const int FRONT = 0x0404; - public const int FRONT_AND_BACK = 0x0408; - public const int FRONT_FACE = 0x0B46; - public const int FRONT_FACE_COMMAND_NV = 0x0012; - public const int FRONT_LEFT = 0x0400; - public const int FRONT_RIGHT = 0x0401; - public const int FULL_RANGE_EXT = 0x87E1; - public const int FULL_STIPPLE_HINT_PGI = 0x1A219; - public const int FULL_SUPPORT = 0x82B7; - public const int FUNC_ADD = 0x8006; - public const int FUNC_ADD_EXT = 0x8006; - public const int FUNC_REVERSE_SUBTRACT = 0x800B; - public const int FUNC_REVERSE_SUBTRACT_EXT = 0x800B; - public const int FUNC_SUBTRACT = 0x800A; - public const int FUNC_SUBTRACT_EXT = 0x800A; - public const int GENERATE_MIPMAP_HINT_SGIS = 0x8192; - public const int GENERATE_MIPMAP_SGIS = 0x8191; - public const int GENERIC_ATTRIB_NV = 0x8C7D; - public const int GEOMETRY_DEFORMATION_BIT_SGIX = 0x00000002; - public const int GEOMETRY_DEFORMATION_SGIX = 0x8194; - public const int GEOMETRY_INPUT_TYPE = 0x8917; - public const int GEOMETRY_INPUT_TYPE_ARB = 0x8DDB; - public const int GEOMETRY_INPUT_TYPE_EXT = 0x8DDB; - public const int GEOMETRY_OUTPUT_TYPE = 0x8918; - public const int GEOMETRY_OUTPUT_TYPE_ARB = 0x8DDC; - public const int GEOMETRY_OUTPUT_TYPE_EXT = 0x8DDC; - public const int GEOMETRY_PROGRAM_NV = 0x8C26; - public const int GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA3; - public const int GEOMETRY_SHADER = 0x8DD9; - public const int GEOMETRY_SHADER_ARB = 0x8DD9; - public const int GEOMETRY_SHADER_BIT = 0x00000004; - public const int GEOMETRY_SHADER_EXT = 0x8DD9; - public const int GEOMETRY_SHADER_INVOCATIONS = 0x887F; - public const int GEOMETRY_SHADER_PRIMITIVES_EMITTED = 0x82F3; - public const int GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3; - public const int GEOMETRY_SUBROUTINE = 0x92EB; - public const int GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1; - public const int GEOMETRY_TEXTURE = 0x829E; - public const int GEOMETRY_VERTICES_OUT = 0x8916; - public const int GEOMETRY_VERTICES_OUT_ARB = 0x8DDA; - public const int GEOMETRY_VERTICES_OUT_EXT = 0x8DDA; - public const int GEQUAL = 0x0206; - public const int GET_TEXTURE_IMAGE_FORMAT = 0x8291; - public const int GET_TEXTURE_IMAGE_TYPE = 0x8292; - public const int GLOBAL_ALPHA_FACTOR_SUN = 0x81DA; - public const int GLOBAL_ALPHA_SUN = 0x81D9; - public const int GLYPH_HAS_KERNING_BIT_NV = 0x100; - public const int GLYPH_HEIGHT_BIT_NV = 0x02; - public const int GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10; - public const int GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x04; - public const int GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x08; - public const int GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80; - public const int GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20; - public const int GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40; - public const int GLYPH_WIDTH_BIT_NV = 0x01; - public const int GPU_ADDRESS_NV = 0x8F34; - public const int GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049; - public const int GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047; - public const int GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; - public const int GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A; - public const int GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048; - public const int GREATER = 0x0204; - public const int GREEN = 0x1904; - public const int GREEN_BIT_ATI = 0x00000002; - public const int GREEN_INTEGER = 0x8D95; - public const int GREEN_INTEGER_EXT = 0x8D95; - public const int GREEN_MAX_CLAMP_INGR = 0x8565; - public const int GREEN_MIN_CLAMP_INGR = 0x8561; - public const int GREEN_NV = 0x1904; - public const int GUILTY_CONTEXT_RESET = 0x8253; - public const int GUILTY_CONTEXT_RESET_ARB = 0x8253; - public const int HALF_APPLE = 0x140B; - public const int HALF_BIAS_NEGATE_NV = 0x853B; - public const int HALF_BIAS_NORMAL_NV = 0x853A; - public const int HALF_BIT_ATI = 0x00000008; - public const int HALF_FLOAT = 0x140B; - public const int HALF_FLOAT_ARB = 0x140B; - public const int HALF_FLOAT_NV = 0x140B; - public const int HANDLE_TYPE_D3D11_IMAGE_EXT = 0x958B; - public const int HANDLE_TYPE_D3D11_IMAGE_KMT_EXT = 0x958C; - public const int HANDLE_TYPE_D3D12_FENCE_EXT = 0x9594; - public const int HANDLE_TYPE_D3D12_RESOURCE_EXT = 0x958A; - public const int HANDLE_TYPE_D3D12_TILEPOOL_EXT = 0x9589; - public const int HANDLE_TYPE_OPAQUE_FD_EXT = 0x9586; - public const int HANDLE_TYPE_OPAQUE_WIN32_EXT = 0x9587; - public const int HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = 0x9588; - public const int HARDLIGHT_KHR = 0x929B; - public const int HARDLIGHT_NV = 0x929B; - public const int HARDMIX_NV = 0x92A9; - public const int HIGH_FLOAT = 0x8DF2; - public const int HIGH_INT = 0x8DF5; - public const int HILO16_NV = 0x86F8; - public const int HILO8_NV = 0x885E; - public const int HILO_NV = 0x86F4; - public const int HISTOGRAM_ALPHA_SIZE_EXT = 0x802B; - public const int HISTOGRAM_BLUE_SIZE_EXT = 0x802A; - public const int HISTOGRAM_EXT = 0x8024; - public const int HISTOGRAM_FORMAT_EXT = 0x8027; - public const int HISTOGRAM_GREEN_SIZE_EXT = 0x8029; - public const int HISTOGRAM_LUMINANCE_SIZE_EXT = 0x802C; - public const int HISTOGRAM_RED_SIZE_EXT = 0x8028; - public const int HISTOGRAM_SINK_EXT = 0x802D; - public const int HISTOGRAM_WIDTH_EXT = 0x8026; - public const int HI_BIAS_NV = 0x8714; - public const int HI_SCALE_NV = 0x870E; - public const int HORIZONTAL_LINE_TO_NV = 0x06; - public const int HSL_COLOR_KHR = 0x92AF; - public const int HSL_COLOR_NV = 0x92AF; - public const int HSL_HUE_KHR = 0x92AD; - public const int HSL_HUE_NV = 0x92AD; - public const int HSL_LUMINOSITY_KHR = 0x92B0; - public const int HSL_LUMINOSITY_NV = 0x92B0; - public const int HSL_SATURATION_KHR = 0x92AE; - public const int HSL_SATURATION_NV = 0x92AE; - public const int IDENTITY_NV = 0x862A; - public const int IGNORE_BORDER_HP = 0x8150; - public const int IMAGE_1D = 0x904C; - public const int IMAGE_1D_ARRAY = 0x9052; - public const int IMAGE_1D_ARRAY_EXT = 0x9052; - public const int IMAGE_1D_EXT = 0x904C; - public const int IMAGE_2D = 0x904D; - public const int IMAGE_2D_ARRAY = 0x9053; - public const int IMAGE_2D_ARRAY_EXT = 0x9053; - public const int IMAGE_2D_EXT = 0x904D; - public const int IMAGE_2D_MULTISAMPLE = 0x9055; - public const int IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056; - public const int IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9056; - public const int IMAGE_2D_MULTISAMPLE_EXT = 0x9055; - public const int IMAGE_2D_RECT = 0x904F; - public const int IMAGE_2D_RECT_EXT = 0x904F; - public const int IMAGE_3D = 0x904E; - public const int IMAGE_3D_EXT = 0x904E; - public const int IMAGE_BINDING_ACCESS = 0x8F3E; - public const int IMAGE_BINDING_ACCESS_EXT = 0x8F3E; - public const int IMAGE_BINDING_FORMAT = 0x906E; - public const int IMAGE_BINDING_FORMAT_EXT = 0x906E; - public const int IMAGE_BINDING_LAYER = 0x8F3D; - public const int IMAGE_BINDING_LAYERED = 0x8F3C; - public const int IMAGE_BINDING_LAYERED_EXT = 0x8F3C; - public const int IMAGE_BINDING_LAYER_EXT = 0x8F3D; - public const int IMAGE_BINDING_LEVEL = 0x8F3B; - public const int IMAGE_BINDING_LEVEL_EXT = 0x8F3B; - public const int IMAGE_BINDING_NAME = 0x8F3A; - public const int IMAGE_BINDING_NAME_EXT = 0x8F3A; - public const int IMAGE_BUFFER = 0x9051; - public const int IMAGE_BUFFER_EXT = 0x9051; - public const int IMAGE_CLASS_10_10_10_2 = 0x82C3; - public const int IMAGE_CLASS_11_11_10 = 0x82C2; - public const int IMAGE_CLASS_1_X_16 = 0x82BE; - public const int IMAGE_CLASS_1_X_32 = 0x82BB; - public const int IMAGE_CLASS_1_X_8 = 0x82C1; - public const int IMAGE_CLASS_2_X_16 = 0x82BD; - public const int IMAGE_CLASS_2_X_32 = 0x82BA; - public const int IMAGE_CLASS_2_X_8 = 0x82C0; - public const int IMAGE_CLASS_4_X_16 = 0x82BC; - public const int IMAGE_CLASS_4_X_32 = 0x82B9; - public const int IMAGE_CLASS_4_X_8 = 0x82BF; - public const int IMAGE_COMPATIBILITY_CLASS = 0x82A8; - public const int IMAGE_CUBE = 0x9050; - public const int IMAGE_CUBE_EXT = 0x9050; - public const int IMAGE_CUBE_MAP_ARRAY = 0x9054; - public const int IMAGE_CUBE_MAP_ARRAY_EXT = 0x9054; - public const int IMAGE_CUBIC_WEIGHT_HP = 0x815E; - public const int IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; - public const int IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8; - public const int IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; - public const int IMAGE_MAG_FILTER_HP = 0x815C; - public const int IMAGE_MIN_FILTER_HP = 0x815D; - public const int IMAGE_PIXEL_FORMAT = 0x82A9; - public const int IMAGE_PIXEL_TYPE = 0x82AA; - public const int IMAGE_ROTATE_ANGLE_HP = 0x8159; - public const int IMAGE_ROTATE_ORIGIN_X_HP = 0x815A; - public const int IMAGE_ROTATE_ORIGIN_Y_HP = 0x815B; - public const int IMAGE_SCALE_X_HP = 0x8155; - public const int IMAGE_SCALE_Y_HP = 0x8156; - public const int IMAGE_TEXEL_SIZE = 0x82A7; - public const int IMAGE_TRANSFORM_2D_HP = 0x8161; - public const int IMAGE_TRANSLATE_X_HP = 0x8157; - public const int IMAGE_TRANSLATE_Y_HP = 0x8158; - public const int IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; - public const int IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B; - public const int IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; - public const int IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A; - public const int INCLUSIVE_EXT = 0x8F10; - public const int INCR = 0x1E02; - public const int INCR_WRAP = 0x8507; - public const int INCR_WRAP_EXT = 0x8507; - public const int INDEX_ARRAY_ADDRESS_NV = 0x8F24; - public const int INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899; - public const int INDEX_ARRAY_COUNT_EXT = 0x8087; - public const int INDEX_ARRAY_EXT = 0x8077; - public const int INDEX_ARRAY_LENGTH_NV = 0x8F2E; - public const int INDEX_ARRAY_LIST_IBM = 103073; - public const int INDEX_ARRAY_LIST_STRIDE_IBM = 103083; - public const int INDEX_ARRAY_POINTER_EXT = 0x8091; - public const int INDEX_ARRAY_STRIDE_EXT = 0x8086; - public const int INDEX_ARRAY_TYPE_EXT = 0x8085; - public const int INDEX_BIT_PGI = 0x00080000; - public const int INDEX_MATERIAL_EXT = 0x81B8; - public const int INDEX_MATERIAL_FACE_EXT = 0x81BA; - public const int INDEX_MATERIAL_PARAMETER_EXT = 0x81B9; - public const int INDEX_TEST_EXT = 0x81B5; - public const int INDEX_TEST_FUNC_EXT = 0x81B6; - public const int INDEX_TEST_REF_EXT = 0x81B7; - public const int INFO_LOG_LENGTH = 0x8B84; - public const int INNOCENT_CONTEXT_RESET = 0x8254; - public const int INNOCENT_CONTEXT_RESET_ARB = 0x8254; - public const int INSTRUMENT_BUFFER_POINTER_SGIX = 0x8180; - public const int INSTRUMENT_MEASUREMENTS_SGIX = 0x8181; - public const int INT = 0x1404; - public const int INT16_NV = 0x8FE4; - public const int INT16_VEC2_NV = 0x8FE5; - public const int INT16_VEC3_NV = 0x8FE6; - public const int INT16_VEC4_NV = 0x8FE7; - public const int INT64_ARB = 0x140E; - public const int INT64_NV = 0x140E; - public const int INT64_VEC2_ARB = 0x8FE9; - public const int INT64_VEC2_NV = 0x8FE9; - public const int INT64_VEC3_ARB = 0x8FEA; - public const int INT64_VEC3_NV = 0x8FEA; - public const int INT64_VEC4_ARB = 0x8FEB; - public const int INT64_VEC4_NV = 0x8FEB; - public const int INT8_NV = 0x8FE0; - public const int INT8_VEC2_NV = 0x8FE1; - public const int INT8_VEC3_NV = 0x8FE2; - public const int INT8_VEC4_NV = 0x8FE3; - public const int INTENSITY12_EXT = 0x804C; - public const int INTENSITY16F_ARB = 0x881D; - public const int INTENSITY16I_EXT = 0x8D8B; - public const int INTENSITY16UI_EXT = 0x8D79; - public const int INTENSITY16_EXT = 0x804D; - public const int INTENSITY16_SNORM = 0x901B; - public const int INTENSITY32F_ARB = 0x8817; - public const int INTENSITY32I_EXT = 0x8D85; - public const int INTENSITY32UI_EXT = 0x8D73; - public const int INTENSITY4_EXT = 0x804A; - public const int INTENSITY8I_EXT = 0x8D91; - public const int INTENSITY8UI_EXT = 0x8D7F; - public const int INTENSITY8_EXT = 0x804B; - public const int INTENSITY8_SNORM = 0x9017; - public const int INTENSITY_EXT = 0x8049; - public const int INTENSITY_FLOAT16_APPLE = 0x881D; - public const int INTENSITY_FLOAT16_ATI = 0x881D; - public const int INTENSITY_FLOAT32_APPLE = 0x8817; - public const int INTENSITY_FLOAT32_ATI = 0x8817; - public const int INTENSITY_SNORM = 0x9013; - public const int INTERLACE_OML = 0x8980; - public const int INTERLACE_READ_INGR = 0x8568; - public const int INTERLACE_READ_OML = 0x8981; - public const int INTERLACE_SGIX = 0x8094; - public const int INTERLEAVED_ATTRIBS = 0x8C8C; - public const int INTERLEAVED_ATTRIBS_EXT = 0x8C8C; - public const int INTERLEAVED_ATTRIBS_NV = 0x8C8C; - public const int INTERNALFORMAT_ALPHA_SIZE = 0x8274; - public const int INTERNALFORMAT_ALPHA_TYPE = 0x827B; - public const int INTERNALFORMAT_BLUE_SIZE = 0x8273; - public const int INTERNALFORMAT_BLUE_TYPE = 0x827A; - public const int INTERNALFORMAT_DEPTH_SIZE = 0x8275; - public const int INTERNALFORMAT_DEPTH_TYPE = 0x827C; - public const int INTERNALFORMAT_GREEN_SIZE = 0x8272; - public const int INTERNALFORMAT_GREEN_TYPE = 0x8279; - public const int INTERNALFORMAT_PREFERRED = 0x8270; - public const int INTERNALFORMAT_RED_SIZE = 0x8271; - public const int INTERNALFORMAT_RED_TYPE = 0x8278; - public const int INTERNALFORMAT_SHARED_SIZE = 0x8277; - public const int INTERNALFORMAT_STENCIL_SIZE = 0x8276; - public const int INTERNALFORMAT_STENCIL_TYPE = 0x827D; - public const int INTERNALFORMAT_SUPPORTED = 0x826F; - public const int INTERPOLATE_ARB = 0x8575; - public const int INTERPOLATE_EXT = 0x8575; - public const int INT_2_10_10_10_REV = 0x8D9F; - public const int INT_IMAGE_1D = 0x9057; - public const int INT_IMAGE_1D_ARRAY = 0x905D; - public const int INT_IMAGE_1D_ARRAY_EXT = 0x905D; - public const int INT_IMAGE_1D_EXT = 0x9057; - public const int INT_IMAGE_2D = 0x9058; - public const int INT_IMAGE_2D_ARRAY = 0x905E; - public const int INT_IMAGE_2D_ARRAY_EXT = 0x905E; - public const int INT_IMAGE_2D_EXT = 0x9058; - public const int INT_IMAGE_2D_MULTISAMPLE = 0x9060; - public const int INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061; - public const int INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9061; - public const int INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060; - public const int INT_IMAGE_2D_RECT = 0x905A; - public const int INT_IMAGE_2D_RECT_EXT = 0x905A; - public const int INT_IMAGE_3D = 0x9059; - public const int INT_IMAGE_3D_EXT = 0x9059; - public const int INT_IMAGE_BUFFER = 0x905C; - public const int INT_IMAGE_BUFFER_EXT = 0x905C; - public const int INT_IMAGE_CUBE = 0x905B; - public const int INT_IMAGE_CUBE_EXT = 0x905B; - public const int INT_IMAGE_CUBE_MAP_ARRAY = 0x905F; - public const int INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x905F; - public const int INT_SAMPLER_1D = 0x8DC9; - public const int INT_SAMPLER_1D_ARRAY = 0x8DCE; - public const int INT_SAMPLER_1D_ARRAY_EXT = 0x8DCE; - public const int INT_SAMPLER_1D_EXT = 0x8DC9; - public const int INT_SAMPLER_2D = 0x8DCA; - public const int INT_SAMPLER_2D_ARRAY = 0x8DCF; - public const int INT_SAMPLER_2D_ARRAY_EXT = 0x8DCF; - public const int INT_SAMPLER_2D_EXT = 0x8DCA; - public const int INT_SAMPLER_2D_MULTISAMPLE = 0x9109; - public const int INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C; - public const int INT_SAMPLER_2D_RECT = 0x8DCD; - public const int INT_SAMPLER_2D_RECT_EXT = 0x8DCD; - public const int INT_SAMPLER_3D = 0x8DCB; - public const int INT_SAMPLER_3D_EXT = 0x8DCB; - public const int INT_SAMPLER_BUFFER = 0x8DD0; - public const int INT_SAMPLER_BUFFER_AMD = 0x9002; - public const int INT_SAMPLER_BUFFER_EXT = 0x8DD0; - public const int INT_SAMPLER_CUBE = 0x8DCC; - public const int INT_SAMPLER_CUBE_EXT = 0x8DCC; - public const int INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E; - public const int INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E; - public const int INT_SAMPLER_RENDERBUFFER_NV = 0x8E57; - public const int INT_VEC2 = 0x8B53; - public const int INT_VEC2_ARB = 0x8B53; - public const int INT_VEC3 = 0x8B54; - public const int INT_VEC3_ARB = 0x8B54; - public const int INT_VEC4 = 0x8B55; - public const int INT_VEC4_ARB = 0x8B55; - public const int INVALID_ENUM = 0x0500; - public const int INVALID_FRAMEBUFFER_OPERATION = 0x0506; - public const int INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506; - public const uint INVALID_INDEX = 0xFFFFFFFF; - public const int INVALID_OPERATION = 0x0502; - public const int INVALID_VALUE = 0x0501; - public const int INVARIANT_DATATYPE_EXT = 0x87EB; - public const int INVARIANT_EXT = 0x87C2; - public const int INVARIANT_VALUE_EXT = 0x87EA; - public const int INVERSE_NV = 0x862B; - public const int INVERSE_TRANSPOSE_NV = 0x862D; - public const int INVERT = 0x150A; - public const int INVERTED_SCREEN_W_REND = 0x8491; - public const int INVERT_OVG_NV = 0x92B4; - public const int INVERT_RGB_NV = 0x92A3; - public const int IR_INSTRUMENT1_SGIX = 0x817F; - public const int ISOLINES = 0x8E7A; - public const int IS_PER_PATCH = 0x92E7; - public const int IS_ROW_MAJOR = 0x9300; - public const int ITALIC_BIT_NV = 0x02; - public const int IUI_N3F_V2F_EXT = 0x81AF; - public const int IUI_N3F_V3F_EXT = 0x81B0; - public const int IUI_V2F_EXT = 0x81AD; - public const int IUI_V3F_EXT = 0x81AE; - public const int KEEP = 0x1E00; - public const int LARGE_CCW_ARC_TO_NV = 0x16; - public const int LARGE_CW_ARC_TO_NV = 0x18; - public const int LAST_VERTEX_CONVENTION = 0x8E4E; - public const int LAST_VERTEX_CONVENTION_EXT = 0x8E4E; - public const int LAST_VIDEO_CAPTURE_STATUS_NV = 0x9027; - public const int LAYER_NV = 0x8DAA; - public const int LAYER_PROVOKING_VERTEX = 0x825E; - public const int LAYOUT_COLOR_ATTACHMENT_EXT = 0x958E; - public const int LAYOUT_DEFAULT_INTEL = 0; - public const int LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT = 0x9531; - public const int LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT = 0x9530; - public const int LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT = 0x958F; - public const int LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT = 0x9590; - public const int LAYOUT_GENERAL_EXT = 0x958D; - public const int LAYOUT_LINEAR_CPU_CACHED_INTEL = 2; - public const int LAYOUT_LINEAR_INTEL = 1; - public const int LAYOUT_SHADER_READ_ONLY_EXT = 0x9591; - public const int LAYOUT_TRANSFER_DST_EXT = 0x9593; - public const int LAYOUT_TRANSFER_SRC_EXT = 0x9592; - public const int LEFT = 0x0406; - public const int LEQUAL = 0x0203; - public const int LERP_ATI = 0x8969; - public const int LESS = 0x0201; - public const int LGPU_SEPARATE_STORAGE_BIT_NVX = 0x0800; - public const int LIGHTEN_KHR = 0x9298; - public const int LIGHTEN_NV = 0x9298; - public const int LIGHT_ENV_MODE_SGIX = 0x8407; - public const int LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8; - public const int LIGHT_MODEL_SPECULAR_VECTOR_APPLE = 0x85B0; - public const int LINE = 0x1B01; - public const int LINEAR = 0x2601; - public const int LINEARBURN_NV = 0x92A5; - public const int LINEARDODGE_NV = 0x92A4; - public const int LINEARLIGHT_NV = 0x92A7; - public const int LINEAR_CLIPMAP_LINEAR_SGIX = 0x8170; - public const int LINEAR_CLIPMAP_NEAREST_SGIX = 0x844F; - public const int LINEAR_DETAIL_ALPHA_SGIS = 0x8098; - public const int LINEAR_DETAIL_COLOR_SGIS = 0x8099; - public const int LINEAR_DETAIL_SGIS = 0x8097; - public const int LINEAR_MIPMAP_LINEAR = 0x2703; - public const int LINEAR_MIPMAP_NEAREST = 0x2701; - public const int LINEAR_SHARPEN_ALPHA_SGIS = 0x80AE; - public const int LINEAR_SHARPEN_COLOR_SGIS = 0x80AF; - public const int LINEAR_SHARPEN_SGIS = 0x80AD; - public const int LINEAR_TILING_EXT = 0x9585; - public const int LINES = 0x0001; - public const int LINES_ADJACENCY = 0x000A; - public const int LINES_ADJACENCY_ARB = 0x000A; - public const int LINES_ADJACENCY_EXT = 0x000A; - public const int LINE_LOOP = 0x0002; - public const int LINE_SMOOTH = 0x0B20; - public const int LINE_SMOOTH_HINT = 0x0C52; - public const int LINE_STRIP = 0x0003; - public const int LINE_STRIP_ADJACENCY = 0x000B; - public const int LINE_STRIP_ADJACENCY_ARB = 0x000B; - public const int LINE_STRIP_ADJACENCY_EXT = 0x000B; - public const int LINE_TO_NV = 0x04; - public const int LINE_WIDTH = 0x0B21; - public const int LINE_WIDTH_COMMAND_NV = 0x000D; - public const int LINE_WIDTH_GRANULARITY = 0x0B23; - public const int LINE_WIDTH_RANGE = 0x0B22; - public const int LINK_STATUS = 0x8B82; - public const int LIST_PRIORITY_SGIX = 0x8182; - public const int LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED; - public const int LOCAL_CONSTANT_EXT = 0x87C3; - public const int LOCAL_CONSTANT_VALUE_EXT = 0x87EC; - public const int LOCAL_EXT = 0x87C4; - public const int LOCATION = 0x930E; - public const int LOCATION_COMPONENT = 0x934A; - public const int LOCATION_INDEX = 0x930F; - public const int LOGIC_OP_MODE = 0x0BF0; - public const int LOSE_CONTEXT_ON_RESET = 0x8252; - public const int LOSE_CONTEXT_ON_RESET_ARB = 0x8252; - public const int LOWER_LEFT = 0x8CA1; - public const int LOW_FLOAT = 0x8DF0; - public const int LOW_INT = 0x8DF3; - public const int LO_BIAS_NV = 0x8715; - public const int LO_SCALE_NV = 0x870F; - public const int LUID_SIZE_EXT = 8; - public const int LUMINANCE12_ALPHA12_EXT = 0x8047; - public const int LUMINANCE12_ALPHA4_EXT = 0x8046; - public const int LUMINANCE12_EXT = 0x8041; - public const int LUMINANCE16F_ARB = 0x881E; - public const int LUMINANCE16F_EXT = 0x881E; - public const int LUMINANCE16I_EXT = 0x8D8C; - public const int LUMINANCE16UI_EXT = 0x8D7A; - public const int LUMINANCE16_ALPHA16_EXT = 0x8048; - public const int LUMINANCE16_ALPHA16_SNORM = 0x901A; - public const int LUMINANCE16_EXT = 0x8042; - public const int LUMINANCE16_SNORM = 0x9019; - public const int LUMINANCE32F_ARB = 0x8818; - public const int LUMINANCE32F_EXT = 0x8818; - public const int LUMINANCE32I_EXT = 0x8D86; - public const int LUMINANCE32UI_EXT = 0x8D74; - public const int LUMINANCE4_ALPHA4_EXT = 0x8043; - public const int LUMINANCE4_EXT = 0x803F; - public const int LUMINANCE6_ALPHA2_EXT = 0x8044; - public const int LUMINANCE8I_EXT = 0x8D92; - public const int LUMINANCE8UI_EXT = 0x8D80; - public const int LUMINANCE8_ALPHA8_EXT = 0x8045; - public const int LUMINANCE8_ALPHA8_SNORM = 0x9016; - public const int LUMINANCE8_EXT = 0x8040; - public const int LUMINANCE8_SNORM = 0x9015; - public const int LUMINANCE_ALPHA16F_ARB = 0x881F; - public const int LUMINANCE_ALPHA16F_EXT = 0x881F; - public const int LUMINANCE_ALPHA16I_EXT = 0x8D8D; - public const int LUMINANCE_ALPHA16UI_EXT = 0x8D7B; - public const int LUMINANCE_ALPHA32F_ARB = 0x8819; - public const int LUMINANCE_ALPHA32F_EXT = 0x8819; - public const int LUMINANCE_ALPHA32I_EXT = 0x8D87; - public const int LUMINANCE_ALPHA32UI_EXT = 0x8D75; - public const int LUMINANCE_ALPHA8I_EXT = 0x8D93; - public const int LUMINANCE_ALPHA8UI_EXT = 0x8D81; - public const int LUMINANCE_ALPHA_FLOAT16_APPLE = 0x881F; - public const int LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F; - public const int LUMINANCE_ALPHA_FLOAT32_APPLE = 0x8819; - public const int LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819; - public const int LUMINANCE_ALPHA_INTEGER_EXT = 0x8D9D; - public const int LUMINANCE_ALPHA_SNORM = 0x9012; - public const int LUMINANCE_FLOAT16_APPLE = 0x881E; - public const int LUMINANCE_FLOAT16_ATI = 0x881E; - public const int LUMINANCE_FLOAT32_APPLE = 0x8818; - public const int LUMINANCE_FLOAT32_ATI = 0x8818; - public const int LUMINANCE_INTEGER_EXT = 0x8D9C; - public const int LUMINANCE_SNORM = 0x9011; - public const int MAD_ATI = 0x8968; - public const int MAGNITUDE_BIAS_NV = 0x8718; - public const int MAGNITUDE_SCALE_NV = 0x8712; - public const int MAJOR_VERSION = 0x821B; - public const int MANUAL_GENERATE_MIPMAP = 0x8294; - public const int MAP1_BINORMAL_EXT = 0x8446; - public const int MAP1_TANGENT_EXT = 0x8444; - public const int MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; - public const int MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; - public const int MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; - public const int MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; - public const int MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; - public const int MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; - public const int MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; - public const int MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; - public const int MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; - public const int MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; - public const int MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; - public const int MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; - public const int MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; - public const int MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; - public const int MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; - public const int MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; - public const int MAP2_BINORMAL_EXT = 0x8447; - public const int MAP2_TANGENT_EXT = 0x8445; - public const int MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; - public const int MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; - public const int MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; - public const int MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; - public const int MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; - public const int MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; - public const int MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; - public const int MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; - public const int MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; - public const int MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; - public const int MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; - public const int MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; - public const int MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; - public const int MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; - public const int MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; - public const int MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; - public const int MAP_ATTRIB_U_ORDER_NV = 0x86C3; - public const int MAP_ATTRIB_V_ORDER_NV = 0x86C4; - public const int MAP_COHERENT_BIT = 0x0080; - public const int MAP_FLUSH_EXPLICIT_BIT = 0x0010; - public const int MAP_INVALIDATE_BUFFER_BIT = 0x0008; - public const int MAP_INVALIDATE_RANGE_BIT = 0x0004; - public const int MAP_PERSISTENT_BIT = 0x0040; - public const int MAP_READ_BIT = 0x0001; - public const int MAP_TESSELLATION_NV = 0x86C2; - public const int MAP_UNSYNCHRONIZED_BIT = 0x0020; - public const int MAP_WRITE_BIT = 0x0002; - public const int MATERIAL_SIDE_HINT_PGI = 0x1A22C; - public const int MATRIX0_ARB = 0x88C0; - public const int MATRIX0_NV = 0x8630; - public const int MATRIX10_ARB = 0x88CA; - public const int MATRIX11_ARB = 0x88CB; - public const int MATRIX12_ARB = 0x88CC; - public const int MATRIX13_ARB = 0x88CD; - public const int MATRIX14_ARB = 0x88CE; - public const int MATRIX15_ARB = 0x88CF; - public const int MATRIX16_ARB = 0x88D0; - public const int MATRIX17_ARB = 0x88D1; - public const int MATRIX18_ARB = 0x88D2; - public const int MATRIX19_ARB = 0x88D3; - public const int MATRIX1_ARB = 0x88C1; - public const int MATRIX1_NV = 0x8631; - public const int MATRIX20_ARB = 0x88D4; - public const int MATRIX21_ARB = 0x88D5; - public const int MATRIX22_ARB = 0x88D6; - public const int MATRIX23_ARB = 0x88D7; - public const int MATRIX24_ARB = 0x88D8; - public const int MATRIX25_ARB = 0x88D9; - public const int MATRIX26_ARB = 0x88DA; - public const int MATRIX27_ARB = 0x88DB; - public const int MATRIX28_ARB = 0x88DC; - public const int MATRIX29_ARB = 0x88DD; - public const int MATRIX2_ARB = 0x88C2; - public const int MATRIX2_NV = 0x8632; - public const int MATRIX30_ARB = 0x88DE; - public const int MATRIX31_ARB = 0x88DF; - public const int MATRIX3_ARB = 0x88C3; - public const int MATRIX3_NV = 0x8633; - public const int MATRIX4_ARB = 0x88C4; - public const int MATRIX4_NV = 0x8634; - public const int MATRIX5_ARB = 0x88C5; - public const int MATRIX5_NV = 0x8635; - public const int MATRIX6_ARB = 0x88C6; - public const int MATRIX6_NV = 0x8636; - public const int MATRIX7_ARB = 0x88C7; - public const int MATRIX7_NV = 0x8637; - public const int MATRIX8_ARB = 0x88C8; - public const int MATRIX9_ARB = 0x88C9; - public const int MATRIX_EXT = 0x87C0; - public const int MATRIX_INDEX_ARRAY_ARB = 0x8844; - public const int MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849; - public const int MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846; - public const int MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848; - public const int MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847; - public const int MATRIX_PALETTE_ARB = 0x8840; - public const int MATRIX_STRIDE = 0x92FF; - public const int MAT_AMBIENT_AND_DIFFUSE_BIT_PGI = 0x00200000; - public const int MAT_AMBIENT_BIT_PGI = 0x00100000; - public const int MAT_COLOR_INDEXES_BIT_PGI = 0x01000000; - public const int MAT_DIFFUSE_BIT_PGI = 0x00400000; - public const int MAT_EMISSION_BIT_PGI = 0x00800000; - public const int MAT_SHININESS_BIT_PGI = 0x02000000; - public const int MAT_SPECULAR_BIT_PGI = 0x04000000; - public const int MAX = 0x8008; - public const int MAX_3D_TEXTURE_SIZE = 0x8073; - public const int MAX_3D_TEXTURE_SIZE_EXT = 0x8073; - public const int MAX_4D_TEXTURE_SIZE_SGIS = 0x8138; - public const int MAX_ACTIVE_LIGHTS_SGIX = 0x8405; - public const int MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; - public const int MAX_ARRAY_TEXTURE_LAYERS_EXT = 0x88FF; - public const int MAX_ASYNC_DRAW_PIXELS_SGIX = 0x8360; - public const int MAX_ASYNC_HISTOGRAM_SGIX = 0x832D; - public const int MAX_ASYNC_READ_PIXELS_SGIX = 0x8361; - public const int MAX_ASYNC_TEX_IMAGE_SGIX = 0x835F; - public const int MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; - public const int MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8; - public const int MAX_BINDABLE_UNIFORM_SIZE_EXT = 0x8DED; - public const int MAX_CLIPMAP_DEPTH_SGIX = 0x8177; - public const int MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8178; - public const int MAX_CLIP_DISTANCES = 0x0D32; - public const int MAX_COARSE_FRAGMENT_SAMPLES_NV = 0x955F; - public const int MAX_COLOR_ATTACHMENTS = 0x8CDF; - public const int MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF; - public const int MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = 0x91B3; - public const int MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = 0x91B4; - public const int MAX_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B3; - public const int MAX_COLOR_TEXTURE_SAMPLES = 0x910E; - public const int MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7; - public const int MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1; - public const int MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; - public const int MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266; - public const int MAX_COMBINED_DIMENSIONS = 0x8282; - public const int MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33; - public const int MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32; - public const int MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; - public const int MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39; - public const int MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT = 0x8F39; - public const int MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV = 0x8E67; - public const int MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; - public const int MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC; - public const int MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV = 0x8E6F; - public const int MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E; - public const int MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; - public const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; - public const int MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D; - public const int MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E; - public const int MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31; - public const int MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265; - public const int MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264; - public const int MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB; - public const int MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF; - public const int MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD; - public const int MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB; - public const int MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262; - public const int MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC; - public const int MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB; - public const int MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263; - public const int MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344; - public const int MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345; - public const int MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE; - public const int MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; - public const int MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; - public const int MAX_CONVOLUTION_HEIGHT_EXT = 0x801B; - public const int MAX_CONVOLUTION_WIDTH_EXT = 0x801A; - public const int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; - public const int MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C; - public const int MAX_CUBE_MAP_TEXTURE_SIZE_EXT = 0x851C; - public const int MAX_CULL_DISTANCES = 0x82F9; - public const int MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C; - public const int MAX_DEBUG_LOGGED_MESSAGES = 0x9144; - public const int MAX_DEBUG_LOGGED_MESSAGES_AMD = 0x9144; - public const int MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144; - public const int MAX_DEBUG_MESSAGE_LENGTH = 0x9143; - public const int MAX_DEBUG_MESSAGE_LENGTH_AMD = 0x9143; - public const int MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143; - public const int MAX_DEEP_3D_TEXTURE_DEPTH_NV = 0x90D1; - public const int MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = 0x90D0; - public const int MAX_DEFORMATION_ORDER_SGIX = 0x8197; - public const int MAX_DEPTH = 0x8280; - public const int MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = 0x91B5; - public const int MAX_DEPTH_TEXTURE_SAMPLES = 0x910F; - public const int MAX_DETACHED_BUFFERS_NV = 0x95AD; - public const int MAX_DETACHED_TEXTURES_NV = 0x95AC; - public const int MAX_DRAW_BUFFERS = 0x8824; - public const int MAX_DRAW_BUFFERS_ARB = 0x8824; - public const int MAX_DRAW_BUFFERS_ATI = 0x8824; - public const int MAX_DRAW_MESH_TASKS_COUNT_NV = 0x953D; - public const int MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; - public const int MAX_ELEMENTS_INDICES = 0x80E9; - public const int MAX_ELEMENTS_INDICES_EXT = 0x80E9; - public const int MAX_ELEMENTS_VERTICES = 0x80E8; - public const int MAX_ELEMENTS_VERTICES_EXT = 0x80E8; - public const int MAX_ELEMENT_INDEX = 0x8D6B; - public const int MAX_EXT = 0x8008; - public const int MAX_FOG_FUNC_POINTS_SGIS = 0x812C; - public const int MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6; - public const int MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0; - public const int MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = 0x8DE3; - public const int MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE; - public const int MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; - public const int MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C; - public const int MAX_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5C; - public const int MAX_FRAGMENT_LIGHTS_SGIX = 0x8404; - public const int MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868; - public const int MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA; - public const int MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D; - public const int MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; - public const int MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49; - public const int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; - public const int MAX_FRAMEBUFFER_HEIGHT = 0x9316; - public const int MAX_FRAMEBUFFER_LAYERS = 0x9317; - public const int MAX_FRAMEBUFFER_SAMPLES = 0x9318; - public const int MAX_FRAMEBUFFER_WIDTH = 0x9315; - public const int MAX_FRAMEZOOM_FACTOR_SGIX = 0x818D; - public const int MAX_GENERAL_COMBINERS_NV = 0x854D; - public const int MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5; - public const int MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF; - public const int MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = 0x8DE4; - public const int MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD; - public const int MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123; - public const int MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124; - public const int MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0; - public const int MAX_GEOMETRY_OUTPUT_VERTICES_ARB = 0x8DE0; - public const int MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 0x8DE0; - public const int MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV = 0x8E5A; - public const int MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A; - public const int MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7; - public const int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29; - public const int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = 0x8C29; - public const int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 0x8C29; - public const int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1; - public const int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = 0x8DE1; - public const int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8DE1; - public const int MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C; - public const int MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF; - public const int MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = 0x8DDF; - public const int MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8DDF; - public const int MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD; - public const int MAX_GEOMETRY_VARYING_COMPONENTS_EXT = 0x8DDD; - public const int MAX_HEIGHT = 0x827F; - public const int MAX_IMAGE_SAMPLES = 0x906D; - public const int MAX_IMAGE_SAMPLES_EXT = 0x906D; - public const int MAX_IMAGE_UNITS = 0x8F38; - public const int MAX_IMAGE_UNITS_EXT = 0x8F38; - public const int MAX_INTEGER_SAMPLES = 0x9110; - public const int MAX_LABEL_LENGTH = 0x82E8; - public const int MAX_LAYERS = 0x8281; - public const int MAX_LGPU_GPUS_NVX = 0x92BA; - public const int MAX_MAP_TESSELLATION_NV = 0x86D6; - public const int MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841; - public const int MAX_MESH_ATOMIC_COUNTERS_NV = 0x8E65; - public const int MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV = 0x8E64; - public const int MAX_MESH_IMAGE_UNIFORMS_NV = 0x8E62; - public const int MAX_MESH_OUTPUT_PRIMITIVES_NV = 0x9539; - public const int MAX_MESH_OUTPUT_VERTICES_NV = 0x9538; - public const int MAX_MESH_SHADER_STORAGE_BLOCKS_NV = 0x8E66; - public const int MAX_MESH_TEXTURE_IMAGE_UNITS_NV = 0x8E61; - public const int MAX_MESH_TOTAL_MEMORY_SIZE_NV = 0x9536; - public const int MAX_MESH_UNIFORM_BLOCKS_NV = 0x8E60; - public const int MAX_MESH_UNIFORM_COMPONENTS_NV = 0x8E63; - public const int MAX_MESH_VIEWS_NV = 0x9557; - public const int MAX_MESH_WORK_GROUP_INVOCATIONS_NV = 0x95A2; - public const int MAX_MESH_WORK_GROUP_SIZE_NV = 0x953B; - public const int MAX_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E11; - public const int MAX_NAME_LENGTH = 0x92F6; - public const int MAX_NUM_ACTIVE_VARIABLES = 0x92F7; - public const int MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; - public const int MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA; - public const int MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CD; - public const int MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE; - public const int MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CC; - public const int MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB; - public const int MAX_PALETTE_MATRICES_ARB = 0x8842; - public const int MAX_PATCH_VERTICES = 0x8E7D; - public const int MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8337; - public const int MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1; - public const int MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; - public const int MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; - public const int MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; - public const int MAX_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8908; - public const int MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5; - public const int MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; - public const int MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4; - public const int MAX_PROGRAM_GENERIC_ATTRIBS_NV = 0x8DA5; - public const int MAX_PROGRAM_GENERIC_RESULTS_NV = 0x8DA6; - public const int MAX_PROGRAM_IF_DEPTH_NV = 0x88F6; - public const int MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; - public const int MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; - public const int MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8; - public const int MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7; - public const int MAX_PROGRAM_MATRICES_ARB = 0x862F; - public const int MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; - public const int MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; - public const int MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; - public const int MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; - public const int MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; - public const int MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; - public const int MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; - public const int MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; - public const int MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; - public const int MAX_PROGRAM_OUTPUT_VERTICES_NV = 0x8C27; - public const int MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; - public const int MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV = 0x8DA0; - public const int MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV = 0x8DA1; - public const int MAX_PROGRAM_PATCH_ATTRIBS_NV = 0x86D8; - public const int MAX_PROGRAM_RESULT_COMPONENTS_NV = 0x8909; - public const int MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45; - public const int MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV = 0x8F44; - public const int MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; - public const int MAX_PROGRAM_TEXEL_OFFSET = 0x8905; - public const int MAX_PROGRAM_TEXEL_OFFSET_EXT = 0x8905; - public const int MAX_PROGRAM_TEXEL_OFFSET_NV = 0x8905; - public const int MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F; - public const int MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F; - public const int MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F; - public const int MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5F; - public const int MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; - public const int MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; - public const int MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV = 0x8C28; - public const int MAX_RASTER_SAMPLES_EXT = 0x9329; - public const int MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7; - public const int MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8; - public const int MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8; - public const int MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8; - public const int MAX_RENDERBUFFER_SIZE = 0x84E8; - public const int MAX_RENDERBUFFER_SIZE_EXT = 0x84E8; - public const int MAX_SAMPLES = 0x8D57; - public const int MAX_SAMPLES_EXT = 0x8D57; - public const int MAX_SAMPLE_MASK_WORDS = 0x8E59; - public const int MAX_SAMPLE_MASK_WORDS_NV = 0x8E59; - public const int MAX_SERVER_WAIT_TIMEOUT = 0x9111; - public const int MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35; - public const int MAX_SHADER_COMPILER_THREADS_ARB = 0x91B0; - public const int MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0; - public const int MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE; - public const int MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD; - public const int MAX_SHININESS_NV = 0x8504; - public const int MAX_SPARSE_3D_TEXTURE_SIZE_AMD = 0x9199; - public const int MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199; - public const int MAX_SPARSE_ARRAY_TEXTURE_LAYERS = 0x919A; - public const int MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A; - public const int MAX_SPARSE_TEXTURE_SIZE_AMD = 0x9198; - public const int MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198; - public const int MAX_SPOT_EXPONENT_NV = 0x8505; - public const int MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = 0x9349; - public const int MAX_SUBROUTINES = 0x8DE7; - public const int MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; - public const int MAX_TASK_ATOMIC_COUNTERS_NV = 0x8E6D; - public const int MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV = 0x8E6C; - public const int MAX_TASK_IMAGE_UNIFORMS_NV = 0x8E6A; - public const int MAX_TASK_OUTPUT_COUNT_NV = 0x953A; - public const int MAX_TASK_SHADER_STORAGE_BLOCKS_NV = 0x8E6E; - public const int MAX_TASK_TEXTURE_IMAGE_UNITS_NV = 0x8E69; - public const int MAX_TASK_TOTAL_MEMORY_SIZE_NV = 0x9537; - public const int MAX_TASK_UNIFORM_BLOCKS_NV = 0x8E68; - public const int MAX_TASK_UNIFORM_COMPONENTS_NV = 0x8E6B; - public const int MAX_TASK_WORK_GROUP_INVOCATIONS_NV = 0x95A3; - public const int MAX_TASK_WORK_GROUP_SIZE_NV = 0x953C; - public const int MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3; - public const int MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD; - public const int MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB; - public const int MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C; - public const int MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83; - public const int MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8; - public const int MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81; - public const int MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85; - public const int MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89; - public const int MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F; - public const int MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4; - public const int MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE; - public const int MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC; - public const int MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D; - public const int MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86; - public const int MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9; - public const int MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82; - public const int MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A; - public const int MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80; - public const int MAX_TESS_GEN_LEVEL = 0x8E7E; - public const int MAX_TESS_PATCH_COMPONENTS = 0x8E84; - public const int MAX_TEXTURE_BUFFER_SIZE = 0x8C2B; - public const int MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B; - public const int MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B; - public const int MAX_TEXTURE_COORDS_ARB = 0x8871; - public const int MAX_TEXTURE_COORDS_NV = 0x8871; - public const int MAX_TEXTURE_IMAGE_UNITS = 0x8872; - public const int MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; - public const int MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872; - public const int MAX_TEXTURE_LOD_BIAS = 0x84FD; - public const int MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD; - public const int MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; - public const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; - public const int MAX_TEXTURE_SIZE = 0x0D33; - public const int MAX_TEXTURE_UNITS_ARB = 0x84E2; - public const int MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV = 0x95B6; - public const int MAX_TRACK_MATRICES_NV = 0x862F; - public const int MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; - public const int MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70; - public const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A; - public const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT = 0x8C8A; - public const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8C8A; - public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B; - public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT = 0x8C8B; - public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B; - public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; - public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT = 0x8C80; - public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8C80; - public const int MAX_UNIFORM_BLOCK_SIZE = 0x8A30; - public const int MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F; - public const int MAX_UNIFORM_LOCATIONS = 0x826E; - public const int MAX_VARYING_COMPONENTS = 0x8B4B; - public const int MAX_VARYING_COMPONENTS_EXT = 0x8B4B; - public const int MAX_VARYING_FLOATS = 0x8B4B; - public const int MAX_VARYING_FLOATS_ARB = 0x8B4B; - public const int MAX_VARYING_VECTORS = 0x8DFC; - public const int MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520; - public const int MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2; - public const int MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC; - public const int MAX_VERTEX_ATTRIBS = 0x8869; - public const int MAX_VERTEX_ATTRIBS_ARB = 0x8869; - public const int MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; - public const int MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9; - public const int MAX_VERTEX_ATTRIB_STRIDE = 0x82E5; - public const int MAX_VERTEX_BINDABLE_UNIFORMS_EXT = 0x8DE2; - public const int MAX_VERTEX_HINT_PGI = 0x1A22D; - public const int MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA; - public const int MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122; - public const int MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5; - public const int MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7; - public const int MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9; - public const int MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8; - public const int MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6; - public const int MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6; - public const int MAX_VERTEX_STREAMS = 0x8E71; - public const int MAX_VERTEX_STREAMS_ATI = 0x876B; - public const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; - public const int MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; - public const int MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B; - public const int MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; - public const int MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A; - public const int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; - public const int MAX_VERTEX_UNITS_ARB = 0x86A4; - public const int MAX_VERTEX_VARYING_COMPONENTS_ARB = 0x8DDE; - public const int MAX_VERTEX_VARYING_COMPONENTS_EXT = 0x8DDE; - public const int MAX_VIEWPORTS = 0x825B; - public const int MAX_VIEWPORT_DIMS = 0x0D3A; - public const int MAX_VIEWS_OVR = 0x9631; - public const int MAX_WIDTH = 0x827E; - public const int MAX_WINDOW_RECTANGLES_EXT = 0x8F14; - public const int MEDIUM_FLOAT = 0x8DF1; - public const int MEDIUM_INT = 0x8DF4; - public const int MEMORY_ATTACHABLE_ALIGNMENT_NV = 0x95A6; - public const int MEMORY_ATTACHABLE_NV = 0x95A8; - public const int MEMORY_ATTACHABLE_SIZE_NV = 0x95A7; - public const int MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV = 0x9543; - public const int MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV = 0x92DF; - public const int MESH_OUTPUT_TYPE_NV = 0x957B; - public const int MESH_PRIMITIVES_OUT_NV = 0x957A; - public const int MESH_SHADER_BIT_NV = 0x00000040; - public const int MESH_SHADER_NV = 0x9559; - public const int MESH_SUBROUTINE_NV = 0x957C; - public const int MESH_SUBROUTINE_UNIFORM_NV = 0x957E; - public const int MESH_VERTICES_OUT_NV = 0x9579; - public const int MESH_WORK_GROUP_SIZE_NV = 0x953E; - public const int MIN = 0x8007; - public const int MINMAX_EXT = 0x802E; - public const int MINMAX_FORMAT_EXT = 0x802F; - public const int MINMAX_SINK_EXT = 0x8030; - public const int MINOR_VERSION = 0x821C; - public const int MINUS_CLAMPED_NV = 0x92B3; - public const int MINUS_NV = 0x929F; - public const int MIN_EXT = 0x8007; - public const int MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B; - public const int MIN_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5B; - public const int MIN_LOD_WARNING_AMD = 0x919C; - public const int MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; - public const int MIN_PROGRAM_TEXEL_OFFSET = 0x8904; - public const int MIN_PROGRAM_TEXEL_OFFSET_EXT = 0x8904; - public const int MIN_PROGRAM_TEXEL_OFFSET_NV = 0x8904; - public const int MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E; - public const int MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E; - public const int MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5E; - public const int MIN_SAMPLE_SHADING_VALUE = 0x8C37; - public const int MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37; - public const int MIN_SPARSE_LEVEL_AMD = 0x919B; - public const int MIPMAP = 0x8293; - public const int MIRRORED_REPEAT = 0x8370; - public const int MIRRORED_REPEAT_ARB = 0x8370; - public const int MIRRORED_REPEAT_IBM = 0x8370; - public const int MIRROR_CLAMP_ATI = 0x8742; - public const int MIRROR_CLAMP_EXT = 0x8742; - public const int MIRROR_CLAMP_TO_BORDER_EXT = 0x8912; - public const int MIRROR_CLAMP_TO_EDGE = 0x8743; - public const int MIRROR_CLAMP_TO_EDGE_ATI = 0x8743; - public const int MIRROR_CLAMP_TO_EDGE_EXT = 0x8743; - public const int MITER_REVERT_NV = 0x90A7; - public const int MITER_TRUNCATE_NV = 0x90A8; - public const int MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F; - public const int MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330; - public const int MODELVIEW0_ARB = 0x1700; - public const int MODELVIEW0_EXT = 0x1700; - public const int MODELVIEW0_MATRIX_EXT = 0x0BA6; - public const int MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3; - public const int MODELVIEW10_ARB = 0x872A; - public const int MODELVIEW11_ARB = 0x872B; - public const int MODELVIEW12_ARB = 0x872C; - public const int MODELVIEW13_ARB = 0x872D; - public const int MODELVIEW14_ARB = 0x872E; - public const int MODELVIEW15_ARB = 0x872F; - public const int MODELVIEW16_ARB = 0x8730; - public const int MODELVIEW17_ARB = 0x8731; - public const int MODELVIEW18_ARB = 0x8732; - public const int MODELVIEW19_ARB = 0x8733; - public const int MODELVIEW1_ARB = 0x850A; - public const int MODELVIEW1_EXT = 0x850A; - public const int MODELVIEW1_MATRIX_EXT = 0x8506; - public const int MODELVIEW1_STACK_DEPTH_EXT = 0x8502; - public const int MODELVIEW20_ARB = 0x8734; - public const int MODELVIEW21_ARB = 0x8735; - public const int MODELVIEW22_ARB = 0x8736; - public const int MODELVIEW23_ARB = 0x8737; - public const int MODELVIEW24_ARB = 0x8738; - public const int MODELVIEW25_ARB = 0x8739; - public const int MODELVIEW26_ARB = 0x873A; - public const int MODELVIEW27_ARB = 0x873B; - public const int MODELVIEW28_ARB = 0x873C; - public const int MODELVIEW29_ARB = 0x873D; - public const int MODELVIEW2_ARB = 0x8722; - public const int MODELVIEW30_ARB = 0x873E; - public const int MODELVIEW31_ARB = 0x873F; - public const int MODELVIEW3_ARB = 0x8723; - public const int MODELVIEW4_ARB = 0x8724; - public const int MODELVIEW5_ARB = 0x8725; - public const int MODELVIEW6_ARB = 0x8726; - public const int MODELVIEW7_ARB = 0x8727; - public const int MODELVIEW8_ARB = 0x8728; - public const int MODELVIEW9_ARB = 0x8729; - public const int MODELVIEW_PROJECTION_NV = 0x8629; - public const int MODULATE_ADD_ATI = 0x8744; - public const int MODULATE_SIGNED_ADD_ATI = 0x8745; - public const int MODULATE_SUBTRACT_ATI = 0x8746; - public const int MOVE_TO_CONTINUES_NV = 0x90B6; - public const int MOVE_TO_NV = 0x02; - public const int MOVE_TO_RESETS_NV = 0x90B5; - public const int MOV_ATI = 0x8961; - public const int MULTICAST_GPUS_NV = 0x92BA; - public const int MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9549; - public const int MULTIPLY_KHR = 0x9294; - public const int MULTIPLY_NV = 0x9294; - public const int MULTISAMPLE = 0x809D; - public const int MULTISAMPLES_NV = 0x9371; - public const int MULTISAMPLE_3DFX = 0x86B2; - public const int MULTISAMPLE_ARB = 0x809D; - public const int MULTISAMPLE_BIT_3DFX = 0x20000000; - public const int MULTISAMPLE_BIT_ARB = 0x20000000; - public const int MULTISAMPLE_BIT_EXT = 0x20000000; - public const int MULTISAMPLE_COVERAGE_MODES_NV = 0x8E12; - public const int MULTISAMPLE_EXT = 0x809D; - public const int MULTISAMPLE_FILTER_HINT_NV = 0x8534; - public const int MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = 0x9382; - public const int MULTISAMPLE_LINE_WIDTH_RANGE_ARB = 0x9381; - public const int MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B; - public const int MULTISAMPLE_SGIS = 0x809D; - public const int MUL_ATI = 0x8964; - public const int MVP_MATRIX_EXT = 0x87E3; - public const int NAMED_STRING_LENGTH_ARB = 0x8DE9; - public const int NAMED_STRING_TYPE_ARB = 0x8DEA; - public const int NAME_LENGTH = 0x92F9; - public const int NAND = 0x150E; - public const int NATIVE_GRAPHICS_BEGIN_HINT_PGI = 0x1A203; - public const int NATIVE_GRAPHICS_END_HINT_PGI = 0x1A204; - public const int NATIVE_GRAPHICS_HANDLE_PGI = 0x1A202; - public const int NEAREST = 0x2600; - public const int NEAREST_CLIPMAP_LINEAR_SGIX = 0x844E; - public const int NEAREST_CLIPMAP_NEAREST_SGIX = 0x844D; - public const int NEAREST_MIPMAP_LINEAR = 0x2702; - public const int NEAREST_MIPMAP_NEAREST = 0x2700; - public const int NEGATE_BIT_ATI = 0x00000004; - public const int NEGATIVE_ONE_EXT = 0x87DF; - public const int NEGATIVE_ONE_TO_ONE = 0x935E; - public const int NEGATIVE_W_EXT = 0x87DC; - public const int NEGATIVE_X_EXT = 0x87D9; - public const int NEGATIVE_Y_EXT = 0x87DA; - public const int NEGATIVE_Z_EXT = 0x87DB; - public const int NEVER = 0x0200; - public const int NEXT_BUFFER_NV = -2; - public const int NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV = 0x9025; - public const int NICEST = 0x1102; - public const int NONE = 0; - public const int NOOP = 0x1505; - public const int NOP_COMMAND_NV = 0x0001; - public const int NOR = 0x1508; - public const int NORMALIZED_RANGE_EXT = 0x87E0; - public const int NORMAL_ARRAY_ADDRESS_NV = 0x8F22; - public const int NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897; - public const int NORMAL_ARRAY_COUNT_EXT = 0x8080; - public const int NORMAL_ARRAY_EXT = 0x8075; - public const int NORMAL_ARRAY_LENGTH_NV = 0x8F2C; - public const int NORMAL_ARRAY_LIST_IBM = 103071; - public const int NORMAL_ARRAY_LIST_STRIDE_IBM = 103081; - public const int NORMAL_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F6; - public const int NORMAL_ARRAY_POINTER_EXT = 0x808F; - public const int NORMAL_ARRAY_STRIDE_EXT = 0x807F; - public const int NORMAL_ARRAY_TYPE_EXT = 0x807E; - public const int NORMAL_BIT_PGI = 0x08000000; - public const int NORMAL_MAP_ARB = 0x8511; - public const int NORMAL_MAP_EXT = 0x8511; - public const int NORMAL_MAP_NV = 0x8511; - public const int NOTEQUAL = 0x0205; - public const int NO_ERROR = 0; - public const int NO_RESET_NOTIFICATION = 0x8261; - public const int NO_RESET_NOTIFICATION_ARB = 0x8261; - public const int NUM_ACTIVE_VARIABLES = 0x9304; - public const int NUM_COMPATIBLE_SUBROUTINES = 0x8E4A; - public const int NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; - public const int NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2; - public const int NUM_DEVICE_UUIDS_EXT = 0x9596; - public const int NUM_EXTENSIONS = 0x821D; - public const int NUM_FILL_STREAMS_NV = 0x8E29; - public const int NUM_FRAGMENT_CONSTANTS_ATI = 0x896F; - public const int NUM_FRAGMENT_REGISTERS_ATI = 0x896E; - public const int NUM_GENERAL_COMBINERS_NV = 0x854E; - public const int NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973; - public const int NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971; - public const int NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972; - public const int NUM_LOOPBACK_COMPONENTS_ATI = 0x8974; - public const int NUM_PASSES_ATI = 0x8970; - public const int NUM_PROGRAM_BINARY_FORMATS = 0x87FE; - public const int NUM_SAMPLE_COUNTS = 0x9380; - public const int NUM_SHADER_BINARY_FORMATS = 0x8DF9; - public const int NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9; - public const int NUM_SPARSE_LEVELS_ARB = 0x91AA; - public const int NUM_SPIR_V_EXTENSIONS = 0x9554; - public const int NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B6; - public const int NUM_TILING_TYPES_EXT = 0x9582; - public const int NUM_VIDEO_CAPTURE_STREAMS_NV = 0x9024; - public const int NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8; - public const int NUM_WINDOW_RECTANGLES_EXT = 0x8F15; - public const int OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89; - public const int OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A; - public const int OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86; - public const int OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87; - public const int OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85; - public const int OBJECT_BUFFER_SIZE_ATI = 0x8764; - public const int OBJECT_BUFFER_USAGE_ATI = 0x8765; - public const int OBJECT_COMPILE_STATUS_ARB = 0x8B81; - public const int OBJECT_DELETE_STATUS_ARB = 0x8B80; - public const int OBJECT_DISTANCE_TO_LINE_SGIS = 0x81F3; - public const int OBJECT_DISTANCE_TO_POINT_SGIS = 0x81F1; - public const int OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84; - public const int OBJECT_LINE_SGIS = 0x81F7; - public const int OBJECT_LINK_STATUS_ARB = 0x8B82; - public const int OBJECT_POINT_SGIS = 0x81F5; - public const int OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88; - public const int OBJECT_SUBTYPE_ARB = 0x8B4F; - public const int OBJECT_TYPE = 0x9112; - public const int OBJECT_TYPE_ARB = 0x8B4E; - public const int OBJECT_VALIDATE_STATUS_ARB = 0x8B83; - public const int OCCLUSION_QUERY_EVENT_MASK_AMD = 0x874F; - public const int OCCLUSION_TEST_HP = 0x8165; - public const int OCCLUSION_TEST_RESULT_HP = 0x8166; - public const int OFFSET = 0x92FC; - public const int OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856; - public const int OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857; - public const int OFFSET_HILO_TEXTURE_2D_NV = 0x8854; - public const int OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855; - public const int OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850; - public const int OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851; - public const int OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852; - public const int OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853; - public const int OFFSET_TEXTURE_2D_BIAS_NV = 0x86E3; - public const int OFFSET_TEXTURE_2D_MATRIX_NV = 0x86E1; - public const int OFFSET_TEXTURE_2D_NV = 0x86E8; - public const int OFFSET_TEXTURE_2D_SCALE_NV = 0x86E2; - public const int OFFSET_TEXTURE_BIAS_NV = 0x86E3; - public const int OFFSET_TEXTURE_MATRIX_NV = 0x86E1; - public const int OFFSET_TEXTURE_RECTANGLE_NV = 0x864C; - public const int OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D; - public const int OFFSET_TEXTURE_SCALE_NV = 0x86E2; - public const int ONE = 1; - public const int ONE_EXT = 0x87DE; - public const int ONE_MINUS_CONSTANT_ALPHA = 0x8004; - public const int ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; - public const int ONE_MINUS_CONSTANT_COLOR = 0x8002; - public const int ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002; - public const int ONE_MINUS_DST_ALPHA = 0x0305; - public const int ONE_MINUS_DST_COLOR = 0x0307; - public const int ONE_MINUS_SRC1_ALPHA = 0x88FB; - public const int ONE_MINUS_SRC1_COLOR = 0x88FA; - public const int ONE_MINUS_SRC_ALPHA = 0x0303; - public const int ONE_MINUS_SRC_COLOR = 0x0301; - public const int OPERAND0_ALPHA_ARB = 0x8598; - public const int OPERAND0_ALPHA_EXT = 0x8598; - public const int OPERAND0_RGB_ARB = 0x8590; - public const int OPERAND0_RGB_EXT = 0x8590; - public const int OPERAND1_ALPHA_ARB = 0x8599; - public const int OPERAND1_ALPHA_EXT = 0x8599; - public const int OPERAND1_RGB_ARB = 0x8591; - public const int OPERAND1_RGB_EXT = 0x8591; - public const int OPERAND2_ALPHA_ARB = 0x859A; - public const int OPERAND2_ALPHA_EXT = 0x859A; - public const int OPERAND2_RGB_ARB = 0x8592; - public const int OPERAND2_RGB_EXT = 0x8592; - public const int OPERAND3_ALPHA_NV = 0x859B; - public const int OPERAND3_RGB_NV = 0x8593; - public const int OPTIMAL_TILING_EXT = 0x9584; - public const int OP_ADD_EXT = 0x8787; - public const int OP_CLAMP_EXT = 0x878E; - public const int OP_CROSS_PRODUCT_EXT = 0x8797; - public const int OP_DOT3_EXT = 0x8784; - public const int OP_DOT4_EXT = 0x8785; - public const int OP_EXP_BASE_2_EXT = 0x8791; - public const int OP_FLOOR_EXT = 0x878F; - public const int OP_FRAC_EXT = 0x8789; - public const int OP_INDEX_EXT = 0x8782; - public const int OP_LOG_BASE_2_EXT = 0x8792; - public const int OP_MADD_EXT = 0x8788; - public const int OP_MAX_EXT = 0x878A; - public const int OP_MIN_EXT = 0x878B; - public const int OP_MOV_EXT = 0x8799; - public const int OP_MULTIPLY_MATRIX_EXT = 0x8798; - public const int OP_MUL_EXT = 0x8786; - public const int OP_NEGATE_EXT = 0x8783; - public const int OP_POWER_EXT = 0x8793; - public const int OP_RECIP_EXT = 0x8794; - public const int OP_RECIP_SQRT_EXT = 0x8795; - public const int OP_ROUND_EXT = 0x8790; - public const int OP_SET_GE_EXT = 0x878C; - public const int OP_SET_LT_EXT = 0x878D; - public const int OP_SUB_EXT = 0x8796; - public const int OR = 0x1507; - public const int OR_INVERTED = 0x150D; - public const int OR_REVERSE = 0x150B; - public const int OUTPUT_COLOR0_EXT = 0x879B; - public const int OUTPUT_COLOR1_EXT = 0x879C; - public const int OUTPUT_FOG_EXT = 0x87BD; - public const int OUTPUT_TEXTURE_COORD0_EXT = 0x879D; - public const int OUTPUT_TEXTURE_COORD10_EXT = 0x87A7; - public const int OUTPUT_TEXTURE_COORD11_EXT = 0x87A8; - public const int OUTPUT_TEXTURE_COORD12_EXT = 0x87A9; - public const int OUTPUT_TEXTURE_COORD13_EXT = 0x87AA; - public const int OUTPUT_TEXTURE_COORD14_EXT = 0x87AB; - public const int OUTPUT_TEXTURE_COORD15_EXT = 0x87AC; - public const int OUTPUT_TEXTURE_COORD16_EXT = 0x87AD; - public const int OUTPUT_TEXTURE_COORD17_EXT = 0x87AE; - public const int OUTPUT_TEXTURE_COORD18_EXT = 0x87AF; - public const int OUTPUT_TEXTURE_COORD19_EXT = 0x87B0; - public const int OUTPUT_TEXTURE_COORD1_EXT = 0x879E; - public const int OUTPUT_TEXTURE_COORD20_EXT = 0x87B1; - public const int OUTPUT_TEXTURE_COORD21_EXT = 0x87B2; - public const int OUTPUT_TEXTURE_COORD22_EXT = 0x87B3; - public const int OUTPUT_TEXTURE_COORD23_EXT = 0x87B4; - public const int OUTPUT_TEXTURE_COORD24_EXT = 0x87B5; - public const int OUTPUT_TEXTURE_COORD25_EXT = 0x87B6; - public const int OUTPUT_TEXTURE_COORD26_EXT = 0x87B7; - public const int OUTPUT_TEXTURE_COORD27_EXT = 0x87B8; - public const int OUTPUT_TEXTURE_COORD28_EXT = 0x87B9; - public const int OUTPUT_TEXTURE_COORD29_EXT = 0x87BA; - public const int OUTPUT_TEXTURE_COORD2_EXT = 0x879F; - public const int OUTPUT_TEXTURE_COORD30_EXT = 0x87BB; - public const int OUTPUT_TEXTURE_COORD31_EXT = 0x87BC; - public const int OUTPUT_TEXTURE_COORD3_EXT = 0x87A0; - public const int OUTPUT_TEXTURE_COORD4_EXT = 0x87A1; - public const int OUTPUT_TEXTURE_COORD5_EXT = 0x87A2; - public const int OUTPUT_TEXTURE_COORD6_EXT = 0x87A3; - public const int OUTPUT_TEXTURE_COORD7_EXT = 0x87A4; - public const int OUTPUT_TEXTURE_COORD8_EXT = 0x87A5; - public const int OUTPUT_TEXTURE_COORD9_EXT = 0x87A6; - public const int OUTPUT_VERTEX_EXT = 0x879A; - public const int OUT_OF_MEMORY = 0x0505; - public const int OVERLAY_KHR = 0x9296; - public const int OVERLAY_NV = 0x9296; - public const int PACK_ALIGNMENT = 0x0D05; - public const int PACK_CMYK_HINT_EXT = 0x800E; - public const int PACK_COMPRESSED_BLOCK_DEPTH = 0x912D; - public const int PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C; - public const int PACK_COMPRESSED_BLOCK_SIZE = 0x912E; - public const int PACK_COMPRESSED_BLOCK_WIDTH = 0x912B; - public const int PACK_IMAGE_DEPTH_SGIS = 0x8131; - public const int PACK_IMAGE_HEIGHT = 0x806C; - public const int PACK_IMAGE_HEIGHT_EXT = 0x806C; - public const int PACK_INVERT_MESA = 0x8758; - public const int PACK_LSB_FIRST = 0x0D01; - public const int PACK_RESAMPLE_OML = 0x8984; - public const int PACK_RESAMPLE_SGIX = 0x842E; - public const int PACK_ROW_BYTES_APPLE = 0x8A15; - public const int PACK_ROW_LENGTH = 0x0D02; - public const int PACK_SKIP_IMAGES = 0x806B; - public const int PACK_SKIP_IMAGES_EXT = 0x806B; - public const int PACK_SKIP_PIXELS = 0x0D04; - public const int PACK_SKIP_ROWS = 0x0D03; - public const int PACK_SKIP_VOLUMES_SGIS = 0x8130; - public const int PACK_SUBSAMPLE_RATE_SGIX = 0x85A0; - public const int PACK_SWAP_BYTES = 0x0D00; - public const int PALETTE4_R5_G6_B5_OES = 0x8B92; - public const int PALETTE4_RGB5_A1_OES = 0x8B94; - public const int PALETTE4_RGB8_OES = 0x8B90; - public const int PALETTE4_RGBA4_OES = 0x8B93; - public const int PALETTE4_RGBA8_OES = 0x8B91; - public const int PALETTE8_R5_G6_B5_OES = 0x8B97; - public const int PALETTE8_RGB5_A1_OES = 0x8B99; - public const int PALETTE8_RGB8_OES = 0x8B95; - public const int PALETTE8_RGBA4_OES = 0x8B98; - public const int PALETTE8_RGBA8_OES = 0x8B96; - public const int PARALLEL_ARRAYS_INTEL = 0x83F4; - public const int PARAMETER_BUFFER = 0x80EE; - public const int PARAMETER_BUFFER_ARB = 0x80EE; - public const int PARAMETER_BUFFER_BINDING = 0x80EF; - public const int PARAMETER_BUFFER_BINDING_ARB = 0x80EF; - public const int PARTIAL_SUCCESS_NV = 0x902E; - public const int PASS_THROUGH_NV = 0x86E6; - public const int PATCHES = 0x000E; - public const int PATCH_DEFAULT_INNER_LEVEL = 0x8E73; - public const int PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; - public const int PATCH_VERTICES = 0x8E72; - public const int PATH_CLIENT_LENGTH_NV = 0x907F; - public const int PATH_COMMAND_COUNT_NV = 0x909D; - public const int PATH_COMPUTED_LENGTH_NV = 0x90A0; - public const int PATH_COORD_COUNT_NV = 0x909E; - public const int PATH_COVER_DEPTH_FUNC_NV = 0x90BF; - public const int PATH_DASH_ARRAY_COUNT_NV = 0x909F; - public const int PATH_DASH_CAPS_NV = 0x907B; - public const int PATH_DASH_OFFSET_NV = 0x907E; - public const int PATH_DASH_OFFSET_RESET_NV = 0x90B4; - public const int PATH_END_CAPS_NV = 0x9076; - public const int PATH_ERROR_POSITION_NV = 0x90AB; - public const int PATH_FILL_BOUNDING_BOX_NV = 0x90A1; - public const int PATH_FILL_COVER_MODE_NV = 0x9082; - public const int PATH_FILL_MASK_NV = 0x9081; - public const int PATH_FILL_MODE_NV = 0x9080; - public const int PATH_FORMAT_PS_NV = 0x9071; - public const int PATH_FORMAT_SVG_NV = 0x9070; - public const int PATH_GEN_COEFF_NV = 0x90B1; - public const int PATH_GEN_COMPONENTS_NV = 0x90B3; - public const int PATH_GEN_MODE_NV = 0x90B0; - public const int PATH_INITIAL_DASH_CAP_NV = 0x907C; - public const int PATH_INITIAL_END_CAP_NV = 0x9077; - public const int PATH_JOIN_STYLE_NV = 0x9079; - public const int PATH_MAX_MODELVIEW_STACK_DEPTH_NV = 0x0D36; - public const int PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38; - public const int PATH_MITER_LIMIT_NV = 0x907A; - public const int PATH_MODELVIEW_MATRIX_NV = 0x0BA6; - public const int PATH_MODELVIEW_NV = 0x1700; - public const int PATH_MODELVIEW_STACK_DEPTH_NV = 0x0BA3; - public const int PATH_OBJECT_BOUNDING_BOX_NV = 0x908A; - public const int PATH_PROJECTION_MATRIX_NV = 0x0BA7; - public const int PATH_PROJECTION_NV = 0x1701; - public const int PATH_PROJECTION_STACK_DEPTH_NV = 0x0BA4; - public const int PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD; - public const int PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE; - public const int PATH_STENCIL_FUNC_NV = 0x90B7; - public const int PATH_STENCIL_REF_NV = 0x90B8; - public const int PATH_STENCIL_VALUE_MASK_NV = 0x90B9; - public const int PATH_STROKE_BOUNDING_BOX_NV = 0x90A2; - public const int PATH_STROKE_COVER_MODE_NV = 0x9083; - public const int PATH_STROKE_MASK_NV = 0x9084; - public const int PATH_STROKE_WIDTH_NV = 0x9075; - public const int PATH_TERMINAL_DASH_CAP_NV = 0x907D; - public const int PATH_TERMINAL_END_CAP_NV = 0x9078; - public const int PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = 0x84E3; - public const int PATH_TRANSPOSE_PROJECTION_MATRIX_NV = 0x84E4; - public const int PERCENTAGE_AMD = 0x8BC3; - public const int PERFMON_RESULT_AMD = 0x8BC6; - public const int PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4; - public const int PERFMON_RESULT_SIZE_AMD = 0x8BC5; - public const int PERFORMANCE_MONITOR_AMD = 0x9152; - public const int PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC; - public const int PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB; - public const int PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA; - public const int PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8; - public const int PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9; - public const int PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF; - public const int PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1; - public const int PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2; - public const int PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0; - public const int PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE; - public const int PERFQUERY_COUNTER_RAW_INTEL = 0x94F4; - public const int PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3; - public const int PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5; - public const int PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9; - public const int PERFQUERY_FLUSH_INTEL = 0x83FA; - public const int PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x00000001; - public const int PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500; - public const int PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD; - public const int PERFQUERY_SINGLE_CONTEXT_INTEL = 0x00000000; - public const int PERFQUERY_WAIT_INTEL = 0x83FB; - public const int PERTURB_EXT = 0x85AE; - public const int PER_GPU_STORAGE_BIT_NV = 0x0800; - public const int PER_GPU_STORAGE_NV = 0x9548; - public const int PER_STAGE_CONSTANTS_NV = 0x8535; - public const int PHONG_HINT_WIN = 0x80EB; - public const int PHONG_WIN = 0x80EA; - public const int PINLIGHT_NV = 0x92A8; - public const int PIXELS_PER_SAMPLE_PATTERN_X_AMD = 0x91AE; - public const int PIXELS_PER_SAMPLE_PATTERN_Y_AMD = 0x91AF; - public const int PIXEL_BUFFER_BARRIER_BIT = 0x00000080; - public const int PIXEL_BUFFER_BARRIER_BIT_EXT = 0x00000080; - public const int PIXEL_COUNTER_BITS_NV = 0x8864; - public const int PIXEL_COUNT_AVAILABLE_NV = 0x8867; - public const int PIXEL_COUNT_NV = 0x8866; - public const int PIXEL_CUBIC_WEIGHT_EXT = 0x8333; - public const int PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = 0x8355; - public const int PIXEL_FRAGMENT_RGB_SOURCE_SGIS = 0x8354; - public const int PIXEL_GROUP_COLOR_SGIS = 0x8356; - public const int PIXEL_MAG_FILTER_EXT = 0x8331; - public const int PIXEL_MIN_FILTER_EXT = 0x8332; - public const int PIXEL_PACK_BUFFER = 0x88EB; - public const int PIXEL_PACK_BUFFER_ARB = 0x88EB; - public const int PIXEL_PACK_BUFFER_BINDING = 0x88ED; - public const int PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED; - public const int PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED; - public const int PIXEL_PACK_BUFFER_EXT = 0x88EB; - public const int PIXEL_SUBSAMPLE_2424_SGIX = 0x85A3; - public const int PIXEL_SUBSAMPLE_4242_SGIX = 0x85A4; - public const int PIXEL_SUBSAMPLE_4444_SGIX = 0x85A2; - public const int PIXEL_TEXTURE_SGIS = 0x8353; - public const int PIXEL_TEX_GEN_MODE_SGIX = 0x832B; - public const int PIXEL_TEX_GEN_SGIX = 0x8139; - public const int PIXEL_TILE_BEST_ALIGNMENT_SGIX = 0x813E; - public const int PIXEL_TILE_CACHE_INCREMENT_SGIX = 0x813F; - public const int PIXEL_TILE_CACHE_SIZE_SGIX = 0x8145; - public const int PIXEL_TILE_GRID_DEPTH_SGIX = 0x8144; - public const int PIXEL_TILE_GRID_HEIGHT_SGIX = 0x8143; - public const int PIXEL_TILE_GRID_WIDTH_SGIX = 0x8142; - public const int PIXEL_TILE_HEIGHT_SGIX = 0x8141; - public const int PIXEL_TILE_WIDTH_SGIX = 0x8140; - public const int PIXEL_TRANSFORM_2D_EXT = 0x8330; - public const int PIXEL_TRANSFORM_2D_MATRIX_EXT = 0x8338; - public const int PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8336; - public const int PIXEL_UNPACK_BUFFER = 0x88EC; - public const int PIXEL_UNPACK_BUFFER_ARB = 0x88EC; - public const int PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; - public const int PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF; - public const int PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF; - public const int PIXEL_UNPACK_BUFFER_EXT = 0x88EC; - public const int PLUS_CLAMPED_ALPHA_NV = 0x92B2; - public const int PLUS_CLAMPED_NV = 0x92B1; - public const int PLUS_DARKER_NV = 0x9292; - public const int PLUS_NV = 0x9291; - public const int PN_TRIANGLES_ATI = 0x87F0; - public const int PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3; - public const int PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7; - public const int PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8; - public const int PN_TRIANGLES_POINT_MODE_ATI = 0x87F2; - public const int PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6; - public const int PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5; - public const int PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4; - public const int POINT = 0x1B00; - public const int POINTS = 0x0000; - public const int POINT_DISTANCE_ATTENUATION_ARB = 0x8129; - public const int POINT_FADE_THRESHOLD_SIZE = 0x8128; - public const int POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128; - public const int POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128; - public const int POINT_FADE_THRESHOLD_SIZE_SGIS = 0x8128; - public const int POINT_SIZE = 0x0B11; - public const int POINT_SIZE_GRANULARITY = 0x0B13; - public const int POINT_SIZE_MAX_ARB = 0x8127; - public const int POINT_SIZE_MAX_EXT = 0x8127; - public const int POINT_SIZE_MAX_SGIS = 0x8127; - public const int POINT_SIZE_MIN_ARB = 0x8126; - public const int POINT_SIZE_MIN_EXT = 0x8126; - public const int POINT_SIZE_MIN_SGIS = 0x8126; - public const int POINT_SIZE_RANGE = 0x0B12; - public const int POINT_SPRITE_ARB = 0x8861; - public const int POINT_SPRITE_COORD_ORIGIN = 0x8CA0; - public const int POINT_SPRITE_NV = 0x8861; - public const int POINT_SPRITE_R_MODE_NV = 0x8863; - public const int POLYGON_MODE = 0x0B40; - public const int POLYGON_OFFSET_BIAS_EXT = 0x8039; - public const int POLYGON_OFFSET_CLAMP = 0x8E1B; - public const int POLYGON_OFFSET_CLAMP_EXT = 0x8E1B; - public const int POLYGON_OFFSET_COMMAND_NV = 0x000E; - public const int POLYGON_OFFSET_EXT = 0x8037; - public const int POLYGON_OFFSET_FACTOR = 0x8038; - public const int POLYGON_OFFSET_FACTOR_EXT = 0x8038; - public const int POLYGON_OFFSET_FILL = 0x8037; - public const int POLYGON_OFFSET_LINE = 0x2A02; - public const int POLYGON_OFFSET_POINT = 0x2A01; - public const int POLYGON_OFFSET_UNITS = 0x2A00; - public const int POLYGON_SMOOTH = 0x0B41; - public const int POLYGON_SMOOTH_HINT = 0x0C53; - public const int POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB; - public const int POST_COLOR_MATRIX_ALPHA_SCALE_SGI = 0x80B7; - public const int POST_COLOR_MATRIX_BLUE_BIAS_SGI = 0x80BA; - public const int POST_COLOR_MATRIX_BLUE_SCALE_SGI = 0x80B6; - public const int POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D2; - public const int POST_COLOR_MATRIX_GREEN_BIAS_SGI = 0x80B9; - public const int POST_COLOR_MATRIX_GREEN_SCALE_SGI = 0x80B5; - public const int POST_COLOR_MATRIX_RED_BIAS_SGI = 0x80B8; - public const int POST_COLOR_MATRIX_RED_SCALE_SGI = 0x80B4; - public const int POST_CONVOLUTION_ALPHA_BIAS_EXT = 0x8023; - public const int POST_CONVOLUTION_ALPHA_SCALE_EXT = 0x801F; - public const int POST_CONVOLUTION_BLUE_BIAS_EXT = 0x8022; - public const int POST_CONVOLUTION_BLUE_SCALE_EXT = 0x801E; - public const int POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D1; - public const int POST_CONVOLUTION_GREEN_BIAS_EXT = 0x8021; - public const int POST_CONVOLUTION_GREEN_SCALE_EXT = 0x801D; - public const int POST_CONVOLUTION_RED_BIAS_EXT = 0x8020; - public const int POST_CONVOLUTION_RED_SCALE_EXT = 0x801C; - public const int POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162; - public const int POST_TEXTURE_FILTER_BIAS_RANGE_SGIX = 0x817B; - public const int POST_TEXTURE_FILTER_BIAS_SGIX = 0x8179; - public const int POST_TEXTURE_FILTER_SCALE_RANGE_SGIX = 0x817C; - public const int POST_TEXTURE_FILTER_SCALE_SGIX = 0x817A; - public const int PREFER_DOUBLEBUFFER_HINT_PGI = 0x1A1F8; - public const int PRESENT_DURATION_NV = 0x8E2B; - public const int PRESENT_TIME_NV = 0x8E2A; - public const int PRESERVE_ATI = 0x8762; - public const int PREVIOUS_ARB = 0x8578; - public const int PREVIOUS_EXT = 0x8578; - public const int PREVIOUS_TEXTURE_INPUT_NV = 0x86E4; - public const int PRIMARY_COLOR_ARB = 0x8577; - public const int PRIMARY_COLOR_EXT = 0x8577; - public const int PRIMARY_COLOR_NV = 0x852C; - public const int PRIMITIVES_GENERATED = 0x8C87; - public const int PRIMITIVES_GENERATED_EXT = 0x8C87; - public const int PRIMITIVES_GENERATED_NV = 0x8C87; - public const int PRIMITIVES_SUBMITTED = 0x82EF; - public const int PRIMITIVES_SUBMITTED_ARB = 0x82EF; - public const int PRIMITIVE_BOUNDING_BOX_ARB = 0x92BE; - public const int PRIMITIVE_ID_NV = 0x8C7C; - public const int PRIMITIVE_RESTART = 0x8F9D; - public const int PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; - public const int PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221; - public const int PRIMITIVE_RESTART_INDEX = 0x8F9E; - public const int PRIMITIVE_RESTART_INDEX_NV = 0x8559; - public const int PRIMITIVE_RESTART_NV = 0x8558; - public const int PROGRAM = 0x82E2; - public const int PROGRAMMABLE_SAMPLE_LOCATION_ARB = 0x9341; - public const int PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9341; - public const int PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = 0x9340; - public const int PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = 0x9340; - public const int PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; - public const int PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; - public const int PROGRAM_ATTRIBS_ARB = 0x88AC; - public const int PROGRAM_ATTRIB_COMPONENTS_NV = 0x8906; - public const int PROGRAM_BINARY_FORMATS = 0x87FF; - public const int PROGRAM_BINARY_FORMAT_MESA = 0x875F; - public const int PROGRAM_BINARY_LENGTH = 0x8741; - public const int PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; - public const int PROGRAM_BINDING_ARB = 0x8677; - public const int PROGRAM_ERROR_POSITION_ARB = 0x864B; - public const int PROGRAM_ERROR_POSITION_NV = 0x864B; - public const int PROGRAM_ERROR_STRING_ARB = 0x8874; - public const int PROGRAM_ERROR_STRING_NV = 0x8874; - public const int PROGRAM_FORMAT_ARB = 0x8876; - public const int PROGRAM_FORMAT_ASCII_ARB = 0x8875; - public const int PROGRAM_INPUT = 0x92E3; - public const int PROGRAM_INSTRUCTIONS_ARB = 0x88A0; - public const int PROGRAM_LENGTH_ARB = 0x8627; - public const int PROGRAM_LENGTH_NV = 0x8627; - public const int PROGRAM_MATRIX_EXT = 0x8E2D; - public const int PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F; - public const int PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; - public const int PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; - public const int PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; - public const int PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; - public const int PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; - public const int PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; - public const int PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; - public const int PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; - public const int PROGRAM_OBJECT_ARB = 0x8B40; - public const int PROGRAM_OBJECT_EXT = 0x8B40; - public const int PROGRAM_OUTPUT = 0x92E4; - public const int PROGRAM_PARAMETERS_ARB = 0x88A8; - public const int PROGRAM_PARAMETER_NV = 0x8644; - public const int PROGRAM_PIPELINE = 0x82E4; - public const int PROGRAM_PIPELINE_BINDING = 0x825A; - public const int PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F; - public const int PROGRAM_POINT_SIZE = 0x8642; - public const int PROGRAM_POINT_SIZE_ARB = 0x8642; - public const int PROGRAM_POINT_SIZE_EXT = 0x8642; - public const int PROGRAM_RESIDENT_NV = 0x8647; - public const int PROGRAM_RESULT_COMPONENTS_NV = 0x8907; - public const int PROGRAM_SEPARABLE = 0x8258; - public const int PROGRAM_STRING_ARB = 0x8628; - public const int PROGRAM_STRING_NV = 0x8628; - public const int PROGRAM_TARGET_NV = 0x8646; - public const int PROGRAM_TEMPORARIES_ARB = 0x88A4; - public const int PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; - public const int PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; - public const int PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; - public const int PROTECTED_MEMORY_OBJECT_EXT = 0x959B; - public const int PROVOKING_VERTEX = 0x8E4F; - public const int PROVOKING_VERTEX_EXT = 0x8E4F; - public const int PROXY_COLOR_TABLE_SGI = 0x80D3; - public const int PROXY_HISTOGRAM_EXT = 0x8025; - public const int PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D5; - public const int PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D4; - public const int PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8163; - public const int PROXY_TEXTURE_1D = 0x8063; - public const int PROXY_TEXTURE_1D_ARRAY = 0x8C19; - public const int PROXY_TEXTURE_1D_ARRAY_EXT = 0x8C19; - public const int PROXY_TEXTURE_1D_EXT = 0x8063; - public const int PROXY_TEXTURE_1D_STACK_MESAX = 0x875B; - public const int PROXY_TEXTURE_2D = 0x8064; - public const int PROXY_TEXTURE_2D_ARRAY = 0x8C1B; - public const int PROXY_TEXTURE_2D_ARRAY_EXT = 0x8C1B; - public const int PROXY_TEXTURE_2D_EXT = 0x8064; - public const int PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; - public const int PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; - public const int PROXY_TEXTURE_2D_STACK_MESAX = 0x875C; - public const int PROXY_TEXTURE_3D = 0x8070; - public const int PROXY_TEXTURE_3D_EXT = 0x8070; - public const int PROXY_TEXTURE_4D_SGIS = 0x8135; - public const int PROXY_TEXTURE_COLOR_TABLE_SGI = 0x80BD; - public const int PROXY_TEXTURE_CUBE_MAP = 0x851B; - public const int PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B; - public const int PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B; - public const int PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B; - public const int PROXY_TEXTURE_CUBE_MAP_EXT = 0x851B; - public const int PROXY_TEXTURE_RECTANGLE = 0x84F7; - public const int PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7; - public const int PROXY_TEXTURE_RECTANGLE_NV = 0x84F7; - public const int PURGEABLE_APPLE = 0x8A1D; - public const int PURGED_CONTEXT_RESET_NV = 0x92BB; - public const int QUADRATIC_CURVE_TO_NV = 0x0A; - public const int QUADS = 0x0007; - public const int QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; - public const int QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C; - public const int QUAD_ALPHA4_SGIS = 0x811E; - public const int QUAD_ALPHA8_SGIS = 0x811F; - public const int QUAD_INTENSITY4_SGIS = 0x8122; - public const int QUAD_INTENSITY8_SGIS = 0x8123; - public const int QUAD_LUMINANCE4_SGIS = 0x8120; - public const int QUAD_LUMINANCE8_SGIS = 0x8121; - public const int QUAD_MESH_SUN = 0x8614; - public const int QUAD_TEXTURE_SELECT_SGIS = 0x8125; - public const int QUARTER_BIT_ATI = 0x00000010; - public const int QUERY = 0x82E3; - public const uint QUERY_ALL_EVENT_BITS_AMD = 0xFFFFFFFF; - public const int QUERY_BUFFER = 0x9192; - public const int QUERY_BUFFER_AMD = 0x9192; - public const int QUERY_BUFFER_BARRIER_BIT = 0x00008000; - public const int QUERY_BUFFER_BINDING = 0x9193; - public const int QUERY_BUFFER_BINDING_AMD = 0x9193; - public const int QUERY_BY_REGION_NO_WAIT = 0x8E16; - public const int QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; - public const int QUERY_BY_REGION_NO_WAIT_NV = 0x8E16; - public const int QUERY_BY_REGION_WAIT = 0x8E15; - public const int QUERY_BY_REGION_WAIT_INVERTED = 0x8E19; - public const int QUERY_BY_REGION_WAIT_NV = 0x8E15; - public const int QUERY_COUNTER_BITS = 0x8864; - public const int QUERY_COUNTER_BITS_ARB = 0x8864; - public const int QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD = 0x00000008; - public const int QUERY_DEPTH_FAIL_EVENT_BIT_AMD = 0x00000002; - public const int QUERY_DEPTH_PASS_EVENT_BIT_AMD = 0x00000001; - public const int QUERY_NO_WAIT = 0x8E14; - public const int QUERY_NO_WAIT_INVERTED = 0x8E18; - public const int QUERY_NO_WAIT_NV = 0x8E14; - public const int QUERY_OBJECT_AMD = 0x9153; - public const int QUERY_OBJECT_EXT = 0x9153; - public const int QUERY_RESOURCE_BUFFEROBJECT_NV = 0x9547; - public const int QUERY_RESOURCE_MEMTYPE_VIDMEM_NV = 0x9542; - public const int QUERY_RESOURCE_RENDERBUFFER_NV = 0x9546; - public const int QUERY_RESOURCE_SYS_RESERVED_NV = 0x9544; - public const int QUERY_RESOURCE_TEXTURE_NV = 0x9545; - public const int QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV = 0x9540; - public const int QUERY_RESULT = 0x8866; - public const int QUERY_RESULT_ARB = 0x8866; - public const int QUERY_RESULT_AVAILABLE = 0x8867; - public const int QUERY_RESULT_AVAILABLE_ARB = 0x8867; - public const int QUERY_RESULT_NO_WAIT = 0x9194; - public const int QUERY_RESULT_NO_WAIT_AMD = 0x9194; - public const int QUERY_STENCIL_FAIL_EVENT_BIT_AMD = 0x00000004; - public const int QUERY_TARGET = 0x82EA; - public const int QUERY_WAIT = 0x8E13; - public const int QUERY_WAIT_INVERTED = 0x8E17; - public const int QUERY_WAIT_NV = 0x8E13; - public const int R11F_G11F_B10F = 0x8C3A; - public const int R11F_G11F_B10F_EXT = 0x8C3A; - public const int R16 = 0x822A; - public const int R16F = 0x822D; - public const int R16F_EXT = 0x822D; - public const int R16I = 0x8233; - public const int R16UI = 0x8234; - public const int R16_SNORM = 0x8F98; - public const int R1UI_C3F_V3F_SUN = 0x85C6; - public const int R1UI_C4F_N3F_V3F_SUN = 0x85C8; - public const int R1UI_C4UB_V3F_SUN = 0x85C5; - public const int R1UI_N3F_V3F_SUN = 0x85C7; - public const int R1UI_T2F_C4F_N3F_V3F_SUN = 0x85CB; - public const int R1UI_T2F_N3F_V3F_SUN = 0x85CA; - public const int R1UI_T2F_V3F_SUN = 0x85C9; - public const int R1UI_V3F_SUN = 0x85C4; - public const int R32F = 0x822E; - public const int R32F_EXT = 0x822E; - public const int R32I = 0x8235; - public const int R32UI = 0x8236; - public const int R3_G3_B2 = 0x2A10; - public const int R8 = 0x8229; - public const int R8I = 0x8231; - public const int R8UI = 0x8232; - public const int R8_EXT = 0x8229; - public const int R8_SNORM = 0x8F94; - public const int RASTERIZER_DISCARD = 0x8C89; - public const int RASTERIZER_DISCARD_EXT = 0x8C89; - public const int RASTERIZER_DISCARD_NV = 0x8C89; - public const int RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A; - public const int RASTER_MULTISAMPLE_EXT = 0x9327; - public const int RASTER_POSITION_UNCLIPPED_IBM = 0x19262; - public const int RASTER_SAMPLES_EXT = 0x9328; - public const int READ_BUFFER = 0x0C02; - public const int READ_FRAMEBUFFER = 0x8CA8; - public const int READ_FRAMEBUFFER_BINDING = 0x8CAA; - public const int READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA; - public const int READ_FRAMEBUFFER_EXT = 0x8CA8; - public const int READ_ONLY = 0x88B8; - public const int READ_ONLY_ARB = 0x88B8; - public const int READ_PIXELS = 0x828C; - public const int READ_PIXELS_FORMAT = 0x828D; - public const int READ_PIXELS_TYPE = 0x828E; - public const int READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B; - public const int READ_PIXEL_DATA_RANGE_NV = 0x8879; - public const int READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D; - public const int READ_WRITE = 0x88BA; - public const int READ_WRITE_ARB = 0x88BA; - public const int RECLAIM_MEMORY_HINT_PGI = 0x1A1FE; - public const int RECT_NV = 0xF6; - public const int RED = 0x1903; - public const int REDUCE_EXT = 0x8016; - public const int RED_BIT_ATI = 0x00000001; - public const int RED_INTEGER = 0x8D94; - public const int RED_INTEGER_EXT = 0x8D94; - public const int RED_MAX_CLAMP_INGR = 0x8564; - public const int RED_MIN_CLAMP_INGR = 0x8560; - public const int RED_NV = 0x1903; - public const int RED_SNORM = 0x8F90; - public const int REFERENCED_BY_COMPUTE_SHADER = 0x930B; - public const int REFERENCED_BY_FRAGMENT_SHADER = 0x930A; - public const int REFERENCED_BY_GEOMETRY_SHADER = 0x9309; - public const int REFERENCED_BY_MESH_SHADER_NV = 0x95A0; - public const int REFERENCED_BY_TASK_SHADER_NV = 0x95A1; - public const int REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307; - public const int REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308; - public const int REFERENCED_BY_VERTEX_SHADER = 0x9306; - public const int REFERENCE_PLANE_EQUATION_SGIX = 0x817E; - public const int REFERENCE_PLANE_SGIX = 0x817D; - public const int REFLECTION_MAP_ARB = 0x8512; - public const int REFLECTION_MAP_EXT = 0x8512; - public const int REFLECTION_MAP_NV = 0x8512; - public const int REGISTER_COMBINERS_NV = 0x8522; - public const int REG_0_ATI = 0x8921; - public const int REG_10_ATI = 0x892B; - public const int REG_11_ATI = 0x892C; - public const int REG_12_ATI = 0x892D; - public const int REG_13_ATI = 0x892E; - public const int REG_14_ATI = 0x892F; - public const int REG_15_ATI = 0x8930; - public const int REG_16_ATI = 0x8931; - public const int REG_17_ATI = 0x8932; - public const int REG_18_ATI = 0x8933; - public const int REG_19_ATI = 0x8934; - public const int REG_1_ATI = 0x8922; - public const int REG_20_ATI = 0x8935; - public const int REG_21_ATI = 0x8936; - public const int REG_22_ATI = 0x8937; - public const int REG_23_ATI = 0x8938; - public const int REG_24_ATI = 0x8939; - public const int REG_25_ATI = 0x893A; - public const int REG_26_ATI = 0x893B; - public const int REG_27_ATI = 0x893C; - public const int REG_28_ATI = 0x893D; - public const int REG_29_ATI = 0x893E; - public const int REG_2_ATI = 0x8923; - public const int REG_30_ATI = 0x893F; - public const int REG_31_ATI = 0x8940; - public const int REG_3_ATI = 0x8924; - public const int REG_4_ATI = 0x8925; - public const int REG_5_ATI = 0x8926; - public const int REG_6_ATI = 0x8927; - public const int REG_7_ATI = 0x8928; - public const int REG_8_ATI = 0x8929; - public const int REG_9_ATI = 0x892A; - public const int RELATIVE_ARC_TO_NV = 0xFF; - public const int RELATIVE_CONIC_CURVE_TO_NV = 0x1B; - public const int RELATIVE_CUBIC_CURVE_TO_NV = 0x0D; - public const int RELATIVE_HORIZONTAL_LINE_TO_NV = 0x07; - public const int RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17; - public const int RELATIVE_LARGE_CW_ARC_TO_NV = 0x19; - public const int RELATIVE_LINE_TO_NV = 0x05; - public const int RELATIVE_MOVE_TO_NV = 0x03; - public const int RELATIVE_QUADRATIC_CURVE_TO_NV = 0x0B; - public const int RELATIVE_RECT_NV = 0xF7; - public const int RELATIVE_ROUNDED_RECT2_NV = 0xEB; - public const int RELATIVE_ROUNDED_RECT4_NV = 0xED; - public const int RELATIVE_ROUNDED_RECT8_NV = 0xEF; - public const int RELATIVE_ROUNDED_RECT_NV = 0xE9; - public const int RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13; - public const int RELATIVE_SMALL_CW_ARC_TO_NV = 0x15; - public const int RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11; - public const int RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0F; - public const int RELATIVE_VERTICAL_LINE_TO_NV = 0x09; - public const int RELEASED_APPLE = 0x8A19; - public const int RENDERBUFFER = 0x8D41; - public const int RENDERBUFFER_ALPHA_SIZE = 0x8D53; - public const int RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53; - public const int RENDERBUFFER_BINDING = 0x8CA7; - public const int RENDERBUFFER_BINDING_EXT = 0x8CA7; - public const int RENDERBUFFER_BLUE_SIZE = 0x8D52; - public const int RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52; - public const int RENDERBUFFER_COLOR_SAMPLES_NV = 0x8E10; - public const int RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB; - public const int RENDERBUFFER_DEPTH_SIZE = 0x8D54; - public const int RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54; - public const int RENDERBUFFER_EXT = 0x8D41; - public const int RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; - public const int RENDERBUFFER_GREEN_SIZE = 0x8D51; - public const int RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51; - public const int RENDERBUFFER_HEIGHT = 0x8D43; - public const int RENDERBUFFER_HEIGHT_EXT = 0x8D43; - public const int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; - public const int RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44; - public const int RENDERBUFFER_RED_SIZE = 0x8D50; - public const int RENDERBUFFER_RED_SIZE_EXT = 0x8D50; - public const int RENDERBUFFER_SAMPLES = 0x8CAB; - public const int RENDERBUFFER_SAMPLES_EXT = 0x8CAB; - public const int RENDERBUFFER_STENCIL_SIZE = 0x8D55; - public const int RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55; - public const int RENDERBUFFER_STORAGE_SAMPLES_AMD = 0x91B2; - public const int RENDERBUFFER_WIDTH = 0x8D42; - public const int RENDERBUFFER_WIDTH_EXT = 0x8D42; - public const int RENDERER = 0x1F01; - public const int RENDER_GPU_MASK_NV = 0x9558; - public const int REPEAT = 0x2901; - public const int REPLACE = 0x1E01; - public const int REPLACEMENT_CODE_ARRAY_POINTER_SUN = 0x85C3; - public const int REPLACEMENT_CODE_ARRAY_STRIDE_SUN = 0x85C2; - public const int REPLACEMENT_CODE_ARRAY_SUN = 0x85C0; - public const int REPLACEMENT_CODE_ARRAY_TYPE_SUN = 0x85C1; - public const int REPLACEMENT_CODE_SUN = 0x81D8; - public const int REPLACE_EXT = 0x8062; - public const int REPLACE_MIDDLE_SUN = 0x0002; - public const int REPLACE_OLDEST_SUN = 0x0003; - public const int REPLACE_VALUE_AMD = 0x874B; - public const int REPLICATE_BORDER_HP = 0x8153; - public const int REPRESENTATIVE_FRAGMENT_TEST_NV = 0x937F; - public const int RESAMPLE_AVERAGE_OML = 0x8988; - public const int RESAMPLE_DECIMATE_OML = 0x8989; - public const int RESAMPLE_DECIMATE_SGIX = 0x8430; - public const int RESAMPLE_REPLICATE_OML = 0x8986; - public const int RESAMPLE_REPLICATE_SGIX = 0x8433; - public const int RESAMPLE_ZERO_FILL_OML = 0x8987; - public const int RESAMPLE_ZERO_FILL_SGIX = 0x8434; - public const int RESCALE_NORMAL_EXT = 0x803A; - public const int RESET_NOTIFICATION_STRATEGY = 0x8256; - public const int RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; - public const int RESTART_PATH_NV = 0xF0; - public const int RESTART_SUN = 0x0001; - public const int RETAINED_APPLE = 0x8A1B; - public const int RG = 0x8227; - public const int RG16 = 0x822C; - public const int RG16F = 0x822F; - public const int RG16F_EXT = 0x822F; - public const int RG16I = 0x8239; - public const int RG16UI = 0x823A; - public const int RG16_SNORM = 0x8F99; - public const int RG32F = 0x8230; - public const int RG32F_EXT = 0x8230; - public const int RG32I = 0x823B; - public const int RG32UI = 0x823C; - public const int RG8 = 0x822B; - public const int RG8I = 0x8237; - public const int RG8UI = 0x8238; - public const int RG8_EXT = 0x822B; - public const int RG8_SNORM = 0x8F95; - public const int RGB = 0x1907; - public const int RGB10 = 0x8052; - public const int RGB10_A2 = 0x8059; - public const int RGB10_A2UI = 0x906F; - public const int RGB10_A2_EXT = 0x8059; - public const int RGB10_EXT = 0x8052; - public const int RGB12 = 0x8053; - public const int RGB12_EXT = 0x8053; - public const int RGB16 = 0x8054; - public const int RGB16F = 0x881B; - public const int RGB16F_ARB = 0x881B; - public const int RGB16F_EXT = 0x881B; - public const int RGB16I = 0x8D89; - public const int RGB16I_EXT = 0x8D89; - public const int RGB16UI = 0x8D77; - public const int RGB16UI_EXT = 0x8D77; - public const int RGB16_EXT = 0x8054; - public const int RGB16_SNORM = 0x8F9A; - public const int RGB2_EXT = 0x804E; - public const int RGB32F = 0x8815; - public const int RGB32F_ARB = 0x8815; - public const int RGB32F_EXT = 0x8815; - public const int RGB32I = 0x8D83; - public const int RGB32I_EXT = 0x8D83; - public const int RGB32UI = 0x8D71; - public const int RGB32UI_EXT = 0x8D71; - public const int RGB4 = 0x804F; - public const int RGB4_EXT = 0x804F; - public const int RGB4_S3TC = 0x83A1; - public const int RGB5 = 0x8050; - public const int RGB565 = 0x8D62; - public const int RGB5_A1 = 0x8057; - public const int RGB5_A1_EXT = 0x8057; - public const int RGB5_EXT = 0x8050; - public const int RGB8 = 0x8051; - public const int RGB8I = 0x8D8F; - public const int RGB8I_EXT = 0x8D8F; - public const int RGB8UI = 0x8D7D; - public const int RGB8UI_EXT = 0x8D7D; - public const int RGB8_EXT = 0x8051; - public const int RGB8_SNORM = 0x8F96; - public const int RGB9_E5 = 0x8C3D; - public const int RGB9_E5_EXT = 0x8C3D; - public const int RGBA = 0x1908; - public const int RGBA12 = 0x805A; - public const int RGBA12_EXT = 0x805A; - public const int RGBA16 = 0x805B; - public const int RGBA16F = 0x881A; - public const int RGBA16F_ARB = 0x881A; - public const int RGBA16F_EXT = 0x881A; - public const int RGBA16I = 0x8D88; - public const int RGBA16I_EXT = 0x8D88; - public const int RGBA16UI = 0x8D76; - public const int RGBA16UI_EXT = 0x8D76; - public const int RGBA16_EXT = 0x805B; - public const int RGBA16_SNORM = 0x8F9B; - public const int RGBA2 = 0x8055; - public const int RGBA2_EXT = 0x8055; - public const int RGBA32F = 0x8814; - public const int RGBA32F_ARB = 0x8814; - public const int RGBA32F_EXT = 0x8814; - public const int RGBA32I = 0x8D82; - public const int RGBA32I_EXT = 0x8D82; - public const int RGBA32UI = 0x8D70; - public const int RGBA32UI_EXT = 0x8D70; - public const int RGBA4 = 0x8056; - public const int RGBA4_DXT5_S3TC = 0x83A5; - public const int RGBA4_EXT = 0x8056; - public const int RGBA4_S3TC = 0x83A3; - public const int RGBA8 = 0x8058; - public const int RGBA8I = 0x8D8E; - public const int RGBA8I_EXT = 0x8D8E; - public const int RGBA8UI = 0x8D7C; - public const int RGBA8UI_EXT = 0x8D7C; - public const int RGBA8_EXT = 0x8058; - public const int RGBA8_SNORM = 0x8F97; - public const int RGBA_DXT5_S3TC = 0x83A4; - public const int RGBA_FLOAT16_APPLE = 0x881A; - public const int RGBA_FLOAT16_ATI = 0x881A; - public const int RGBA_FLOAT32_APPLE = 0x8814; - public const int RGBA_FLOAT32_ATI = 0x8814; - public const int RGBA_FLOAT_MODE_ARB = 0x8820; - public const int RGBA_FLOAT_MODE_ATI = 0x8820; - public const int RGBA_INTEGER = 0x8D99; - public const int RGBA_INTEGER_EXT = 0x8D99; - public const int RGBA_INTEGER_MODE_EXT = 0x8D9E; - public const int RGBA_S3TC = 0x83A2; - public const int RGBA_SIGNED_COMPONENTS_EXT = 0x8C3C; - public const int RGBA_SNORM = 0x8F93; - public const int RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9; - public const int RGB_422_APPLE = 0x8A1F; - public const int RGB_FLOAT16_APPLE = 0x881B; - public const int RGB_FLOAT16_ATI = 0x881B; - public const int RGB_FLOAT32_APPLE = 0x8815; - public const int RGB_FLOAT32_ATI = 0x8815; - public const int RGB_INTEGER = 0x8D98; - public const int RGB_INTEGER_EXT = 0x8D98; - public const int RGB_RAW_422_APPLE = 0x8A51; - public const int RGB_S3TC = 0x83A0; - public const int RGB_SCALE_ARB = 0x8573; - public const int RGB_SCALE_EXT = 0x8573; - public const int RGB_SNORM = 0x8F92; - public const int RG_INTEGER = 0x8228; - public const int RG_SNORM = 0x8F91; - public const int RIGHT = 0x0407; - public const int ROUNDED_RECT2_NV = 0xEA; - public const int ROUNDED_RECT4_NV = 0xEC; - public const int ROUNDED_RECT8_NV = 0xEE; - public const int ROUNDED_RECT_NV = 0xE8; - public const int ROUND_NV = 0x90A4; - public const int SAMPLER = 0x82E6; - public const int SAMPLER_1D = 0x8B5D; - public const int SAMPLER_1D_ARB = 0x8B5D; - public const int SAMPLER_1D_ARRAY = 0x8DC0; - public const int SAMPLER_1D_ARRAY_EXT = 0x8DC0; - public const int SAMPLER_1D_ARRAY_SHADOW = 0x8DC3; - public const int SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3; - public const int SAMPLER_1D_SHADOW = 0x8B61; - public const int SAMPLER_1D_SHADOW_ARB = 0x8B61; - public const int SAMPLER_2D = 0x8B5E; - public const int SAMPLER_2D_ARB = 0x8B5E; - public const int SAMPLER_2D_ARRAY = 0x8DC1; - public const int SAMPLER_2D_ARRAY_EXT = 0x8DC1; - public const int SAMPLER_2D_ARRAY_SHADOW = 0x8DC4; - public const int SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4; - public const int SAMPLER_2D_MULTISAMPLE = 0x9108; - public const int SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B; - public const int SAMPLER_2D_RECT = 0x8B63; - public const int SAMPLER_2D_RECT_ARB = 0x8B63; - public const int SAMPLER_2D_RECT_SHADOW = 0x8B64; - public const int SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64; - public const int SAMPLER_2D_SHADOW = 0x8B62; - public const int SAMPLER_2D_SHADOW_ARB = 0x8B62; - public const int SAMPLER_3D = 0x8B5F; - public const int SAMPLER_3D_ARB = 0x8B5F; - public const int SAMPLER_BINDING = 0x8919; - public const int SAMPLER_BUFFER = 0x8DC2; - public const int SAMPLER_BUFFER_AMD = 0x9001; - public const int SAMPLER_BUFFER_EXT = 0x8DC2; - public const int SAMPLER_CUBE = 0x8B60; - public const int SAMPLER_CUBE_ARB = 0x8B60; - public const int SAMPLER_CUBE_MAP_ARRAY = 0x900C; - public const int SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C; - public const int SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D; - public const int SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D; - public const int SAMPLER_CUBE_SHADOW = 0x8DC5; - public const int SAMPLER_CUBE_SHADOW_EXT = 0x8DC5; - public const int SAMPLER_OBJECT_AMD = 0x9155; - public const int SAMPLER_RENDERBUFFER_NV = 0x8E56; - public const int SAMPLES = 0x80A9; - public const int SAMPLES_3DFX = 0x86B4; - public const int SAMPLES_ARB = 0x80A9; - public const int SAMPLES_EXT = 0x80A9; - public const int SAMPLES_PASSED = 0x8914; - public const int SAMPLES_PASSED_ARB = 0x8914; - public const int SAMPLES_SGIS = 0x80A9; - public const int SAMPLE_ALPHA_TO_COVERAGE = 0x809E; - public const int SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E; - public const int SAMPLE_ALPHA_TO_MASK_EXT = 0x809E; - public const int SAMPLE_ALPHA_TO_MASK_SGIS = 0x809E; - public const int SAMPLE_ALPHA_TO_ONE = 0x809F; - public const int SAMPLE_ALPHA_TO_ONE_ARB = 0x809F; - public const int SAMPLE_ALPHA_TO_ONE_EXT = 0x809F; - public const int SAMPLE_ALPHA_TO_ONE_SGIS = 0x809F; - public const int SAMPLE_BUFFERS = 0x80A8; - public const int SAMPLE_BUFFERS_3DFX = 0x86B3; - public const int SAMPLE_BUFFERS_ARB = 0x80A8; - public const int SAMPLE_BUFFERS_EXT = 0x80A8; - public const int SAMPLE_BUFFERS_SGIS = 0x80A8; - public const int SAMPLE_COVERAGE = 0x80A0; - public const int SAMPLE_COVERAGE_ARB = 0x80A0; - public const int SAMPLE_COVERAGE_INVERT = 0x80AB; - public const int SAMPLE_COVERAGE_INVERT_ARB = 0x80AB; - public const int SAMPLE_COVERAGE_VALUE = 0x80AA; - public const int SAMPLE_COVERAGE_VALUE_ARB = 0x80AA; - public const int SAMPLE_LOCATION_ARB = 0x8E50; - public const int SAMPLE_LOCATION_NV = 0x8E50; - public const int SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = 0x933F; - public const int SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = 0x933F; - public const int SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = 0x933E; - public const int SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = 0x933E; - public const int SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = 0x933D; - public const int SAMPLE_LOCATION_SUBPIXEL_BITS_NV = 0x933D; - public const int SAMPLE_MASK = 0x8E51; - public const int SAMPLE_MASK_EXT = 0x80A0; - public const int SAMPLE_MASK_INVERT_EXT = 0x80AB; - public const int SAMPLE_MASK_INVERT_SGIS = 0x80AB; - public const int SAMPLE_MASK_NV = 0x8E51; - public const int SAMPLE_MASK_SGIS = 0x80A0; - public const int SAMPLE_MASK_VALUE = 0x8E52; - public const int SAMPLE_MASK_VALUE_EXT = 0x80AA; - public const int SAMPLE_MASK_VALUE_NV = 0x8E52; - public const int SAMPLE_MASK_VALUE_SGIS = 0x80AA; - public const int SAMPLE_PATTERN_EXT = 0x80AC; - public const int SAMPLE_PATTERN_SGIS = 0x80AC; - public const int SAMPLE_POSITION = 0x8E50; - public const int SAMPLE_POSITION_NV = 0x8E50; - public const int SAMPLE_SHADING = 0x8C36; - public const int SAMPLE_SHADING_ARB = 0x8C36; - public const int SATURATE_BIT_ATI = 0x00000040; - public const int SCALAR_EXT = 0x87BE; - public const int SCALEBIAS_HINT_SGIX = 0x8322; - public const int SCALED_RESOLVE_FASTEST_EXT = 0x90BA; - public const int SCALED_RESOLVE_NICEST_EXT = 0x90BB; - public const int SCALE_BY_FOUR_NV = 0x853F; - public const int SCALE_BY_ONE_HALF_NV = 0x8540; - public const int SCALE_BY_TWO_NV = 0x853E; - public const int SCISSOR_BOX = 0x0C10; - public const int SCISSOR_BOX_EXCLUSIVE_NV = 0x9556; - public const int SCISSOR_COMMAND_NV = 0x0011; - public const int SCISSOR_TEST = 0x0C11; - public const int SCISSOR_TEST_EXCLUSIVE_NV = 0x9555; - public const int SCREEN_COORDINATES_REND = 0x8490; - public const int SCREEN_KHR = 0x9295; - public const int SCREEN_NV = 0x9295; - public const int SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27; - public const int SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C; - public const int SECONDARY_COLOR_ARRAY_EXT = 0x845E; - public const int SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31; - public const int SECONDARY_COLOR_ARRAY_LIST_IBM = 103077; - public const int SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM = 103087; - public const int SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D; - public const int SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A; - public const int SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C; - public const int SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B; - public const int SECONDARY_COLOR_NV = 0x852D; - public const int SECONDARY_INTERPOLATOR_ATI = 0x896D; - public const int SEMAPHORE_TYPE_BINARY_NV = 0x95B4; - public const int SEMAPHORE_TYPE_NV = 0x95B3; - public const int SEMAPHORE_TYPE_TIMELINE_NV = 0x95B5; - public const int SEPARABLE_2D_EXT = 0x8012; - public const int SEPARATE_ATTRIBS = 0x8C8D; - public const int SEPARATE_ATTRIBS_EXT = 0x8C8D; - public const int SEPARATE_ATTRIBS_NV = 0x8C8D; - public const int SEPARATE_SPECULAR_COLOR_EXT = 0x81FA; - public const int SET = 0x150F; - public const int SET_AMD = 0x874A; - public const int SHADER = 0x82E1; - public const int SHADER_BINARY_FORMATS = 0x8DF8; - public const int SHADER_BINARY_FORMAT_SPIR_V = 0x9551; - public const int SHADER_BINARY_FORMAT_SPIR_V_ARB = 0x9551; - public const int SHADER_COMPILER = 0x8DFA; - public const int SHADER_CONSISTENT_NV = 0x86DD; - public const int SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010; - public const int SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020; - public const int SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT = 0x00000020; - public const int SHADER_IMAGE_ATOMIC = 0x82A6; - public const int SHADER_IMAGE_LOAD = 0x82A4; - public const int SHADER_IMAGE_STORE = 0x82A5; - public const int SHADER_INCLUDE_ARB = 0x8DAE; - public const int SHADER_OBJECT_ARB = 0x8B48; - public const int SHADER_OBJECT_EXT = 0x8B48; - public const int SHADER_OPERATION_NV = 0x86DF; - public const int SHADER_SOURCE_LENGTH = 0x8B88; - public const int SHADER_STORAGE_BARRIER_BIT = 0x00002000; - public const int SHADER_STORAGE_BLOCK = 0x92E6; - public const int SHADER_STORAGE_BUFFER = 0x90D2; - public const int SHADER_STORAGE_BUFFER_BINDING = 0x90D3; - public const int SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; - public const int SHADER_STORAGE_BUFFER_SIZE = 0x90D5; - public const int SHADER_STORAGE_BUFFER_START = 0x90D4; - public const int SHADER_TYPE = 0x8B4F; - public const int SHADING_LANGUAGE_VERSION = 0x8B8C; - public const int SHADING_LANGUAGE_VERSION_ARB = 0x8B8C; - public const int SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 0x956F; - public const int SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 0x9566; - public const int SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 0x9567; - public const int SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 0x9568; - public const int SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 0x9569; - public const int SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 0x956A; - public const int SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 0x956B; - public const int SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0x9565; - public const int SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 0x956C; - public const int SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 0x956D; - public const int SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 0x956E; - public const int SHADING_RATE_IMAGE_BINDING_NV = 0x955B; - public const int SHADING_RATE_IMAGE_NV = 0x9563; - public const int SHADING_RATE_IMAGE_PALETTE_COUNT_NV = 0x95B2; - public const int SHADING_RATE_IMAGE_PALETTE_SIZE_NV = 0x955E; - public const int SHADING_RATE_IMAGE_PER_PRIMITIVE_NV = 0x95B1; - public const int SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV = 0x955D; - public const int SHADING_RATE_IMAGE_TEXEL_WIDTH_NV = 0x955C; - public const int SHADING_RATE_NO_INVOCATIONS_NV = 0x9564; - public const int SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV = 0x95AE; - public const int SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV = 0x95AF; - public const int SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV = 0x95B0; - public const int SHADOW_AMBIENT_SGIX = 0x80BF; - public const int SHADOW_ATTENUATION_EXT = 0x834E; - public const int SHARED_EDGE_NV = 0xC0; - public const int SHARED_TEXTURE_PALETTE_EXT = 0x81FB; - public const int SHARPEN_TEXTURE_FUNC_POINTS_SGIS = 0x80B0; - public const int SHORT = 0x1402; - public const int SIGNALED = 0x9119; - public const int SIGNED_ALPHA8_NV = 0x8706; - public const int SIGNED_ALPHA_NV = 0x8705; - public const int SIGNED_HILO16_NV = 0x86FA; - public const int SIGNED_HILO8_NV = 0x885F; - public const int SIGNED_HILO_NV = 0x86F9; - public const int SIGNED_IDENTITY_NV = 0x853C; - public const int SIGNED_INTENSITY8_NV = 0x8708; - public const int SIGNED_INTENSITY_NV = 0x8707; - public const int SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704; - public const int SIGNED_LUMINANCE8_NV = 0x8702; - public const int SIGNED_LUMINANCE_ALPHA_NV = 0x8703; - public const int SIGNED_LUMINANCE_NV = 0x8701; - public const int SIGNED_NEGATE_NV = 0x853D; - public const int SIGNED_NORMALIZED = 0x8F9C; - public const int SIGNED_RGB8_NV = 0x86FF; - public const int SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D; - public const int SIGNED_RGBA8_NV = 0x86FC; - public const int SIGNED_RGBA_NV = 0x86FB; - public const int SIGNED_RGB_NV = 0x86FE; - public const int SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C; - public const int SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC; - public const int SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE; - public const int SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD; - public const int SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF; - public const int SINGLE_COLOR_EXT = 0x81F9; - public const int SKIP_COMPONENTS1_NV = -6; - public const int SKIP_COMPONENTS2_NV = -5; - public const int SKIP_COMPONENTS3_NV = -4; - public const int SKIP_COMPONENTS4_NV = -3; - public const int SKIP_DECODE_EXT = 0x8A4A; - public const int SKIP_MISSING_GLYPH_NV = 0x90A9; - public const int SLICE_ACCUM_SUN = 0x85CC; - public const int SLUMINANCE8_ALPHA8_EXT = 0x8C45; - public const int SLUMINANCE8_EXT = 0x8C47; - public const int SLUMINANCE_ALPHA_EXT = 0x8C44; - public const int SLUMINANCE_EXT = 0x8C46; - public const int SMALL_CCW_ARC_TO_NV = 0x12; - public const int SMALL_CW_ARC_TO_NV = 0x14; - public const int SMOOTH_CUBIC_CURVE_TO_NV = 0x10; - public const int SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23; - public const int SMOOTH_LINE_WIDTH_RANGE = 0x0B22; - public const int SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13; - public const int SMOOTH_POINT_SIZE_RANGE = 0x0B12; - public const int SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0E; - public const int SM_COUNT_NV = 0x933B; - public const int SOFTLIGHT_KHR = 0x929C; - public const int SOFTLIGHT_NV = 0x929C; - public const int SOURCE0_ALPHA_ARB = 0x8588; - public const int SOURCE0_ALPHA_EXT = 0x8588; - public const int SOURCE0_RGB_ARB = 0x8580; - public const int SOURCE0_RGB_EXT = 0x8580; - public const int SOURCE1_ALPHA = 0x8589; - public const int SOURCE1_ALPHA_ARB = 0x8589; - public const int SOURCE1_ALPHA_EXT = 0x8589; - public const int SOURCE1_RGB_ARB = 0x8581; - public const int SOURCE1_RGB_EXT = 0x8581; - public const int SOURCE2_ALPHA_ARB = 0x858A; - public const int SOURCE2_ALPHA_EXT = 0x858A; - public const int SOURCE2_RGB_ARB = 0x8582; - public const int SOURCE2_RGB_EXT = 0x8582; - public const int SOURCE3_ALPHA_NV = 0x858B; - public const int SOURCE3_RGB_NV = 0x8583; - public const int SPARE0_NV = 0x852E; - public const int SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532; - public const int SPARE1_NV = 0x852F; - public const int SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8; - public const int SPARSE_STORAGE_BIT_ARB = 0x0400; - public const int SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9; - public const int SPIR_V_BINARY = 0x9552; - public const int SPIR_V_BINARY_ARB = 0x9552; - public const int SPIR_V_EXTENSIONS = 0x9553; - public const int SPRITE_AXIAL_SGIX = 0x814C; - public const int SPRITE_AXIS_SGIX = 0x814A; - public const int SPRITE_EYE_ALIGNED_SGIX = 0x814E; - public const int SPRITE_MODE_SGIX = 0x8149; - public const int SPRITE_OBJECT_ALIGNED_SGIX = 0x814D; - public const int SPRITE_SGIX = 0x8148; - public const int SPRITE_TRANSLATION_SGIX = 0x814B; - public const int SQUARE_NV = 0x90A3; - public const int SR8_EXT = 0x8FBD; - public const int SRC1_ALPHA = 0x8589; - public const int SRC1_COLOR = 0x88F9; - public const int SRC_ALPHA = 0x0302; - public const int SRC_ALPHA_SATURATE = 0x0308; - public const int SRC_ATOP_NV = 0x928E; - public const int SRC_COLOR = 0x0300; - public const int SRC_IN_NV = 0x928A; - public const int SRC_NV = 0x9286; - public const int SRC_OUT_NV = 0x928C; - public const int SRC_OVER_NV = 0x9288; - public const int SRG8_EXT = 0x8FBE; - public const int SRGB = 0x8C40; - public const int SRGB8 = 0x8C41; - public const int SRGB8_ALPHA8 = 0x8C43; - public const int SRGB8_ALPHA8_EXT = 0x8C43; - public const int SRGB8_EXT = 0x8C41; - public const int SRGB_ALPHA = 0x8C42; - public const int SRGB_ALPHA_EXT = 0x8C42; - public const int SRGB_DECODE_ARB = 0x8299; - public const int SRGB_EXT = 0x8C40; - public const int SRGB_READ = 0x8297; - public const int SRGB_WRITE = 0x8298; - public const int STACK_OVERFLOW = 0x0503; - public const int STACK_UNDERFLOW = 0x0504; - public const int STANDARD_FONT_FORMAT_NV = 0x936C; - public const int STANDARD_FONT_NAME_NV = 0x9072; - public const int STATIC_ATI = 0x8760; - public const int STATIC_COPY = 0x88E6; - public const int STATIC_COPY_ARB = 0x88E6; - public const int STATIC_DRAW = 0x88E4; - public const int STATIC_DRAW_ARB = 0x88E4; - public const int STATIC_READ = 0x88E5; - public const int STATIC_READ_ARB = 0x88E5; - public const int STATIC_VERTEX_ARRAY_IBM = 103061; - public const int STENCIL = 0x1802; - public const int STENCIL_ATTACHMENT = 0x8D20; - public const int STENCIL_ATTACHMENT_EXT = 0x8D20; - public const int STENCIL_BACK_FAIL = 0x8801; - public const int STENCIL_BACK_FAIL_ATI = 0x8801; - public const int STENCIL_BACK_FUNC = 0x8800; - public const int STENCIL_BACK_FUNC_ATI = 0x8800; - public const int STENCIL_BACK_OP_VALUE_AMD = 0x874D; - public const int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; - public const int STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802; - public const int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; - public const int STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803; - public const int STENCIL_BACK_REF = 0x8CA3; - public const int STENCIL_BACK_VALUE_MASK = 0x8CA4; - public const int STENCIL_BACK_WRITEMASK = 0x8CA5; - public const int STENCIL_BUFFER_BIT = 0x00000400; - public const int STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3; - public const int STENCIL_CLEAR_VALUE = 0x0B91; - public const int STENCIL_COMPONENTS = 0x8285; - public const int STENCIL_FAIL = 0x0B94; - public const int STENCIL_FUNC = 0x0B92; - public const int STENCIL_INDEX = 0x1901; - public const int STENCIL_INDEX1 = 0x8D46; - public const int STENCIL_INDEX16 = 0x8D49; - public const int STENCIL_INDEX16_EXT = 0x8D49; - public const int STENCIL_INDEX1_EXT = 0x8D46; - public const int STENCIL_INDEX4 = 0x8D47; - public const int STENCIL_INDEX4_EXT = 0x8D47; - public const int STENCIL_INDEX8 = 0x8D48; - public const int STENCIL_INDEX8_EXT = 0x8D48; - public const int STENCIL_OP_VALUE_AMD = 0x874C; - public const int STENCIL_PASS_DEPTH_FAIL = 0x0B95; - public const int STENCIL_PASS_DEPTH_PASS = 0x0B96; - public const int STENCIL_REF = 0x0B97; - public const int STENCIL_REF_COMMAND_NV = 0x000C; - public const int STENCIL_RENDERABLE = 0x8288; - public const int STENCIL_SAMPLES_NV = 0x932E; - public const int STENCIL_TAG_BITS_EXT = 0x88F2; - public const int STENCIL_TEST = 0x0B90; - public const int STENCIL_TEST_TWO_SIDE_EXT = 0x8910; - public const int STENCIL_VALUE_MASK = 0x0B93; - public const int STENCIL_WRITEMASK = 0x0B98; - public const int STEREO = 0x0C33; - public const int STORAGE_CACHED_APPLE = 0x85BE; - public const int STORAGE_CLIENT_APPLE = 0x85B4; - public const int STORAGE_PRIVATE_APPLE = 0x85BD; - public const int STORAGE_SHARED_APPLE = 0x85BF; - public const int STREAM_COPY = 0x88E2; - public const int STREAM_COPY_ARB = 0x88E2; - public const int STREAM_DRAW = 0x88E0; - public const int STREAM_DRAW_ARB = 0x88E0; - public const int STREAM_RASTERIZATION_AMD = 0x91A0; - public const int STREAM_READ = 0x88E1; - public const int STREAM_READ_ARB = 0x88E1; - public const int STRICT_DEPTHFUNC_HINT_PGI = 0x1A216; - public const int STRICT_LIGHTING_HINT_PGI = 0x1A217; - public const int STRICT_SCISSOR_HINT_PGI = 0x1A218; - public const int SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR = 0x00000004; - public const int SUBGROUP_FEATURE_BALLOT_BIT_KHR = 0x00000008; - public const int SUBGROUP_FEATURE_BASIC_BIT_KHR = 0x00000001; - public const int SUBGROUP_FEATURE_CLUSTERED_BIT_KHR = 0x00000040; - public const int SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100; - public const int SUBGROUP_FEATURE_QUAD_BIT_KHR = 0x00000080; - public const int SUBGROUP_FEATURE_SHUFFLE_BIT_KHR = 0x00000010; - public const int SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR = 0x00000020; - public const int SUBGROUP_FEATURE_VOTE_BIT_KHR = 0x00000002; - public const int SUBGROUP_QUAD_ALL_STAGES_KHR = 0x9535; - public const int SUBGROUP_SIZE_KHR = 0x9532; - public const int SUBGROUP_SUPPORTED_FEATURES_KHR = 0x9534; - public const int SUBGROUP_SUPPORTED_STAGES_KHR = 0x9533; - public const int SUBPIXEL_BITS = 0x0D50; - public const int SUBPIXEL_PRECISION_BIAS_X_BITS_NV = 0x9347; - public const int SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = 0x9348; - public const int SUBSAMPLE_DISTANCE_AMD = 0x883F; - public const int SUBTRACT_ARB = 0x84E7; - public const int SUB_ATI = 0x8965; - public const int SUCCESS_NV = 0x902F; - public const int SUPERSAMPLE_SCALE_X_NV = 0x9372; - public const int SUPERSAMPLE_SCALE_Y_NV = 0x9373; - public const int SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B7; - public const int SURFACE_MAPPED_NV = 0x8700; - public const int SURFACE_REGISTERED_NV = 0x86FD; - public const int SURFACE_STATE_NV = 0x86EB; - public const int SWIZZLE_STQ_ATI = 0x8977; - public const int SWIZZLE_STQ_DQ_ATI = 0x8979; - public const int SWIZZLE_STRQ_ATI = 0x897A; - public const int SWIZZLE_STRQ_DQ_ATI = 0x897B; - public const int SWIZZLE_STR_ATI = 0x8976; - public const int SWIZZLE_STR_DR_ATI = 0x8978; - public const int SYNC_CL_EVENT_ARB = 0x8240; - public const int SYNC_CL_EVENT_COMPLETE_ARB = 0x8241; - public const int SYNC_CONDITION = 0x9113; - public const int SYNC_FENCE = 0x9116; - public const int SYNC_FLAGS = 0x9115; - public const int SYNC_FLUSH_COMMANDS_BIT = 0x00000001; - public const int SYNC_GPU_COMMANDS_COMPLETE = 0x9117; - public const int SYNC_STATUS = 0x9114; - public const int SYNC_X11_FENCE_EXT = 0x90E1; - public const int SYSTEM_FONT_NAME_NV = 0x9073; - public const int T2F_IUI_N3F_V2F_EXT = 0x81B3; - public const int T2F_IUI_N3F_V3F_EXT = 0x81B4; - public const int T2F_IUI_V2F_EXT = 0x81B1; - public const int T2F_IUI_V3F_EXT = 0x81B2; - public const int TABLE_TOO_LARGE_EXT = 0x8031; - public const int TANGENT_ARRAY_EXT = 0x8439; - public const int TANGENT_ARRAY_POINTER_EXT = 0x8442; - public const int TANGENT_ARRAY_STRIDE_EXT = 0x843F; - public const int TANGENT_ARRAY_TYPE_EXT = 0x843E; - public const int TASK_SHADER_BIT_NV = 0x00000080; - public const int TASK_SHADER_NV = 0x955A; - public const int TASK_SUBROUTINE_NV = 0x957D; - public const int TASK_SUBROUTINE_UNIFORM_NV = 0x957F; - public const int TASK_WORK_GROUP_SIZE_NV = 0x953F; - public const int TERMINATE_SEQUENCE_COMMAND_NV = 0x0000; - public const int TESSELLATION_FACTOR_AMD = 0x9005; - public const int TESSELLATION_MODE_AMD = 0x9004; - public const int TESS_CONTROL_OUTPUT_VERTICES = 0x8E75; - public const int TESS_CONTROL_PROGRAM_NV = 0x891E; - public const int TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV = 0x8C74; - public const int TESS_CONTROL_SHADER = 0x8E88; - public const int TESS_CONTROL_SHADER_BIT = 0x00000008; - public const int TESS_CONTROL_SHADER_PATCHES = 0x82F1; - public const int TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1; - public const int TESS_CONTROL_SUBROUTINE = 0x92E9; - public const int TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF; - public const int TESS_CONTROL_TEXTURE = 0x829C; - public const int TESS_EVALUATION_PROGRAM_NV = 0x891F; - public const int TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV = 0x8C75; - public const int TESS_EVALUATION_SHADER = 0x8E87; - public const int TESS_EVALUATION_SHADER_BIT = 0x00000010; - public const int TESS_EVALUATION_SHADER_INVOCATIONS = 0x82F2; - public const int TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2; - public const int TESS_EVALUATION_SUBROUTINE = 0x92EA; - public const int TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0; - public const int TESS_EVALUATION_TEXTURE = 0x829D; - public const int TESS_GEN_MODE = 0x8E76; - public const int TESS_GEN_POINT_MODE = 0x8E79; - public const int TESS_GEN_SPACING = 0x8E77; - public const int TESS_GEN_VERTEX_ORDER = 0x8E78; - public const int TEXCOORD1_BIT_PGI = 0x10000000; - public const int TEXCOORD2_BIT_PGI = 0x20000000; - public const int TEXCOORD3_BIT_PGI = 0x40000000; - public const uint TEXCOORD4_BIT_PGI = 0x80000000; - public const int TEXTURE = 0x1702; - public const int TEXTURE0 = 0x84C0; - public const int TEXTURE0_ARB = 0x84C0; - public const int TEXTURE1 = 0x84C1; - public const int TEXTURE10 = 0x84CA; - public const int TEXTURE10_ARB = 0x84CA; - public const int TEXTURE11 = 0x84CB; - public const int TEXTURE11_ARB = 0x84CB; - public const int TEXTURE12 = 0x84CC; - public const int TEXTURE12_ARB = 0x84CC; - public const int TEXTURE13 = 0x84CD; - public const int TEXTURE13_ARB = 0x84CD; - public const int TEXTURE14 = 0x84CE; - public const int TEXTURE14_ARB = 0x84CE; - public const int TEXTURE15 = 0x84CF; - public const int TEXTURE15_ARB = 0x84CF; - public const int TEXTURE16 = 0x84D0; - public const int TEXTURE16_ARB = 0x84D0; - public const int TEXTURE17 = 0x84D1; - public const int TEXTURE17_ARB = 0x84D1; - public const int TEXTURE18 = 0x84D2; - public const int TEXTURE18_ARB = 0x84D2; - public const int TEXTURE19 = 0x84D3; - public const int TEXTURE19_ARB = 0x84D3; - public const int TEXTURE1_ARB = 0x84C1; - public const int TEXTURE2 = 0x84C2; - public const int TEXTURE20 = 0x84D4; - public const int TEXTURE20_ARB = 0x84D4; - public const int TEXTURE21 = 0x84D5; - public const int TEXTURE21_ARB = 0x84D5; - public const int TEXTURE22 = 0x84D6; - public const int TEXTURE22_ARB = 0x84D6; - public const int TEXTURE23 = 0x84D7; - public const int TEXTURE23_ARB = 0x84D7; - public const int TEXTURE24 = 0x84D8; - public const int TEXTURE24_ARB = 0x84D8; - public const int TEXTURE25 = 0x84D9; - public const int TEXTURE25_ARB = 0x84D9; - public const int TEXTURE26 = 0x84DA; - public const int TEXTURE26_ARB = 0x84DA; - public const int TEXTURE27 = 0x84DB; - public const int TEXTURE27_ARB = 0x84DB; - public const int TEXTURE28 = 0x84DC; - public const int TEXTURE28_ARB = 0x84DC; - public const int TEXTURE29 = 0x84DD; - public const int TEXTURE29_ARB = 0x84DD; - public const int TEXTURE2_ARB = 0x84C2; - public const int TEXTURE3 = 0x84C3; - public const int TEXTURE30 = 0x84DE; - public const int TEXTURE30_ARB = 0x84DE; - public const int TEXTURE31 = 0x84DF; - public const int TEXTURE31_ARB = 0x84DF; - public const int TEXTURE3_ARB = 0x84C3; - public const int TEXTURE4 = 0x84C4; - public const int TEXTURE4_ARB = 0x84C4; - public const int TEXTURE5 = 0x84C5; - public const int TEXTURE5_ARB = 0x84C5; - public const int TEXTURE6 = 0x84C6; - public const int TEXTURE6_ARB = 0x84C6; - public const int TEXTURE7 = 0x84C7; - public const int TEXTURE7_ARB = 0x84C7; - public const int TEXTURE8 = 0x84C8; - public const int TEXTURE8_ARB = 0x84C8; - public const int TEXTURE9 = 0x84C9; - public const int TEXTURE9_ARB = 0x84C9; - public const int TEXTURE_1D = 0x0DE0; - public const int TEXTURE_1D_ARRAY = 0x8C18; - public const int TEXTURE_1D_ARRAY_EXT = 0x8C18; - public const int TEXTURE_1D_BINDING_EXT = 0x8068; - public const int TEXTURE_1D_STACK_BINDING_MESAX = 0x875D; - public const int TEXTURE_1D_STACK_MESAX = 0x8759; - public const int TEXTURE_2D = 0x0DE1; - public const int TEXTURE_2D_ARRAY = 0x8C1A; - public const int TEXTURE_2D_ARRAY_EXT = 0x8C1A; - public const int TEXTURE_2D_BINDING_EXT = 0x8069; - public const int TEXTURE_2D_MULTISAMPLE = 0x9100; - public const int TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; - public const int TEXTURE_2D_STACK_BINDING_MESAX = 0x875E; - public const int TEXTURE_2D_STACK_MESAX = 0x875A; - public const int TEXTURE_3D = 0x806F; - public const int TEXTURE_3D_BINDING_EXT = 0x806A; - public const int TEXTURE_3D_EXT = 0x806F; - public const int TEXTURE_4DSIZE_SGIS = 0x8136; - public const int TEXTURE_4D_BINDING_SGIS = 0x814F; - public const int TEXTURE_4D_SGIS = 0x8134; - public const int TEXTURE_ALPHA_SIZE = 0x805F; - public const int TEXTURE_ALPHA_SIZE_EXT = 0x805F; - public const int TEXTURE_ALPHA_TYPE = 0x8C13; - public const int TEXTURE_ALPHA_TYPE_ARB = 0x8C13; - public const int TEXTURE_APPLICATION_MODE_EXT = 0x834F; - public const int TEXTURE_BASE_LEVEL = 0x813C; - public const int TEXTURE_BASE_LEVEL_SGIS = 0x813C; - public const int TEXTURE_BINDING_1D = 0x8068; - public const int TEXTURE_BINDING_1D_ARRAY = 0x8C1C; - public const int TEXTURE_BINDING_1D_ARRAY_EXT = 0x8C1C; - public const int TEXTURE_BINDING_2D = 0x8069; - public const int TEXTURE_BINDING_2D_ARRAY = 0x8C1D; - public const int TEXTURE_BINDING_2D_ARRAY_EXT = 0x8C1D; - public const int TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104; - public const int TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; - public const int TEXTURE_BINDING_3D = 0x806A; - public const int TEXTURE_BINDING_BUFFER = 0x8C2C; - public const int TEXTURE_BINDING_BUFFER_ARB = 0x8C2C; - public const int TEXTURE_BINDING_BUFFER_EXT = 0x8C2C; - public const int TEXTURE_BINDING_CUBE_MAP = 0x8514; - public const int TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514; - public const int TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A; - public const int TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A; - public const int TEXTURE_BINDING_CUBE_MAP_EXT = 0x8514; - public const int TEXTURE_BINDING_RECTANGLE = 0x84F6; - public const int TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6; - public const int TEXTURE_BINDING_RECTANGLE_NV = 0x84F6; - public const int TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53; - public const int TEXTURE_BLUE_SIZE = 0x805E; - public const int TEXTURE_BLUE_SIZE_EXT = 0x805E; - public const int TEXTURE_BLUE_TYPE = 0x8C12; - public const int TEXTURE_BLUE_TYPE_ARB = 0x8C12; - public const int TEXTURE_BORDER_COLOR = 0x1004; - public const int TEXTURE_BORDER_VALUES_NV = 0x871A; - public const int TEXTURE_BUFFER = 0x8C2A; - public const int TEXTURE_BUFFER_ARB = 0x8C2A; - public const int TEXTURE_BUFFER_BINDING = 0x8C2A; - public const int TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D; - public const int TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D; - public const int TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D; - public const int TEXTURE_BUFFER_EXT = 0x8C2A; - public const int TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E; - public const int TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E; - public const int TEXTURE_BUFFER_OFFSET = 0x919D; - public const int TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; - public const int TEXTURE_BUFFER_SIZE = 0x919E; - public const int TEXTURE_CLIPMAP_CENTER_SGIX = 0x8171; - public const int TEXTURE_CLIPMAP_DEPTH_SGIX = 0x8176; - public const int TEXTURE_CLIPMAP_FRAME_SGIX = 0x8172; - public const int TEXTURE_CLIPMAP_LOD_OFFSET_SGIX = 0x8175; - public const int TEXTURE_CLIPMAP_OFFSET_SGIX = 0x8173; - public const int TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8174; - public const int TEXTURE_COLOR_SAMPLES_NV = 0x9046; - public const int TEXTURE_COLOR_TABLE_SGI = 0x80BC; - public const int TEXTURE_COLOR_WRITEMASK_SGIS = 0x81EF; - public const int TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF; - public const int TEXTURE_COMPARE_FUNC = 0x884D; - public const int TEXTURE_COMPARE_FUNC_ARB = 0x884D; - public const int TEXTURE_COMPARE_MODE = 0x884C; - public const int TEXTURE_COMPARE_MODE_ARB = 0x884C; - public const int TEXTURE_COMPARE_OPERATOR_SGIX = 0x819B; - public const int TEXTURE_COMPARE_SGIX = 0x819A; - public const int TEXTURE_COMPRESSED = 0x86A1; - public const int TEXTURE_COMPRESSED_ARB = 0x86A1; - public const int TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2; - public const int TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3; - public const int TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1; - public const int TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0; - public const int TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0; - public const int TEXTURE_COMPRESSION_HINT = 0x84EF; - public const int TEXTURE_COMPRESSION_HINT_ARB = 0x84EF; - public const int TEXTURE_CONSTANT_DATA_SUNX = 0x81D6; - public const int TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25; - public const int TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A; - public const int TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; - public const int TEXTURE_COORD_ARRAY_EXT = 0x8078; - public const int TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F; - public const int TEXTURE_COORD_ARRAY_LIST_IBM = 103074; - public const int TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM = 103084; - public const int TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F8; - public const int TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; - public const int TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; - public const int TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; - public const int TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; - public const int TEXTURE_COORD_NV = 0x8C79; - public const int TEXTURE_COVERAGE_SAMPLES_NV = 0x9045; - public const int TEXTURE_CUBE_MAP = 0x8513; - public const int TEXTURE_CUBE_MAP_ARB = 0x8513; - public const int TEXTURE_CUBE_MAP_ARRAY = 0x9009; - public const int TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009; - public const int TEXTURE_CUBE_MAP_EXT = 0x8513; - public const int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; - public const int TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516; - public const int TEXTURE_CUBE_MAP_NEGATIVE_X_EXT = 0x8516; - public const int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; - public const int TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518; - public const int TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT = 0x8518; - public const int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; - public const int TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A; - public const int TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT = 0x851A; - public const int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; - public const int TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515; - public const int TEXTURE_CUBE_MAP_POSITIVE_X_EXT = 0x8515; - public const int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; - public const int TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517; - public const int TEXTURE_CUBE_MAP_POSITIVE_Y_EXT = 0x8517; - public const int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; - public const int TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519; - public const int TEXTURE_CUBE_MAP_POSITIVE_Z_EXT = 0x8519; - public const int TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; - public const int TEXTURE_DEFORMATION_BIT_SGIX = 0x00000001; - public const int TEXTURE_DEFORMATION_SGIX = 0x8195; - public const int TEXTURE_DEPTH = 0x8071; - public const int TEXTURE_DEPTH_EXT = 0x8071; - public const int TEXTURE_DEPTH_SIZE = 0x884A; - public const int TEXTURE_DEPTH_SIZE_ARB = 0x884A; - public const int TEXTURE_DEPTH_TYPE = 0x8C16; - public const int TEXTURE_DEPTH_TYPE_ARB = 0x8C16; - public const int TEXTURE_DS_SIZE_NV = 0x871D; - public const int TEXTURE_DT_SIZE_NV = 0x871E; - public const int TEXTURE_ENV_BIAS_SGIX = 0x80BE; - public const int TEXTURE_FETCH_BARRIER_BIT = 0x00000008; - public const int TEXTURE_FETCH_BARRIER_BIT_EXT = 0x00000008; - public const int TEXTURE_FILTER4_SIZE_SGIS = 0x8147; - public const int TEXTURE_FILTER_CONTROL_EXT = 0x8500; - public const int TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; - public const int TEXTURE_FLOAT_COMPONENTS_NV = 0x888C; - public const int TEXTURE_FREE_MEMORY_ATI = 0x87FC; - public const int TEXTURE_GATHER = 0x82A2; - public const int TEXTURE_GATHER_SHADOW = 0x82A3; - public const int TEXTURE_GEQUAL_R_SGIX = 0x819D; - public const int TEXTURE_GREEN_SIZE = 0x805D; - public const int TEXTURE_GREEN_SIZE_EXT = 0x805D; - public const int TEXTURE_GREEN_TYPE = 0x8C11; - public const int TEXTURE_GREEN_TYPE_ARB = 0x8C11; - public const int TEXTURE_HEIGHT = 0x1001; - public const int TEXTURE_HI_SIZE_NV = 0x871B; - public const int TEXTURE_IMAGE_FORMAT = 0x828F; - public const int TEXTURE_IMAGE_TYPE = 0x8290; - public const int TEXTURE_IMMUTABLE_FORMAT = 0x912F; - public const int TEXTURE_IMMUTABLE_FORMAT_EXT = 0x912F; - public const int TEXTURE_IMMUTABLE_LEVELS = 0x82DF; - public const int TEXTURE_INDEX_SIZE_EXT = 0x80ED; - public const int TEXTURE_INTENSITY_SIZE_EXT = 0x8061; - public const int TEXTURE_INTENSITY_TYPE_ARB = 0x8C15; - public const int TEXTURE_INTERNAL_FORMAT = 0x1003; - public const int TEXTURE_LEQUAL_R_SGIX = 0x819C; - public const int TEXTURE_LIGHTING_MODE_HP = 0x8167; - public const int TEXTURE_LIGHT_EXT = 0x8350; - public const int TEXTURE_LOD_BIAS = 0x8501; - public const int TEXTURE_LOD_BIAS_EXT = 0x8501; - public const int TEXTURE_LOD_BIAS_R_SGIX = 0x8190; - public const int TEXTURE_LOD_BIAS_S_SGIX = 0x818E; - public const int TEXTURE_LOD_BIAS_T_SGIX = 0x818F; - public const int TEXTURE_LO_SIZE_NV = 0x871C; - public const int TEXTURE_LUMINANCE_SIZE_EXT = 0x8060; - public const int TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14; - public const int TEXTURE_MAG_FILTER = 0x2800; - public const int TEXTURE_MAG_SIZE_NV = 0x871F; - public const int TEXTURE_MATERIAL_FACE_EXT = 0x8351; - public const int TEXTURE_MATERIAL_PARAMETER_EXT = 0x8352; - public const int TEXTURE_MAX_ANISOTROPY = 0x84FE; - public const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; - public const int TEXTURE_MAX_CLAMP_R_SGIX = 0x836B; - public const int TEXTURE_MAX_CLAMP_S_SGIX = 0x8369; - public const int TEXTURE_MAX_CLAMP_T_SGIX = 0x836A; - public const int TEXTURE_MAX_LEVEL = 0x813D; - public const int TEXTURE_MAX_LEVEL_SGIS = 0x813D; - public const int TEXTURE_MAX_LOD = 0x813B; - public const int TEXTURE_MAX_LOD_SGIS = 0x813B; - public const int TEXTURE_MEMORY_LAYOUT_INTEL = 0x83FF; - public const int TEXTURE_MIN_FILTER = 0x2801; - public const int TEXTURE_MIN_LOD = 0x813A; - public const int TEXTURE_MIN_LOD_SGIS = 0x813A; - public const int TEXTURE_MULTI_BUFFER_HINT_SGIX = 0x812E; - public const int TEXTURE_NORMAL_EXT = 0x85AF; - public const int TEXTURE_POST_SPECULAR_HP = 0x8168; - public const int TEXTURE_PRE_SPECULAR_HP = 0x8169; - public const int TEXTURE_PRIORITY_EXT = 0x8066; - public const int TEXTURE_RANGE_LENGTH_APPLE = 0x85B7; - public const int TEXTURE_RANGE_POINTER_APPLE = 0x85B8; - public const int TEXTURE_RECTANGLE = 0x84F5; - public const int TEXTURE_RECTANGLE_ARB = 0x84F5; - public const int TEXTURE_RECTANGLE_NV = 0x84F5; - public const int TEXTURE_REDUCTION_MODE_ARB = 0x9366; - public const int TEXTURE_REDUCTION_MODE_EXT = 0x9366; - public const int TEXTURE_RED_SIZE = 0x805C; - public const int TEXTURE_RED_SIZE_EXT = 0x805C; - public const int TEXTURE_RED_TYPE = 0x8C10; - public const int TEXTURE_RED_TYPE_ARB = 0x8C10; - public const int TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54; - public const int TEXTURE_RENDERBUFFER_NV = 0x8E55; - public const int TEXTURE_RESIDENT_EXT = 0x8067; - public const int TEXTURE_SAMPLES = 0x9106; - public const int TEXTURE_SHADER_NV = 0x86DE; - public const int TEXTURE_SHADOW = 0x82A1; - public const int TEXTURE_SHARED_SIZE = 0x8C3F; - public const int TEXTURE_SHARED_SIZE_EXT = 0x8C3F; - public const int TEXTURE_SPARSE_ARB = 0x91A6; - public const int TEXTURE_SRGB_DECODE_EXT = 0x8A48; - public const int TEXTURE_STENCIL_SIZE = 0x88F1; - public const int TEXTURE_STENCIL_SIZE_EXT = 0x88F1; - public const int TEXTURE_STORAGE_HINT_APPLE = 0x85BC; - public const int TEXTURE_STORAGE_SPARSE_BIT_AMD = 0x00000001; - public const int TEXTURE_SWIZZLE_A = 0x8E45; - public const int TEXTURE_SWIZZLE_A_EXT = 0x8E45; - public const int TEXTURE_SWIZZLE_B = 0x8E44; - public const int TEXTURE_SWIZZLE_B_EXT = 0x8E44; - public const int TEXTURE_SWIZZLE_G = 0x8E43; - public const int TEXTURE_SWIZZLE_G_EXT = 0x8E43; - public const int TEXTURE_SWIZZLE_R = 0x8E42; - public const int TEXTURE_SWIZZLE_RGBA = 0x8E46; - public const int TEXTURE_SWIZZLE_RGBA_EXT = 0x8E46; - public const int TEXTURE_SWIZZLE_R_EXT = 0x8E42; - public const int TEXTURE_TARGET = 0x1006; - public const int TEXTURE_TILING_EXT = 0x9580; - public const int TEXTURE_TOO_LARGE_EXT = 0x8065; - public const int TEXTURE_UNSIGNED_REMAP_MODE_NV = 0x888F; - public const int TEXTURE_UPDATE_BARRIER_BIT = 0x00000100; - public const int TEXTURE_UPDATE_BARRIER_BIT_EXT = 0x00000100; - public const int TEXTURE_VIEW = 0x82B5; - public const int TEXTURE_VIEW_MIN_LAYER = 0x82DD; - public const int TEXTURE_VIEW_MIN_LEVEL = 0x82DB; - public const int TEXTURE_VIEW_NUM_LAYERS = 0x82DE; - public const int TEXTURE_VIEW_NUM_LEVELS = 0x82DC; - public const int TEXTURE_WIDTH = 0x1000; - public const int TEXTURE_WRAP_Q_SGIS = 0x8137; - public const int TEXTURE_WRAP_R = 0x8072; - public const int TEXTURE_WRAP_R_EXT = 0x8072; - public const int TEXTURE_WRAP_S = 0x2802; - public const int TEXTURE_WRAP_T = 0x2803; - public const int TEXT_FRAGMENT_SHADER_ATI = 0x8200; - public const int TILE_RASTER_ORDER_FIXED_MESA = 0x8BB8; - public const int TILE_RASTER_ORDER_INCREASING_X_MESA = 0x8BB9; - public const int TILE_RASTER_ORDER_INCREASING_Y_MESA = 0x8BBA; - public const int TILING_TYPES_EXT = 0x9583; - public const int TIMELINE_SEMAPHORE_VALUE_NV = 0x9595; - public const int TIMEOUT_EXPIRED = 0x911B; - public const ulong TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFF; - public const int TIMESTAMP = 0x8E28; - public const int TIME_ELAPSED = 0x88BF; - public const int TIME_ELAPSED_EXT = 0x88BF; - public const int TOP_LEVEL_ARRAY_SIZE = 0x930C; - public const int TOP_LEVEL_ARRAY_STRIDE = 0x930D; - public const int TRACK_MATRIX_NV = 0x8648; - public const int TRACK_MATRIX_TRANSFORM_NV = 0x8649; - public const int TRANSFORM_FEEDBACK = 0x8E22; - public const int TRANSFORM_FEEDBACK_ACTIVE = 0x8E24; - public const int TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8C7E; - public const int TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800; - public const int TRANSFORM_FEEDBACK_BARRIER_BIT_EXT = 0x00000800; - public const int TRANSFORM_FEEDBACK_BINDING = 0x8E25; - public const int TRANSFORM_FEEDBACK_BINDING_NV = 0x8E25; - public const int TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; - public const int TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24; - public const int TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = 0x8E24; - public const int TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; - public const int TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT = 0x8C8F; - public const int TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8C8F; - public const int TRANSFORM_FEEDBACK_BUFFER_EXT = 0x8C8E; - public const int TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B; - public const int TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F; - public const int TRANSFORM_FEEDBACK_BUFFER_MODE_EXT = 0x8C7F; - public const int TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8C7F; - public const int TRANSFORM_FEEDBACK_BUFFER_NV = 0x8C8E; - public const int TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23; - public const int TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = 0x8E23; - public const int TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; - public const int TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT = 0x8C85; - public const int TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8C85; - public const int TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84; - public const int TRANSFORM_FEEDBACK_BUFFER_START_EXT = 0x8C84; - public const int TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8C84; - public const int TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; - public const int TRANSFORM_FEEDBACK_NV = 0x8E22; - public const int TRANSFORM_FEEDBACK_OVERFLOW = 0x82EC; - public const int TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC; - public const int TRANSFORM_FEEDBACK_PAUSED = 0x8E23; - public const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; - public const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT = 0x8C88; - public const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8C88; - public const int TRANSFORM_FEEDBACK_RECORD_NV = 0x8C86; - public const int TRANSFORM_FEEDBACK_STREAM_OVERFLOW = 0x82ED; - public const int TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED; - public const int TRANSFORM_FEEDBACK_VARYING = 0x92F4; - public const int TRANSFORM_FEEDBACK_VARYINGS = 0x8C83; - public const int TRANSFORM_FEEDBACK_VARYINGS_EXT = 0x8C83; - public const int TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8C83; - public const int TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; - public const int TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT = 0x8C76; - public const int TRANSFORM_HINT_APPLE = 0x85B1; - public const int TRANSLATE_2D_NV = 0x9090; - public const int TRANSLATE_3D_NV = 0x9091; - public const int TRANSLATE_X_NV = 0x908E; - public const int TRANSLATE_Y_NV = 0x908F; - public const int TRANSPOSE_AFFINE_2D_NV = 0x9096; - public const int TRANSPOSE_AFFINE_3D_NV = 0x9098; - public const int TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; - public const int TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; - public const int TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3; - public const int TRANSPOSE_NV = 0x862C; - public const int TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E; - public const int TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4; - public const int TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5; - public const int TRIANGLES = 0x0004; - public const int TRIANGLES_ADJACENCY = 0x000C; - public const int TRIANGLES_ADJACENCY_ARB = 0x000C; - public const int TRIANGLES_ADJACENCY_EXT = 0x000C; - public const int TRIANGLE_FAN = 0x0006; - public const int TRIANGLE_LIST_SUN = 0x81D7; - public const int TRIANGLE_MESH_SUN = 0x8615; - public const int TRIANGLE_STRIP = 0x0005; - public const int TRIANGLE_STRIP_ADJACENCY = 0x000D; - public const int TRIANGLE_STRIP_ADJACENCY_ARB = 0x000D; - public const int TRIANGLE_STRIP_ADJACENCY_EXT = 0x000D; - public const int TRIANGULAR_NV = 0x90A5; - public const int TRUE = 1; - public const int TYPE = 0x92FA; - public const int UNCORRELATED_NV = 0x9282; - public const int UNDEFINED_APPLE = 0x8A1C; - public const int UNDEFINED_VERTEX = 0x8260; - public const int UNIFORM = 0x92E1; - public const int UNIFORM_ADDRESS_COMMAND_NV = 0x000A; - public const int UNIFORM_ARRAY_STRIDE = 0x8A3C; - public const int UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; - public const int UNIFORM_BARRIER_BIT = 0x00000004; - public const int UNIFORM_BARRIER_BIT_EXT = 0x00000004; - public const int UNIFORM_BLOCK = 0x92E2; - public const int UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42; - public const int UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43; - public const int UNIFORM_BLOCK_BINDING = 0x8A3F; - public const int UNIFORM_BLOCK_DATA_SIZE = 0x8A40; - public const int UNIFORM_BLOCK_INDEX = 0x8A3A; - public const int UNIFORM_BLOCK_NAME_LENGTH = 0x8A41; - public const int UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; - public const int UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; - public const int UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45; - public const int UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV = 0x959C; - public const int UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV = 0x959D; - public const int UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0; - public const int UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; - public const int UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44; - public const int UNIFORM_BUFFER = 0x8A11; - public const int UNIFORM_BUFFER_ADDRESS_NV = 0x936F; - public const int UNIFORM_BUFFER_BINDING = 0x8A28; - public const int UNIFORM_BUFFER_BINDING_EXT = 0x8DEF; - public const int UNIFORM_BUFFER_EXT = 0x8DEE; - public const int UNIFORM_BUFFER_LENGTH_NV = 0x9370; - public const int UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; - public const int UNIFORM_BUFFER_SIZE = 0x8A2A; - public const int UNIFORM_BUFFER_START = 0x8A29; - public const int UNIFORM_BUFFER_UNIFIED_NV = 0x936E; - public const int UNIFORM_IS_ROW_MAJOR = 0x8A3E; - public const int UNIFORM_MATRIX_STRIDE = 0x8A3D; - public const int UNIFORM_NAME_LENGTH = 0x8A39; - public const int UNIFORM_OFFSET = 0x8A3B; - public const int UNIFORM_SIZE = 0x8A38; - public const int UNIFORM_TYPE = 0x8A37; - public const int UNKNOWN_CONTEXT_RESET = 0x8255; - public const int UNKNOWN_CONTEXT_RESET_ARB = 0x8255; - public const int UNPACK_ALIGNMENT = 0x0CF5; - public const int UNPACK_CLIENT_STORAGE_APPLE = 0x85B2; - public const int UNPACK_CMYK_HINT_EXT = 0x800F; - public const int UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129; - public const int UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128; - public const int UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A; - public const int UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127; - public const int UNPACK_CONSTANT_DATA_SUNX = 0x81D5; - public const int UNPACK_IMAGE_DEPTH_SGIS = 0x8133; - public const int UNPACK_IMAGE_HEIGHT = 0x806E; - public const int UNPACK_IMAGE_HEIGHT_EXT = 0x806E; - public const int UNPACK_LSB_FIRST = 0x0CF1; - public const int UNPACK_RESAMPLE_OML = 0x8985; - public const int UNPACK_RESAMPLE_SGIX = 0x842F; - public const int UNPACK_ROW_BYTES_APPLE = 0x8A16; - public const int UNPACK_ROW_LENGTH = 0x0CF2; - public const int UNPACK_SKIP_IMAGES = 0x806D; - public const int UNPACK_SKIP_IMAGES_EXT = 0x806D; - public const int UNPACK_SKIP_PIXELS = 0x0CF4; - public const int UNPACK_SKIP_ROWS = 0x0CF3; - public const int UNPACK_SKIP_VOLUMES_SGIS = 0x8132; - public const int UNPACK_SUBSAMPLE_RATE_SGIX = 0x85A1; - public const int UNPACK_SWAP_BYTES = 0x0CF0; - public const int UNSIGNALED = 0x9118; - public const int UNSIGNED_BYTE = 0x1401; - public const int UNSIGNED_BYTE_2_3_3_REV = 0x8362; - public const int UNSIGNED_BYTE_3_3_2 = 0x8032; - public const int UNSIGNED_BYTE_3_3_2_EXT = 0x8032; - public const int UNSIGNED_IDENTITY_NV = 0x8536; - public const int UNSIGNED_INT = 0x1405; - public const int UNSIGNED_INT16_NV = 0x8FF0; - public const int UNSIGNED_INT16_VEC2_NV = 0x8FF1; - public const int UNSIGNED_INT16_VEC3_NV = 0x8FF2; - public const int UNSIGNED_INT16_VEC4_NV = 0x8FF3; - public const int UNSIGNED_INT64_AMD = 0x8BC2; - public const int UNSIGNED_INT64_ARB = 0x140F; - public const int UNSIGNED_INT64_NV = 0x140F; - public const int UNSIGNED_INT64_VEC2_ARB = 0x8FF5; - public const int UNSIGNED_INT64_VEC2_NV = 0x8FF5; - public const int UNSIGNED_INT64_VEC3_ARB = 0x8FF6; - public const int UNSIGNED_INT64_VEC3_NV = 0x8FF6; - public const int UNSIGNED_INT64_VEC4_ARB = 0x8FF7; - public const int UNSIGNED_INT64_VEC4_NV = 0x8FF7; - public const int UNSIGNED_INT8_NV = 0x8FEC; - public const int UNSIGNED_INT8_VEC2_NV = 0x8FED; - public const int UNSIGNED_INT8_VEC3_NV = 0x8FEE; - public const int UNSIGNED_INT8_VEC4_NV = 0x8FEF; - public const int UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; - public const int UNSIGNED_INT_10F_11F_11F_REV_EXT = 0x8C3B; - public const int UNSIGNED_INT_10_10_10_2 = 0x8036; - public const int UNSIGNED_INT_10_10_10_2_EXT = 0x8036; - public const int UNSIGNED_INT_24_8 = 0x84FA; - public const int UNSIGNED_INT_24_8_EXT = 0x84FA; - public const int UNSIGNED_INT_24_8_NV = 0x84FA; - public const int UNSIGNED_INT_2_10_10_10_REV = 0x8368; - public const int UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; - public const int UNSIGNED_INT_5_9_9_9_REV_EXT = 0x8C3E; - public const int UNSIGNED_INT_8_8_8_8 = 0x8035; - public const int UNSIGNED_INT_8_8_8_8_EXT = 0x8035; - public const int UNSIGNED_INT_8_8_8_8_REV = 0x8367; - public const int UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB; - public const int UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; - public const int UNSIGNED_INT_IMAGE_1D = 0x9062; - public const int UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068; - public const int UNSIGNED_INT_IMAGE_1D_ARRAY_EXT = 0x9068; - public const int UNSIGNED_INT_IMAGE_1D_EXT = 0x9062; - public const int UNSIGNED_INT_IMAGE_2D = 0x9063; - public const int UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069; - public const int UNSIGNED_INT_IMAGE_2D_ARRAY_EXT = 0x9069; - public const int UNSIGNED_INT_IMAGE_2D_EXT = 0x9063; - public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B; - public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; - public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x906C; - public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x906B; - public const int UNSIGNED_INT_IMAGE_2D_RECT = 0x9065; - public const int UNSIGNED_INT_IMAGE_2D_RECT_EXT = 0x9065; - public const int UNSIGNED_INT_IMAGE_3D = 0x9064; - public const int UNSIGNED_INT_IMAGE_3D_EXT = 0x9064; - public const int UNSIGNED_INT_IMAGE_BUFFER = 0x9067; - public const int UNSIGNED_INT_IMAGE_BUFFER_EXT = 0x9067; - public const int UNSIGNED_INT_IMAGE_CUBE = 0x9066; - public const int UNSIGNED_INT_IMAGE_CUBE_EXT = 0x9066; - public const int UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A; - public const int UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x906A; - public const int UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA; - public const int UNSIGNED_INT_SAMPLER_1D = 0x8DD1; - public const int UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6; - public const int UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT = 0x8DD6; - public const int UNSIGNED_INT_SAMPLER_1D_EXT = 0x8DD1; - public const int UNSIGNED_INT_SAMPLER_2D = 0x8DD2; - public const int UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; - public const int UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT = 0x8DD7; - public const int UNSIGNED_INT_SAMPLER_2D_EXT = 0x8DD2; - public const int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A; - public const int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; - public const int UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5; - public const int UNSIGNED_INT_SAMPLER_2D_RECT_EXT = 0x8DD5; - public const int UNSIGNED_INT_SAMPLER_3D = 0x8DD3; - public const int UNSIGNED_INT_SAMPLER_3D_EXT = 0x8DD3; - public const int UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8; - public const int UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003; - public const int UNSIGNED_INT_SAMPLER_BUFFER_EXT = 0x8DD8; - public const int UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4; - public const int UNSIGNED_INT_SAMPLER_CUBE_EXT = 0x8DD4; - public const int UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F; - public const int UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F; - public const int UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58; - public const int UNSIGNED_INT_VEC2 = 0x8DC6; - public const int UNSIGNED_INT_VEC2_EXT = 0x8DC6; - public const int UNSIGNED_INT_VEC3 = 0x8DC7; - public const int UNSIGNED_INT_VEC3_EXT = 0x8DC7; - public const int UNSIGNED_INT_VEC4 = 0x8DC8; - public const int UNSIGNED_INT_VEC4_EXT = 0x8DC8; - public const int UNSIGNED_INVERT_NV = 0x8537; - public const int UNSIGNED_NORMALIZED = 0x8C17; - public const int UNSIGNED_NORMALIZED_ARB = 0x8C17; - public const int UNSIGNED_SHORT = 0x1403; - public const int UNSIGNED_SHORT_1_5_5_5_REV = 0x8366; - public const int UNSIGNED_SHORT_4_4_4_4 = 0x8033; - public const int UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033; - public const int UNSIGNED_SHORT_4_4_4_4_REV = 0x8365; - public const int UNSIGNED_SHORT_5_5_5_1 = 0x8034; - public const int UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034; - public const int UNSIGNED_SHORT_5_6_5 = 0x8363; - public const int UNSIGNED_SHORT_5_6_5_REV = 0x8364; - public const int UNSIGNED_SHORT_8_8_APPLE = 0x85BA; - public const int UNSIGNED_SHORT_8_8_MESA = 0x85BA; - public const int UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB; - public const int UNSIGNED_SHORT_8_8_REV_MESA = 0x85BB; - public const int UPLOAD_GPU_MASK_NVX = 0x954A; - public const int UPPER_LEFT = 0x8CA2; - public const int USE_MISSING_GLYPH_NV = 0x90AA; - public const int UTF16_NV = 0x909B; - public const int UTF8_NV = 0x909A; - public const int UUID_SIZE_EXT = 16; - public const int VALIDATE_STATUS = 0x8B83; - public const int VARIABLE_A_NV = 0x8523; - public const int VARIABLE_B_NV = 0x8524; - public const int VARIABLE_C_NV = 0x8525; - public const int VARIABLE_D_NV = 0x8526; - public const int VARIABLE_E_NV = 0x8527; - public const int VARIABLE_F_NV = 0x8528; - public const int VARIABLE_G_NV = 0x8529; - public const int VARIANT_ARRAY_EXT = 0x87E8; - public const int VARIANT_ARRAY_POINTER_EXT = 0x87E9; - public const int VARIANT_ARRAY_STRIDE_EXT = 0x87E6; - public const int VARIANT_ARRAY_TYPE_EXT = 0x87E7; - public const int VARIANT_DATATYPE_EXT = 0x87E5; - public const int VARIANT_EXT = 0x87C1; - public const int VARIANT_VALUE_EXT = 0x87E4; - public const int VBO_FREE_MEMORY_ATI = 0x87FB; - public const int VECTOR_EXT = 0x87BF; - public const int VENDOR = 0x1F00; - public const int VERSION = 0x1F02; - public const int VERTEX23_BIT_PGI = 0x00000004; - public const int VERTEX4_BIT_PGI = 0x00000008; - public const int VERTEX_ARRAY = 0x8074; - public const int VERTEX_ARRAY_ADDRESS_NV = 0x8F21; - public const int VERTEX_ARRAY_BINDING = 0x85B5; - public const int VERTEX_ARRAY_BINDING_APPLE = 0x85B5; - public const int VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896; - public const int VERTEX_ARRAY_COUNT_EXT = 0x807D; - public const int VERTEX_ARRAY_EXT = 0x8074; - public const int VERTEX_ARRAY_LENGTH_NV = 0x8F2B; - public const int VERTEX_ARRAY_LIST_IBM = 103070; - public const int VERTEX_ARRAY_LIST_STRIDE_IBM = 103080; - public const int VERTEX_ARRAY_OBJECT_AMD = 0x9154; - public const int VERTEX_ARRAY_OBJECT_EXT = 0x9154; - public const int VERTEX_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F5; - public const int VERTEX_ARRAY_POINTER_EXT = 0x808E; - public const int VERTEX_ARRAY_RANGE_APPLE = 0x851D; - public const int VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E; - public const int VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E; - public const int VERTEX_ARRAY_RANGE_NV = 0x851D; - public const int VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521; - public const int VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521; - public const int VERTEX_ARRAY_RANGE_VALID_NV = 0x851F; - public const int VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533; - public const int VERTEX_ARRAY_SIZE_EXT = 0x807A; - public const int VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F; - public const int VERTEX_ARRAY_STRIDE_EXT = 0x807C; - public const int VERTEX_ARRAY_TYPE_EXT = 0x807B; - public const int VERTEX_ATTRIB_ARRAY0_NV = 0x8650; - public const int VERTEX_ATTRIB_ARRAY10_NV = 0x865A; - public const int VERTEX_ATTRIB_ARRAY11_NV = 0x865B; - public const int VERTEX_ATTRIB_ARRAY12_NV = 0x865C; - public const int VERTEX_ATTRIB_ARRAY13_NV = 0x865D; - public const int VERTEX_ATTRIB_ARRAY14_NV = 0x865E; - public const int VERTEX_ATTRIB_ARRAY15_NV = 0x865F; - public const int VERTEX_ATTRIB_ARRAY1_NV = 0x8651; - public const int VERTEX_ATTRIB_ARRAY2_NV = 0x8652; - public const int VERTEX_ATTRIB_ARRAY3_NV = 0x8653; - public const int VERTEX_ATTRIB_ARRAY4_NV = 0x8654; - public const int VERTEX_ATTRIB_ARRAY5_NV = 0x8655; - public const int VERTEX_ATTRIB_ARRAY6_NV = 0x8656; - public const int VERTEX_ATTRIB_ARRAY7_NV = 0x8657; - public const int VERTEX_ATTRIB_ARRAY8_NV = 0x8658; - public const int VERTEX_ATTRIB_ARRAY9_NV = 0x8659; - public const int VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20; - public const int VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001; - public const int VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT = 0x00000001; - public const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; - public const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F; - public const int VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; - public const int VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE; - public const int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; - public const int VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; - public const int VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; - public const int VERTEX_ATTRIB_ARRAY_INTEGER_EXT = 0x88FD; - public const int VERTEX_ATTRIB_ARRAY_INTEGER_NV = 0x88FD; - public const int VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A; - public const int VERTEX_ATTRIB_ARRAY_LONG = 0x874E; - public const int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; - public const int VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; - public const int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; - public const int VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; - public const int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; - public const int VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; - public const int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; - public const int VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; - public const int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; - public const int VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; - public const int VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E; - public const int VERTEX_ATTRIB_BINDING = 0x82D4; - public const int VERTEX_ATTRIB_MAP1_APPLE = 0x8A00; - public const int VERTEX_ATTRIB_MAP1_COEFF_APPLE = 0x8A03; - public const int VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = 0x8A05; - public const int VERTEX_ATTRIB_MAP1_ORDER_APPLE = 0x8A04; - public const int VERTEX_ATTRIB_MAP1_SIZE_APPLE = 0x8A02; - public const int VERTEX_ATTRIB_MAP2_APPLE = 0x8A01; - public const int VERTEX_ATTRIB_MAP2_COEFF_APPLE = 0x8A07; - public const int VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = 0x8A09; - public const int VERTEX_ATTRIB_MAP2_ORDER_APPLE = 0x8A08; - public const int VERTEX_ATTRIB_MAP2_SIZE_APPLE = 0x8A06; - public const int VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; - public const int VERTEX_BINDING_BUFFER = 0x8F4F; - public const int VERTEX_BINDING_DIVISOR = 0x82D6; - public const int VERTEX_BINDING_OFFSET = 0x82D7; - public const int VERTEX_BINDING_STRIDE = 0x82D8; - public const int VERTEX_BLEND_ARB = 0x86A7; - public const int VERTEX_CONSISTENT_HINT_PGI = 0x1A22B; - public const int VERTEX_DATA_HINT_PGI = 0x1A22A; - public const int VERTEX_ELEMENT_SWIZZLE_AMD = 0x91A4; - public const int VERTEX_ID_NV = 0x8C7B; - public const int VERTEX_ID_SWIZZLE_AMD = 0x91A5; - public const int VERTEX_PRECLIP_HINT_SGIX = 0x83EF; - public const int VERTEX_PRECLIP_SGIX = 0x83EE; - public const int VERTEX_PROGRAM_ARB = 0x8620; - public const int VERTEX_PROGRAM_BINDING_NV = 0x864A; - public const int VERTEX_PROGRAM_NV = 0x8620; - public const int VERTEX_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA2; - public const int VERTEX_PROGRAM_POINT_SIZE = 0x8642; - public const int VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; - public const int VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; - public const int VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; - public const int VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; - public const int VERTEX_SHADER = 0x8B31; - public const int VERTEX_SHADER_ARB = 0x8B31; - public const int VERTEX_SHADER_BINDING_EXT = 0x8781; - public const int VERTEX_SHADER_BIT = 0x00000001; - public const int VERTEX_SHADER_EXT = 0x8780; - public const int VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF; - public const int VERTEX_SHADER_INVARIANTS_EXT = 0x87D1; - public const int VERTEX_SHADER_INVOCATIONS = 0x82F0; - public const int VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0; - public const int VERTEX_SHADER_LOCALS_EXT = 0x87D3; - public const int VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2; - public const int VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4; - public const int VERTEX_SHADER_VARIANTS_EXT = 0x87D0; - public const int VERTEX_SOURCE_ATI = 0x8774; - public const int VERTEX_STATE_PROGRAM_NV = 0x8621; - public const int VERTEX_STREAM0_ATI = 0x876C; - public const int VERTEX_STREAM1_ATI = 0x876D; - public const int VERTEX_STREAM2_ATI = 0x876E; - public const int VERTEX_STREAM3_ATI = 0x876F; - public const int VERTEX_STREAM4_ATI = 0x8770; - public const int VERTEX_STREAM5_ATI = 0x8771; - public const int VERTEX_STREAM6_ATI = 0x8772; - public const int VERTEX_STREAM7_ATI = 0x8773; - public const int VERTEX_SUBROUTINE = 0x92E8; - public const int VERTEX_SUBROUTINE_UNIFORM = 0x92EE; - public const int VERTEX_TEXTURE = 0x829B; - public const int VERTEX_WEIGHTING_EXT = 0x8509; - public const int VERTEX_WEIGHT_ARRAY_EXT = 0x850C; - public const int VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510; - public const int VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D; - public const int VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F; - public const int VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E; - public const int VERTICAL_LINE_TO_NV = 0x08; - public const int VERTICES_SUBMITTED = 0x82EE; - public const int VERTICES_SUBMITTED_ARB = 0x82EE; - public const int VIBRANCE_BIAS_NV = 0x8719; - public const int VIBRANCE_SCALE_NV = 0x8713; - public const int VIDEO_BUFFER_BINDING_NV = 0x9021; - public const int VIDEO_BUFFER_INTERNAL_FORMAT_NV = 0x902D; - public const int VIDEO_BUFFER_NV = 0x9020; - public const int VIDEO_BUFFER_PITCH_NV = 0x9028; - public const int VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV = 0x903B; - public const int VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV = 0x903A; - public const int VIDEO_CAPTURE_FRAME_HEIGHT_NV = 0x9039; - public const int VIDEO_CAPTURE_FRAME_WIDTH_NV = 0x9038; - public const int VIDEO_CAPTURE_SURFACE_ORIGIN_NV = 0x903C; - public const int VIDEO_CAPTURE_TO_422_SUPPORTED_NV = 0x9026; - public const int VIDEO_COLOR_CONVERSION_MATRIX_NV = 0x9029; - public const int VIDEO_COLOR_CONVERSION_MAX_NV = 0x902A; - public const int VIDEO_COLOR_CONVERSION_MIN_NV = 0x902B; - public const int VIDEO_COLOR_CONVERSION_OFFSET_NV = 0x902C; - public const int VIEWPORT = 0x0BA2; - public const int VIEWPORT_BOUNDS_RANGE = 0x825D; - public const int VIEWPORT_COMMAND_NV = 0x0010; - public const int VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; - public const int VIEWPORT_POSITION_W_SCALE_NV = 0x937C; - public const int VIEWPORT_POSITION_W_SCALE_X_COEFF_NV = 0x937D; - public const int VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV = 0x937E; - public const int VIEWPORT_SUBPIXEL_BITS = 0x825C; - public const int VIEWPORT_SWIZZLE_NEGATIVE_W_NV = 0x9357; - public const int VIEWPORT_SWIZZLE_NEGATIVE_X_NV = 0x9351; - public const int VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = 0x9353; - public const int VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = 0x9355; - public const int VIEWPORT_SWIZZLE_POSITIVE_W_NV = 0x9356; - public const int VIEWPORT_SWIZZLE_POSITIVE_X_NV = 0x9350; - public const int VIEWPORT_SWIZZLE_POSITIVE_Y_NV = 0x9352; - public const int VIEWPORT_SWIZZLE_POSITIVE_Z_NV = 0x9354; - public const int VIEWPORT_SWIZZLE_W_NV = 0x935B; - public const int VIEWPORT_SWIZZLE_X_NV = 0x9358; - public const int VIEWPORT_SWIZZLE_Y_NV = 0x9359; - public const int VIEWPORT_SWIZZLE_Z_NV = 0x935A; - public const int VIEW_CLASS_128_BITS = 0x82C4; - public const int VIEW_CLASS_16_BITS = 0x82CA; - public const int VIEW_CLASS_24_BITS = 0x82C9; - public const int VIEW_CLASS_32_BITS = 0x82C8; - public const int VIEW_CLASS_48_BITS = 0x82C7; - public const int VIEW_CLASS_64_BITS = 0x82C6; - public const int VIEW_CLASS_8_BITS = 0x82CB; - public const int VIEW_CLASS_96_BITS = 0x82C5; - public const int VIEW_CLASS_ASTC_10x10_RGBA = 0x9393; - public const int VIEW_CLASS_ASTC_10x5_RGBA = 0x9390; - public const int VIEW_CLASS_ASTC_10x6_RGBA = 0x9391; - public const int VIEW_CLASS_ASTC_10x8_RGBA = 0x9392; - public const int VIEW_CLASS_ASTC_12x10_RGBA = 0x9394; - public const int VIEW_CLASS_ASTC_12x12_RGBA = 0x9395; - public const int VIEW_CLASS_ASTC_4x4_RGBA = 0x9388; - public const int VIEW_CLASS_ASTC_5x4_RGBA = 0x9389; - public const int VIEW_CLASS_ASTC_5x5_RGBA = 0x938A; - public const int VIEW_CLASS_ASTC_6x5_RGBA = 0x938B; - public const int VIEW_CLASS_ASTC_6x6_RGBA = 0x938C; - public const int VIEW_CLASS_ASTC_8x5_RGBA = 0x938D; - public const int VIEW_CLASS_ASTC_8x6_RGBA = 0x938E; - public const int VIEW_CLASS_ASTC_8x8_RGBA = 0x938F; - public const int VIEW_CLASS_BPTC_FLOAT = 0x82D3; - public const int VIEW_CLASS_BPTC_UNORM = 0x82D2; - public const int VIEW_CLASS_EAC_R11 = 0x9383; - public const int VIEW_CLASS_EAC_RG11 = 0x9384; - public const int VIEW_CLASS_ETC2_EAC_RGBA = 0x9387; - public const int VIEW_CLASS_ETC2_RGB = 0x9385; - public const int VIEW_CLASS_ETC2_RGBA = 0x9386; - public const int VIEW_CLASS_RGTC1_RED = 0x82D0; - public const int VIEW_CLASS_RGTC2_RG = 0x82D1; - public const int VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC; - public const int VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD; - public const int VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE; - public const int VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF; - public const int VIEW_COMPATIBILITY_CLASS = 0x82B6; - public const int VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7; - public const int VIRTUAL_PAGE_SIZE_X_AMD = 0x9195; - public const int VIRTUAL_PAGE_SIZE_X_ARB = 0x9195; - public const int VIRTUAL_PAGE_SIZE_Y_AMD = 0x9196; - public const int VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196; - public const int VIRTUAL_PAGE_SIZE_Z_AMD = 0x9197; - public const int VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197; - public const int VIVIDLIGHT_NV = 0x92A6; - public const int VOLATILE_APPLE = 0x8A1A; - public const int WAIT_FAILED = 0x911D; - public const int WARPS_PER_SM_NV = 0x933A; - public const int WARP_SIZE_NV = 0x9339; - public const int WEIGHTED_AVERAGE_ARB = 0x9367; - public const int WEIGHTED_AVERAGE_EXT = 0x9367; - public const int WEIGHT_ARRAY_ARB = 0x86AD; - public const int WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E; - public const int WEIGHT_ARRAY_POINTER_ARB = 0x86AC; - public const int WEIGHT_ARRAY_SIZE_ARB = 0x86AB; - public const int WEIGHT_ARRAY_STRIDE_ARB = 0x86AA; - public const int WEIGHT_ARRAY_TYPE_ARB = 0x86A9; - public const int WEIGHT_SUM_UNITY_ARB = 0x86A6; - public const int WIDE_LINE_HINT_PGI = 0x1A222; - public const int WINDOW_RECTANGLE_EXT = 0x8F12; - public const int WINDOW_RECTANGLE_MODE_EXT = 0x8F13; - public const int WRAP_BORDER_SUN = 0x81D4; - public const int WRITE_DISCARD_NV = 0x88BE; - public const int WRITE_ONLY = 0x88B9; - public const int WRITE_ONLY_ARB = 0x88B9; - public const int WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A; - public const int WRITE_PIXEL_DATA_RANGE_NV = 0x8878; - public const int WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C; - public const int W_EXT = 0x87D8; - public const int XOR = 0x1506; - public const int XOR_NV = 0x1506; - public const int X_EXT = 0x87D5; - public const int YCBAYCR8A_4224_NV = 0x9032; - public const int YCBCR_422_APPLE = 0x85B9; - public const int YCBCR_MESA = 0x8757; - public const int YCBYCR8_422_NV = 0x9031; - public const int YCRCBA_SGIX = 0x8319; - public const int YCRCB_422_SGIX = 0x81BB; - public const int YCRCB_444_SGIX = 0x81BC; - public const int YCRCB_SGIX = 0x8318; - public const int Y_EXT = 0x87D6; - public const int Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV = 0x9036; - public const int Z4Y12Z4CB12Z4CR12_444_NV = 0x9037; - public const int Z4Y12Z4CB12Z4Y12Z4CR12_422_NV = 0x9035; - public const int Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV = 0x9034; - public const int Z6Y10Z6CB10Z6Y10Z6CR10_422_NV = 0x9033; - public const int ZERO = 0; - public const int ZERO_EXT = 0x87DD; - public const int ZERO_TO_ONE = 0x935F; - public const int Z_EXT = 0x87D7; - - #endregion - } - - public static class glAttachment - { - - public const uint Depth = glConst.DEPTH_ATTACHMENT; - public const uint DepthAndStencil = glConst.DEPTH_STENCIL_ATTACHMENT; - public const uint Stencil = glConst.STENCIL_ATTACHMENT; - - public static uint Color(int i) - { - #if DEBUG - if ((i > OpenGLFunction.CurrentGL.AttachmentColorRange) || (i < 0)) - { - throw new ArgumentOutOfRangeException(); - } - #endif - return (uint)(glConst.COLOR_ATTACHMENT0 + i); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glConst" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Drawing; + +namespace StgSharp.Graphics.OpenGL +{ + // rename types in style of glConst + + public static unsafe class glConst + { + + #region glad + + public const int _1PASS_EXT = 0x80A1; + public const int _1PASS_SGIS = 0x80A1; + public const int _2PASS_0_EXT = 0x80A2; + public const int _2PASS_0_SGIS = 0x80A2; + public const int _2PASS_1_EXT = 0x80A3; + public const int _2PASS_1_SGIS = 0x80A3; + public const int _2X_BIT_ATI = 0x00000001; + public const int _422_AVERAGE_EXT = 0x80CE; + public const int _422_EXT = 0x80CC; + public const int _422_REV_AVERAGE_EXT = 0x80CF; + public const int _422_REV_EXT = 0x80CD; + public const int _4PASS_0_EXT = 0x80A4; + public const int _4PASS_0_SGIS = 0x80A4; + public const int _4PASS_1_EXT = 0x80A5; + public const int _4PASS_1_SGIS = 0x80A5; + public const int _4PASS_2_EXT = 0x80A6; + public const int _4PASS_2_SGIS = 0x80A6; + public const int _4PASS_3_EXT = 0x80A7; + public const int _4PASS_3_SGIS = 0x80A7; + public const int _4X_BIT_ATI = 0x00000002; + public const int _8X_BIT_ATI = 0x00000004; + public const int ABGR_EXT = 0x8000; + public const int ACCUM_ADJACENT_PAIRS_NV = 0x90AD; + public const int ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; + public const int ACTIVE_ATTRIBUTES = 0x8B89; + public const int ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; + public const int ACTIVE_PROGRAM = 0x8259; + public const int ACTIVE_PROGRAM_EXT = 0x8B8D; + public const int ACTIVE_RESOURCES = 0x92F5; + public const int ACTIVE_STENCIL_FACE_EXT = 0x8911; + public const int ACTIVE_SUBROUTINES = 0x8DE5; + public const int ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48; + public const int ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6; + public const int ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47; + public const int ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; + public const int ACTIVE_TEXTURE = 0x84E0; + public const int ACTIVE_TEXTURE_ARB = 0x84E0; + public const int ACTIVE_UNIFORMS = 0x8B86; + public const int ACTIVE_UNIFORM_BLOCKS = 0x8A36; + public const int ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35; + public const int ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; + public const int ACTIVE_VARIABLES = 0x9305; + public const int ACTIVE_VARYINGS_NV = 0x8C81; + public const int ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82; + public const int ACTIVE_VERTEX_UNITS_ARB = 0x86A5; + public const int ADD_ATI = 0x8963; + public const int ADD_SIGNED_ARB = 0x8574; + public const int ADD_SIGNED_EXT = 0x8574; + public const int ADJACENT_PAIRS_NV = 0x90AE; + public const int AFFINE_2D_NV = 0x9092; + public const int AFFINE_3D_NV = 0x9094; + public const int ALIASED_LINE_WIDTH_RANGE = 0x846E; + public const int ALLOW_DRAW_FRG_HINT_PGI = 0x1A210; + public const int ALLOW_DRAW_MEM_HINT_PGI = 0x1A211; + public const int ALLOW_DRAW_OBJ_HINT_PGI = 0x1A20E; + public const int ALLOW_DRAW_WIN_HINT_PGI = 0x1A20F; + public const uint ALL_BARRIER_BITS = 0xFFFFFFFF; + public const uint ALL_BARRIER_BITS_EXT = 0xFFFFFFFF; + public const int ALL_COMPLETED_NV = 0x84F2; + public const uint ALL_PIXELS_AMD = 0xFFFFFFFF; + public const uint ALL_SHADER_BITS = 0xFFFFFFFF; + public const int ALL_STATIC_DATA_IBM = 103060; + public const int ALPHA = 0x1906; + public const int ALPHA12_EXT = 0x803D; + public const int ALPHA16F_ARB = 0x881C; + public const int ALPHA16F_EXT = 0x881C; + public const int ALPHA16I_EXT = 0x8D8A; + public const int ALPHA16UI_EXT = 0x8D78; + public const int ALPHA16_EXT = 0x803E; + public const int ALPHA16_SNORM = 0x9018; + public const int ALPHA32F_ARB = 0x8816; + public const int ALPHA32F_EXT = 0x8816; + public const int ALPHA32I_EXT = 0x8D84; + public const int ALPHA32UI_EXT = 0x8D72; + public const int ALPHA4_EXT = 0x803B; + public const int ALPHA8I_EXT = 0x8D90; + public const int ALPHA8UI_EXT = 0x8D7E; + public const int ALPHA8_EXT = 0x803C; + public const int ALPHA8_SNORM = 0x9014; + public const int ALPHA_FLOAT16_APPLE = 0x881C; + public const int ALPHA_FLOAT16_ATI = 0x881C; + public const int ALPHA_FLOAT32_APPLE = 0x8816; + public const int ALPHA_FLOAT32_ATI = 0x8816; + public const int ALPHA_INTEGER_EXT = 0x8D97; + public const int ALPHA_MAX_CLAMP_INGR = 0x8567; + public const int ALPHA_MAX_SGIX = 0x8321; + public const int ALPHA_MIN_CLAMP_INGR = 0x8563; + public const int ALPHA_MIN_SGIX = 0x8320; + public const int ALPHA_REF_COMMAND_NV = 0x000F; + public const int ALPHA_SNORM = 0x9010; + public const int ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV = 0x934D; + public const int ALPHA_TO_COVERAGE_DITHER_DISABLE_NV = 0x934F; + public const int ALPHA_TO_COVERAGE_DITHER_ENABLE_NV = 0x934E; + public const int ALPHA_TO_COVERAGE_DITHER_MODE_NV = 0x92BF; + public const int ALREADY_SIGNALED = 0x911A; + public const int ALWAYS = 0x0207; + public const int ALWAYS_FAST_HINT_PGI = 0x1A20C; + public const int ALWAYS_SOFT_HINT_PGI = 0x1A20D; + public const int AND = 0x1501; + public const int AND_INVERTED = 0x1504; + public const int AND_REVERSE = 0x1502; + public const int ANY_SAMPLES_PASSED = 0x8C2F; + public const int ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; + public const int ARC_TO_NV = 0xFE; + public const int ARRAY_BUFFER = 0x8892; + public const int ARRAY_BUFFER_ARB = 0x8892; + public const int ARRAY_BUFFER_BINDING = 0x8894; + public const int ARRAY_BUFFER_BINDING_ARB = 0x8894; + public const int ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9; + public const int ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8; + public const int ARRAY_OBJECT_BUFFER_ATI = 0x8766; + public const int ARRAY_OBJECT_OFFSET_ATI = 0x8767; + public const int ARRAY_SIZE = 0x92FB; + public const int ARRAY_STRIDE = 0x92FE; + public const int ASYNC_DRAW_PIXELS_SGIX = 0x835D; + public const int ASYNC_HISTOGRAM_SGIX = 0x832C; + public const int ASYNC_MARKER_SGIX = 0x8329; + public const int ASYNC_READ_PIXELS_SGIX = 0x835E; + public const int ASYNC_TEX_IMAGE_SGIX = 0x835C; + public const int ATOMIC_COUNTER_BARRIER_BIT = 0x00001000; + public const int ATOMIC_COUNTER_BARRIER_BIT_EXT = 0x00001000; + public const int ATOMIC_COUNTER_BUFFER = 0x92C0; + public const int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5; + public const int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6; + public const int ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; + public const int ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4; + public const int ATOMIC_COUNTER_BUFFER_INDEX = 0x9301; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV = 0x959E; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV = 0x959F; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7; + public const int ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; + public const int ATOMIC_COUNTER_BUFFER_START = 0x92C2; + public const int ATTACHED_MEMORY_OBJECT_NV = 0x95A4; + public const int ATTACHED_MEMORY_OFFSET_NV = 0x95A5; + public const int ATTACHED_SHADERS = 0x8B85; + public const int ATTENUATION_EXT = 0x834D; + public const int ATTRIBUTE_ADDRESS_COMMAND_NV = 0x0009; + public const int ATTRIB_ARRAY_POINTER_NV = 0x8645; + public const int ATTRIB_ARRAY_SIZE_NV = 0x8623; + public const int ATTRIB_ARRAY_STRIDE_NV = 0x8624; + public const int ATTRIB_ARRAY_TYPE_NV = 0x8625; + public const int AUTO_GENERATE_MIPMAP = 0x8295; + public const int AUX_DEPTH_STENCIL_APPLE = 0x8A14; + public const int AVERAGE_EXT = 0x8335; + public const int AVERAGE_HP = 0x8160; + public const int BACK = 0x0405; + public const int BACK_LEFT = 0x0402; + public const int BACK_NORMALS_HINT_PGI = 0x1A223; + public const int BACK_PRIMARY_COLOR_NV = 0x8C77; + public const int BACK_RIGHT = 0x0403; + public const int BACK_SECONDARY_COLOR_NV = 0x8C78; + public const int BEVEL_NV = 0x90A6; + public const int BGR = 0x80E0; + public const int BGRA = 0x80E1; + public const int BGRA8_EXT = 0x93A1; + public const int BGRA_EXT = 0x80E1; + public const int BGRA_INTEGER = 0x8D9B; + public const int BGRA_INTEGER_EXT = 0x8D9B; + public const int BGR_EXT = 0x80E0; + public const int BGR_INTEGER = 0x8D9A; + public const int BGR_INTEGER_EXT = 0x8D9A; + public const int BIAS_BIT_ATI = 0x00000008; + public const int BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541; + public const int BINORMAL_ARRAY_EXT = 0x843A; + public const int BINORMAL_ARRAY_POINTER_EXT = 0x8443; + public const int BINORMAL_ARRAY_STRIDE_EXT = 0x8441; + public const int BINORMAL_ARRAY_TYPE_EXT = 0x8440; + public const int BLACKHOLE_RENDER_INTEL = 0x83FC; + public const int BLEND = 0x0BE2; + public const int BLEND_ADVANCED_COHERENT_KHR = 0x9285; + public const int BLEND_ADVANCED_COHERENT_NV = 0x9285; + public const int BLEND_COLOR = 0x8005; + public const int BLEND_COLOR_COMMAND_NV = 0x000B; + public const int BLEND_COLOR_EXT = 0x8005; + public const int BLEND_DST = 0x0BE0; + public const int BLEND_DST_ALPHA = 0x80CA; + public const int BLEND_DST_ALPHA_EXT = 0x80CA; + public const int BLEND_DST_RGB = 0x80C8; + public const int BLEND_DST_RGB_EXT = 0x80C8; + public const int BLEND_EQUATION = 0x8009; + public const int BLEND_EQUATION_ALPHA = 0x883D; + public const int BLEND_EQUATION_ALPHA_EXT = 0x883D; + public const int BLEND_EQUATION_EXT = 0x8009; + public const int BLEND_EQUATION_RGB = 0x8009; + public const int BLEND_EQUATION_RGB_EXT = 0x8009; + public const int BLEND_OVERLAP_NV = 0x9281; + public const int BLEND_PREMULTIPLIED_SRC_NV = 0x9280; + public const int BLEND_SRC = 0x0BE1; + public const int BLEND_SRC_ALPHA = 0x80CB; + public const int BLEND_SRC_ALPHA_EXT = 0x80CB; + public const int BLEND_SRC_RGB = 0x80C9; + public const int BLEND_SRC_RGB_EXT = 0x80C9; + public const int BLOCK_INDEX = 0x92FD; + public const int BLUE = 0x1905; + public const int BLUE_BIT_ATI = 0x00000004; + public const int BLUE_INTEGER = 0x8D96; + public const int BLUE_INTEGER_EXT = 0x8D96; + public const int BLUE_MAX_CLAMP_INGR = 0x8566; + public const int BLUE_MIN_CLAMP_INGR = 0x8562; + public const int BLUE_NV = 0x1905; + public const int BOLD_BIT_NV = 0x01; + public const int BOOL = 0x8B56; + public const int BOOL_ARB = 0x8B56; + public const int BOOL_VEC2 = 0x8B57; + public const int BOOL_VEC2_ARB = 0x8B57; + public const int BOOL_VEC3 = 0x8B58; + public const int BOOL_VEC3_ARB = 0x8B58; + public const int BOOL_VEC4 = 0x8B59; + public const int BOOL_VEC4_ARB = 0x8B59; + public const int BOUNDING_BOX_NV = 0x908D; + public const int BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C; + public const int BUFFER = 0x82E0; + public const int BUFFER_ACCESS = 0x88BB; + public const int BUFFER_ACCESS_ARB = 0x88BB; + public const int BUFFER_ACCESS_FLAGS = 0x911F; + public const int BUFFER_BINDING = 0x9302; + public const int BUFFER_DATA_SIZE = 0x9303; + public const int BUFFER_FLUSHING_UNMAP_APPLE = 0x8A13; + public const int BUFFER_GPU_ADDRESS_NV = 0x8F1D; + public const int BUFFER_IMMUTABLE_STORAGE = 0x821F; + public const int BUFFER_MAPPED = 0x88BC; + public const int BUFFER_MAPPED_ARB = 0x88BC; + public const int BUFFER_MAP_LENGTH = 0x9120; + public const int BUFFER_MAP_OFFSET = 0x9121; + public const int BUFFER_MAP_POINTER = 0x88BD; + public const int BUFFER_MAP_POINTER_ARB = 0x88BD; + public const int BUFFER_OBJECT_APPLE = 0x85B3; + public const int BUFFER_OBJECT_EXT = 0x9151; + public const int BUFFER_SERIALIZED_MODIFY_APPLE = 0x8A12; + public const int BUFFER_SIZE = 0x8764; + public const int BUFFER_SIZE_ARB = 0x8764; + public const int BUFFER_STORAGE_FLAGS = 0x8220; + public const int BUFFER_UPDATE_BARRIER_BIT = 0x00000200; + public const int BUFFER_UPDATE_BARRIER_BIT_EXT = 0x00000200; + public const int BUFFER_USAGE = 0x8765; + public const int BUFFER_USAGE_ARB = 0x8765; + public const int BUFFER_VARIABLE = 0x92E5; + public const int BUMP_ENVMAP_ATI = 0x877B; + public const int BUMP_NUM_TEX_UNITS_ATI = 0x8777; + public const int BUMP_ROT_MATRIX_ATI = 0x8775; + public const int BUMP_ROT_MATRIX_SIZE_ATI = 0x8776; + public const int BUMP_TARGET_ATI = 0x877C; + public const int BUMP_TEX_UNITS_ATI = 0x8778; + public const int BYTE = 0x1400; + public const int CALLIGRAPHIC_FRAGMENT_SGIX = 0x8183; + public const int CAVEAT_SUPPORT = 0x82B8; + public const int CCW = 0x0901; + public const int CIRCULAR_CCW_ARC_TO_NV = 0xF8; + public const int CIRCULAR_CW_ARC_TO_NV = 0xFA; + public const int CIRCULAR_TANGENT_ARC_TO_NV = 0xFC; + public const int CLAMP_FRAGMENT_COLOR_ARB = 0x891B; + public const int CLAMP_READ_COLOR = 0x891C; + public const int CLAMP_READ_COLOR_ARB = 0x891C; + public const int CLAMP_TO_BORDER = 0x812D; + public const int CLAMP_TO_BORDER_ARB = 0x812D; + public const int CLAMP_TO_BORDER_SGIS = 0x812D; + public const int CLAMP_TO_EDGE = 0x812F; + public const int CLAMP_TO_EDGE_SGIS = 0x812F; + public const int CLAMP_VERTEX_COLOR_ARB = 0x891A; + public const int CLEAR = 0x1500; + public const int CLEAR_BUFFER = 0x82B4; + public const int CLEAR_TEXTURE = 0x9365; + public const int CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1; + public const int CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000; + public const int CLIENT_STORAGE_BIT = 0x0200; + public const int CLIPPING_INPUT_PRIMITIVES = 0x82F6; + public const int CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6; + public const int CLIPPING_OUTPUT_PRIMITIVES = 0x82F7; + public const int CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7; + public const int CLIP_DEPTH_MODE = 0x935D; + public const int CLIP_DISTANCE0 = 0x3000; + public const int CLIP_DISTANCE1 = 0x3001; + public const int CLIP_DISTANCE2 = 0x3002; + public const int CLIP_DISTANCE3 = 0x3003; + public const int CLIP_DISTANCE4 = 0x3004; + public const int CLIP_DISTANCE5 = 0x3005; + public const int CLIP_DISTANCE6 = 0x3006; + public const int CLIP_DISTANCE7 = 0x3007; + public const int CLIP_DISTANCE_NV = 0x8C7A; + public const int CLIP_FAR_HINT_PGI = 0x1A221; + public const int CLIP_NEAR_HINT_PGI = 0x1A220; + public const int CLIP_ORIGIN = 0x935C; + public const int CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0; + public const int CLOSE_PATH_NV = 0x00; + public const int CMYKA_EXT = 0x800D; + public const int CMYK_EXT = 0x800C; + public const int CND0_ATI = 0x896B; + public const int CND_ATI = 0x896A; + public const int COLOR = 0x1800; + public const int COLOR3_BIT_PGI = 0x00010000; + public const int COLOR4_BIT_PGI = 0x00020000; + public const int COLORBURN_KHR = 0x929A; + public const int COLORBURN_NV = 0x929A; + public const int COLORDODGE_KHR = 0x9299; + public const int COLORDODGE_NV = 0x9299; + public const int COLOR_ALPHA_PAIRING_ATI = 0x8975; + public const int COLOR_ARRAY_ADDRESS_NV = 0x8F23; + public const int COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898; + public const int COLOR_ARRAY_COUNT_EXT = 0x8084; + public const int COLOR_ARRAY_EXT = 0x8076; + public const int COLOR_ARRAY_LENGTH_NV = 0x8F2D; + public const int COLOR_ARRAY_LIST_IBM = 103072; + public const int COLOR_ARRAY_LIST_STRIDE_IBM = 103082; + public const int COLOR_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F7; + public const int COLOR_ARRAY_POINTER_EXT = 0x8090; + public const int COLOR_ARRAY_SIZE_EXT = 0x8081; + public const int COLOR_ARRAY_STRIDE_EXT = 0x8083; + public const int COLOR_ARRAY_TYPE_EXT = 0x8082; + public const int COLOR_ATTACHMENT0 = 0x8CE0; + public const int COLOR_ATTACHMENT0_EXT = 0x8CE0; + public const int COLOR_ATTACHMENT1 = 0x8CE1; + public const int COLOR_ATTACHMENT10 = 0x8CEA; + public const int COLOR_ATTACHMENT10_EXT = 0x8CEA; + public const int COLOR_ATTACHMENT11 = 0x8CEB; + public const int COLOR_ATTACHMENT11_EXT = 0x8CEB; + public const int COLOR_ATTACHMENT12 = 0x8CEC; + public const int COLOR_ATTACHMENT12_EXT = 0x8CEC; + public const int COLOR_ATTACHMENT13 = 0x8CED; + public const int COLOR_ATTACHMENT13_EXT = 0x8CED; + public const int COLOR_ATTACHMENT14 = 0x8CEE; + public const int COLOR_ATTACHMENT14_EXT = 0x8CEE; + public const int COLOR_ATTACHMENT15 = 0x8CEF; + public const int COLOR_ATTACHMENT15_EXT = 0x8CEF; + public const int COLOR_ATTACHMENT16 = 0x8CF0; + public const int COLOR_ATTACHMENT17 = 0x8CF1; + public const int COLOR_ATTACHMENT18 = 0x8CF2; + public const int COLOR_ATTACHMENT19 = 0x8CF3; + public const int COLOR_ATTACHMENT1_EXT = 0x8CE1; + public const int COLOR_ATTACHMENT2 = 0x8CE2; + public const int COLOR_ATTACHMENT20 = 0x8CF4; + public const int COLOR_ATTACHMENT21 = 0x8CF5; + public const int COLOR_ATTACHMENT22 = 0x8CF6; + public const int COLOR_ATTACHMENT23 = 0x8CF7; + public const int COLOR_ATTACHMENT24 = 0x8CF8; + public const int COLOR_ATTACHMENT25 = 0x8CF9; + public const int COLOR_ATTACHMENT26 = 0x8CFA; + public const int COLOR_ATTACHMENT27 = 0x8CFB; + public const int COLOR_ATTACHMENT28 = 0x8CFC; + public const int COLOR_ATTACHMENT29 = 0x8CFD; + public const int COLOR_ATTACHMENT2_EXT = 0x8CE2; + public const int COLOR_ATTACHMENT3 = 0x8CE3; + public const int COLOR_ATTACHMENT30 = 0x8CFE; + public const int COLOR_ATTACHMENT31 = 0x8CFF; + public const int COLOR_ATTACHMENT3_EXT = 0x8CE3; + public const int COLOR_ATTACHMENT4 = 0x8CE4; + public const int COLOR_ATTACHMENT4_EXT = 0x8CE4; + public const int COLOR_ATTACHMENT5 = 0x8CE5; + public const int COLOR_ATTACHMENT5_EXT = 0x8CE5; + public const int COLOR_ATTACHMENT6 = 0x8CE6; + public const int COLOR_ATTACHMENT6_EXT = 0x8CE6; + public const int COLOR_ATTACHMENT7 = 0x8CE7; + public const int COLOR_ATTACHMENT7_EXT = 0x8CE7; + public const int COLOR_ATTACHMENT8 = 0x8CE8; + public const int COLOR_ATTACHMENT8_EXT = 0x8CE8; + public const int COLOR_ATTACHMENT9 = 0x8CE9; + public const int COLOR_ATTACHMENT9_EXT = 0x8CE9; + public const int COLOR_BUFFER_BIT = 0x00004000; + public const int COLOR_CLEAR_UNCLAMPED_VALUE_ATI = 0x8835; + public const int COLOR_CLEAR_VALUE = 0x0C22; + public const int COLOR_COMPONENTS = 0x8283; + public const int COLOR_ENCODING = 0x8296; + public const int COLOR_FLOAT_APPLE = 0x8A0F; + public const int COLOR_INDEX12_EXT = 0x80E6; + public const int COLOR_INDEX16_EXT = 0x80E7; + public const int COLOR_INDEX1_EXT = 0x80E2; + public const int COLOR_INDEX2_EXT = 0x80E3; + public const int COLOR_INDEX4_EXT = 0x80E4; + public const int COLOR_INDEX8_EXT = 0x80E5; + public const int COLOR_LOGIC_OP = 0x0BF2; + public const int COLOR_MATRIX_SGI = 0x80B1; + public const int COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B2; + public const int COLOR_RENDERABLE = 0x8286; + public const int COLOR_SAMPLES_NV = 0x8E20; + public const int COLOR_SUM_ARB = 0x8458; + public const int COLOR_SUM_CLAMP_NV = 0x854F; + public const int COLOR_SUM_EXT = 0x8458; + public const int COLOR_TABLE_ALPHA_SIZE_SGI = 0x80DD; + public const int COLOR_TABLE_BIAS_SGI = 0x80D7; + public const int COLOR_TABLE_BLUE_SIZE_SGI = 0x80DC; + public const int COLOR_TABLE_FORMAT_SGI = 0x80D8; + public const int COLOR_TABLE_GREEN_SIZE_SGI = 0x80DB; + public const int COLOR_TABLE_INTENSITY_SIZE_SGI = 0x80DF; + public const int COLOR_TABLE_LUMINANCE_SIZE_SGI = 0x80DE; + public const int COLOR_TABLE_RED_SIZE_SGI = 0x80DA; + public const int COLOR_TABLE_SCALE_SGI = 0x80D6; + public const int COLOR_TABLE_SGI = 0x80D0; + public const int COLOR_TABLE_WIDTH_SGI = 0x80D9; + public const int COLOR_WRITEMASK = 0x0C23; + public const int COMBINE4_NV = 0x8503; + public const int COMBINER0_NV = 0x8550; + public const int COMBINER1_NV = 0x8551; + public const int COMBINER2_NV = 0x8552; + public const int COMBINER3_NV = 0x8553; + public const int COMBINER4_NV = 0x8554; + public const int COMBINER5_NV = 0x8555; + public const int COMBINER6_NV = 0x8556; + public const int COMBINER7_NV = 0x8557; + public const int COMBINER_AB_DOT_PRODUCT_NV = 0x8545; + public const int COMBINER_AB_OUTPUT_NV = 0x854A; + public const int COMBINER_BIAS_NV = 0x8549; + public const int COMBINER_CD_DOT_PRODUCT_NV = 0x8546; + public const int COMBINER_CD_OUTPUT_NV = 0x854B; + public const int COMBINER_COMPONENT_USAGE_NV = 0x8544; + public const int COMBINER_INPUT_NV = 0x8542; + public const int COMBINER_MAPPING_NV = 0x8543; + public const int COMBINER_MUX_SUM_NV = 0x8547; + public const int COMBINER_SCALE_NV = 0x8548; + public const int COMBINER_SUM_OUTPUT_NV = 0x854C; + public const int COMBINE_ALPHA_ARB = 0x8572; + public const int COMBINE_ALPHA_EXT = 0x8572; + public const int COMBINE_ARB = 0x8570; + public const int COMBINE_EXT = 0x8570; + public const int COMBINE_RGB_ARB = 0x8571; + public const int COMBINE_RGB_EXT = 0x8571; + public const int COMMAND_BARRIER_BIT = 0x00000040; + public const int COMMAND_BARRIER_BIT_EXT = 0x00000040; + public const int COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E; + public const int COMPARE_REF_TO_TEXTURE = 0x884E; + public const int COMPARE_R_TO_TEXTURE_ARB = 0x884E; + public const int COMPATIBLE_SUBROUTINES = 0x8E4B; + public const int COMPILE_STATUS = 0x8B81; + public const int COMPLETION_STATUS_ARB = 0x91B1; + public const int COMPLETION_STATUS_KHR = 0x91B1; + public const int COMPRESSED_ALPHA_ARB = 0x84E9; + public const int COMPRESSED_INTENSITY_ARB = 0x84EC; + public const int COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB; + public const int COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C72; + public const int COMPRESSED_LUMINANCE_ARB = 0x84EA; + public const int COMPRESSED_LUMINANCE_LATC1_EXT = 0x8C70; + public const int COMPRESSED_R11_EAC = 0x9270; + public const int COMPRESSED_RED = 0x8225; + public const int COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD; + public const int COMPRESSED_RED_RGTC1 = 0x8DBB; + public const int COMPRESSED_RED_RGTC1_EXT = 0x8DBB; + public const int COMPRESSED_RG = 0x8226; + public const int COMPRESSED_RG11_EAC = 0x9272; + public const int COMPRESSED_RGB = 0x84ED; + public const int COMPRESSED_RGB8_ETC2 = 0x9274; + public const int COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276; + public const int COMPRESSED_RGBA = 0x84EE; + public const int COMPRESSED_RGBA8_ETC2_EAC = 0x9278; + public const int COMPRESSED_RGBA_ARB = 0x84EE; + public const int COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB; + public const int COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8; + public const int COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9; + public const int COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA; + public const int COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC; + public const int COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD; + public const int COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0; + public const int COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1; + public const int COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2; + public const int COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3; + public const int COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4; + public const int COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5; + public const int COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6; + public const int COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7; + public const int COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C; + public const int COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C; + public const int COMPRESSED_RGBA_FXT1_3DFX = 0x86B1; + public const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; + public const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; + public const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; + public const int COMPRESSED_RGB_ARB = 0x84ED; + public const int COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E; + public const int COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E; + public const int COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; + public const int COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F; + public const int COMPRESSED_RGB_FXT1_3DFX = 0x86B0; + public const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; + public const int COMPRESSED_RG_RGTC2 = 0x8DBD; + public const int COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C73; + public const int COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT = 0x8C71; + public const int COMPRESSED_SIGNED_R11_EAC = 0x9271; + public const int COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE; + public const int COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC; + public const int COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC; + public const int COMPRESSED_SIGNED_RG11_EAC = 0x9273; + public const int COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; + public const int COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B; + public const int COMPRESSED_SLUMINANCE_EXT = 0x8C4A; + public const int COMPRESSED_SRGB = 0x8C48; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7; + public const int COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279; + public const int COMPRESSED_SRGB8_ETC2 = 0x9275; + public const int COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277; + public const int COMPRESSED_SRGB_ALPHA = 0x8C49; + public const int COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D; + public const int COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D; + public const int COMPRESSED_SRGB_ALPHA_EXT = 0x8C49; + public const int COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D; + public const int COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E; + public const int COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F; + public const int COMPRESSED_SRGB_EXT = 0x8C48; + public const int COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C; + public const int COMPRESSED_TEXTURE_FORMATS = 0x86A3; + public const int COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; + public const int COMPUTE_PROGRAM_NV = 0x90FB; + public const int COMPUTE_PROGRAM_PARAMETER_BUFFER_NV = 0x90FC; + public const int COMPUTE_SHADER = 0x91B9; + public const int COMPUTE_SHADER_BIT = 0x00000020; + public const int COMPUTE_SHADER_INVOCATIONS = 0x82F5; + public const int COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5; + public const int COMPUTE_SUBROUTINE = 0x92ED; + public const int COMPUTE_SUBROUTINE_UNIFORM = 0x92F3; + public const int COMPUTE_TEXTURE = 0x82A0; + public const int COMPUTE_WORK_GROUP_SIZE = 0x8267; + public const int COMP_BIT_ATI = 0x00000002; + public const int CONDITION_SATISFIED = 0x911C; + public const int CONFORMANT_NV = 0x9374; + public const int CONIC_CURVE_TO_NV = 0x1A; + public const int CONJOINT_NV = 0x9284; + public const int CONSERVATIVE_RASTERIZATION_INTEL = 0x83FE; + public const int CONSERVATIVE_RASTERIZATION_NV = 0x9346; + public const int CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = 0x937B; + public const int CONSERVATIVE_RASTER_DILATE_NV = 0x9379; + public const int CONSERVATIVE_RASTER_DILATE_RANGE_NV = 0x937A; + public const int CONSERVATIVE_RASTER_MODE_NV = 0x954D; + public const int CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = 0x954E; + public const int CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = 0x9550; + public const int CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = 0x954F; + public const int CONSERVE_MEMORY_HINT_PGI = 0x1A1FD; + public const int CONSTANT_ALPHA = 0x8003; + public const int CONSTANT_ALPHA_EXT = 0x8003; + public const int CONSTANT_ARB = 0x8576; + public const int CONSTANT_BORDER_HP = 0x8151; + public const int CONSTANT_COLOR = 0x8001; + public const int CONSTANT_COLOR0_NV = 0x852A; + public const int CONSTANT_COLOR1_NV = 0x852B; + public const int CONSTANT_COLOR_EXT = 0x8001; + public const int CONSTANT_EXT = 0x8576; + public const int CONST_EYE_NV = 0x86E5; + public const int CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002; + public const int CONTEXT_CORE_PROFILE_BIT = 0x00000001; + public const int CONTEXT_FLAGS = 0x821E; + public const int CONTEXT_FLAG_DEBUG_BIT = 0x00000002; + public const int CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001; + public const int CONTEXT_FLAG_NO_ERROR_BIT = 0x00000008; + public const int CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x00000008; + public const int CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004; + public const int CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004; + public const int CONTEXT_LOST = 0x0507; + public const int CONTEXT_PROFILE_MASK = 0x9126; + public const int CONTEXT_RELEASE_BEHAVIOR = 0x82FB; + public const int CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; + public const int CONTEXT_ROBUST_ACCESS = 0x90F3; + public const int CONTINUOUS_AMD = 0x9007; + public const int CONTRAST_NV = 0x92A1; + public const int CONVEX_HULL_NV = 0x908B; + public const int CONVOLUTION_1D_EXT = 0x8010; + public const int CONVOLUTION_2D_EXT = 0x8011; + public const int CONVOLUTION_BORDER_COLOR_HP = 0x8154; + public const int CONVOLUTION_BORDER_MODE_EXT = 0x8013; + public const int CONVOLUTION_FILTER_BIAS_EXT = 0x8015; + public const int CONVOLUTION_FILTER_SCALE_EXT = 0x8014; + public const int CONVOLUTION_FORMAT_EXT = 0x8017; + public const int CONVOLUTION_HEIGHT_EXT = 0x8019; + public const int CONVOLUTION_HINT_SGIX = 0x8316; + public const int CONVOLUTION_WIDTH_EXT = 0x8018; + public const int CON_0_ATI = 0x8941; + public const int CON_10_ATI = 0x894B; + public const int CON_11_ATI = 0x894C; + public const int CON_12_ATI = 0x894D; + public const int CON_13_ATI = 0x894E; + public const int CON_14_ATI = 0x894F; + public const int CON_15_ATI = 0x8950; + public const int CON_16_ATI = 0x8951; + public const int CON_17_ATI = 0x8952; + public const int CON_18_ATI = 0x8953; + public const int CON_19_ATI = 0x8954; + public const int CON_1_ATI = 0x8942; + public const int CON_20_ATI = 0x8955; + public const int CON_21_ATI = 0x8956; + public const int CON_22_ATI = 0x8957; + public const int CON_23_ATI = 0x8958; + public const int CON_24_ATI = 0x8959; + public const int CON_25_ATI = 0x895A; + public const int CON_26_ATI = 0x895B; + public const int CON_27_ATI = 0x895C; + public const int CON_28_ATI = 0x895D; + public const int CON_29_ATI = 0x895E; + public const int CON_2_ATI = 0x8943; + public const int CON_30_ATI = 0x895F; + public const int CON_31_ATI = 0x8960; + public const int CON_3_ATI = 0x8944; + public const int CON_4_ATI = 0x8945; + public const int CON_5_ATI = 0x8946; + public const int CON_6_ATI = 0x8947; + public const int CON_7_ATI = 0x8948; + public const int CON_8_ATI = 0x8949; + public const int CON_9_ATI = 0x894A; + public const int COORD_REPLACE_ARB = 0x8862; + public const int COORD_REPLACE_NV = 0x8862; + public const int COPY = 0x1503; + public const int COPY_INVERTED = 0x150C; + public const int COPY_READ_BUFFER = 0x8F36; + public const int COPY_READ_BUFFER_BINDING = 0x8F36; + public const int COPY_WRITE_BUFFER = 0x8F37; + public const int COPY_WRITE_BUFFER_BINDING = 0x8F37; + public const int COUNTER_RANGE_AMD = 0x8BC1; + public const int COUNTER_TYPE_AMD = 0x8BC0; + public const int COUNT_DOWN_NV = 0x9089; + public const int COUNT_UP_NV = 0x9088; + public const int COVERAGE_MODULATION_NV = 0x9332; + public const int COVERAGE_MODULATION_TABLE_NV = 0x9331; + public const int COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333; + public const int CUBIC_CURVE_TO_NV = 0x0C; + public const int CUBIC_EXT = 0x8334; + public const int CUBIC_HP = 0x815F; + public const int CULL_FACE = 0x0B44; + public const int CULL_FACE_MODE = 0x0B45; + public const int CULL_FRAGMENT_NV = 0x86E7; + public const int CULL_MODES_NV = 0x86E0; + public const int CULL_VERTEX_EXT = 0x81AA; + public const int CULL_VERTEX_EYE_POSITION_EXT = 0x81AB; + public const int CULL_VERTEX_IBM = 103050; + public const int CULL_VERTEX_OBJECT_POSITION_EXT = 0x81AC; + public const int CURRENT_ATTRIB_NV = 0x8626; + public const int CURRENT_BINORMAL_EXT = 0x843C; + public const int CURRENT_FOG_COORDINATE_EXT = 0x8453; + public const int CURRENT_MATRIX_ARB = 0x8641; + public const int CURRENT_MATRIX_INDEX_ARB = 0x8845; + public const int CURRENT_MATRIX_NV = 0x8641; + public const int CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; + public const int CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; + public const int CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865; + public const int CURRENT_PALETTE_MATRIX_ARB = 0x8843; + public const int CURRENT_PROGRAM = 0x8B8D; + public const int CURRENT_QUERY = 0x8865; + public const int CURRENT_QUERY_ARB = 0x8865; + public const int CURRENT_RASTER_NORMAL_SGIX = 0x8406; + public const int CURRENT_SECONDARY_COLOR_EXT = 0x8459; + public const int CURRENT_TANGENT_EXT = 0x843B; + public const int CURRENT_TIME_NV = 0x8E28; + public const int CURRENT_VERTEX_ATTRIB = 0x8626; + public const int CURRENT_VERTEX_ATTRIB_ARB = 0x8626; + public const int CURRENT_VERTEX_EXT = 0x87E2; + public const int CURRENT_VERTEX_WEIGHT_EXT = 0x850B; + public const int CURRENT_WEIGHT_ARB = 0x86A8; + public const int CW = 0x0900; + public const int D3D12_FENCE_VALUE_EXT = 0x9595; + public const int DARKEN_KHR = 0x9297; + public const int DARKEN_NV = 0x9297; + public const int DATA_BUFFER_AMD = 0x9151; + public const int DEBUG_CALLBACK_FUNCTION = 0x8244; + public const int DEBUG_CALLBACK_FUNCTION_ARB = 0x8244; + public const int DEBUG_CALLBACK_USER_PARAM = 0x8245; + public const int DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245; + public const int DEBUG_CATEGORY_API_ERROR_AMD = 0x9149; + public const int DEBUG_CATEGORY_APPLICATION_AMD = 0x914F; + public const int DEBUG_CATEGORY_DEPRECATION_AMD = 0x914B; + public const int DEBUG_CATEGORY_OTHER_AMD = 0x9150; + public const int DEBUG_CATEGORY_PERFORMANCE_AMD = 0x914D; + public const int DEBUG_CATEGORY_SHADER_COMPILER_AMD = 0x914E; + public const int DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD = 0x914C; + public const int DEBUG_CATEGORY_WINDOW_SYSTEM_AMD = 0x914A; + public const int DEBUG_GROUP_STACK_DEPTH = 0x826D; + public const int DEBUG_LOGGED_MESSAGES = 0x9145; + public const int DEBUG_LOGGED_MESSAGES_AMD = 0x9145; + public const int DEBUG_LOGGED_MESSAGES_ARB = 0x9145; + public const int DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243; + public const int DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243; + public const int DEBUG_OUTPUT = 0x92E0; + public const int DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; + public const int DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242; + public const int DEBUG_SEVERITY_HIGH = 0x9146; + public const int DEBUG_SEVERITY_HIGH_AMD = 0x9146; + public const int DEBUG_SEVERITY_HIGH_ARB = 0x9146; + public const int DEBUG_SEVERITY_LOW = 0x9148; + public const int DEBUG_SEVERITY_LOW_AMD = 0x9148; + public const int DEBUG_SEVERITY_LOW_ARB = 0x9148; + public const int DEBUG_SEVERITY_MEDIUM = 0x9147; + public const int DEBUG_SEVERITY_MEDIUM_AMD = 0x9147; + public const int DEBUG_SEVERITY_MEDIUM_ARB = 0x9147; + public const int DEBUG_SEVERITY_NOTIFICATION = 0x826B; + public const int DEBUG_SOURCE_API = 0x8246; + public const int DEBUG_SOURCE_API_ARB = 0x8246; + public const int DEBUG_SOURCE_APPLICATION = 0x824A; + public const int DEBUG_SOURCE_APPLICATION_ARB = 0x824A; + public const int DEBUG_SOURCE_OTHER = 0x824B; + public const int DEBUG_SOURCE_OTHER_ARB = 0x824B; + public const int DEBUG_SOURCE_SHADER_COMPILER = 0x8248; + public const int DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248; + public const int DEBUG_SOURCE_THIRD_PARTY = 0x8249; + public const int DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249; + public const int DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247; + public const int DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247; + public const int DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D; + public const int DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D; + public const int DEBUG_TYPE_ERROR = 0x824C; + public const int DEBUG_TYPE_ERROR_ARB = 0x824C; + public const int DEBUG_TYPE_MARKER = 0x8268; + public const int DEBUG_TYPE_OTHER = 0x8251; + public const int DEBUG_TYPE_OTHER_ARB = 0x8251; + public const int DEBUG_TYPE_PERFORMANCE = 0x8250; + public const int DEBUG_TYPE_PERFORMANCE_ARB = 0x8250; + public const int DEBUG_TYPE_POP_GROUP = 0x826A; + public const int DEBUG_TYPE_PORTABILITY = 0x824F; + public const int DEBUG_TYPE_PORTABILITY_ARB = 0x824F; + public const int DEBUG_TYPE_PUSH_GROUP = 0x8269; + public const int DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E; + public const int DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E; + public const int DECODE_EXT = 0x8A49; + public const int DECR = 0x1E03; + public const int DECR_WRAP = 0x8508; + public const int DECR_WRAP_EXT = 0x8508; + public const int DEDICATED_MEMORY_OBJECT_EXT = 0x9581; + public const int DEFORMATIONS_MASK_SGIX = 0x8196; + public const int DELETE_STATUS = 0x8B80; + public const int DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9; + public const int DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA; + public const int DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858; + public const int DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859; + public const int DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A; + public const int DEPTH = 0x1801; + public const int DEPTH24_STENCIL8 = 0x88F0; + public const int DEPTH24_STENCIL8_EXT = 0x88F0; + public const int DEPTH32F_STENCIL8 = 0x8CAD; + public const int DEPTH32F_STENCIL8_NV = 0x8DAC; + public const int DEPTH_ATTACHMENT = 0x8D00; + public const int DEPTH_ATTACHMENT_EXT = 0x8D00; + public const int DEPTH_BOUNDS_EXT = 0x8891; + public const int DEPTH_BOUNDS_TEST_EXT = 0x8890; + public const int DEPTH_BUFFER_BIT = 0x00000100; + public const int DEPTH_BUFFER_FLOAT_MODE_NV = 0x8DAF; + public const int DEPTH_CLAMP = 0x864F; + public const int DEPTH_CLAMP_FAR_AMD = 0x901F; + public const int DEPTH_CLAMP_NEAR_AMD = 0x901E; + public const int DEPTH_CLAMP_NV = 0x864F; + public const int DEPTH_CLEAR_VALUE = 0x0B73; + public const int DEPTH_COMPONENT = 0x1902; + public const int DEPTH_COMPONENT16 = 0x81A5; + public const int DEPTH_COMPONENT16_ARB = 0x81A5; + public const int DEPTH_COMPONENT16_SGIX = 0x81A5; + public const int DEPTH_COMPONENT24 = 0x81A6; + public const int DEPTH_COMPONENT24_ARB = 0x81A6; + public const int DEPTH_COMPONENT24_SGIX = 0x81A6; + public const int DEPTH_COMPONENT32 = 0x81A7; + public const int DEPTH_COMPONENT32F = 0x8CAC; + public const int DEPTH_COMPONENT32F_NV = 0x8DAB; + public const int DEPTH_COMPONENT32_ARB = 0x81A7; + public const int DEPTH_COMPONENT32_SGIX = 0x81A7; + public const int DEPTH_COMPONENTS = 0x8284; + public const int DEPTH_FUNC = 0x0B74; + public const int DEPTH_RANGE = 0x0B70; + public const int DEPTH_RENDERABLE = 0x8287; + public const int DEPTH_SAMPLES_NV = 0x932D; + public const int DEPTH_STENCIL = 0x84F9; + public const int DEPTH_STENCIL_ATTACHMENT = 0x821A; + public const int DEPTH_STENCIL_EXT = 0x84F9; + public const int DEPTH_STENCIL_NV = 0x84F9; + public const int DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; + public const int DEPTH_STENCIL_TO_BGRA_NV = 0x886F; + public const int DEPTH_STENCIL_TO_RGBA_NV = 0x886E; + public const int DEPTH_TEST = 0x0B71; + public const int DEPTH_TEXTURE_MODE_ARB = 0x884B; + public const int DEPTH_WRITEMASK = 0x0B72; + public const int DETACHED_BUFFERS_NV = 0x95AB; + public const int DETACHED_MEMORY_INCARNATION_NV = 0x95A9; + public const int DETACHED_TEXTURES_NV = 0x95AA; + public const int DETAIL_TEXTURE_2D_BINDING_SGIS = 0x8096; + public const int DETAIL_TEXTURE_2D_SGIS = 0x8095; + public const int DETAIL_TEXTURE_FUNC_POINTS_SGIS = 0x809C; + public const int DETAIL_TEXTURE_LEVEL_SGIS = 0x809A; + public const int DETAIL_TEXTURE_MODE_SGIS = 0x809B; + public const int DEVICE_LUID_EXT = 0x9599; + public const int DEVICE_NODE_MASK_EXT = 0x959A; + public const int DEVICE_UUID_EXT = 0x9597; + public const int DIFFERENCE_KHR = 0x929E; + public const int DIFFERENCE_NV = 0x929E; + public const int DISCARD_ATI = 0x8763; + public const int DISCARD_NV = 0x8530; + public const int DISCRETE_AMD = 0x9006; + public const int DISJOINT_NV = 0x9283; + public const int DISPATCH_INDIRECT_BUFFER = 0x90EE; + public const int DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; + public const int DISTANCE_ATTENUATION_EXT = 0x8129; + public const int DISTANCE_ATTENUATION_SGIS = 0x8129; + public const int DITHER = 0x0BD0; + public const int DONT_CARE = 0x1100; + public const int DOT2_ADD_ATI = 0x896C; + public const int DOT3_ATI = 0x8966; + public const int DOT3_RGBA_ARB = 0x86AF; + public const int DOT3_RGBA_EXT = 0x8741; + public const int DOT3_RGB_ARB = 0x86AE; + public const int DOT3_RGB_EXT = 0x8740; + public const int DOT4_ATI = 0x8967; + public const int DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D; + public const int DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3; + public const int DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED; + public const int DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1; + public const int DOT_PRODUCT_NV = 0x86EC; + public const int DOT_PRODUCT_PASS_THROUGH_NV = 0x885B; + public const int DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2; + public const int DOT_PRODUCT_TEXTURE_1D_NV = 0x885C; + public const int DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE; + public const int DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF; + public const int DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0; + public const int DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E; + public const int DOUBLE = 0x140A; + public const int DOUBLEBUFFER = 0x0C32; + public const int DOUBLE_MAT2 = 0x8F46; + public const int DOUBLE_MAT2_EXT = 0x8F46; + public const int DOUBLE_MAT2x3 = 0x8F49; + public const int DOUBLE_MAT2x3_EXT = 0x8F49; + public const int DOUBLE_MAT2x4 = 0x8F4A; + public const int DOUBLE_MAT2x4_EXT = 0x8F4A; + public const int DOUBLE_MAT3 = 0x8F47; + public const int DOUBLE_MAT3_EXT = 0x8F47; + public const int DOUBLE_MAT3x2 = 0x8F4B; + public const int DOUBLE_MAT3x2_EXT = 0x8F4B; + public const int DOUBLE_MAT3x4 = 0x8F4C; + public const int DOUBLE_MAT3x4_EXT = 0x8F4C; + public const int DOUBLE_MAT4 = 0x8F48; + public const int DOUBLE_MAT4_EXT = 0x8F48; + public const int DOUBLE_MAT4x2 = 0x8F4D; + public const int DOUBLE_MAT4x2_EXT = 0x8F4D; + public const int DOUBLE_MAT4x3 = 0x8F4E; + public const int DOUBLE_MAT4x3_EXT = 0x8F4E; + public const int DOUBLE_VEC2 = 0x8FFC; + public const int DOUBLE_VEC2_EXT = 0x8FFC; + public const int DOUBLE_VEC3 = 0x8FFD; + public const int DOUBLE_VEC3_EXT = 0x8FFD; + public const int DOUBLE_VEC4 = 0x8FFE; + public const int DOUBLE_VEC4_EXT = 0x8FFE; + public const int DRAW_ARRAYS_COMMAND_NV = 0x0003; + public const int DRAW_ARRAYS_INSTANCED_COMMAND_NV = 0x0007; + public const int DRAW_ARRAYS_STRIP_COMMAND_NV = 0x0005; + public const int DRAW_BUFFER = 0x0C01; + public const int DRAW_BUFFER0 = 0x8825; + public const int DRAW_BUFFER0_ARB = 0x8825; + public const int DRAW_BUFFER0_ATI = 0x8825; + public const int DRAW_BUFFER1 = 0x8826; + public const int DRAW_BUFFER10 = 0x882F; + public const int DRAW_BUFFER10_ARB = 0x882F; + public const int DRAW_BUFFER10_ATI = 0x882F; + public const int DRAW_BUFFER11 = 0x8830; + public const int DRAW_BUFFER11_ARB = 0x8830; + public const int DRAW_BUFFER11_ATI = 0x8830; + public const int DRAW_BUFFER12 = 0x8831; + public const int DRAW_BUFFER12_ARB = 0x8831; + public const int DRAW_BUFFER12_ATI = 0x8831; + public const int DRAW_BUFFER13 = 0x8832; + public const int DRAW_BUFFER13_ARB = 0x8832; + public const int DRAW_BUFFER13_ATI = 0x8832; + public const int DRAW_BUFFER14 = 0x8833; + public const int DRAW_BUFFER14_ARB = 0x8833; + public const int DRAW_BUFFER14_ATI = 0x8833; + public const int DRAW_BUFFER15 = 0x8834; + public const int DRAW_BUFFER15_ARB = 0x8834; + public const int DRAW_BUFFER15_ATI = 0x8834; + public const int DRAW_BUFFER1_ARB = 0x8826; + public const int DRAW_BUFFER1_ATI = 0x8826; + public const int DRAW_BUFFER2 = 0x8827; + public const int DRAW_BUFFER2_ARB = 0x8827; + public const int DRAW_BUFFER2_ATI = 0x8827; + public const int DRAW_BUFFER3 = 0x8828; + public const int DRAW_BUFFER3_ARB = 0x8828; + public const int DRAW_BUFFER3_ATI = 0x8828; + public const int DRAW_BUFFER4 = 0x8829; + public const int DRAW_BUFFER4_ARB = 0x8829; + public const int DRAW_BUFFER4_ATI = 0x8829; + public const int DRAW_BUFFER5 = 0x882A; + public const int DRAW_BUFFER5_ARB = 0x882A; + public const int DRAW_BUFFER5_ATI = 0x882A; + public const int DRAW_BUFFER6 = 0x882B; + public const int DRAW_BUFFER6_ARB = 0x882B; + public const int DRAW_BUFFER6_ATI = 0x882B; + public const int DRAW_BUFFER7 = 0x882C; + public const int DRAW_BUFFER7_ARB = 0x882C; + public const int DRAW_BUFFER7_ATI = 0x882C; + public const int DRAW_BUFFER8 = 0x882D; + public const int DRAW_BUFFER8_ARB = 0x882D; + public const int DRAW_BUFFER8_ATI = 0x882D; + public const int DRAW_BUFFER9 = 0x882E; + public const int DRAW_BUFFER9_ARB = 0x882E; + public const int DRAW_BUFFER9_ATI = 0x882E; + public const int DRAW_ELEMENTS_COMMAND_NV = 0x0002; + public const int DRAW_ELEMENTS_INSTANCED_COMMAND_NV = 0x0006; + public const int DRAW_ELEMENTS_STRIP_COMMAND_NV = 0x0004; + public const int DRAW_FRAMEBUFFER = 0x8CA9; + public const int DRAW_FRAMEBUFFER_BINDING = 0x8CA6; + public const int DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6; + public const int DRAW_FRAMEBUFFER_EXT = 0x8CA9; + public const int DRAW_INDIRECT_ADDRESS_NV = 0x8F41; + public const int DRAW_INDIRECT_BUFFER = 0x8F3F; + public const int DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; + public const int DRAW_INDIRECT_LENGTH_NV = 0x8F42; + public const int DRAW_INDIRECT_UNIFIED_NV = 0x8F40; + public const int DRAW_PIXELS_APPLE = 0x8A0A; + public const int DRIVER_UUID_EXT = 0x9598; + public const int DSDT8_MAG8_INTENSITY8_NV = 0x870B; + public const int DSDT8_MAG8_NV = 0x870A; + public const int DSDT8_NV = 0x8709; + public const int DSDT_MAG_INTENSITY_NV = 0x86DC; + public const int DSDT_MAG_NV = 0x86F6; + public const int DSDT_MAG_VIB_NV = 0x86F7; + public const int DSDT_NV = 0x86F5; + public const int DST_ALPHA = 0x0304; + public const int DST_ATOP_NV = 0x928F; + public const int DST_COLOR = 0x0306; + public const int DST_IN_NV = 0x928B; + public const int DST_NV = 0x9287; + public const int DST_OUT_NV = 0x928D; + public const int DST_OVER_NV = 0x9289; + public const int DS_BIAS_NV = 0x8716; + public const int DS_SCALE_NV = 0x8710; + public const int DT_BIAS_NV = 0x8717; + public const int DT_SCALE_NV = 0x8711; + public const int DU8DV8_ATI = 0x877A; + public const int DUAL_ALPHA12_SGIS = 0x8112; + public const int DUAL_ALPHA16_SGIS = 0x8113; + public const int DUAL_ALPHA4_SGIS = 0x8110; + public const int DUAL_ALPHA8_SGIS = 0x8111; + public const int DUAL_INTENSITY12_SGIS = 0x811A; + public const int DUAL_INTENSITY16_SGIS = 0x811B; + public const int DUAL_INTENSITY4_SGIS = 0x8118; + public const int DUAL_INTENSITY8_SGIS = 0x8119; + public const int DUAL_LUMINANCE12_SGIS = 0x8116; + public const int DUAL_LUMINANCE16_SGIS = 0x8117; + public const int DUAL_LUMINANCE4_SGIS = 0x8114; + public const int DUAL_LUMINANCE8_SGIS = 0x8115; + public const int DUAL_LUMINANCE_ALPHA4_SGIS = 0x811C; + public const int DUAL_LUMINANCE_ALPHA8_SGIS = 0x811D; + public const int DUAL_TEXTURE_SELECT_SGIS = 0x8124; + public const int DUDV_ATI = 0x8779; + public const int DUP_FIRST_CUBIC_CURVE_TO_NV = 0xF2; + public const int DUP_LAST_CUBIC_CURVE_TO_NV = 0xF4; + public const int DYNAMIC_ATI = 0x8761; + public const int DYNAMIC_COPY = 0x88EA; + public const int DYNAMIC_COPY_ARB = 0x88EA; + public const int DYNAMIC_DRAW = 0x88E8; + public const int DYNAMIC_DRAW_ARB = 0x88E8; + public const int DYNAMIC_READ = 0x88E9; + public const int DYNAMIC_READ_ARB = 0x88E9; + public const int DYNAMIC_STORAGE_BIT = 0x0100; + public const int EDGEFLAG_BIT_PGI = 0x00040000; + public const int EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26; + public const int EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B; + public const int EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; + public const int EDGE_FLAG_ARRAY_EXT = 0x8079; + public const int EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30; + public const int EDGE_FLAG_ARRAY_LIST_IBM = 103075; + public const int EDGE_FLAG_ARRAY_LIST_STRIDE_IBM = 103085; + public const int EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; + public const int EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; + public const int EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C; + public const int EIGHTH_BIT_ATI = 0x00000020; + public const int ELEMENT_ADDRESS_COMMAND_NV = 0x0008; + public const int ELEMENT_ARRAY_ADDRESS_NV = 0x8F29; + public const int ELEMENT_ARRAY_APPLE = 0x8A0C; + public const int ELEMENT_ARRAY_ATI = 0x8768; + public const int ELEMENT_ARRAY_BARRIER_BIT = 0x00000002; + public const int ELEMENT_ARRAY_BARRIER_BIT_EXT = 0x00000002; + public const int ELEMENT_ARRAY_BUFFER = 0x8893; + public const int ELEMENT_ARRAY_BUFFER_ARB = 0x8893; + public const int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; + public const int ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895; + public const int ELEMENT_ARRAY_LENGTH_NV = 0x8F33; + public const int ELEMENT_ARRAY_POINTER_APPLE = 0x8A0E; + public const int ELEMENT_ARRAY_POINTER_ATI = 0x876A; + public const int ELEMENT_ARRAY_TYPE_APPLE = 0x8A0D; + public const int ELEMENT_ARRAY_TYPE_ATI = 0x8769; + public const int ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F; + public const int EMBOSS_CONSTANT_NV = 0x855E; + public const int EMBOSS_LIGHT_NV = 0x855D; + public const int EMBOSS_MAP_NV = 0x855F; + public const int EQUAL = 0x0202; + public const int EQUIV = 0x1509; + public const int EVAL_2D_NV = 0x86C0; + public const int EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5; + public const int EVAL_TRIANGULAR_2D_NV = 0x86C1; + public const int EVAL_VERTEX_ATTRIB0_NV = 0x86C6; + public const int EVAL_VERTEX_ATTRIB10_NV = 0x86D0; + public const int EVAL_VERTEX_ATTRIB11_NV = 0x86D1; + public const int EVAL_VERTEX_ATTRIB12_NV = 0x86D2; + public const int EVAL_VERTEX_ATTRIB13_NV = 0x86D3; + public const int EVAL_VERTEX_ATTRIB14_NV = 0x86D4; + public const int EVAL_VERTEX_ATTRIB15_NV = 0x86D5; + public const int EVAL_VERTEX_ATTRIB1_NV = 0x86C7; + public const int EVAL_VERTEX_ATTRIB2_NV = 0x86C8; + public const int EVAL_VERTEX_ATTRIB3_NV = 0x86C9; + public const int EVAL_VERTEX_ATTRIB4_NV = 0x86CA; + public const int EVAL_VERTEX_ATTRIB5_NV = 0x86CB; + public const int EVAL_VERTEX_ATTRIB6_NV = 0x86CC; + public const int EVAL_VERTEX_ATTRIB7_NV = 0x86CD; + public const int EVAL_VERTEX_ATTRIB8_NV = 0x86CE; + public const int EVAL_VERTEX_ATTRIB9_NV = 0x86CF; + public const int EXCLUSION_KHR = 0x92A0; + public const int EXCLUSION_NV = 0x92A0; + public const int EXCLUSIVE_EXT = 0x8F11; + public const int EXPAND_NEGATE_NV = 0x8539; + public const int EXPAND_NORMAL_NV = 0x8538; + public const int EXTENSIONS = 0x1F03; + public const int EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD = 0x9160; + public const int EYE_DISTANCE_TO_LINE_SGIS = 0x81F2; + public const int EYE_DISTANCE_TO_POINT_SGIS = 0x81F0; + public const int EYE_LINE_SGIS = 0x81F6; + public const int EYE_PLANE = 0x2502; + public const int EYE_PLANE_ABSOLUTE_NV = 0x855C; + public const int EYE_POINT_SGIS = 0x81F4; + public const int EYE_RADIAL_NV = 0x855B; + public const int E_TIMES_F_NV = 0x8531; + public const int FACTOR_MAX_AMD = 0x901D; + public const int FACTOR_MIN_AMD = 0x901C; + public const int FAILURE_NV = 0x9030; + public const int FALSE = 0; + public const int FASTEST = 0x1101; + public const int FENCE_APPLE = 0x8A0B; + public const int FENCE_CONDITION_NV = 0x84F4; + public const int FENCE_STATUS_NV = 0x84F3; + public const int FIELDS_NV = 0x8E27; + public const int FIELD_LOWER_NV = 0x9023; + public const int FIELD_UPPER_NV = 0x9022; + public const int FILE_NAME_NV = 0x9074; + public const int FILL = 0x1B02; + public const int FILL_RECTANGLE_NV = 0x933C; + public const int FILTER = 0x829A; + public const int FILTER4_SGIS = 0x8146; + public const int FIRST_TO_REST_NV = 0x90AF; + public const int FIRST_VERTEX_CONVENTION = 0x8E4D; + public const int FIRST_VERTEX_CONVENTION_EXT = 0x8E4D; + public const int FIXED = 0x140C; + public const int FIXED_OES = 0x140C; + public const int FIXED_ONLY = 0x891D; + public const int FIXED_ONLY_ARB = 0x891D; + public const int FLOAT = 0x1406; + public const int FLOAT16_MAT2_AMD = 0x91C5; + public const int FLOAT16_MAT2x3_AMD = 0x91C8; + public const int FLOAT16_MAT2x4_AMD = 0x91C9; + public const int FLOAT16_MAT3_AMD = 0x91C6; + public const int FLOAT16_MAT3x2_AMD = 0x91CA; + public const int FLOAT16_MAT3x4_AMD = 0x91CB; + public const int FLOAT16_MAT4_AMD = 0x91C7; + public const int FLOAT16_MAT4x2_AMD = 0x91CC; + public const int FLOAT16_MAT4x3_AMD = 0x91CD; + public const int FLOAT16_NV = 0x8FF8; + public const int FLOAT16_VEC2_NV = 0x8FF9; + public const int FLOAT16_VEC3_NV = 0x8FFA; + public const int FLOAT16_VEC4_NV = 0x8FFB; + public const int FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; + public const int FLOAT_32_UNSIGNED_INT_24_8_REV_NV = 0x8DAD; + public const int FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D; + public const int FLOAT_MAT2 = 0x8B5A; + public const int FLOAT_MAT2_ARB = 0x8B5A; + public const int FLOAT_MAT2x3 = 0x8B65; + public const int FLOAT_MAT2x4 = 0x8B66; + public const int FLOAT_MAT3 = 0x8B5B; + public const int FLOAT_MAT3_ARB = 0x8B5B; + public const int FLOAT_MAT3x2 = 0x8B67; + public const int FLOAT_MAT3x4 = 0x8B68; + public const int FLOAT_MAT4 = 0x8B5C; + public const int FLOAT_MAT4_ARB = 0x8B5C; + public const int FLOAT_MAT4x2 = 0x8B69; + public const int FLOAT_MAT4x3 = 0x8B6A; + public const int FLOAT_R16_NV = 0x8884; + public const int FLOAT_R32_NV = 0x8885; + public const int FLOAT_RG16_NV = 0x8886; + public const int FLOAT_RG32_NV = 0x8887; + public const int FLOAT_RGB16_NV = 0x8888; + public const int FLOAT_RGB32_NV = 0x8889; + public const int FLOAT_RGBA16_NV = 0x888A; + public const int FLOAT_RGBA32_NV = 0x888B; + public const int FLOAT_RGBA_MODE_NV = 0x888E; + public const int FLOAT_RGBA_NV = 0x8883; + public const int FLOAT_RGB_NV = 0x8882; + public const int FLOAT_RG_NV = 0x8881; + public const int FLOAT_R_NV = 0x8880; + public const int FLOAT_VEC2 = 0x8B50; + public const int FLOAT_VEC2_ARB = 0x8B50; + public const int FLOAT_VEC3 = 0x8B51; + public const int FLOAT_VEC3_ARB = 0x8B51; + public const int FLOAT_VEC4 = 0x8B52; + public const int FLOAT_VEC4_ARB = 0x8B52; + public const int FOG = 0x0B60; + public const int FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D; + public const int FOG_COORDINATE_ARRAY_EXT = 0x8457; + public const int FOG_COORDINATE_ARRAY_LIST_IBM = 103076; + public const int FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM = 103086; + public const int FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456; + public const int FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455; + public const int FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454; + public const int FOG_COORDINATE_EXT = 0x8451; + public const int FOG_COORDINATE_SOURCE_EXT = 0x8450; + public const int FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28; + public const int FOG_COORD_ARRAY_LENGTH_NV = 0x8F32; + public const int FOG_DISTANCE_MODE_NV = 0x855A; + public const int FOG_FUNC_POINTS_SGIS = 0x812B; + public const int FOG_FUNC_SGIS = 0x812A; + public const int FOG_OFFSET_SGIX = 0x8198; + public const int FOG_OFFSET_VALUE_SGIX = 0x8199; + public const int FOG_SPECULAR_TEXTURE_WIN = 0x80EC; + public const int FONT_ASCENDER_BIT_NV = 0x00200000; + public const int FONT_DESCENDER_BIT_NV = 0x00400000; + public const int FONT_GLYPHS_AVAILABLE_NV = 0x9368; + public const int FONT_HAS_KERNING_BIT_NV = 0x10000000; + public const int FONT_HEIGHT_BIT_NV = 0x00800000; + public const int FONT_MAX_ADVANCE_HEIGHT_BIT_NV = 0x02000000; + public const int FONT_MAX_ADVANCE_WIDTH_BIT_NV = 0x01000000; + public const int FONT_NUM_GLYPH_INDICES_BIT_NV = 0x20000000; + public const int FONT_TARGET_UNAVAILABLE_NV = 0x9369; + public const int FONT_UNAVAILABLE_NV = 0x936A; + public const int FONT_UNDERLINE_POSITION_BIT_NV = 0x04000000; + public const int FONT_UNDERLINE_THICKNESS_BIT_NV = 0x08000000; + public const int FONT_UNINTELLIGIBLE_NV = 0x936B; + public const int FONT_UNITS_PER_EM_BIT_NV = 0x00100000; + public const int FONT_X_MAX_BOUNDS_BIT_NV = 0x00040000; + public const int FONT_X_MIN_BOUNDS_BIT_NV = 0x00010000; + public const int FONT_Y_MAX_BOUNDS_BIT_NV = 0x00080000; + public const int FONT_Y_MIN_BOUNDS_BIT_NV = 0x00020000; + public const int FORCE_BLUE_TO_ONE_NV = 0x8860; + public const int FORMAT_SUBSAMPLE_244_244_OML = 0x8983; + public const int FORMAT_SUBSAMPLE_24_24_OML = 0x8982; + public const int FRACTIONAL_EVEN = 0x8E7C; + public const int FRACTIONAL_ODD = 0x8E7B; + public const int FRAGMENT_COLOR_EXT = 0x834C; + public const int FRAGMENT_COLOR_MATERIAL_FACE_SGIX = 0x8402; + public const int FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX = 0x8403; + public const int FRAGMENT_COLOR_MATERIAL_SGIX = 0x8401; + public const int FRAGMENT_COVERAGE_COLOR_NV = 0x92DE; + public const int FRAGMENT_COVERAGE_TO_COLOR_NV = 0x92DD; + public const int FRAGMENT_DEPTH_EXT = 0x8452; + public const int FRAGMENT_INPUT_NV = 0x936D; + public const int FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D; + public const int FRAGMENT_LIGHT0_SGIX = 0x840C; + public const int FRAGMENT_LIGHT1_SGIX = 0x840D; + public const int FRAGMENT_LIGHT2_SGIX = 0x840E; + public const int FRAGMENT_LIGHT3_SGIX = 0x840F; + public const int FRAGMENT_LIGHT4_SGIX = 0x8410; + public const int FRAGMENT_LIGHT5_SGIX = 0x8411; + public const int FRAGMENT_LIGHT6_SGIX = 0x8412; + public const int FRAGMENT_LIGHT7_SGIX = 0x8413; + public const int FRAGMENT_LIGHTING_SGIX = 0x8400; + public const int FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX = 0x840A; + public const int FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX = 0x8408; + public const int FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX = 0x840B; + public const int FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX = 0x8409; + public const int FRAGMENT_MATERIAL_EXT = 0x8349; + public const int FRAGMENT_NORMAL_EXT = 0x834A; + public const int FRAGMENT_PROGRAM_ARB = 0x8804; + public const int FRAGMENT_PROGRAM_BINDING_NV = 0x8873; + public const int FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV = 0x8E5D; + public const int FRAGMENT_PROGRAM_NV = 0x8870; + public const int FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA4; + public const int FRAGMENT_SHADER = 0x8B30; + public const int FRAGMENT_SHADER_ARB = 0x8B30; + public const int FRAGMENT_SHADER_ATI = 0x8920; + public const int FRAGMENT_SHADER_BIT = 0x00000002; + public const int FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; + public const int FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B; + public const int FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52; + public const int FRAGMENT_SHADER_INVOCATIONS = 0x82F4; + public const int FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4; + public const int FRAGMENT_SUBROUTINE = 0x92EC; + public const int FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2; + public const int FRAGMENT_TEXTURE = 0x829F; + public const int FRAMEBUFFER = 0x8D40; + public const int FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215; + public const int FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214; + public const int FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210; + public const int FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211; + public const int FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216; + public const int FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213; + public const int FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7; + public const int FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = 0x8DA7; + public const int FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 0x8DA7; + public const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; + public const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1; + public const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; + public const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0; + public const int FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212; + public const int FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630; + public const int FRAMEBUFFER_BARRIER_BIT = 0x00000400; + public const int FRAMEBUFFER_BARRIER_BIT_EXT = 0x00000400; + public const int FRAMEBUFFER_BINDING = 0x8CA6; + public const int FRAMEBUFFER_BINDING_EXT = 0x8CA6; + public const int FRAMEBUFFER_BLEND = 0x828B; + public const int FRAMEBUFFER_COMPLETE = 0x8CD5; + public const int FRAMEBUFFER_COMPLETE_EXT = 0x8CD5; + public const int FRAMEBUFFER_DEFAULT = 0x8218; + public const int FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; + public const int FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311; + public const int FRAMEBUFFER_DEFAULT_LAYERS = 0x9312; + public const int FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313; + public const int FRAMEBUFFER_DEFAULT_WIDTH = 0x9310; + public const int FRAMEBUFFER_EXT = 0x8D40; + public const int FRAMEBUFFER_FLIP_X_MESA = 0x8BBC; + public const int FRAMEBUFFER_FLIP_Y_MESA = 0x8BBB; + public const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; + public const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6; + public const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9; + public const int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB; + public const int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB; + public const int FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = 0x8DA9; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT = 0x8DA9; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = 0x8DA8; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 0x8DA8; + public const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; + public const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7; + public const int FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56; + public const int FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56; + public const int FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC; + public const int FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC; + public const int FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633; + public const int FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = 0x9342; + public const int FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = 0x9342; + public const int FRAMEBUFFER_RENDERABLE = 0x8289; + public const int FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A; + public const int FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = 0x9343; + public const int FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = 0x9343; + public const int FRAMEBUFFER_SRGB = 0x8DB9; + public const int FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8DBA; + public const int FRAMEBUFFER_SRGB_EXT = 0x8DB9; + public const int FRAMEBUFFER_SWAP_XY_MESA = 0x8BBD; + public const int FRAMEBUFFER_UNDEFINED = 0x8219; + public const int FRAMEBUFFER_UNSUPPORTED = 0x8CDD; + public const int FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD; + public const int FRAMEZOOM_FACTOR_SGIX = 0x818C; + public const int FRAMEZOOM_SGIX = 0x818B; + public const int FRAME_NV = 0x8E26; + public const int FRONT = 0x0404; + public const int FRONT_AND_BACK = 0x0408; + public const int FRONT_FACE = 0x0B46; + public const int FRONT_FACE_COMMAND_NV = 0x0012; + public const int FRONT_LEFT = 0x0400; + public const int FRONT_RIGHT = 0x0401; + public const int FULL_RANGE_EXT = 0x87E1; + public const int FULL_STIPPLE_HINT_PGI = 0x1A219; + public const int FULL_SUPPORT = 0x82B7; + public const int FUNC_ADD = 0x8006; + public const int FUNC_ADD_EXT = 0x8006; + public const int FUNC_REVERSE_SUBTRACT = 0x800B; + public const int FUNC_REVERSE_SUBTRACT_EXT = 0x800B; + public const int FUNC_SUBTRACT = 0x800A; + public const int FUNC_SUBTRACT_EXT = 0x800A; + public const int GENERATE_MIPMAP_HINT_SGIS = 0x8192; + public const int GENERATE_MIPMAP_SGIS = 0x8191; + public const int GENERIC_ATTRIB_NV = 0x8C7D; + public const int GEOMETRY_DEFORMATION_BIT_SGIX = 0x00000002; + public const int GEOMETRY_DEFORMATION_SGIX = 0x8194; + public const int GEOMETRY_INPUT_TYPE = 0x8917; + public const int GEOMETRY_INPUT_TYPE_ARB = 0x8DDB; + public const int GEOMETRY_INPUT_TYPE_EXT = 0x8DDB; + public const int GEOMETRY_OUTPUT_TYPE = 0x8918; + public const int GEOMETRY_OUTPUT_TYPE_ARB = 0x8DDC; + public const int GEOMETRY_OUTPUT_TYPE_EXT = 0x8DDC; + public const int GEOMETRY_PROGRAM_NV = 0x8C26; + public const int GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA3; + public const int GEOMETRY_SHADER = 0x8DD9; + public const int GEOMETRY_SHADER_ARB = 0x8DD9; + public const int GEOMETRY_SHADER_BIT = 0x00000004; + public const int GEOMETRY_SHADER_EXT = 0x8DD9; + public const int GEOMETRY_SHADER_INVOCATIONS = 0x887F; + public const int GEOMETRY_SHADER_PRIMITIVES_EMITTED = 0x82F3; + public const int GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3; + public const int GEOMETRY_SUBROUTINE = 0x92EB; + public const int GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1; + public const int GEOMETRY_TEXTURE = 0x829E; + public const int GEOMETRY_VERTICES_OUT = 0x8916; + public const int GEOMETRY_VERTICES_OUT_ARB = 0x8DDA; + public const int GEOMETRY_VERTICES_OUT_EXT = 0x8DDA; + public const int GEQUAL = 0x0206; + public const int GET_TEXTURE_IMAGE_FORMAT = 0x8291; + public const int GET_TEXTURE_IMAGE_TYPE = 0x8292; + public const int GLOBAL_ALPHA_FACTOR_SUN = 0x81DA; + public const int GLOBAL_ALPHA_SUN = 0x81D9; + public const int GLYPH_HAS_KERNING_BIT_NV = 0x100; + public const int GLYPH_HEIGHT_BIT_NV = 0x02; + public const int GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10; + public const int GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x04; + public const int GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x08; + public const int GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80; + public const int GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20; + public const int GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40; + public const int GLYPH_WIDTH_BIT_NV = 0x01; + public const int GPU_ADDRESS_NV = 0x8F34; + public const int GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049; + public const int GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047; + public const int GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; + public const int GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A; + public const int GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048; + public const int GREATER = 0x0204; + public const int GREEN = 0x1904; + public const int GREEN_BIT_ATI = 0x00000002; + public const int GREEN_INTEGER = 0x8D95; + public const int GREEN_INTEGER_EXT = 0x8D95; + public const int GREEN_MAX_CLAMP_INGR = 0x8565; + public const int GREEN_MIN_CLAMP_INGR = 0x8561; + public const int GREEN_NV = 0x1904; + public const int GUILTY_CONTEXT_RESET = 0x8253; + public const int GUILTY_CONTEXT_RESET_ARB = 0x8253; + public const int HALF_APPLE = 0x140B; + public const int HALF_BIAS_NEGATE_NV = 0x853B; + public const int HALF_BIAS_NORMAL_NV = 0x853A; + public const int HALF_BIT_ATI = 0x00000008; + public const int HALF_FLOAT = 0x140B; + public const int HALF_FLOAT_ARB = 0x140B; + public const int HALF_FLOAT_NV = 0x140B; + public const int HANDLE_TYPE_D3D11_IMAGE_EXT = 0x958B; + public const int HANDLE_TYPE_D3D11_IMAGE_KMT_EXT = 0x958C; + public const int HANDLE_TYPE_D3D12_FENCE_EXT = 0x9594; + public const int HANDLE_TYPE_D3D12_RESOURCE_EXT = 0x958A; + public const int HANDLE_TYPE_D3D12_TILEPOOL_EXT = 0x9589; + public const int HANDLE_TYPE_OPAQUE_FD_EXT = 0x9586; + public const int HANDLE_TYPE_OPAQUE_WIN32_EXT = 0x9587; + public const int HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = 0x9588; + public const int HARDLIGHT_KHR = 0x929B; + public const int HARDLIGHT_NV = 0x929B; + public const int HARDMIX_NV = 0x92A9; + public const int HIGH_FLOAT = 0x8DF2; + public const int HIGH_INT = 0x8DF5; + public const int HILO16_NV = 0x86F8; + public const int HILO8_NV = 0x885E; + public const int HILO_NV = 0x86F4; + public const int HISTOGRAM_ALPHA_SIZE_EXT = 0x802B; + public const int HISTOGRAM_BLUE_SIZE_EXT = 0x802A; + public const int HISTOGRAM_EXT = 0x8024; + public const int HISTOGRAM_FORMAT_EXT = 0x8027; + public const int HISTOGRAM_GREEN_SIZE_EXT = 0x8029; + public const int HISTOGRAM_LUMINANCE_SIZE_EXT = 0x802C; + public const int HISTOGRAM_RED_SIZE_EXT = 0x8028; + public const int HISTOGRAM_SINK_EXT = 0x802D; + public const int HISTOGRAM_WIDTH_EXT = 0x8026; + public const int HI_BIAS_NV = 0x8714; + public const int HI_SCALE_NV = 0x870E; + public const int HORIZONTAL_LINE_TO_NV = 0x06; + public const int HSL_COLOR_KHR = 0x92AF; + public const int HSL_COLOR_NV = 0x92AF; + public const int HSL_HUE_KHR = 0x92AD; + public const int HSL_HUE_NV = 0x92AD; + public const int HSL_LUMINOSITY_KHR = 0x92B0; + public const int HSL_LUMINOSITY_NV = 0x92B0; + public const int HSL_SATURATION_KHR = 0x92AE; + public const int HSL_SATURATION_NV = 0x92AE; + public const int IDENTITY_NV = 0x862A; + public const int IGNORE_BORDER_HP = 0x8150; + public const int IMAGE_1D = 0x904C; + public const int IMAGE_1D_ARRAY = 0x9052; + public const int IMAGE_1D_ARRAY_EXT = 0x9052; + public const int IMAGE_1D_EXT = 0x904C; + public const int IMAGE_2D = 0x904D; + public const int IMAGE_2D_ARRAY = 0x9053; + public const int IMAGE_2D_ARRAY_EXT = 0x9053; + public const int IMAGE_2D_EXT = 0x904D; + public const int IMAGE_2D_MULTISAMPLE = 0x9055; + public const int IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056; + public const int IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9056; + public const int IMAGE_2D_MULTISAMPLE_EXT = 0x9055; + public const int IMAGE_2D_RECT = 0x904F; + public const int IMAGE_2D_RECT_EXT = 0x904F; + public const int IMAGE_3D = 0x904E; + public const int IMAGE_3D_EXT = 0x904E; + public const int IMAGE_BINDING_ACCESS = 0x8F3E; + public const int IMAGE_BINDING_ACCESS_EXT = 0x8F3E; + public const int IMAGE_BINDING_FORMAT = 0x906E; + public const int IMAGE_BINDING_FORMAT_EXT = 0x906E; + public const int IMAGE_BINDING_LAYER = 0x8F3D; + public const int IMAGE_BINDING_LAYERED = 0x8F3C; + public const int IMAGE_BINDING_LAYERED_EXT = 0x8F3C; + public const int IMAGE_BINDING_LAYER_EXT = 0x8F3D; + public const int IMAGE_BINDING_LEVEL = 0x8F3B; + public const int IMAGE_BINDING_LEVEL_EXT = 0x8F3B; + public const int IMAGE_BINDING_NAME = 0x8F3A; + public const int IMAGE_BINDING_NAME_EXT = 0x8F3A; + public const int IMAGE_BUFFER = 0x9051; + public const int IMAGE_BUFFER_EXT = 0x9051; + public const int IMAGE_CLASS_10_10_10_2 = 0x82C3; + public const int IMAGE_CLASS_11_11_10 = 0x82C2; + public const int IMAGE_CLASS_1_X_16 = 0x82BE; + public const int IMAGE_CLASS_1_X_32 = 0x82BB; + public const int IMAGE_CLASS_1_X_8 = 0x82C1; + public const int IMAGE_CLASS_2_X_16 = 0x82BD; + public const int IMAGE_CLASS_2_X_32 = 0x82BA; + public const int IMAGE_CLASS_2_X_8 = 0x82C0; + public const int IMAGE_CLASS_4_X_16 = 0x82BC; + public const int IMAGE_CLASS_4_X_32 = 0x82B9; + public const int IMAGE_CLASS_4_X_8 = 0x82BF; + public const int IMAGE_COMPATIBILITY_CLASS = 0x82A8; + public const int IMAGE_CUBE = 0x9050; + public const int IMAGE_CUBE_EXT = 0x9050; + public const int IMAGE_CUBE_MAP_ARRAY = 0x9054; + public const int IMAGE_CUBE_MAP_ARRAY_EXT = 0x9054; + public const int IMAGE_CUBIC_WEIGHT_HP = 0x815E; + public const int IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; + public const int IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8; + public const int IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; + public const int IMAGE_MAG_FILTER_HP = 0x815C; + public const int IMAGE_MIN_FILTER_HP = 0x815D; + public const int IMAGE_PIXEL_FORMAT = 0x82A9; + public const int IMAGE_PIXEL_TYPE = 0x82AA; + public const int IMAGE_ROTATE_ANGLE_HP = 0x8159; + public const int IMAGE_ROTATE_ORIGIN_X_HP = 0x815A; + public const int IMAGE_ROTATE_ORIGIN_Y_HP = 0x815B; + public const int IMAGE_SCALE_X_HP = 0x8155; + public const int IMAGE_SCALE_Y_HP = 0x8156; + public const int IMAGE_TEXEL_SIZE = 0x82A7; + public const int IMAGE_TRANSFORM_2D_HP = 0x8161; + public const int IMAGE_TRANSLATE_X_HP = 0x8157; + public const int IMAGE_TRANSLATE_Y_HP = 0x8158; + public const int IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; + public const int IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B; + public const int IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; + public const int IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A; + public const int INCLUSIVE_EXT = 0x8F10; + public const int INCR = 0x1E02; + public const int INCR_WRAP = 0x8507; + public const int INCR_WRAP_EXT = 0x8507; + public const int INDEX_ARRAY_ADDRESS_NV = 0x8F24; + public const int INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899; + public const int INDEX_ARRAY_COUNT_EXT = 0x8087; + public const int INDEX_ARRAY_EXT = 0x8077; + public const int INDEX_ARRAY_LENGTH_NV = 0x8F2E; + public const int INDEX_ARRAY_LIST_IBM = 103073; + public const int INDEX_ARRAY_LIST_STRIDE_IBM = 103083; + public const int INDEX_ARRAY_POINTER_EXT = 0x8091; + public const int INDEX_ARRAY_STRIDE_EXT = 0x8086; + public const int INDEX_ARRAY_TYPE_EXT = 0x8085; + public const int INDEX_BIT_PGI = 0x00080000; + public const int INDEX_MATERIAL_EXT = 0x81B8; + public const int INDEX_MATERIAL_FACE_EXT = 0x81BA; + public const int INDEX_MATERIAL_PARAMETER_EXT = 0x81B9; + public const int INDEX_TEST_EXT = 0x81B5; + public const int INDEX_TEST_FUNC_EXT = 0x81B6; + public const int INDEX_TEST_REF_EXT = 0x81B7; + public const int INFO_LOG_LENGTH = 0x8B84; + public const int INNOCENT_CONTEXT_RESET = 0x8254; + public const int INNOCENT_CONTEXT_RESET_ARB = 0x8254; + public const int INSTRUMENT_BUFFER_POINTER_SGIX = 0x8180; + public const int INSTRUMENT_MEASUREMENTS_SGIX = 0x8181; + public const int INT = 0x1404; + public const int INT16_NV = 0x8FE4; + public const int INT16_VEC2_NV = 0x8FE5; + public const int INT16_VEC3_NV = 0x8FE6; + public const int INT16_VEC4_NV = 0x8FE7; + public const int INT64_ARB = 0x140E; + public const int INT64_NV = 0x140E; + public const int INT64_VEC2_ARB = 0x8FE9; + public const int INT64_VEC2_NV = 0x8FE9; + public const int INT64_VEC3_ARB = 0x8FEA; + public const int INT64_VEC3_NV = 0x8FEA; + public const int INT64_VEC4_ARB = 0x8FEB; + public const int INT64_VEC4_NV = 0x8FEB; + public const int INT8_NV = 0x8FE0; + public const int INT8_VEC2_NV = 0x8FE1; + public const int INT8_VEC3_NV = 0x8FE2; + public const int INT8_VEC4_NV = 0x8FE3; + public const int INTENSITY12_EXT = 0x804C; + public const int INTENSITY16F_ARB = 0x881D; + public const int INTENSITY16I_EXT = 0x8D8B; + public const int INTENSITY16UI_EXT = 0x8D79; + public const int INTENSITY16_EXT = 0x804D; + public const int INTENSITY16_SNORM = 0x901B; + public const int INTENSITY32F_ARB = 0x8817; + public const int INTENSITY32I_EXT = 0x8D85; + public const int INTENSITY32UI_EXT = 0x8D73; + public const int INTENSITY4_EXT = 0x804A; + public const int INTENSITY8I_EXT = 0x8D91; + public const int INTENSITY8UI_EXT = 0x8D7F; + public const int INTENSITY8_EXT = 0x804B; + public const int INTENSITY8_SNORM = 0x9017; + public const int INTENSITY_EXT = 0x8049; + public const int INTENSITY_FLOAT16_APPLE = 0x881D; + public const int INTENSITY_FLOAT16_ATI = 0x881D; + public const int INTENSITY_FLOAT32_APPLE = 0x8817; + public const int INTENSITY_FLOAT32_ATI = 0x8817; + public const int INTENSITY_SNORM = 0x9013; + public const int INTERLACE_OML = 0x8980; + public const int INTERLACE_READ_INGR = 0x8568; + public const int INTERLACE_READ_OML = 0x8981; + public const int INTERLACE_SGIX = 0x8094; + public const int INTERLEAVED_ATTRIBS = 0x8C8C; + public const int INTERLEAVED_ATTRIBS_EXT = 0x8C8C; + public const int INTERLEAVED_ATTRIBS_NV = 0x8C8C; + public const int INTERNALFORMAT_ALPHA_SIZE = 0x8274; + public const int INTERNALFORMAT_ALPHA_TYPE = 0x827B; + public const int INTERNALFORMAT_BLUE_SIZE = 0x8273; + public const int INTERNALFORMAT_BLUE_TYPE = 0x827A; + public const int INTERNALFORMAT_DEPTH_SIZE = 0x8275; + public const int INTERNALFORMAT_DEPTH_TYPE = 0x827C; + public const int INTERNALFORMAT_GREEN_SIZE = 0x8272; + public const int INTERNALFORMAT_GREEN_TYPE = 0x8279; + public const int INTERNALFORMAT_PREFERRED = 0x8270; + public const int INTERNALFORMAT_RED_SIZE = 0x8271; + public const int INTERNALFORMAT_RED_TYPE = 0x8278; + public const int INTERNALFORMAT_SHARED_SIZE = 0x8277; + public const int INTERNALFORMAT_STENCIL_SIZE = 0x8276; + public const int INTERNALFORMAT_STENCIL_TYPE = 0x827D; + public const int INTERNALFORMAT_SUPPORTED = 0x826F; + public const int INTERPOLATE_ARB = 0x8575; + public const int INTERPOLATE_EXT = 0x8575; + public const int INT_2_10_10_10_REV = 0x8D9F; + public const int INT_IMAGE_1D = 0x9057; + public const int INT_IMAGE_1D_ARRAY = 0x905D; + public const int INT_IMAGE_1D_ARRAY_EXT = 0x905D; + public const int INT_IMAGE_1D_EXT = 0x9057; + public const int INT_IMAGE_2D = 0x9058; + public const int INT_IMAGE_2D_ARRAY = 0x905E; + public const int INT_IMAGE_2D_ARRAY_EXT = 0x905E; + public const int INT_IMAGE_2D_EXT = 0x9058; + public const int INT_IMAGE_2D_MULTISAMPLE = 0x9060; + public const int INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061; + public const int INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9061; + public const int INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060; + public const int INT_IMAGE_2D_RECT = 0x905A; + public const int INT_IMAGE_2D_RECT_EXT = 0x905A; + public const int INT_IMAGE_3D = 0x9059; + public const int INT_IMAGE_3D_EXT = 0x9059; + public const int INT_IMAGE_BUFFER = 0x905C; + public const int INT_IMAGE_BUFFER_EXT = 0x905C; + public const int INT_IMAGE_CUBE = 0x905B; + public const int INT_IMAGE_CUBE_EXT = 0x905B; + public const int INT_IMAGE_CUBE_MAP_ARRAY = 0x905F; + public const int INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x905F; + public const int INT_SAMPLER_1D = 0x8DC9; + public const int INT_SAMPLER_1D_ARRAY = 0x8DCE; + public const int INT_SAMPLER_1D_ARRAY_EXT = 0x8DCE; + public const int INT_SAMPLER_1D_EXT = 0x8DC9; + public const int INT_SAMPLER_2D = 0x8DCA; + public const int INT_SAMPLER_2D_ARRAY = 0x8DCF; + public const int INT_SAMPLER_2D_ARRAY_EXT = 0x8DCF; + public const int INT_SAMPLER_2D_EXT = 0x8DCA; + public const int INT_SAMPLER_2D_MULTISAMPLE = 0x9109; + public const int INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C; + public const int INT_SAMPLER_2D_RECT = 0x8DCD; + public const int INT_SAMPLER_2D_RECT_EXT = 0x8DCD; + public const int INT_SAMPLER_3D = 0x8DCB; + public const int INT_SAMPLER_3D_EXT = 0x8DCB; + public const int INT_SAMPLER_BUFFER = 0x8DD0; + public const int INT_SAMPLER_BUFFER_AMD = 0x9002; + public const int INT_SAMPLER_BUFFER_EXT = 0x8DD0; + public const int INT_SAMPLER_CUBE = 0x8DCC; + public const int INT_SAMPLER_CUBE_EXT = 0x8DCC; + public const int INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E; + public const int INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E; + public const int INT_SAMPLER_RENDERBUFFER_NV = 0x8E57; + public const int INT_VEC2 = 0x8B53; + public const int INT_VEC2_ARB = 0x8B53; + public const int INT_VEC3 = 0x8B54; + public const int INT_VEC3_ARB = 0x8B54; + public const int INT_VEC4 = 0x8B55; + public const int INT_VEC4_ARB = 0x8B55; + public const int INVALID_ENUM = 0x0500; + public const int INVALID_FRAMEBUFFER_OPERATION = 0x0506; + public const int INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506; + public const uint INVALID_INDEX = 0xFFFFFFFF; + public const int INVALID_OPERATION = 0x0502; + public const int INVALID_VALUE = 0x0501; + public const int INVARIANT_DATATYPE_EXT = 0x87EB; + public const int INVARIANT_EXT = 0x87C2; + public const int INVARIANT_VALUE_EXT = 0x87EA; + public const int INVERSE_NV = 0x862B; + public const int INVERSE_TRANSPOSE_NV = 0x862D; + public const int INVERT = 0x150A; + public const int INVERTED_SCREEN_W_REND = 0x8491; + public const int INVERT_OVG_NV = 0x92B4; + public const int INVERT_RGB_NV = 0x92A3; + public const int IR_INSTRUMENT1_SGIX = 0x817F; + public const int ISOLINES = 0x8E7A; + public const int IS_PER_PATCH = 0x92E7; + public const int IS_ROW_MAJOR = 0x9300; + public const int ITALIC_BIT_NV = 0x02; + public const int IUI_N3F_V2F_EXT = 0x81AF; + public const int IUI_N3F_V3F_EXT = 0x81B0; + public const int IUI_V2F_EXT = 0x81AD; + public const int IUI_V3F_EXT = 0x81AE; + public const int KEEP = 0x1E00; + public const int LARGE_CCW_ARC_TO_NV = 0x16; + public const int LARGE_CW_ARC_TO_NV = 0x18; + public const int LAST_VERTEX_CONVENTION = 0x8E4E; + public const int LAST_VERTEX_CONVENTION_EXT = 0x8E4E; + public const int LAST_VIDEO_CAPTURE_STATUS_NV = 0x9027; + public const int LAYER_NV = 0x8DAA; + public const int LAYER_PROVOKING_VERTEX = 0x825E; + public const int LAYOUT_COLOR_ATTACHMENT_EXT = 0x958E; + public const int LAYOUT_DEFAULT_INTEL = 0; + public const int LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT = 0x9531; + public const int LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT = 0x9530; + public const int LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT = 0x958F; + public const int LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT = 0x9590; + public const int LAYOUT_GENERAL_EXT = 0x958D; + public const int LAYOUT_LINEAR_CPU_CACHED_INTEL = 2; + public const int LAYOUT_LINEAR_INTEL = 1; + public const int LAYOUT_SHADER_READ_ONLY_EXT = 0x9591; + public const int LAYOUT_TRANSFER_DST_EXT = 0x9593; + public const int LAYOUT_TRANSFER_SRC_EXT = 0x9592; + public const int LEFT = 0x0406; + public const int LEQUAL = 0x0203; + public const int LERP_ATI = 0x8969; + public const int LESS = 0x0201; + public const int LGPU_SEPARATE_STORAGE_BIT_NVX = 0x0800; + public const int LIGHTEN_KHR = 0x9298; + public const int LIGHTEN_NV = 0x9298; + public const int LIGHT_ENV_MODE_SGIX = 0x8407; + public const int LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8; + public const int LIGHT_MODEL_SPECULAR_VECTOR_APPLE = 0x85B0; + public const int LINE = 0x1B01; + public const int LINEAR = 0x2601; + public const int LINEARBURN_NV = 0x92A5; + public const int LINEARDODGE_NV = 0x92A4; + public const int LINEARLIGHT_NV = 0x92A7; + public const int LINEAR_CLIPMAP_LINEAR_SGIX = 0x8170; + public const int LINEAR_CLIPMAP_NEAREST_SGIX = 0x844F; + public const int LINEAR_DETAIL_ALPHA_SGIS = 0x8098; + public const int LINEAR_DETAIL_COLOR_SGIS = 0x8099; + public const int LINEAR_DETAIL_SGIS = 0x8097; + public const int LINEAR_MIPMAP_LINEAR = 0x2703; + public const int LINEAR_MIPMAP_NEAREST = 0x2701; + public const int LINEAR_SHARPEN_ALPHA_SGIS = 0x80AE; + public const int LINEAR_SHARPEN_COLOR_SGIS = 0x80AF; + public const int LINEAR_SHARPEN_SGIS = 0x80AD; + public const int LINEAR_TILING_EXT = 0x9585; + public const int LINES = 0x0001; + public const int LINES_ADJACENCY = 0x000A; + public const int LINES_ADJACENCY_ARB = 0x000A; + public const int LINES_ADJACENCY_EXT = 0x000A; + public const int LINE_LOOP = 0x0002; + public const int LINE_SMOOTH = 0x0B20; + public const int LINE_SMOOTH_HINT = 0x0C52; + public const int LINE_STRIP = 0x0003; + public const int LINE_STRIP_ADJACENCY = 0x000B; + public const int LINE_STRIP_ADJACENCY_ARB = 0x000B; + public const int LINE_STRIP_ADJACENCY_EXT = 0x000B; + public const int LINE_TO_NV = 0x04; + public const int LINE_WIDTH = 0x0B21; + public const int LINE_WIDTH_COMMAND_NV = 0x000D; + public const int LINE_WIDTH_GRANULARITY = 0x0B23; + public const int LINE_WIDTH_RANGE = 0x0B22; + public const int LINK_STATUS = 0x8B82; + public const int LIST_PRIORITY_SGIX = 0x8182; + public const int LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED; + public const int LOCAL_CONSTANT_EXT = 0x87C3; + public const int LOCAL_CONSTANT_VALUE_EXT = 0x87EC; + public const int LOCAL_EXT = 0x87C4; + public const int LOCATION = 0x930E; + public const int LOCATION_COMPONENT = 0x934A; + public const int LOCATION_INDEX = 0x930F; + public const int LOGIC_OP_MODE = 0x0BF0; + public const int LOSE_CONTEXT_ON_RESET = 0x8252; + public const int LOSE_CONTEXT_ON_RESET_ARB = 0x8252; + public const int LOWER_LEFT = 0x8CA1; + public const int LOW_FLOAT = 0x8DF0; + public const int LOW_INT = 0x8DF3; + public const int LO_BIAS_NV = 0x8715; + public const int LO_SCALE_NV = 0x870F; + public const int LUID_SIZE_EXT = 8; + public const int LUMINANCE12_ALPHA12_EXT = 0x8047; + public const int LUMINANCE12_ALPHA4_EXT = 0x8046; + public const int LUMINANCE12_EXT = 0x8041; + public const int LUMINANCE16F_ARB = 0x881E; + public const int LUMINANCE16F_EXT = 0x881E; + public const int LUMINANCE16I_EXT = 0x8D8C; + public const int LUMINANCE16UI_EXT = 0x8D7A; + public const int LUMINANCE16_ALPHA16_EXT = 0x8048; + public const int LUMINANCE16_ALPHA16_SNORM = 0x901A; + public const int LUMINANCE16_EXT = 0x8042; + public const int LUMINANCE16_SNORM = 0x9019; + public const int LUMINANCE32F_ARB = 0x8818; + public const int LUMINANCE32F_EXT = 0x8818; + public const int LUMINANCE32I_EXT = 0x8D86; + public const int LUMINANCE32UI_EXT = 0x8D74; + public const int LUMINANCE4_ALPHA4_EXT = 0x8043; + public const int LUMINANCE4_EXT = 0x803F; + public const int LUMINANCE6_ALPHA2_EXT = 0x8044; + public const int LUMINANCE8I_EXT = 0x8D92; + public const int LUMINANCE8UI_EXT = 0x8D80; + public const int LUMINANCE8_ALPHA8_EXT = 0x8045; + public const int LUMINANCE8_ALPHA8_SNORM = 0x9016; + public const int LUMINANCE8_EXT = 0x8040; + public const int LUMINANCE8_SNORM = 0x9015; + public const int LUMINANCE_ALPHA16F_ARB = 0x881F; + public const int LUMINANCE_ALPHA16F_EXT = 0x881F; + public const int LUMINANCE_ALPHA16I_EXT = 0x8D8D; + public const int LUMINANCE_ALPHA16UI_EXT = 0x8D7B; + public const int LUMINANCE_ALPHA32F_ARB = 0x8819; + public const int LUMINANCE_ALPHA32F_EXT = 0x8819; + public const int LUMINANCE_ALPHA32I_EXT = 0x8D87; + public const int LUMINANCE_ALPHA32UI_EXT = 0x8D75; + public const int LUMINANCE_ALPHA8I_EXT = 0x8D93; + public const int LUMINANCE_ALPHA8UI_EXT = 0x8D81; + public const int LUMINANCE_ALPHA_FLOAT16_APPLE = 0x881F; + public const int LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F; + public const int LUMINANCE_ALPHA_FLOAT32_APPLE = 0x8819; + public const int LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819; + public const int LUMINANCE_ALPHA_INTEGER_EXT = 0x8D9D; + public const int LUMINANCE_ALPHA_SNORM = 0x9012; + public const int LUMINANCE_FLOAT16_APPLE = 0x881E; + public const int LUMINANCE_FLOAT16_ATI = 0x881E; + public const int LUMINANCE_FLOAT32_APPLE = 0x8818; + public const int LUMINANCE_FLOAT32_ATI = 0x8818; + public const int LUMINANCE_INTEGER_EXT = 0x8D9C; + public const int LUMINANCE_SNORM = 0x9011; + public const int MAD_ATI = 0x8968; + public const int MAGNITUDE_BIAS_NV = 0x8718; + public const int MAGNITUDE_SCALE_NV = 0x8712; + public const int MAJOR_VERSION = 0x821B; + public const int MANUAL_GENERATE_MIPMAP = 0x8294; + public const int MAP1_BINORMAL_EXT = 0x8446; + public const int MAP1_TANGENT_EXT = 0x8444; + public const int MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; + public const int MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; + public const int MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; + public const int MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; + public const int MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; + public const int MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; + public const int MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; + public const int MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; + public const int MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; + public const int MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; + public const int MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; + public const int MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; + public const int MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; + public const int MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; + public const int MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; + public const int MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; + public const int MAP2_BINORMAL_EXT = 0x8447; + public const int MAP2_TANGENT_EXT = 0x8445; + public const int MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; + public const int MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; + public const int MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; + public const int MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; + public const int MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; + public const int MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; + public const int MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; + public const int MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; + public const int MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; + public const int MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; + public const int MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; + public const int MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; + public const int MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; + public const int MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; + public const int MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; + public const int MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; + public const int MAP_ATTRIB_U_ORDER_NV = 0x86C3; + public const int MAP_ATTRIB_V_ORDER_NV = 0x86C4; + public const int MAP_COHERENT_BIT = 0x0080; + public const int MAP_FLUSH_EXPLICIT_BIT = 0x0010; + public const int MAP_INVALIDATE_BUFFER_BIT = 0x0008; + public const int MAP_INVALIDATE_RANGE_BIT = 0x0004; + public const int MAP_PERSISTENT_BIT = 0x0040; + public const int MAP_READ_BIT = 0x0001; + public const int MAP_TESSELLATION_NV = 0x86C2; + public const int MAP_UNSYNCHRONIZED_BIT = 0x0020; + public const int MAP_WRITE_BIT = 0x0002; + public const int MATERIAL_SIDE_HINT_PGI = 0x1A22C; + public const int MATRIX0_ARB = 0x88C0; + public const int MATRIX0_NV = 0x8630; + public const int MATRIX10_ARB = 0x88CA; + public const int MATRIX11_ARB = 0x88CB; + public const int MATRIX12_ARB = 0x88CC; + public const int MATRIX13_ARB = 0x88CD; + public const int MATRIX14_ARB = 0x88CE; + public const int MATRIX15_ARB = 0x88CF; + public const int MATRIX16_ARB = 0x88D0; + public const int MATRIX17_ARB = 0x88D1; + public const int MATRIX18_ARB = 0x88D2; + public const int MATRIX19_ARB = 0x88D3; + public const int MATRIX1_ARB = 0x88C1; + public const int MATRIX1_NV = 0x8631; + public const int MATRIX20_ARB = 0x88D4; + public const int MATRIX21_ARB = 0x88D5; + public const int MATRIX22_ARB = 0x88D6; + public const int MATRIX23_ARB = 0x88D7; + public const int MATRIX24_ARB = 0x88D8; + public const int MATRIX25_ARB = 0x88D9; + public const int MATRIX26_ARB = 0x88DA; + public const int MATRIX27_ARB = 0x88DB; + public const int MATRIX28_ARB = 0x88DC; + public const int MATRIX29_ARB = 0x88DD; + public const int MATRIX2_ARB = 0x88C2; + public const int MATRIX2_NV = 0x8632; + public const int MATRIX30_ARB = 0x88DE; + public const int MATRIX31_ARB = 0x88DF; + public const int MATRIX3_ARB = 0x88C3; + public const int MATRIX3_NV = 0x8633; + public const int MATRIX4_ARB = 0x88C4; + public const int MATRIX4_NV = 0x8634; + public const int MATRIX5_ARB = 0x88C5; + public const int MATRIX5_NV = 0x8635; + public const int MATRIX6_ARB = 0x88C6; + public const int MATRIX6_NV = 0x8636; + public const int MATRIX7_ARB = 0x88C7; + public const int MATRIX7_NV = 0x8637; + public const int MATRIX8_ARB = 0x88C8; + public const int MATRIX9_ARB = 0x88C9; + public const int MATRIX_EXT = 0x87C0; + public const int MATRIX_INDEX_ARRAY_ARB = 0x8844; + public const int MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849; + public const int MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846; + public const int MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848; + public const int MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847; + public const int MATRIX_PALETTE_ARB = 0x8840; + public const int MATRIX_STRIDE = 0x92FF; + public const int MAT_AMBIENT_AND_DIFFUSE_BIT_PGI = 0x00200000; + public const int MAT_AMBIENT_BIT_PGI = 0x00100000; + public const int MAT_COLOR_INDEXES_BIT_PGI = 0x01000000; + public const int MAT_DIFFUSE_BIT_PGI = 0x00400000; + public const int MAT_EMISSION_BIT_PGI = 0x00800000; + public const int MAT_SHININESS_BIT_PGI = 0x02000000; + public const int MAT_SPECULAR_BIT_PGI = 0x04000000; + public const int MAX = 0x8008; + public const int MAX_3D_TEXTURE_SIZE = 0x8073; + public const int MAX_3D_TEXTURE_SIZE_EXT = 0x8073; + public const int MAX_4D_TEXTURE_SIZE_SGIS = 0x8138; + public const int MAX_ACTIVE_LIGHTS_SGIX = 0x8405; + public const int MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; + public const int MAX_ARRAY_TEXTURE_LAYERS_EXT = 0x88FF; + public const int MAX_ASYNC_DRAW_PIXELS_SGIX = 0x8360; + public const int MAX_ASYNC_HISTOGRAM_SGIX = 0x832D; + public const int MAX_ASYNC_READ_PIXELS_SGIX = 0x8361; + public const int MAX_ASYNC_TEX_IMAGE_SGIX = 0x835F; + public const int MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; + public const int MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8; + public const int MAX_BINDABLE_UNIFORM_SIZE_EXT = 0x8DED; + public const int MAX_CLIPMAP_DEPTH_SGIX = 0x8177; + public const int MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8178; + public const int MAX_CLIP_DISTANCES = 0x0D32; + public const int MAX_COARSE_FRAGMENT_SAMPLES_NV = 0x955F; + public const int MAX_COLOR_ATTACHMENTS = 0x8CDF; + public const int MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF; + public const int MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = 0x91B3; + public const int MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = 0x91B4; + public const int MAX_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B3; + public const int MAX_COLOR_TEXTURE_SAMPLES = 0x910E; + public const int MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7; + public const int MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1; + public const int MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; + public const int MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266; + public const int MAX_COMBINED_DIMENSIONS = 0x8282; + public const int MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33; + public const int MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32; + public const int MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; + public const int MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39; + public const int MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT = 0x8F39; + public const int MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV = 0x8E67; + public const int MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; + public const int MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC; + public const int MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV = 0x8E6F; + public const int MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E; + public const int MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; + public const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; + public const int MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D; + public const int MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E; + public const int MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31; + public const int MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265; + public const int MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264; + public const int MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB; + public const int MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF; + public const int MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD; + public const int MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB; + public const int MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262; + public const int MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC; + public const int MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB; + public const int MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263; + public const int MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344; + public const int MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345; + public const int MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE; + public const int MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; + public const int MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; + public const int MAX_CONVOLUTION_HEIGHT_EXT = 0x801B; + public const int MAX_CONVOLUTION_WIDTH_EXT = 0x801A; + public const int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; + public const int MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C; + public const int MAX_CUBE_MAP_TEXTURE_SIZE_EXT = 0x851C; + public const int MAX_CULL_DISTANCES = 0x82F9; + public const int MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C; + public const int MAX_DEBUG_LOGGED_MESSAGES = 0x9144; + public const int MAX_DEBUG_LOGGED_MESSAGES_AMD = 0x9144; + public const int MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144; + public const int MAX_DEBUG_MESSAGE_LENGTH = 0x9143; + public const int MAX_DEBUG_MESSAGE_LENGTH_AMD = 0x9143; + public const int MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143; + public const int MAX_DEEP_3D_TEXTURE_DEPTH_NV = 0x90D1; + public const int MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = 0x90D0; + public const int MAX_DEFORMATION_ORDER_SGIX = 0x8197; + public const int MAX_DEPTH = 0x8280; + public const int MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = 0x91B5; + public const int MAX_DEPTH_TEXTURE_SAMPLES = 0x910F; + public const int MAX_DETACHED_BUFFERS_NV = 0x95AD; + public const int MAX_DETACHED_TEXTURES_NV = 0x95AC; + public const int MAX_DRAW_BUFFERS = 0x8824; + public const int MAX_DRAW_BUFFERS_ARB = 0x8824; + public const int MAX_DRAW_BUFFERS_ATI = 0x8824; + public const int MAX_DRAW_MESH_TASKS_COUNT_NV = 0x953D; + public const int MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; + public const int MAX_ELEMENTS_INDICES = 0x80E9; + public const int MAX_ELEMENTS_INDICES_EXT = 0x80E9; + public const int MAX_ELEMENTS_VERTICES = 0x80E8; + public const int MAX_ELEMENTS_VERTICES_EXT = 0x80E8; + public const int MAX_ELEMENT_INDEX = 0x8D6B; + public const int MAX_EXT = 0x8008; + public const int MAX_FOG_FUNC_POINTS_SGIS = 0x812C; + public const int MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6; + public const int MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0; + public const int MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = 0x8DE3; + public const int MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE; + public const int MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; + public const int MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C; + public const int MAX_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5C; + public const int MAX_FRAGMENT_LIGHTS_SGIX = 0x8404; + public const int MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868; + public const int MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA; + public const int MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D; + public const int MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; + public const int MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49; + public const int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; + public const int MAX_FRAMEBUFFER_HEIGHT = 0x9316; + public const int MAX_FRAMEBUFFER_LAYERS = 0x9317; + public const int MAX_FRAMEBUFFER_SAMPLES = 0x9318; + public const int MAX_FRAMEBUFFER_WIDTH = 0x9315; + public const int MAX_FRAMEZOOM_FACTOR_SGIX = 0x818D; + public const int MAX_GENERAL_COMBINERS_NV = 0x854D; + public const int MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5; + public const int MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF; + public const int MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = 0x8DE4; + public const int MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD; + public const int MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123; + public const int MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124; + public const int MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0; + public const int MAX_GEOMETRY_OUTPUT_VERTICES_ARB = 0x8DE0; + public const int MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 0x8DE0; + public const int MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV = 0x8E5A; + public const int MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A; + public const int MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7; + public const int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29; + public const int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = 0x8C29; + public const int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 0x8C29; + public const int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1; + public const int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = 0x8DE1; + public const int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8DE1; + public const int MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C; + public const int MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF; + public const int MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = 0x8DDF; + public const int MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8DDF; + public const int MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD; + public const int MAX_GEOMETRY_VARYING_COMPONENTS_EXT = 0x8DDD; + public const int MAX_HEIGHT = 0x827F; + public const int MAX_IMAGE_SAMPLES = 0x906D; + public const int MAX_IMAGE_SAMPLES_EXT = 0x906D; + public const int MAX_IMAGE_UNITS = 0x8F38; + public const int MAX_IMAGE_UNITS_EXT = 0x8F38; + public const int MAX_INTEGER_SAMPLES = 0x9110; + public const int MAX_LABEL_LENGTH = 0x82E8; + public const int MAX_LAYERS = 0x8281; + public const int MAX_LGPU_GPUS_NVX = 0x92BA; + public const int MAX_MAP_TESSELLATION_NV = 0x86D6; + public const int MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841; + public const int MAX_MESH_ATOMIC_COUNTERS_NV = 0x8E65; + public const int MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV = 0x8E64; + public const int MAX_MESH_IMAGE_UNIFORMS_NV = 0x8E62; + public const int MAX_MESH_OUTPUT_PRIMITIVES_NV = 0x9539; + public const int MAX_MESH_OUTPUT_VERTICES_NV = 0x9538; + public const int MAX_MESH_SHADER_STORAGE_BLOCKS_NV = 0x8E66; + public const int MAX_MESH_TEXTURE_IMAGE_UNITS_NV = 0x8E61; + public const int MAX_MESH_TOTAL_MEMORY_SIZE_NV = 0x9536; + public const int MAX_MESH_UNIFORM_BLOCKS_NV = 0x8E60; + public const int MAX_MESH_UNIFORM_COMPONENTS_NV = 0x8E63; + public const int MAX_MESH_VIEWS_NV = 0x9557; + public const int MAX_MESH_WORK_GROUP_INVOCATIONS_NV = 0x95A2; + public const int MAX_MESH_WORK_GROUP_SIZE_NV = 0x953B; + public const int MAX_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E11; + public const int MAX_NAME_LENGTH = 0x92F6; + public const int MAX_NUM_ACTIVE_VARIABLES = 0x92F7; + public const int MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; + public const int MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA; + public const int MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CD; + public const int MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE; + public const int MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CC; + public const int MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB; + public const int MAX_PALETTE_MATRICES_ARB = 0x8842; + public const int MAX_PATCH_VERTICES = 0x8E7D; + public const int MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8337; + public const int MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1; + public const int MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; + public const int MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; + public const int MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; + public const int MAX_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8908; + public const int MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5; + public const int MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; + public const int MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4; + public const int MAX_PROGRAM_GENERIC_ATTRIBS_NV = 0x8DA5; + public const int MAX_PROGRAM_GENERIC_RESULTS_NV = 0x8DA6; + public const int MAX_PROGRAM_IF_DEPTH_NV = 0x88F6; + public const int MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; + public const int MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; + public const int MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8; + public const int MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7; + public const int MAX_PROGRAM_MATRICES_ARB = 0x862F; + public const int MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; + public const int MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; + public const int MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; + public const int MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; + public const int MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; + public const int MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; + public const int MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; + public const int MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; + public const int MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; + public const int MAX_PROGRAM_OUTPUT_VERTICES_NV = 0x8C27; + public const int MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; + public const int MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV = 0x8DA0; + public const int MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV = 0x8DA1; + public const int MAX_PROGRAM_PATCH_ATTRIBS_NV = 0x86D8; + public const int MAX_PROGRAM_RESULT_COMPONENTS_NV = 0x8909; + public const int MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45; + public const int MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV = 0x8F44; + public const int MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; + public const int MAX_PROGRAM_TEXEL_OFFSET = 0x8905; + public const int MAX_PROGRAM_TEXEL_OFFSET_EXT = 0x8905; + public const int MAX_PROGRAM_TEXEL_OFFSET_NV = 0x8905; + public const int MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F; + public const int MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F; + public const int MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F; + public const int MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5F; + public const int MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; + public const int MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; + public const int MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV = 0x8C28; + public const int MAX_RASTER_SAMPLES_EXT = 0x9329; + public const int MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7; + public const int MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8; + public const int MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8; + public const int MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8; + public const int MAX_RENDERBUFFER_SIZE = 0x84E8; + public const int MAX_RENDERBUFFER_SIZE_EXT = 0x84E8; + public const int MAX_SAMPLES = 0x8D57; + public const int MAX_SAMPLES_EXT = 0x8D57; + public const int MAX_SAMPLE_MASK_WORDS = 0x8E59; + public const int MAX_SAMPLE_MASK_WORDS_NV = 0x8E59; + public const int MAX_SERVER_WAIT_TIMEOUT = 0x9111; + public const int MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35; + public const int MAX_SHADER_COMPILER_THREADS_ARB = 0x91B0; + public const int MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0; + public const int MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE; + public const int MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD; + public const int MAX_SHININESS_NV = 0x8504; + public const int MAX_SPARSE_3D_TEXTURE_SIZE_AMD = 0x9199; + public const int MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199; + public const int MAX_SPARSE_ARRAY_TEXTURE_LAYERS = 0x919A; + public const int MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A; + public const int MAX_SPARSE_TEXTURE_SIZE_AMD = 0x9198; + public const int MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198; + public const int MAX_SPOT_EXPONENT_NV = 0x8505; + public const int MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = 0x9349; + public const int MAX_SUBROUTINES = 0x8DE7; + public const int MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; + public const int MAX_TASK_ATOMIC_COUNTERS_NV = 0x8E6D; + public const int MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV = 0x8E6C; + public const int MAX_TASK_IMAGE_UNIFORMS_NV = 0x8E6A; + public const int MAX_TASK_OUTPUT_COUNT_NV = 0x953A; + public const int MAX_TASK_SHADER_STORAGE_BLOCKS_NV = 0x8E6E; + public const int MAX_TASK_TEXTURE_IMAGE_UNITS_NV = 0x8E69; + public const int MAX_TASK_TOTAL_MEMORY_SIZE_NV = 0x9537; + public const int MAX_TASK_UNIFORM_BLOCKS_NV = 0x8E68; + public const int MAX_TASK_UNIFORM_COMPONENTS_NV = 0x8E6B; + public const int MAX_TASK_WORK_GROUP_INVOCATIONS_NV = 0x95A3; + public const int MAX_TASK_WORK_GROUP_SIZE_NV = 0x953C; + public const int MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3; + public const int MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD; + public const int MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB; + public const int MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C; + public const int MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83; + public const int MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8; + public const int MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81; + public const int MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85; + public const int MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89; + public const int MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F; + public const int MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4; + public const int MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE; + public const int MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC; + public const int MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D; + public const int MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86; + public const int MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9; + public const int MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82; + public const int MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A; + public const int MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80; + public const int MAX_TESS_GEN_LEVEL = 0x8E7E; + public const int MAX_TESS_PATCH_COMPONENTS = 0x8E84; + public const int MAX_TEXTURE_BUFFER_SIZE = 0x8C2B; + public const int MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B; + public const int MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B; + public const int MAX_TEXTURE_COORDS_ARB = 0x8871; + public const int MAX_TEXTURE_COORDS_NV = 0x8871; + public const int MAX_TEXTURE_IMAGE_UNITS = 0x8872; + public const int MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; + public const int MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872; + public const int MAX_TEXTURE_LOD_BIAS = 0x84FD; + public const int MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD; + public const int MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; + public const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; + public const int MAX_TEXTURE_SIZE = 0x0D33; + public const int MAX_TEXTURE_UNITS_ARB = 0x84E2; + public const int MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV = 0x95B6; + public const int MAX_TRACK_MATRICES_NV = 0x862F; + public const int MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; + public const int MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70; + public const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A; + public const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT = 0x8C8A; + public const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8C8A; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT = 0x8C8B; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT = 0x8C80; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8C80; + public const int MAX_UNIFORM_BLOCK_SIZE = 0x8A30; + public const int MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F; + public const int MAX_UNIFORM_LOCATIONS = 0x826E; + public const int MAX_VARYING_COMPONENTS = 0x8B4B; + public const int MAX_VARYING_COMPONENTS_EXT = 0x8B4B; + public const int MAX_VARYING_FLOATS = 0x8B4B; + public const int MAX_VARYING_FLOATS_ARB = 0x8B4B; + public const int MAX_VARYING_VECTORS = 0x8DFC; + public const int MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520; + public const int MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2; + public const int MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC; + public const int MAX_VERTEX_ATTRIBS = 0x8869; + public const int MAX_VERTEX_ATTRIBS_ARB = 0x8869; + public const int MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; + public const int MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9; + public const int MAX_VERTEX_ATTRIB_STRIDE = 0x82E5; + public const int MAX_VERTEX_BINDABLE_UNIFORMS_EXT = 0x8DE2; + public const int MAX_VERTEX_HINT_PGI = 0x1A22D; + public const int MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA; + public const int MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122; + public const int MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5; + public const int MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7; + public const int MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9; + public const int MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8; + public const int MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6; + public const int MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6; + public const int MAX_VERTEX_STREAMS = 0x8E71; + public const int MAX_VERTEX_STREAMS_ATI = 0x876B; + public const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; + public const int MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; + public const int MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B; + public const int MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; + public const int MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A; + public const int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; + public const int MAX_VERTEX_UNITS_ARB = 0x86A4; + public const int MAX_VERTEX_VARYING_COMPONENTS_ARB = 0x8DDE; + public const int MAX_VERTEX_VARYING_COMPONENTS_EXT = 0x8DDE; + public const int MAX_VIEWPORTS = 0x825B; + public const int MAX_VIEWPORT_DIMS = 0x0D3A; + public const int MAX_VIEWS_OVR = 0x9631; + public const int MAX_WIDTH = 0x827E; + public const int MAX_WINDOW_RECTANGLES_EXT = 0x8F14; + public const int MEDIUM_FLOAT = 0x8DF1; + public const int MEDIUM_INT = 0x8DF4; + public const int MEMORY_ATTACHABLE_ALIGNMENT_NV = 0x95A6; + public const int MEMORY_ATTACHABLE_NV = 0x95A8; + public const int MEMORY_ATTACHABLE_SIZE_NV = 0x95A7; + public const int MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV = 0x9543; + public const int MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV = 0x92DF; + public const int MESH_OUTPUT_TYPE_NV = 0x957B; + public const int MESH_PRIMITIVES_OUT_NV = 0x957A; + public const int MESH_SHADER_BIT_NV = 0x00000040; + public const int MESH_SHADER_NV = 0x9559; + public const int MESH_SUBROUTINE_NV = 0x957C; + public const int MESH_SUBROUTINE_UNIFORM_NV = 0x957E; + public const int MESH_VERTICES_OUT_NV = 0x9579; + public const int MESH_WORK_GROUP_SIZE_NV = 0x953E; + public const int MIN = 0x8007; + public const int MINMAX_EXT = 0x802E; + public const int MINMAX_FORMAT_EXT = 0x802F; + public const int MINMAX_SINK_EXT = 0x8030; + public const int MINOR_VERSION = 0x821C; + public const int MINUS_CLAMPED_NV = 0x92B3; + public const int MINUS_NV = 0x929F; + public const int MIN_EXT = 0x8007; + public const int MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B; + public const int MIN_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5B; + public const int MIN_LOD_WARNING_AMD = 0x919C; + public const int MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; + public const int MIN_PROGRAM_TEXEL_OFFSET = 0x8904; + public const int MIN_PROGRAM_TEXEL_OFFSET_EXT = 0x8904; + public const int MIN_PROGRAM_TEXEL_OFFSET_NV = 0x8904; + public const int MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E; + public const int MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E; + public const int MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5E; + public const int MIN_SAMPLE_SHADING_VALUE = 0x8C37; + public const int MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37; + public const int MIN_SPARSE_LEVEL_AMD = 0x919B; + public const int MIPMAP = 0x8293; + public const int MIRRORED_REPEAT = 0x8370; + public const int MIRRORED_REPEAT_ARB = 0x8370; + public const int MIRRORED_REPEAT_IBM = 0x8370; + public const int MIRROR_CLAMP_ATI = 0x8742; + public const int MIRROR_CLAMP_EXT = 0x8742; + public const int MIRROR_CLAMP_TO_BORDER_EXT = 0x8912; + public const int MIRROR_CLAMP_TO_EDGE = 0x8743; + public const int MIRROR_CLAMP_TO_EDGE_ATI = 0x8743; + public const int MIRROR_CLAMP_TO_EDGE_EXT = 0x8743; + public const int MITER_REVERT_NV = 0x90A7; + public const int MITER_TRUNCATE_NV = 0x90A8; + public const int MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F; + public const int MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330; + public const int MODELVIEW0_ARB = 0x1700; + public const int MODELVIEW0_EXT = 0x1700; + public const int MODELVIEW0_MATRIX_EXT = 0x0BA6; + public const int MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3; + public const int MODELVIEW10_ARB = 0x872A; + public const int MODELVIEW11_ARB = 0x872B; + public const int MODELVIEW12_ARB = 0x872C; + public const int MODELVIEW13_ARB = 0x872D; + public const int MODELVIEW14_ARB = 0x872E; + public const int MODELVIEW15_ARB = 0x872F; + public const int MODELVIEW16_ARB = 0x8730; + public const int MODELVIEW17_ARB = 0x8731; + public const int MODELVIEW18_ARB = 0x8732; + public const int MODELVIEW19_ARB = 0x8733; + public const int MODELVIEW1_ARB = 0x850A; + public const int MODELVIEW1_EXT = 0x850A; + public const int MODELVIEW1_MATRIX_EXT = 0x8506; + public const int MODELVIEW1_STACK_DEPTH_EXT = 0x8502; + public const int MODELVIEW20_ARB = 0x8734; + public const int MODELVIEW21_ARB = 0x8735; + public const int MODELVIEW22_ARB = 0x8736; + public const int MODELVIEW23_ARB = 0x8737; + public const int MODELVIEW24_ARB = 0x8738; + public const int MODELVIEW25_ARB = 0x8739; + public const int MODELVIEW26_ARB = 0x873A; + public const int MODELVIEW27_ARB = 0x873B; + public const int MODELVIEW28_ARB = 0x873C; + public const int MODELVIEW29_ARB = 0x873D; + public const int MODELVIEW2_ARB = 0x8722; + public const int MODELVIEW30_ARB = 0x873E; + public const int MODELVIEW31_ARB = 0x873F; + public const int MODELVIEW3_ARB = 0x8723; + public const int MODELVIEW4_ARB = 0x8724; + public const int MODELVIEW5_ARB = 0x8725; + public const int MODELVIEW6_ARB = 0x8726; + public const int MODELVIEW7_ARB = 0x8727; + public const int MODELVIEW8_ARB = 0x8728; + public const int MODELVIEW9_ARB = 0x8729; + public const int MODELVIEW_PROJECTION_NV = 0x8629; + public const int MODULATE_ADD_ATI = 0x8744; + public const int MODULATE_SIGNED_ADD_ATI = 0x8745; + public const int MODULATE_SUBTRACT_ATI = 0x8746; + public const int MOVE_TO_CONTINUES_NV = 0x90B6; + public const int MOVE_TO_NV = 0x02; + public const int MOVE_TO_RESETS_NV = 0x90B5; + public const int MOV_ATI = 0x8961; + public const int MULTICAST_GPUS_NV = 0x92BA; + public const int MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9549; + public const int MULTIPLY_KHR = 0x9294; + public const int MULTIPLY_NV = 0x9294; + public const int MULTISAMPLE = 0x809D; + public const int MULTISAMPLES_NV = 0x9371; + public const int MULTISAMPLE_3DFX = 0x86B2; + public const int MULTISAMPLE_ARB = 0x809D; + public const int MULTISAMPLE_BIT_3DFX = 0x20000000; + public const int MULTISAMPLE_BIT_ARB = 0x20000000; + public const int MULTISAMPLE_BIT_EXT = 0x20000000; + public const int MULTISAMPLE_COVERAGE_MODES_NV = 0x8E12; + public const int MULTISAMPLE_EXT = 0x809D; + public const int MULTISAMPLE_FILTER_HINT_NV = 0x8534; + public const int MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = 0x9382; + public const int MULTISAMPLE_LINE_WIDTH_RANGE_ARB = 0x9381; + public const int MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B; + public const int MULTISAMPLE_SGIS = 0x809D; + public const int MUL_ATI = 0x8964; + public const int MVP_MATRIX_EXT = 0x87E3; + public const int NAMED_STRING_LENGTH_ARB = 0x8DE9; + public const int NAMED_STRING_TYPE_ARB = 0x8DEA; + public const int NAME_LENGTH = 0x92F9; + public const int NAND = 0x150E; + public const int NATIVE_GRAPHICS_BEGIN_HINT_PGI = 0x1A203; + public const int NATIVE_GRAPHICS_END_HINT_PGI = 0x1A204; + public const int NATIVE_GRAPHICS_HANDLE_PGI = 0x1A202; + public const int NEAREST = 0x2600; + public const int NEAREST_CLIPMAP_LINEAR_SGIX = 0x844E; + public const int NEAREST_CLIPMAP_NEAREST_SGIX = 0x844D; + public const int NEAREST_MIPMAP_LINEAR = 0x2702; + public const int NEAREST_MIPMAP_NEAREST = 0x2700; + public const int NEGATE_BIT_ATI = 0x00000004; + public const int NEGATIVE_ONE_EXT = 0x87DF; + public const int NEGATIVE_ONE_TO_ONE = 0x935E; + public const int NEGATIVE_W_EXT = 0x87DC; + public const int NEGATIVE_X_EXT = 0x87D9; + public const int NEGATIVE_Y_EXT = 0x87DA; + public const int NEGATIVE_Z_EXT = 0x87DB; + public const int NEVER = 0x0200; + public const int NEXT_BUFFER_NV = -2; + public const int NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV = 0x9025; + public const int NICEST = 0x1102; + public const int NONE = 0; + public const int NOOP = 0x1505; + public const int NOP_COMMAND_NV = 0x0001; + public const int NOR = 0x1508; + public const int NORMALIZED_RANGE_EXT = 0x87E0; + public const int NORMAL_ARRAY_ADDRESS_NV = 0x8F22; + public const int NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897; + public const int NORMAL_ARRAY_COUNT_EXT = 0x8080; + public const int NORMAL_ARRAY_EXT = 0x8075; + public const int NORMAL_ARRAY_LENGTH_NV = 0x8F2C; + public const int NORMAL_ARRAY_LIST_IBM = 103071; + public const int NORMAL_ARRAY_LIST_STRIDE_IBM = 103081; + public const int NORMAL_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F6; + public const int NORMAL_ARRAY_POINTER_EXT = 0x808F; + public const int NORMAL_ARRAY_STRIDE_EXT = 0x807F; + public const int NORMAL_ARRAY_TYPE_EXT = 0x807E; + public const int NORMAL_BIT_PGI = 0x08000000; + public const int NORMAL_MAP_ARB = 0x8511; + public const int NORMAL_MAP_EXT = 0x8511; + public const int NORMAL_MAP_NV = 0x8511; + public const int NOTEQUAL = 0x0205; + public const int NO_ERROR = 0; + public const int NO_RESET_NOTIFICATION = 0x8261; + public const int NO_RESET_NOTIFICATION_ARB = 0x8261; + public const int NUM_ACTIVE_VARIABLES = 0x9304; + public const int NUM_COMPATIBLE_SUBROUTINES = 0x8E4A; + public const int NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; + public const int NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2; + public const int NUM_DEVICE_UUIDS_EXT = 0x9596; + public const int NUM_EXTENSIONS = 0x821D; + public const int NUM_FILL_STREAMS_NV = 0x8E29; + public const int NUM_FRAGMENT_CONSTANTS_ATI = 0x896F; + public const int NUM_FRAGMENT_REGISTERS_ATI = 0x896E; + public const int NUM_GENERAL_COMBINERS_NV = 0x854E; + public const int NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973; + public const int NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971; + public const int NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972; + public const int NUM_LOOPBACK_COMPONENTS_ATI = 0x8974; + public const int NUM_PASSES_ATI = 0x8970; + public const int NUM_PROGRAM_BINARY_FORMATS = 0x87FE; + public const int NUM_SAMPLE_COUNTS = 0x9380; + public const int NUM_SHADER_BINARY_FORMATS = 0x8DF9; + public const int NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9; + public const int NUM_SPARSE_LEVELS_ARB = 0x91AA; + public const int NUM_SPIR_V_EXTENSIONS = 0x9554; + public const int NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B6; + public const int NUM_TILING_TYPES_EXT = 0x9582; + public const int NUM_VIDEO_CAPTURE_STREAMS_NV = 0x9024; + public const int NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8; + public const int NUM_WINDOW_RECTANGLES_EXT = 0x8F15; + public const int OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89; + public const int OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A; + public const int OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86; + public const int OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87; + public const int OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85; + public const int OBJECT_BUFFER_SIZE_ATI = 0x8764; + public const int OBJECT_BUFFER_USAGE_ATI = 0x8765; + public const int OBJECT_COMPILE_STATUS_ARB = 0x8B81; + public const int OBJECT_DELETE_STATUS_ARB = 0x8B80; + public const int OBJECT_DISTANCE_TO_LINE_SGIS = 0x81F3; + public const int OBJECT_DISTANCE_TO_POINT_SGIS = 0x81F1; + public const int OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84; + public const int OBJECT_LINE_SGIS = 0x81F7; + public const int OBJECT_LINK_STATUS_ARB = 0x8B82; + public const int OBJECT_POINT_SGIS = 0x81F5; + public const int OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88; + public const int OBJECT_SUBTYPE_ARB = 0x8B4F; + public const int OBJECT_TYPE = 0x9112; + public const int OBJECT_TYPE_ARB = 0x8B4E; + public const int OBJECT_VALIDATE_STATUS_ARB = 0x8B83; + public const int OCCLUSION_QUERY_EVENT_MASK_AMD = 0x874F; + public const int OCCLUSION_TEST_HP = 0x8165; + public const int OCCLUSION_TEST_RESULT_HP = 0x8166; + public const int OFFSET = 0x92FC; + public const int OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856; + public const int OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857; + public const int OFFSET_HILO_TEXTURE_2D_NV = 0x8854; + public const int OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855; + public const int OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850; + public const int OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851; + public const int OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852; + public const int OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853; + public const int OFFSET_TEXTURE_2D_BIAS_NV = 0x86E3; + public const int OFFSET_TEXTURE_2D_MATRIX_NV = 0x86E1; + public const int OFFSET_TEXTURE_2D_NV = 0x86E8; + public const int OFFSET_TEXTURE_2D_SCALE_NV = 0x86E2; + public const int OFFSET_TEXTURE_BIAS_NV = 0x86E3; + public const int OFFSET_TEXTURE_MATRIX_NV = 0x86E1; + public const int OFFSET_TEXTURE_RECTANGLE_NV = 0x864C; + public const int OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D; + public const int OFFSET_TEXTURE_SCALE_NV = 0x86E2; + public const int ONE = 1; + public const int ONE_EXT = 0x87DE; + public const int ONE_MINUS_CONSTANT_ALPHA = 0x8004; + public const int ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; + public const int ONE_MINUS_CONSTANT_COLOR = 0x8002; + public const int ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002; + public const int ONE_MINUS_DST_ALPHA = 0x0305; + public const int ONE_MINUS_DST_COLOR = 0x0307; + public const int ONE_MINUS_SRC1_ALPHA = 0x88FB; + public const int ONE_MINUS_SRC1_COLOR = 0x88FA; + public const int ONE_MINUS_SRC_ALPHA = 0x0303; + public const int ONE_MINUS_SRC_COLOR = 0x0301; + public const int OPERAND0_ALPHA_ARB = 0x8598; + public const int OPERAND0_ALPHA_EXT = 0x8598; + public const int OPERAND0_RGB_ARB = 0x8590; + public const int OPERAND0_RGB_EXT = 0x8590; + public const int OPERAND1_ALPHA_ARB = 0x8599; + public const int OPERAND1_ALPHA_EXT = 0x8599; + public const int OPERAND1_RGB_ARB = 0x8591; + public const int OPERAND1_RGB_EXT = 0x8591; + public const int OPERAND2_ALPHA_ARB = 0x859A; + public const int OPERAND2_ALPHA_EXT = 0x859A; + public const int OPERAND2_RGB_ARB = 0x8592; + public const int OPERAND2_RGB_EXT = 0x8592; + public const int OPERAND3_ALPHA_NV = 0x859B; + public const int OPERAND3_RGB_NV = 0x8593; + public const int OPTIMAL_TILING_EXT = 0x9584; + public const int OP_ADD_EXT = 0x8787; + public const int OP_CLAMP_EXT = 0x878E; + public const int OP_CROSS_PRODUCT_EXT = 0x8797; + public const int OP_DOT3_EXT = 0x8784; + public const int OP_DOT4_EXT = 0x8785; + public const int OP_EXP_BASE_2_EXT = 0x8791; + public const int OP_FLOOR_EXT = 0x878F; + public const int OP_FRAC_EXT = 0x8789; + public const int OP_INDEX_EXT = 0x8782; + public const int OP_LOG_BASE_2_EXT = 0x8792; + public const int OP_MADD_EXT = 0x8788; + public const int OP_MAX_EXT = 0x878A; + public const int OP_MIN_EXT = 0x878B; + public const int OP_MOV_EXT = 0x8799; + public const int OP_MULTIPLY_MATRIX_EXT = 0x8798; + public const int OP_MUL_EXT = 0x8786; + public const int OP_NEGATE_EXT = 0x8783; + public const int OP_POWER_EXT = 0x8793; + public const int OP_RECIP_EXT = 0x8794; + public const int OP_RECIP_SQRT_EXT = 0x8795; + public const int OP_ROUND_EXT = 0x8790; + public const int OP_SET_GE_EXT = 0x878C; + public const int OP_SET_LT_EXT = 0x878D; + public const int OP_SUB_EXT = 0x8796; + public const int OR = 0x1507; + public const int OR_INVERTED = 0x150D; + public const int OR_REVERSE = 0x150B; + public const int OUTPUT_COLOR0_EXT = 0x879B; + public const int OUTPUT_COLOR1_EXT = 0x879C; + public const int OUTPUT_FOG_EXT = 0x87BD; + public const int OUTPUT_TEXTURE_COORD0_EXT = 0x879D; + public const int OUTPUT_TEXTURE_COORD10_EXT = 0x87A7; + public const int OUTPUT_TEXTURE_COORD11_EXT = 0x87A8; + public const int OUTPUT_TEXTURE_COORD12_EXT = 0x87A9; + public const int OUTPUT_TEXTURE_COORD13_EXT = 0x87AA; + public const int OUTPUT_TEXTURE_COORD14_EXT = 0x87AB; + public const int OUTPUT_TEXTURE_COORD15_EXT = 0x87AC; + public const int OUTPUT_TEXTURE_COORD16_EXT = 0x87AD; + public const int OUTPUT_TEXTURE_COORD17_EXT = 0x87AE; + public const int OUTPUT_TEXTURE_COORD18_EXT = 0x87AF; + public const int OUTPUT_TEXTURE_COORD19_EXT = 0x87B0; + public const int OUTPUT_TEXTURE_COORD1_EXT = 0x879E; + public const int OUTPUT_TEXTURE_COORD20_EXT = 0x87B1; + public const int OUTPUT_TEXTURE_COORD21_EXT = 0x87B2; + public const int OUTPUT_TEXTURE_COORD22_EXT = 0x87B3; + public const int OUTPUT_TEXTURE_COORD23_EXT = 0x87B4; + public const int OUTPUT_TEXTURE_COORD24_EXT = 0x87B5; + public const int OUTPUT_TEXTURE_COORD25_EXT = 0x87B6; + public const int OUTPUT_TEXTURE_COORD26_EXT = 0x87B7; + public const int OUTPUT_TEXTURE_COORD27_EXT = 0x87B8; + public const int OUTPUT_TEXTURE_COORD28_EXT = 0x87B9; + public const int OUTPUT_TEXTURE_COORD29_EXT = 0x87BA; + public const int OUTPUT_TEXTURE_COORD2_EXT = 0x879F; + public const int OUTPUT_TEXTURE_COORD30_EXT = 0x87BB; + public const int OUTPUT_TEXTURE_COORD31_EXT = 0x87BC; + public const int OUTPUT_TEXTURE_COORD3_EXT = 0x87A0; + public const int OUTPUT_TEXTURE_COORD4_EXT = 0x87A1; + public const int OUTPUT_TEXTURE_COORD5_EXT = 0x87A2; + public const int OUTPUT_TEXTURE_COORD6_EXT = 0x87A3; + public const int OUTPUT_TEXTURE_COORD7_EXT = 0x87A4; + public const int OUTPUT_TEXTURE_COORD8_EXT = 0x87A5; + public const int OUTPUT_TEXTURE_COORD9_EXT = 0x87A6; + public const int OUTPUT_VERTEX_EXT = 0x879A; + public const int OUT_OF_MEMORY = 0x0505; + public const int OVERLAY_KHR = 0x9296; + public const int OVERLAY_NV = 0x9296; + public const int PACK_ALIGNMENT = 0x0D05; + public const int PACK_CMYK_HINT_EXT = 0x800E; + public const int PACK_COMPRESSED_BLOCK_DEPTH = 0x912D; + public const int PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C; + public const int PACK_COMPRESSED_BLOCK_SIZE = 0x912E; + public const int PACK_COMPRESSED_BLOCK_WIDTH = 0x912B; + public const int PACK_IMAGE_DEPTH_SGIS = 0x8131; + public const int PACK_IMAGE_HEIGHT = 0x806C; + public const int PACK_IMAGE_HEIGHT_EXT = 0x806C; + public const int PACK_INVERT_MESA = 0x8758; + public const int PACK_LSB_FIRST = 0x0D01; + public const int PACK_RESAMPLE_OML = 0x8984; + public const int PACK_RESAMPLE_SGIX = 0x842E; + public const int PACK_ROW_BYTES_APPLE = 0x8A15; + public const int PACK_ROW_LENGTH = 0x0D02; + public const int PACK_SKIP_IMAGES = 0x806B; + public const int PACK_SKIP_IMAGES_EXT = 0x806B; + public const int PACK_SKIP_PIXELS = 0x0D04; + public const int PACK_SKIP_ROWS = 0x0D03; + public const int PACK_SKIP_VOLUMES_SGIS = 0x8130; + public const int PACK_SUBSAMPLE_RATE_SGIX = 0x85A0; + public const int PACK_SWAP_BYTES = 0x0D00; + public const int PALETTE4_R5_G6_B5_OES = 0x8B92; + public const int PALETTE4_RGB5_A1_OES = 0x8B94; + public const int PALETTE4_RGB8_OES = 0x8B90; + public const int PALETTE4_RGBA4_OES = 0x8B93; + public const int PALETTE4_RGBA8_OES = 0x8B91; + public const int PALETTE8_R5_G6_B5_OES = 0x8B97; + public const int PALETTE8_RGB5_A1_OES = 0x8B99; + public const int PALETTE8_RGB8_OES = 0x8B95; + public const int PALETTE8_RGBA4_OES = 0x8B98; + public const int PALETTE8_RGBA8_OES = 0x8B96; + public const int PARALLEL_ARRAYS_INTEL = 0x83F4; + public const int PARAMETER_BUFFER = 0x80EE; + public const int PARAMETER_BUFFER_ARB = 0x80EE; + public const int PARAMETER_BUFFER_BINDING = 0x80EF; + public const int PARAMETER_BUFFER_BINDING_ARB = 0x80EF; + public const int PARTIAL_SUCCESS_NV = 0x902E; + public const int PASS_THROUGH_NV = 0x86E6; + public const int PATCHES = 0x000E; + public const int PATCH_DEFAULT_INNER_LEVEL = 0x8E73; + public const int PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; + public const int PATCH_VERTICES = 0x8E72; + public const int PATH_CLIENT_LENGTH_NV = 0x907F; + public const int PATH_COMMAND_COUNT_NV = 0x909D; + public const int PATH_COMPUTED_LENGTH_NV = 0x90A0; + public const int PATH_COORD_COUNT_NV = 0x909E; + public const int PATH_COVER_DEPTH_FUNC_NV = 0x90BF; + public const int PATH_DASH_ARRAY_COUNT_NV = 0x909F; + public const int PATH_DASH_CAPS_NV = 0x907B; + public const int PATH_DASH_OFFSET_NV = 0x907E; + public const int PATH_DASH_OFFSET_RESET_NV = 0x90B4; + public const int PATH_END_CAPS_NV = 0x9076; + public const int PATH_ERROR_POSITION_NV = 0x90AB; + public const int PATH_FILL_BOUNDING_BOX_NV = 0x90A1; + public const int PATH_FILL_COVER_MODE_NV = 0x9082; + public const int PATH_FILL_MASK_NV = 0x9081; + public const int PATH_FILL_MODE_NV = 0x9080; + public const int PATH_FORMAT_PS_NV = 0x9071; + public const int PATH_FORMAT_SVG_NV = 0x9070; + public const int PATH_GEN_COEFF_NV = 0x90B1; + public const int PATH_GEN_COMPONENTS_NV = 0x90B3; + public const int PATH_GEN_MODE_NV = 0x90B0; + public const int PATH_INITIAL_DASH_CAP_NV = 0x907C; + public const int PATH_INITIAL_END_CAP_NV = 0x9077; + public const int PATH_JOIN_STYLE_NV = 0x9079; + public const int PATH_MAX_MODELVIEW_STACK_DEPTH_NV = 0x0D36; + public const int PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38; + public const int PATH_MITER_LIMIT_NV = 0x907A; + public const int PATH_MODELVIEW_MATRIX_NV = 0x0BA6; + public const int PATH_MODELVIEW_NV = 0x1700; + public const int PATH_MODELVIEW_STACK_DEPTH_NV = 0x0BA3; + public const int PATH_OBJECT_BOUNDING_BOX_NV = 0x908A; + public const int PATH_PROJECTION_MATRIX_NV = 0x0BA7; + public const int PATH_PROJECTION_NV = 0x1701; + public const int PATH_PROJECTION_STACK_DEPTH_NV = 0x0BA4; + public const int PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD; + public const int PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE; + public const int PATH_STENCIL_FUNC_NV = 0x90B7; + public const int PATH_STENCIL_REF_NV = 0x90B8; + public const int PATH_STENCIL_VALUE_MASK_NV = 0x90B9; + public const int PATH_STROKE_BOUNDING_BOX_NV = 0x90A2; + public const int PATH_STROKE_COVER_MODE_NV = 0x9083; + public const int PATH_STROKE_MASK_NV = 0x9084; + public const int PATH_STROKE_WIDTH_NV = 0x9075; + public const int PATH_TERMINAL_DASH_CAP_NV = 0x907D; + public const int PATH_TERMINAL_END_CAP_NV = 0x9078; + public const int PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = 0x84E3; + public const int PATH_TRANSPOSE_PROJECTION_MATRIX_NV = 0x84E4; + public const int PERCENTAGE_AMD = 0x8BC3; + public const int PERFMON_RESULT_AMD = 0x8BC6; + public const int PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4; + public const int PERFMON_RESULT_SIZE_AMD = 0x8BC5; + public const int PERFORMANCE_MONITOR_AMD = 0x9152; + public const int PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC; + public const int PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB; + public const int PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA; + public const int PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8; + public const int PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9; + public const int PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF; + public const int PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1; + public const int PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2; + public const int PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0; + public const int PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE; + public const int PERFQUERY_COUNTER_RAW_INTEL = 0x94F4; + public const int PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3; + public const int PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5; + public const int PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9; + public const int PERFQUERY_FLUSH_INTEL = 0x83FA; + public const int PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x00000001; + public const int PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500; + public const int PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD; + public const int PERFQUERY_SINGLE_CONTEXT_INTEL = 0x00000000; + public const int PERFQUERY_WAIT_INTEL = 0x83FB; + public const int PERTURB_EXT = 0x85AE; + public const int PER_GPU_STORAGE_BIT_NV = 0x0800; + public const int PER_GPU_STORAGE_NV = 0x9548; + public const int PER_STAGE_CONSTANTS_NV = 0x8535; + public const int PHONG_HINT_WIN = 0x80EB; + public const int PHONG_WIN = 0x80EA; + public const int PINLIGHT_NV = 0x92A8; + public const int PIXELS_PER_SAMPLE_PATTERN_X_AMD = 0x91AE; + public const int PIXELS_PER_SAMPLE_PATTERN_Y_AMD = 0x91AF; + public const int PIXEL_BUFFER_BARRIER_BIT = 0x00000080; + public const int PIXEL_BUFFER_BARRIER_BIT_EXT = 0x00000080; + public const int PIXEL_COUNTER_BITS_NV = 0x8864; + public const int PIXEL_COUNT_AVAILABLE_NV = 0x8867; + public const int PIXEL_COUNT_NV = 0x8866; + public const int PIXEL_CUBIC_WEIGHT_EXT = 0x8333; + public const int PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = 0x8355; + public const int PIXEL_FRAGMENT_RGB_SOURCE_SGIS = 0x8354; + public const int PIXEL_GROUP_COLOR_SGIS = 0x8356; + public const int PIXEL_MAG_FILTER_EXT = 0x8331; + public const int PIXEL_MIN_FILTER_EXT = 0x8332; + public const int PIXEL_PACK_BUFFER = 0x88EB; + public const int PIXEL_PACK_BUFFER_ARB = 0x88EB; + public const int PIXEL_PACK_BUFFER_BINDING = 0x88ED; + public const int PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED; + public const int PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED; + public const int PIXEL_PACK_BUFFER_EXT = 0x88EB; + public const int PIXEL_SUBSAMPLE_2424_SGIX = 0x85A3; + public const int PIXEL_SUBSAMPLE_4242_SGIX = 0x85A4; + public const int PIXEL_SUBSAMPLE_4444_SGIX = 0x85A2; + public const int PIXEL_TEXTURE_SGIS = 0x8353; + public const int PIXEL_TEX_GEN_MODE_SGIX = 0x832B; + public const int PIXEL_TEX_GEN_SGIX = 0x8139; + public const int PIXEL_TILE_BEST_ALIGNMENT_SGIX = 0x813E; + public const int PIXEL_TILE_CACHE_INCREMENT_SGIX = 0x813F; + public const int PIXEL_TILE_CACHE_SIZE_SGIX = 0x8145; + public const int PIXEL_TILE_GRID_DEPTH_SGIX = 0x8144; + public const int PIXEL_TILE_GRID_HEIGHT_SGIX = 0x8143; + public const int PIXEL_TILE_GRID_WIDTH_SGIX = 0x8142; + public const int PIXEL_TILE_HEIGHT_SGIX = 0x8141; + public const int PIXEL_TILE_WIDTH_SGIX = 0x8140; + public const int PIXEL_TRANSFORM_2D_EXT = 0x8330; + public const int PIXEL_TRANSFORM_2D_MATRIX_EXT = 0x8338; + public const int PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8336; + public const int PIXEL_UNPACK_BUFFER = 0x88EC; + public const int PIXEL_UNPACK_BUFFER_ARB = 0x88EC; + public const int PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; + public const int PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF; + public const int PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF; + public const int PIXEL_UNPACK_BUFFER_EXT = 0x88EC; + public const int PLUS_CLAMPED_ALPHA_NV = 0x92B2; + public const int PLUS_CLAMPED_NV = 0x92B1; + public const int PLUS_DARKER_NV = 0x9292; + public const int PLUS_NV = 0x9291; + public const int PN_TRIANGLES_ATI = 0x87F0; + public const int PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3; + public const int PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7; + public const int PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8; + public const int PN_TRIANGLES_POINT_MODE_ATI = 0x87F2; + public const int PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6; + public const int PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5; + public const int PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4; + public const int POINT = 0x1B00; + public const int POINTS = 0x0000; + public const int POINT_DISTANCE_ATTENUATION_ARB = 0x8129; + public const int POINT_FADE_THRESHOLD_SIZE = 0x8128; + public const int POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128; + public const int POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128; + public const int POINT_FADE_THRESHOLD_SIZE_SGIS = 0x8128; + public const int POINT_SIZE = 0x0B11; + public const int POINT_SIZE_GRANULARITY = 0x0B13; + public const int POINT_SIZE_MAX_ARB = 0x8127; + public const int POINT_SIZE_MAX_EXT = 0x8127; + public const int POINT_SIZE_MAX_SGIS = 0x8127; + public const int POINT_SIZE_MIN_ARB = 0x8126; + public const int POINT_SIZE_MIN_EXT = 0x8126; + public const int POINT_SIZE_MIN_SGIS = 0x8126; + public const int POINT_SIZE_RANGE = 0x0B12; + public const int POINT_SPRITE_ARB = 0x8861; + public const int POINT_SPRITE_COORD_ORIGIN = 0x8CA0; + public const int POINT_SPRITE_NV = 0x8861; + public const int POINT_SPRITE_R_MODE_NV = 0x8863; + public const int POLYGON_MODE = 0x0B40; + public const int POLYGON_OFFSET_BIAS_EXT = 0x8039; + public const int POLYGON_OFFSET_CLAMP = 0x8E1B; + public const int POLYGON_OFFSET_CLAMP_EXT = 0x8E1B; + public const int POLYGON_OFFSET_COMMAND_NV = 0x000E; + public const int POLYGON_OFFSET_EXT = 0x8037; + public const int POLYGON_OFFSET_FACTOR = 0x8038; + public const int POLYGON_OFFSET_FACTOR_EXT = 0x8038; + public const int POLYGON_OFFSET_FILL = 0x8037; + public const int POLYGON_OFFSET_LINE = 0x2A02; + public const int POLYGON_OFFSET_POINT = 0x2A01; + public const int POLYGON_OFFSET_UNITS = 0x2A00; + public const int POLYGON_SMOOTH = 0x0B41; + public const int POLYGON_SMOOTH_HINT = 0x0C53; + public const int POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB; + public const int POST_COLOR_MATRIX_ALPHA_SCALE_SGI = 0x80B7; + public const int POST_COLOR_MATRIX_BLUE_BIAS_SGI = 0x80BA; + public const int POST_COLOR_MATRIX_BLUE_SCALE_SGI = 0x80B6; + public const int POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D2; + public const int POST_COLOR_MATRIX_GREEN_BIAS_SGI = 0x80B9; + public const int POST_COLOR_MATRIX_GREEN_SCALE_SGI = 0x80B5; + public const int POST_COLOR_MATRIX_RED_BIAS_SGI = 0x80B8; + public const int POST_COLOR_MATRIX_RED_SCALE_SGI = 0x80B4; + public const int POST_CONVOLUTION_ALPHA_BIAS_EXT = 0x8023; + public const int POST_CONVOLUTION_ALPHA_SCALE_EXT = 0x801F; + public const int POST_CONVOLUTION_BLUE_BIAS_EXT = 0x8022; + public const int POST_CONVOLUTION_BLUE_SCALE_EXT = 0x801E; + public const int POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D1; + public const int POST_CONVOLUTION_GREEN_BIAS_EXT = 0x8021; + public const int POST_CONVOLUTION_GREEN_SCALE_EXT = 0x801D; + public const int POST_CONVOLUTION_RED_BIAS_EXT = 0x8020; + public const int POST_CONVOLUTION_RED_SCALE_EXT = 0x801C; + public const int POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162; + public const int POST_TEXTURE_FILTER_BIAS_RANGE_SGIX = 0x817B; + public const int POST_TEXTURE_FILTER_BIAS_SGIX = 0x8179; + public const int POST_TEXTURE_FILTER_SCALE_RANGE_SGIX = 0x817C; + public const int POST_TEXTURE_FILTER_SCALE_SGIX = 0x817A; + public const int PREFER_DOUBLEBUFFER_HINT_PGI = 0x1A1F8; + public const int PRESENT_DURATION_NV = 0x8E2B; + public const int PRESENT_TIME_NV = 0x8E2A; + public const int PRESERVE_ATI = 0x8762; + public const int PREVIOUS_ARB = 0x8578; + public const int PREVIOUS_EXT = 0x8578; + public const int PREVIOUS_TEXTURE_INPUT_NV = 0x86E4; + public const int PRIMARY_COLOR_ARB = 0x8577; + public const int PRIMARY_COLOR_EXT = 0x8577; + public const int PRIMARY_COLOR_NV = 0x852C; + public const int PRIMITIVES_GENERATED = 0x8C87; + public const int PRIMITIVES_GENERATED_EXT = 0x8C87; + public const int PRIMITIVES_GENERATED_NV = 0x8C87; + public const int PRIMITIVES_SUBMITTED = 0x82EF; + public const int PRIMITIVES_SUBMITTED_ARB = 0x82EF; + public const int PRIMITIVE_BOUNDING_BOX_ARB = 0x92BE; + public const int PRIMITIVE_ID_NV = 0x8C7C; + public const int PRIMITIVE_RESTART = 0x8F9D; + public const int PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; + public const int PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221; + public const int PRIMITIVE_RESTART_INDEX = 0x8F9E; + public const int PRIMITIVE_RESTART_INDEX_NV = 0x8559; + public const int PRIMITIVE_RESTART_NV = 0x8558; + public const int PROGRAM = 0x82E2; + public const int PROGRAMMABLE_SAMPLE_LOCATION_ARB = 0x9341; + public const int PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9341; + public const int PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = 0x9340; + public const int PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = 0x9340; + public const int PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; + public const int PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; + public const int PROGRAM_ATTRIBS_ARB = 0x88AC; + public const int PROGRAM_ATTRIB_COMPONENTS_NV = 0x8906; + public const int PROGRAM_BINARY_FORMATS = 0x87FF; + public const int PROGRAM_BINARY_FORMAT_MESA = 0x875F; + public const int PROGRAM_BINARY_LENGTH = 0x8741; + public const int PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; + public const int PROGRAM_BINDING_ARB = 0x8677; + public const int PROGRAM_ERROR_POSITION_ARB = 0x864B; + public const int PROGRAM_ERROR_POSITION_NV = 0x864B; + public const int PROGRAM_ERROR_STRING_ARB = 0x8874; + public const int PROGRAM_ERROR_STRING_NV = 0x8874; + public const int PROGRAM_FORMAT_ARB = 0x8876; + public const int PROGRAM_FORMAT_ASCII_ARB = 0x8875; + public const int PROGRAM_INPUT = 0x92E3; + public const int PROGRAM_INSTRUCTIONS_ARB = 0x88A0; + public const int PROGRAM_LENGTH_ARB = 0x8627; + public const int PROGRAM_LENGTH_NV = 0x8627; + public const int PROGRAM_MATRIX_EXT = 0x8E2D; + public const int PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F; + public const int PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; + public const int PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; + public const int PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; + public const int PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; + public const int PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; + public const int PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; + public const int PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; + public const int PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; + public const int PROGRAM_OBJECT_ARB = 0x8B40; + public const int PROGRAM_OBJECT_EXT = 0x8B40; + public const int PROGRAM_OUTPUT = 0x92E4; + public const int PROGRAM_PARAMETERS_ARB = 0x88A8; + public const int PROGRAM_PARAMETER_NV = 0x8644; + public const int PROGRAM_PIPELINE = 0x82E4; + public const int PROGRAM_PIPELINE_BINDING = 0x825A; + public const int PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F; + public const int PROGRAM_POINT_SIZE = 0x8642; + public const int PROGRAM_POINT_SIZE_ARB = 0x8642; + public const int PROGRAM_POINT_SIZE_EXT = 0x8642; + public const int PROGRAM_RESIDENT_NV = 0x8647; + public const int PROGRAM_RESULT_COMPONENTS_NV = 0x8907; + public const int PROGRAM_SEPARABLE = 0x8258; + public const int PROGRAM_STRING_ARB = 0x8628; + public const int PROGRAM_STRING_NV = 0x8628; + public const int PROGRAM_TARGET_NV = 0x8646; + public const int PROGRAM_TEMPORARIES_ARB = 0x88A4; + public const int PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; + public const int PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; + public const int PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; + public const int PROTECTED_MEMORY_OBJECT_EXT = 0x959B; + public const int PROVOKING_VERTEX = 0x8E4F; + public const int PROVOKING_VERTEX_EXT = 0x8E4F; + public const int PROXY_COLOR_TABLE_SGI = 0x80D3; + public const int PROXY_HISTOGRAM_EXT = 0x8025; + public const int PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D5; + public const int PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D4; + public const int PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8163; + public const int PROXY_TEXTURE_1D = 0x8063; + public const int PROXY_TEXTURE_1D_ARRAY = 0x8C19; + public const int PROXY_TEXTURE_1D_ARRAY_EXT = 0x8C19; + public const int PROXY_TEXTURE_1D_EXT = 0x8063; + public const int PROXY_TEXTURE_1D_STACK_MESAX = 0x875B; + public const int PROXY_TEXTURE_2D = 0x8064; + public const int PROXY_TEXTURE_2D_ARRAY = 0x8C1B; + public const int PROXY_TEXTURE_2D_ARRAY_EXT = 0x8C1B; + public const int PROXY_TEXTURE_2D_EXT = 0x8064; + public const int PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; + public const int PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; + public const int PROXY_TEXTURE_2D_STACK_MESAX = 0x875C; + public const int PROXY_TEXTURE_3D = 0x8070; + public const int PROXY_TEXTURE_3D_EXT = 0x8070; + public const int PROXY_TEXTURE_4D_SGIS = 0x8135; + public const int PROXY_TEXTURE_COLOR_TABLE_SGI = 0x80BD; + public const int PROXY_TEXTURE_CUBE_MAP = 0x851B; + public const int PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B; + public const int PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B; + public const int PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B; + public const int PROXY_TEXTURE_CUBE_MAP_EXT = 0x851B; + public const int PROXY_TEXTURE_RECTANGLE = 0x84F7; + public const int PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7; + public const int PROXY_TEXTURE_RECTANGLE_NV = 0x84F7; + public const int PURGEABLE_APPLE = 0x8A1D; + public const int PURGED_CONTEXT_RESET_NV = 0x92BB; + public const int QUADRATIC_CURVE_TO_NV = 0x0A; + public const int QUADS = 0x0007; + public const int QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; + public const int QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C; + public const int QUAD_ALPHA4_SGIS = 0x811E; + public const int QUAD_ALPHA8_SGIS = 0x811F; + public const int QUAD_INTENSITY4_SGIS = 0x8122; + public const int QUAD_INTENSITY8_SGIS = 0x8123; + public const int QUAD_LUMINANCE4_SGIS = 0x8120; + public const int QUAD_LUMINANCE8_SGIS = 0x8121; + public const int QUAD_MESH_SUN = 0x8614; + public const int QUAD_TEXTURE_SELECT_SGIS = 0x8125; + public const int QUARTER_BIT_ATI = 0x00000010; + public const int QUERY = 0x82E3; + public const uint QUERY_ALL_EVENT_BITS_AMD = 0xFFFFFFFF; + public const int QUERY_BUFFER = 0x9192; + public const int QUERY_BUFFER_AMD = 0x9192; + public const int QUERY_BUFFER_BARRIER_BIT = 0x00008000; + public const int QUERY_BUFFER_BINDING = 0x9193; + public const int QUERY_BUFFER_BINDING_AMD = 0x9193; + public const int QUERY_BY_REGION_NO_WAIT = 0x8E16; + public const int QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; + public const int QUERY_BY_REGION_NO_WAIT_NV = 0x8E16; + public const int QUERY_BY_REGION_WAIT = 0x8E15; + public const int QUERY_BY_REGION_WAIT_INVERTED = 0x8E19; + public const int QUERY_BY_REGION_WAIT_NV = 0x8E15; + public const int QUERY_COUNTER_BITS = 0x8864; + public const int QUERY_COUNTER_BITS_ARB = 0x8864; + public const int QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD = 0x00000008; + public const int QUERY_DEPTH_FAIL_EVENT_BIT_AMD = 0x00000002; + public const int QUERY_DEPTH_PASS_EVENT_BIT_AMD = 0x00000001; + public const int QUERY_NO_WAIT = 0x8E14; + public const int QUERY_NO_WAIT_INVERTED = 0x8E18; + public const int QUERY_NO_WAIT_NV = 0x8E14; + public const int QUERY_OBJECT_AMD = 0x9153; + public const int QUERY_OBJECT_EXT = 0x9153; + public const int QUERY_RESOURCE_BUFFEROBJECT_NV = 0x9547; + public const int QUERY_RESOURCE_MEMTYPE_VIDMEM_NV = 0x9542; + public const int QUERY_RESOURCE_RENDERBUFFER_NV = 0x9546; + public const int QUERY_RESOURCE_SYS_RESERVED_NV = 0x9544; + public const int QUERY_RESOURCE_TEXTURE_NV = 0x9545; + public const int QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV = 0x9540; + public const int QUERY_RESULT = 0x8866; + public const int QUERY_RESULT_ARB = 0x8866; + public const int QUERY_RESULT_AVAILABLE = 0x8867; + public const int QUERY_RESULT_AVAILABLE_ARB = 0x8867; + public const int QUERY_RESULT_NO_WAIT = 0x9194; + public const int QUERY_RESULT_NO_WAIT_AMD = 0x9194; + public const int QUERY_STENCIL_FAIL_EVENT_BIT_AMD = 0x00000004; + public const int QUERY_TARGET = 0x82EA; + public const int QUERY_WAIT = 0x8E13; + public const int QUERY_WAIT_INVERTED = 0x8E17; + public const int QUERY_WAIT_NV = 0x8E13; + public const int R11F_G11F_B10F = 0x8C3A; + public const int R11F_G11F_B10F_EXT = 0x8C3A; + public const int R16 = 0x822A; + public const int R16F = 0x822D; + public const int R16F_EXT = 0x822D; + public const int R16I = 0x8233; + public const int R16UI = 0x8234; + public const int R16_SNORM = 0x8F98; + public const int R1UI_C3F_V3F_SUN = 0x85C6; + public const int R1UI_C4F_N3F_V3F_SUN = 0x85C8; + public const int R1UI_C4UB_V3F_SUN = 0x85C5; + public const int R1UI_N3F_V3F_SUN = 0x85C7; + public const int R1UI_T2F_C4F_N3F_V3F_SUN = 0x85CB; + public const int R1UI_T2F_N3F_V3F_SUN = 0x85CA; + public const int R1UI_T2F_V3F_SUN = 0x85C9; + public const int R1UI_V3F_SUN = 0x85C4; + public const int R32F = 0x822E; + public const int R32F_EXT = 0x822E; + public const int R32I = 0x8235; + public const int R32UI = 0x8236; + public const int R3_G3_B2 = 0x2A10; + public const int R8 = 0x8229; + public const int R8I = 0x8231; + public const int R8UI = 0x8232; + public const int R8_EXT = 0x8229; + public const int R8_SNORM = 0x8F94; + public const int RASTERIZER_DISCARD = 0x8C89; + public const int RASTERIZER_DISCARD_EXT = 0x8C89; + public const int RASTERIZER_DISCARD_NV = 0x8C89; + public const int RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A; + public const int RASTER_MULTISAMPLE_EXT = 0x9327; + public const int RASTER_POSITION_UNCLIPPED_IBM = 0x19262; + public const int RASTER_SAMPLES_EXT = 0x9328; + public const int READ_BUFFER = 0x0C02; + public const int READ_FRAMEBUFFER = 0x8CA8; + public const int READ_FRAMEBUFFER_BINDING = 0x8CAA; + public const int READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA; + public const int READ_FRAMEBUFFER_EXT = 0x8CA8; + public const int READ_ONLY = 0x88B8; + public const int READ_ONLY_ARB = 0x88B8; + public const int READ_PIXELS = 0x828C; + public const int READ_PIXELS_FORMAT = 0x828D; + public const int READ_PIXELS_TYPE = 0x828E; + public const int READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B; + public const int READ_PIXEL_DATA_RANGE_NV = 0x8879; + public const int READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D; + public const int READ_WRITE = 0x88BA; + public const int READ_WRITE_ARB = 0x88BA; + public const int RECLAIM_MEMORY_HINT_PGI = 0x1A1FE; + public const int RECT_NV = 0xF6; + public const int RED = 0x1903; + public const int REDUCE_EXT = 0x8016; + public const int RED_BIT_ATI = 0x00000001; + public const int RED_INTEGER = 0x8D94; + public const int RED_INTEGER_EXT = 0x8D94; + public const int RED_MAX_CLAMP_INGR = 0x8564; + public const int RED_MIN_CLAMP_INGR = 0x8560; + public const int RED_NV = 0x1903; + public const int RED_SNORM = 0x8F90; + public const int REFERENCED_BY_COMPUTE_SHADER = 0x930B; + public const int REFERENCED_BY_FRAGMENT_SHADER = 0x930A; + public const int REFERENCED_BY_GEOMETRY_SHADER = 0x9309; + public const int REFERENCED_BY_MESH_SHADER_NV = 0x95A0; + public const int REFERENCED_BY_TASK_SHADER_NV = 0x95A1; + public const int REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307; + public const int REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308; + public const int REFERENCED_BY_VERTEX_SHADER = 0x9306; + public const int REFERENCE_PLANE_EQUATION_SGIX = 0x817E; + public const int REFERENCE_PLANE_SGIX = 0x817D; + public const int REFLECTION_MAP_ARB = 0x8512; + public const int REFLECTION_MAP_EXT = 0x8512; + public const int REFLECTION_MAP_NV = 0x8512; + public const int REGISTER_COMBINERS_NV = 0x8522; + public const int REG_0_ATI = 0x8921; + public const int REG_10_ATI = 0x892B; + public const int REG_11_ATI = 0x892C; + public const int REG_12_ATI = 0x892D; + public const int REG_13_ATI = 0x892E; + public const int REG_14_ATI = 0x892F; + public const int REG_15_ATI = 0x8930; + public const int REG_16_ATI = 0x8931; + public const int REG_17_ATI = 0x8932; + public const int REG_18_ATI = 0x8933; + public const int REG_19_ATI = 0x8934; + public const int REG_1_ATI = 0x8922; + public const int REG_20_ATI = 0x8935; + public const int REG_21_ATI = 0x8936; + public const int REG_22_ATI = 0x8937; + public const int REG_23_ATI = 0x8938; + public const int REG_24_ATI = 0x8939; + public const int REG_25_ATI = 0x893A; + public const int REG_26_ATI = 0x893B; + public const int REG_27_ATI = 0x893C; + public const int REG_28_ATI = 0x893D; + public const int REG_29_ATI = 0x893E; + public const int REG_2_ATI = 0x8923; + public const int REG_30_ATI = 0x893F; + public const int REG_31_ATI = 0x8940; + public const int REG_3_ATI = 0x8924; + public const int REG_4_ATI = 0x8925; + public const int REG_5_ATI = 0x8926; + public const int REG_6_ATI = 0x8927; + public const int REG_7_ATI = 0x8928; + public const int REG_8_ATI = 0x8929; + public const int REG_9_ATI = 0x892A; + public const int RELATIVE_ARC_TO_NV = 0xFF; + public const int RELATIVE_CONIC_CURVE_TO_NV = 0x1B; + public const int RELATIVE_CUBIC_CURVE_TO_NV = 0x0D; + public const int RELATIVE_HORIZONTAL_LINE_TO_NV = 0x07; + public const int RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17; + public const int RELATIVE_LARGE_CW_ARC_TO_NV = 0x19; + public const int RELATIVE_LINE_TO_NV = 0x05; + public const int RELATIVE_MOVE_TO_NV = 0x03; + public const int RELATIVE_QUADRATIC_CURVE_TO_NV = 0x0B; + public const int RELATIVE_RECT_NV = 0xF7; + public const int RELATIVE_ROUNDED_RECT2_NV = 0xEB; + public const int RELATIVE_ROUNDED_RECT4_NV = 0xED; + public const int RELATIVE_ROUNDED_RECT8_NV = 0xEF; + public const int RELATIVE_ROUNDED_RECT_NV = 0xE9; + public const int RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13; + public const int RELATIVE_SMALL_CW_ARC_TO_NV = 0x15; + public const int RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11; + public const int RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0F; + public const int RELATIVE_VERTICAL_LINE_TO_NV = 0x09; + public const int RELEASED_APPLE = 0x8A19; + public const int RENDERBUFFER = 0x8D41; + public const int RENDERBUFFER_ALPHA_SIZE = 0x8D53; + public const int RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53; + public const int RENDERBUFFER_BINDING = 0x8CA7; + public const int RENDERBUFFER_BINDING_EXT = 0x8CA7; + public const int RENDERBUFFER_BLUE_SIZE = 0x8D52; + public const int RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52; + public const int RENDERBUFFER_COLOR_SAMPLES_NV = 0x8E10; + public const int RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB; + public const int RENDERBUFFER_DEPTH_SIZE = 0x8D54; + public const int RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54; + public const int RENDERBUFFER_EXT = 0x8D41; + public const int RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; + public const int RENDERBUFFER_GREEN_SIZE = 0x8D51; + public const int RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51; + public const int RENDERBUFFER_HEIGHT = 0x8D43; + public const int RENDERBUFFER_HEIGHT_EXT = 0x8D43; + public const int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; + public const int RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44; + public const int RENDERBUFFER_RED_SIZE = 0x8D50; + public const int RENDERBUFFER_RED_SIZE_EXT = 0x8D50; + public const int RENDERBUFFER_SAMPLES = 0x8CAB; + public const int RENDERBUFFER_SAMPLES_EXT = 0x8CAB; + public const int RENDERBUFFER_STENCIL_SIZE = 0x8D55; + public const int RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55; + public const int RENDERBUFFER_STORAGE_SAMPLES_AMD = 0x91B2; + public const int RENDERBUFFER_WIDTH = 0x8D42; + public const int RENDERBUFFER_WIDTH_EXT = 0x8D42; + public const int RENDERER = 0x1F01; + public const int RENDER_GPU_MASK_NV = 0x9558; + public const int REPEAT = 0x2901; + public const int REPLACE = 0x1E01; + public const int REPLACEMENT_CODE_ARRAY_POINTER_SUN = 0x85C3; + public const int REPLACEMENT_CODE_ARRAY_STRIDE_SUN = 0x85C2; + public const int REPLACEMENT_CODE_ARRAY_SUN = 0x85C0; + public const int REPLACEMENT_CODE_ARRAY_TYPE_SUN = 0x85C1; + public const int REPLACEMENT_CODE_SUN = 0x81D8; + public const int REPLACE_EXT = 0x8062; + public const int REPLACE_MIDDLE_SUN = 0x0002; + public const int REPLACE_OLDEST_SUN = 0x0003; + public const int REPLACE_VALUE_AMD = 0x874B; + public const int REPLICATE_BORDER_HP = 0x8153; + public const int REPRESENTATIVE_FRAGMENT_TEST_NV = 0x937F; + public const int RESAMPLE_AVERAGE_OML = 0x8988; + public const int RESAMPLE_DECIMATE_OML = 0x8989; + public const int RESAMPLE_DECIMATE_SGIX = 0x8430; + public const int RESAMPLE_REPLICATE_OML = 0x8986; + public const int RESAMPLE_REPLICATE_SGIX = 0x8433; + public const int RESAMPLE_ZERO_FILL_OML = 0x8987; + public const int RESAMPLE_ZERO_FILL_SGIX = 0x8434; + public const int RESCALE_NORMAL_EXT = 0x803A; + public const int RESET_NOTIFICATION_STRATEGY = 0x8256; + public const int RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; + public const int RESTART_PATH_NV = 0xF0; + public const int RESTART_SUN = 0x0001; + public const int RETAINED_APPLE = 0x8A1B; + public const int RG = 0x8227; + public const int RG16 = 0x822C; + public const int RG16F = 0x822F; + public const int RG16F_EXT = 0x822F; + public const int RG16I = 0x8239; + public const int RG16UI = 0x823A; + public const int RG16_SNORM = 0x8F99; + public const int RG32F = 0x8230; + public const int RG32F_EXT = 0x8230; + public const int RG32I = 0x823B; + public const int RG32UI = 0x823C; + public const int RG8 = 0x822B; + public const int RG8I = 0x8237; + public const int RG8UI = 0x8238; + public const int RG8_EXT = 0x822B; + public const int RG8_SNORM = 0x8F95; + public const int RGB = 0x1907; + public const int RGB10 = 0x8052; + public const int RGB10_A2 = 0x8059; + public const int RGB10_A2UI = 0x906F; + public const int RGB10_A2_EXT = 0x8059; + public const int RGB10_EXT = 0x8052; + public const int RGB12 = 0x8053; + public const int RGB12_EXT = 0x8053; + public const int RGB16 = 0x8054; + public const int RGB16F = 0x881B; + public const int RGB16F_ARB = 0x881B; + public const int RGB16F_EXT = 0x881B; + public const int RGB16I = 0x8D89; + public const int RGB16I_EXT = 0x8D89; + public const int RGB16UI = 0x8D77; + public const int RGB16UI_EXT = 0x8D77; + public const int RGB16_EXT = 0x8054; + public const int RGB16_SNORM = 0x8F9A; + public const int RGB2_EXT = 0x804E; + public const int RGB32F = 0x8815; + public const int RGB32F_ARB = 0x8815; + public const int RGB32F_EXT = 0x8815; + public const int RGB32I = 0x8D83; + public const int RGB32I_EXT = 0x8D83; + public const int RGB32UI = 0x8D71; + public const int RGB32UI_EXT = 0x8D71; + public const int RGB4 = 0x804F; + public const int RGB4_EXT = 0x804F; + public const int RGB4_S3TC = 0x83A1; + public const int RGB5 = 0x8050; + public const int RGB565 = 0x8D62; + public const int RGB5_A1 = 0x8057; + public const int RGB5_A1_EXT = 0x8057; + public const int RGB5_EXT = 0x8050; + public const int RGB8 = 0x8051; + public const int RGB8I = 0x8D8F; + public const int RGB8I_EXT = 0x8D8F; + public const int RGB8UI = 0x8D7D; + public const int RGB8UI_EXT = 0x8D7D; + public const int RGB8_EXT = 0x8051; + public const int RGB8_SNORM = 0x8F96; + public const int RGB9_E5 = 0x8C3D; + public const int RGB9_E5_EXT = 0x8C3D; + public const int RGBA = 0x1908; + public const int RGBA12 = 0x805A; + public const int RGBA12_EXT = 0x805A; + public const int RGBA16 = 0x805B; + public const int RGBA16F = 0x881A; + public const int RGBA16F_ARB = 0x881A; + public const int RGBA16F_EXT = 0x881A; + public const int RGBA16I = 0x8D88; + public const int RGBA16I_EXT = 0x8D88; + public const int RGBA16UI = 0x8D76; + public const int RGBA16UI_EXT = 0x8D76; + public const int RGBA16_EXT = 0x805B; + public const int RGBA16_SNORM = 0x8F9B; + public const int RGBA2 = 0x8055; + public const int RGBA2_EXT = 0x8055; + public const int RGBA32F = 0x8814; + public const int RGBA32F_ARB = 0x8814; + public const int RGBA32F_EXT = 0x8814; + public const int RGBA32I = 0x8D82; + public const int RGBA32I_EXT = 0x8D82; + public const int RGBA32UI = 0x8D70; + public const int RGBA32UI_EXT = 0x8D70; + public const int RGBA4 = 0x8056; + public const int RGBA4_DXT5_S3TC = 0x83A5; + public const int RGBA4_EXT = 0x8056; + public const int RGBA4_S3TC = 0x83A3; + public const int RGBA8 = 0x8058; + public const int RGBA8I = 0x8D8E; + public const int RGBA8I_EXT = 0x8D8E; + public const int RGBA8UI = 0x8D7C; + public const int RGBA8UI_EXT = 0x8D7C; + public const int RGBA8_EXT = 0x8058; + public const int RGBA8_SNORM = 0x8F97; + public const int RGBA_DXT5_S3TC = 0x83A4; + public const int RGBA_FLOAT16_APPLE = 0x881A; + public const int RGBA_FLOAT16_ATI = 0x881A; + public const int RGBA_FLOAT32_APPLE = 0x8814; + public const int RGBA_FLOAT32_ATI = 0x8814; + public const int RGBA_FLOAT_MODE_ARB = 0x8820; + public const int RGBA_FLOAT_MODE_ATI = 0x8820; + public const int RGBA_INTEGER = 0x8D99; + public const int RGBA_INTEGER_EXT = 0x8D99; + public const int RGBA_INTEGER_MODE_EXT = 0x8D9E; + public const int RGBA_S3TC = 0x83A2; + public const int RGBA_SIGNED_COMPONENTS_EXT = 0x8C3C; + public const int RGBA_SNORM = 0x8F93; + public const int RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9; + public const int RGB_422_APPLE = 0x8A1F; + public const int RGB_FLOAT16_APPLE = 0x881B; + public const int RGB_FLOAT16_ATI = 0x881B; + public const int RGB_FLOAT32_APPLE = 0x8815; + public const int RGB_FLOAT32_ATI = 0x8815; + public const int RGB_INTEGER = 0x8D98; + public const int RGB_INTEGER_EXT = 0x8D98; + public const int RGB_RAW_422_APPLE = 0x8A51; + public const int RGB_S3TC = 0x83A0; + public const int RGB_SCALE_ARB = 0x8573; + public const int RGB_SCALE_EXT = 0x8573; + public const int RGB_SNORM = 0x8F92; + public const int RG_INTEGER = 0x8228; + public const int RG_SNORM = 0x8F91; + public const int RIGHT = 0x0407; + public const int ROUNDED_RECT2_NV = 0xEA; + public const int ROUNDED_RECT4_NV = 0xEC; + public const int ROUNDED_RECT8_NV = 0xEE; + public const int ROUNDED_RECT_NV = 0xE8; + public const int ROUND_NV = 0x90A4; + public const int SAMPLER = 0x82E6; + public const int SAMPLER_1D = 0x8B5D; + public const int SAMPLER_1D_ARB = 0x8B5D; + public const int SAMPLER_1D_ARRAY = 0x8DC0; + public const int SAMPLER_1D_ARRAY_EXT = 0x8DC0; + public const int SAMPLER_1D_ARRAY_SHADOW = 0x8DC3; + public const int SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3; + public const int SAMPLER_1D_SHADOW = 0x8B61; + public const int SAMPLER_1D_SHADOW_ARB = 0x8B61; + public const int SAMPLER_2D = 0x8B5E; + public const int SAMPLER_2D_ARB = 0x8B5E; + public const int SAMPLER_2D_ARRAY = 0x8DC1; + public const int SAMPLER_2D_ARRAY_EXT = 0x8DC1; + public const int SAMPLER_2D_ARRAY_SHADOW = 0x8DC4; + public const int SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4; + public const int SAMPLER_2D_MULTISAMPLE = 0x9108; + public const int SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B; + public const int SAMPLER_2D_RECT = 0x8B63; + public const int SAMPLER_2D_RECT_ARB = 0x8B63; + public const int SAMPLER_2D_RECT_SHADOW = 0x8B64; + public const int SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64; + public const int SAMPLER_2D_SHADOW = 0x8B62; + public const int SAMPLER_2D_SHADOW_ARB = 0x8B62; + public const int SAMPLER_3D = 0x8B5F; + public const int SAMPLER_3D_ARB = 0x8B5F; + public const int SAMPLER_BINDING = 0x8919; + public const int SAMPLER_BUFFER = 0x8DC2; + public const int SAMPLER_BUFFER_AMD = 0x9001; + public const int SAMPLER_BUFFER_EXT = 0x8DC2; + public const int SAMPLER_CUBE = 0x8B60; + public const int SAMPLER_CUBE_ARB = 0x8B60; + public const int SAMPLER_CUBE_MAP_ARRAY = 0x900C; + public const int SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C; + public const int SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D; + public const int SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D; + public const int SAMPLER_CUBE_SHADOW = 0x8DC5; + public const int SAMPLER_CUBE_SHADOW_EXT = 0x8DC5; + public const int SAMPLER_OBJECT_AMD = 0x9155; + public const int SAMPLER_RENDERBUFFER_NV = 0x8E56; + public const int SAMPLES = 0x80A9; + public const int SAMPLES_3DFX = 0x86B4; + public const int SAMPLES_ARB = 0x80A9; + public const int SAMPLES_EXT = 0x80A9; + public const int SAMPLES_PASSED = 0x8914; + public const int SAMPLES_PASSED_ARB = 0x8914; + public const int SAMPLES_SGIS = 0x80A9; + public const int SAMPLE_ALPHA_TO_COVERAGE = 0x809E; + public const int SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E; + public const int SAMPLE_ALPHA_TO_MASK_EXT = 0x809E; + public const int SAMPLE_ALPHA_TO_MASK_SGIS = 0x809E; + public const int SAMPLE_ALPHA_TO_ONE = 0x809F; + public const int SAMPLE_ALPHA_TO_ONE_ARB = 0x809F; + public const int SAMPLE_ALPHA_TO_ONE_EXT = 0x809F; + public const int SAMPLE_ALPHA_TO_ONE_SGIS = 0x809F; + public const int SAMPLE_BUFFERS = 0x80A8; + public const int SAMPLE_BUFFERS_3DFX = 0x86B3; + public const int SAMPLE_BUFFERS_ARB = 0x80A8; + public const int SAMPLE_BUFFERS_EXT = 0x80A8; + public const int SAMPLE_BUFFERS_SGIS = 0x80A8; + public const int SAMPLE_COVERAGE = 0x80A0; + public const int SAMPLE_COVERAGE_ARB = 0x80A0; + public const int SAMPLE_COVERAGE_INVERT = 0x80AB; + public const int SAMPLE_COVERAGE_INVERT_ARB = 0x80AB; + public const int SAMPLE_COVERAGE_VALUE = 0x80AA; + public const int SAMPLE_COVERAGE_VALUE_ARB = 0x80AA; + public const int SAMPLE_LOCATION_ARB = 0x8E50; + public const int SAMPLE_LOCATION_NV = 0x8E50; + public const int SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = 0x933F; + public const int SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = 0x933F; + public const int SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = 0x933E; + public const int SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = 0x933E; + public const int SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = 0x933D; + public const int SAMPLE_LOCATION_SUBPIXEL_BITS_NV = 0x933D; + public const int SAMPLE_MASK = 0x8E51; + public const int SAMPLE_MASK_EXT = 0x80A0; + public const int SAMPLE_MASK_INVERT_EXT = 0x80AB; + public const int SAMPLE_MASK_INVERT_SGIS = 0x80AB; + public const int SAMPLE_MASK_NV = 0x8E51; + public const int SAMPLE_MASK_SGIS = 0x80A0; + public const int SAMPLE_MASK_VALUE = 0x8E52; + public const int SAMPLE_MASK_VALUE_EXT = 0x80AA; + public const int SAMPLE_MASK_VALUE_NV = 0x8E52; + public const int SAMPLE_MASK_VALUE_SGIS = 0x80AA; + public const int SAMPLE_PATTERN_EXT = 0x80AC; + public const int SAMPLE_PATTERN_SGIS = 0x80AC; + public const int SAMPLE_POSITION = 0x8E50; + public const int SAMPLE_POSITION_NV = 0x8E50; + public const int SAMPLE_SHADING = 0x8C36; + public const int SAMPLE_SHADING_ARB = 0x8C36; + public const int SATURATE_BIT_ATI = 0x00000040; + public const int SCALAR_EXT = 0x87BE; + public const int SCALEBIAS_HINT_SGIX = 0x8322; + public const int SCALED_RESOLVE_FASTEST_EXT = 0x90BA; + public const int SCALED_RESOLVE_NICEST_EXT = 0x90BB; + public const int SCALE_BY_FOUR_NV = 0x853F; + public const int SCALE_BY_ONE_HALF_NV = 0x8540; + public const int SCALE_BY_TWO_NV = 0x853E; + public const int SCISSOR_BOX = 0x0C10; + public const int SCISSOR_BOX_EXCLUSIVE_NV = 0x9556; + public const int SCISSOR_COMMAND_NV = 0x0011; + public const int SCISSOR_TEST = 0x0C11; + public const int SCISSOR_TEST_EXCLUSIVE_NV = 0x9555; + public const int SCREEN_COORDINATES_REND = 0x8490; + public const int SCREEN_KHR = 0x9295; + public const int SCREEN_NV = 0x9295; + public const int SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27; + public const int SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C; + public const int SECONDARY_COLOR_ARRAY_EXT = 0x845E; + public const int SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31; + public const int SECONDARY_COLOR_ARRAY_LIST_IBM = 103077; + public const int SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM = 103087; + public const int SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D; + public const int SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A; + public const int SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C; + public const int SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B; + public const int SECONDARY_COLOR_NV = 0x852D; + public const int SECONDARY_INTERPOLATOR_ATI = 0x896D; + public const int SEMAPHORE_TYPE_BINARY_NV = 0x95B4; + public const int SEMAPHORE_TYPE_NV = 0x95B3; + public const int SEMAPHORE_TYPE_TIMELINE_NV = 0x95B5; + public const int SEPARABLE_2D_EXT = 0x8012; + public const int SEPARATE_ATTRIBS = 0x8C8D; + public const int SEPARATE_ATTRIBS_EXT = 0x8C8D; + public const int SEPARATE_ATTRIBS_NV = 0x8C8D; + public const int SEPARATE_SPECULAR_COLOR_EXT = 0x81FA; + public const int SET = 0x150F; + public const int SET_AMD = 0x874A; + public const int SHADER = 0x82E1; + public const int SHADER_BINARY_FORMATS = 0x8DF8; + public const int SHADER_BINARY_FORMAT_SPIR_V = 0x9551; + public const int SHADER_BINARY_FORMAT_SPIR_V_ARB = 0x9551; + public const int SHADER_COMPILER = 0x8DFA; + public const int SHADER_CONSISTENT_NV = 0x86DD; + public const int SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010; + public const int SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020; + public const int SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT = 0x00000020; + public const int SHADER_IMAGE_ATOMIC = 0x82A6; + public const int SHADER_IMAGE_LOAD = 0x82A4; + public const int SHADER_IMAGE_STORE = 0x82A5; + public const int SHADER_INCLUDE_ARB = 0x8DAE; + public const int SHADER_OBJECT_ARB = 0x8B48; + public const int SHADER_OBJECT_EXT = 0x8B48; + public const int SHADER_OPERATION_NV = 0x86DF; + public const int SHADER_SOURCE_LENGTH = 0x8B88; + public const int SHADER_STORAGE_BARRIER_BIT = 0x00002000; + public const int SHADER_STORAGE_BLOCK = 0x92E6; + public const int SHADER_STORAGE_BUFFER = 0x90D2; + public const int SHADER_STORAGE_BUFFER_BINDING = 0x90D3; + public const int SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; + public const int SHADER_STORAGE_BUFFER_SIZE = 0x90D5; + public const int SHADER_STORAGE_BUFFER_START = 0x90D4; + public const int SHADER_TYPE = 0x8B4F; + public const int SHADING_LANGUAGE_VERSION = 0x8B8C; + public const int SHADING_LANGUAGE_VERSION_ARB = 0x8B8C; + public const int SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 0x956F; + public const int SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 0x9566; + public const int SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 0x9567; + public const int SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 0x9568; + public const int SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 0x9569; + public const int SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 0x956A; + public const int SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 0x956B; + public const int SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0x9565; + public const int SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 0x956C; + public const int SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 0x956D; + public const int SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 0x956E; + public const int SHADING_RATE_IMAGE_BINDING_NV = 0x955B; + public const int SHADING_RATE_IMAGE_NV = 0x9563; + public const int SHADING_RATE_IMAGE_PALETTE_COUNT_NV = 0x95B2; + public const int SHADING_RATE_IMAGE_PALETTE_SIZE_NV = 0x955E; + public const int SHADING_RATE_IMAGE_PER_PRIMITIVE_NV = 0x95B1; + public const int SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV = 0x955D; + public const int SHADING_RATE_IMAGE_TEXEL_WIDTH_NV = 0x955C; + public const int SHADING_RATE_NO_INVOCATIONS_NV = 0x9564; + public const int SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV = 0x95AE; + public const int SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV = 0x95AF; + public const int SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV = 0x95B0; + public const int SHADOW_AMBIENT_SGIX = 0x80BF; + public const int SHADOW_ATTENUATION_EXT = 0x834E; + public const int SHARED_EDGE_NV = 0xC0; + public const int SHARED_TEXTURE_PALETTE_EXT = 0x81FB; + public const int SHARPEN_TEXTURE_FUNC_POINTS_SGIS = 0x80B0; + public const int SHORT = 0x1402; + public const int SIGNALED = 0x9119; + public const int SIGNED_ALPHA8_NV = 0x8706; + public const int SIGNED_ALPHA_NV = 0x8705; + public const int SIGNED_HILO16_NV = 0x86FA; + public const int SIGNED_HILO8_NV = 0x885F; + public const int SIGNED_HILO_NV = 0x86F9; + public const int SIGNED_IDENTITY_NV = 0x853C; + public const int SIGNED_INTENSITY8_NV = 0x8708; + public const int SIGNED_INTENSITY_NV = 0x8707; + public const int SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704; + public const int SIGNED_LUMINANCE8_NV = 0x8702; + public const int SIGNED_LUMINANCE_ALPHA_NV = 0x8703; + public const int SIGNED_LUMINANCE_NV = 0x8701; + public const int SIGNED_NEGATE_NV = 0x853D; + public const int SIGNED_NORMALIZED = 0x8F9C; + public const int SIGNED_RGB8_NV = 0x86FF; + public const int SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D; + public const int SIGNED_RGBA8_NV = 0x86FC; + public const int SIGNED_RGBA_NV = 0x86FB; + public const int SIGNED_RGB_NV = 0x86FE; + public const int SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C; + public const int SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC; + public const int SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE; + public const int SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD; + public const int SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF; + public const int SINGLE_COLOR_EXT = 0x81F9; + public const int SKIP_COMPONENTS1_NV = -6; + public const int SKIP_COMPONENTS2_NV = -5; + public const int SKIP_COMPONENTS3_NV = -4; + public const int SKIP_COMPONENTS4_NV = -3; + public const int SKIP_DECODE_EXT = 0x8A4A; + public const int SKIP_MISSING_GLYPH_NV = 0x90A9; + public const int SLICE_ACCUM_SUN = 0x85CC; + public const int SLUMINANCE8_ALPHA8_EXT = 0x8C45; + public const int SLUMINANCE8_EXT = 0x8C47; + public const int SLUMINANCE_ALPHA_EXT = 0x8C44; + public const int SLUMINANCE_EXT = 0x8C46; + public const int SMALL_CCW_ARC_TO_NV = 0x12; + public const int SMALL_CW_ARC_TO_NV = 0x14; + public const int SMOOTH_CUBIC_CURVE_TO_NV = 0x10; + public const int SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23; + public const int SMOOTH_LINE_WIDTH_RANGE = 0x0B22; + public const int SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13; + public const int SMOOTH_POINT_SIZE_RANGE = 0x0B12; + public const int SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0E; + public const int SM_COUNT_NV = 0x933B; + public const int SOFTLIGHT_KHR = 0x929C; + public const int SOFTLIGHT_NV = 0x929C; + public const int SOURCE0_ALPHA_ARB = 0x8588; + public const int SOURCE0_ALPHA_EXT = 0x8588; + public const int SOURCE0_RGB_ARB = 0x8580; + public const int SOURCE0_RGB_EXT = 0x8580; + public const int SOURCE1_ALPHA = 0x8589; + public const int SOURCE1_ALPHA_ARB = 0x8589; + public const int SOURCE1_ALPHA_EXT = 0x8589; + public const int SOURCE1_RGB_ARB = 0x8581; + public const int SOURCE1_RGB_EXT = 0x8581; + public const int SOURCE2_ALPHA_ARB = 0x858A; + public const int SOURCE2_ALPHA_EXT = 0x858A; + public const int SOURCE2_RGB_ARB = 0x8582; + public const int SOURCE2_RGB_EXT = 0x8582; + public const int SOURCE3_ALPHA_NV = 0x858B; + public const int SOURCE3_RGB_NV = 0x8583; + public const int SPARE0_NV = 0x852E; + public const int SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532; + public const int SPARE1_NV = 0x852F; + public const int SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8; + public const int SPARSE_STORAGE_BIT_ARB = 0x0400; + public const int SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9; + public const int SPIR_V_BINARY = 0x9552; + public const int SPIR_V_BINARY_ARB = 0x9552; + public const int SPIR_V_EXTENSIONS = 0x9553; + public const int SPRITE_AXIAL_SGIX = 0x814C; + public const int SPRITE_AXIS_SGIX = 0x814A; + public const int SPRITE_EYE_ALIGNED_SGIX = 0x814E; + public const int SPRITE_MODE_SGIX = 0x8149; + public const int SPRITE_OBJECT_ALIGNED_SGIX = 0x814D; + public const int SPRITE_SGIX = 0x8148; + public const int SPRITE_TRANSLATION_SGIX = 0x814B; + public const int SQUARE_NV = 0x90A3; + public const int SR8_EXT = 0x8FBD; + public const int SRC1_ALPHA = 0x8589; + public const int SRC1_COLOR = 0x88F9; + public const int SRC_ALPHA = 0x0302; + public const int SRC_ALPHA_SATURATE = 0x0308; + public const int SRC_ATOP_NV = 0x928E; + public const int SRC_COLOR = 0x0300; + public const int SRC_IN_NV = 0x928A; + public const int SRC_NV = 0x9286; + public const int SRC_OUT_NV = 0x928C; + public const int SRC_OVER_NV = 0x9288; + public const int SRG8_EXT = 0x8FBE; + public const int SRGB = 0x8C40; + public const int SRGB8 = 0x8C41; + public const int SRGB8_ALPHA8 = 0x8C43; + public const int SRGB8_ALPHA8_EXT = 0x8C43; + public const int SRGB8_EXT = 0x8C41; + public const int SRGB_ALPHA = 0x8C42; + public const int SRGB_ALPHA_EXT = 0x8C42; + public const int SRGB_DECODE_ARB = 0x8299; + public const int SRGB_EXT = 0x8C40; + public const int SRGB_READ = 0x8297; + public const int SRGB_WRITE = 0x8298; + public const int STACK_OVERFLOW = 0x0503; + public const int STACK_UNDERFLOW = 0x0504; + public const int STANDARD_FONT_FORMAT_NV = 0x936C; + public const int STANDARD_FONT_NAME_NV = 0x9072; + public const int STATIC_ATI = 0x8760; + public const int STATIC_COPY = 0x88E6; + public const int STATIC_COPY_ARB = 0x88E6; + public const int STATIC_DRAW = 0x88E4; + public const int STATIC_DRAW_ARB = 0x88E4; + public const int STATIC_READ = 0x88E5; + public const int STATIC_READ_ARB = 0x88E5; + public const int STATIC_VERTEX_ARRAY_IBM = 103061; + public const int STENCIL = 0x1802; + public const int STENCIL_ATTACHMENT = 0x8D20; + public const int STENCIL_ATTACHMENT_EXT = 0x8D20; + public const int STENCIL_BACK_FAIL = 0x8801; + public const int STENCIL_BACK_FAIL_ATI = 0x8801; + public const int STENCIL_BACK_FUNC = 0x8800; + public const int STENCIL_BACK_FUNC_ATI = 0x8800; + public const int STENCIL_BACK_OP_VALUE_AMD = 0x874D; + public const int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; + public const int STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802; + public const int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; + public const int STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803; + public const int STENCIL_BACK_REF = 0x8CA3; + public const int STENCIL_BACK_VALUE_MASK = 0x8CA4; + public const int STENCIL_BACK_WRITEMASK = 0x8CA5; + public const int STENCIL_BUFFER_BIT = 0x00000400; + public const int STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3; + public const int STENCIL_CLEAR_VALUE = 0x0B91; + public const int STENCIL_COMPONENTS = 0x8285; + public const int STENCIL_FAIL = 0x0B94; + public const int STENCIL_FUNC = 0x0B92; + public const int STENCIL_INDEX = 0x1901; + public const int STENCIL_INDEX1 = 0x8D46; + public const int STENCIL_INDEX16 = 0x8D49; + public const int STENCIL_INDEX16_EXT = 0x8D49; + public const int STENCIL_INDEX1_EXT = 0x8D46; + public const int STENCIL_INDEX4 = 0x8D47; + public const int STENCIL_INDEX4_EXT = 0x8D47; + public const int STENCIL_INDEX8 = 0x8D48; + public const int STENCIL_INDEX8_EXT = 0x8D48; + public const int STENCIL_OP_VALUE_AMD = 0x874C; + public const int STENCIL_PASS_DEPTH_FAIL = 0x0B95; + public const int STENCIL_PASS_DEPTH_PASS = 0x0B96; + public const int STENCIL_REF = 0x0B97; + public const int STENCIL_REF_COMMAND_NV = 0x000C; + public const int STENCIL_RENDERABLE = 0x8288; + public const int STENCIL_SAMPLES_NV = 0x932E; + public const int STENCIL_TAG_BITS_EXT = 0x88F2; + public const int STENCIL_TEST = 0x0B90; + public const int STENCIL_TEST_TWO_SIDE_EXT = 0x8910; + public const int STENCIL_VALUE_MASK = 0x0B93; + public const int STENCIL_WRITEMASK = 0x0B98; + public const int STEREO = 0x0C33; + public const int STORAGE_CACHED_APPLE = 0x85BE; + public const int STORAGE_CLIENT_APPLE = 0x85B4; + public const int STORAGE_PRIVATE_APPLE = 0x85BD; + public const int STORAGE_SHARED_APPLE = 0x85BF; + public const int STREAM_COPY = 0x88E2; + public const int STREAM_COPY_ARB = 0x88E2; + public const int STREAM_DRAW = 0x88E0; + public const int STREAM_DRAW_ARB = 0x88E0; + public const int STREAM_RASTERIZATION_AMD = 0x91A0; + public const int STREAM_READ = 0x88E1; + public const int STREAM_READ_ARB = 0x88E1; + public const int STRICT_DEPTHFUNC_HINT_PGI = 0x1A216; + public const int STRICT_LIGHTING_HINT_PGI = 0x1A217; + public const int STRICT_SCISSOR_HINT_PGI = 0x1A218; + public const int SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR = 0x00000004; + public const int SUBGROUP_FEATURE_BALLOT_BIT_KHR = 0x00000008; + public const int SUBGROUP_FEATURE_BASIC_BIT_KHR = 0x00000001; + public const int SUBGROUP_FEATURE_CLUSTERED_BIT_KHR = 0x00000040; + public const int SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100; + public const int SUBGROUP_FEATURE_QUAD_BIT_KHR = 0x00000080; + public const int SUBGROUP_FEATURE_SHUFFLE_BIT_KHR = 0x00000010; + public const int SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR = 0x00000020; + public const int SUBGROUP_FEATURE_VOTE_BIT_KHR = 0x00000002; + public const int SUBGROUP_QUAD_ALL_STAGES_KHR = 0x9535; + public const int SUBGROUP_SIZE_KHR = 0x9532; + public const int SUBGROUP_SUPPORTED_FEATURES_KHR = 0x9534; + public const int SUBGROUP_SUPPORTED_STAGES_KHR = 0x9533; + public const int SUBPIXEL_BITS = 0x0D50; + public const int SUBPIXEL_PRECISION_BIAS_X_BITS_NV = 0x9347; + public const int SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = 0x9348; + public const int SUBSAMPLE_DISTANCE_AMD = 0x883F; + public const int SUBTRACT_ARB = 0x84E7; + public const int SUB_ATI = 0x8965; + public const int SUCCESS_NV = 0x902F; + public const int SUPERSAMPLE_SCALE_X_NV = 0x9372; + public const int SUPERSAMPLE_SCALE_Y_NV = 0x9373; + public const int SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B7; + public const int SURFACE_MAPPED_NV = 0x8700; + public const int SURFACE_REGISTERED_NV = 0x86FD; + public const int SURFACE_STATE_NV = 0x86EB; + public const int SWIZZLE_STQ_ATI = 0x8977; + public const int SWIZZLE_STQ_DQ_ATI = 0x8979; + public const int SWIZZLE_STRQ_ATI = 0x897A; + public const int SWIZZLE_STRQ_DQ_ATI = 0x897B; + public const int SWIZZLE_STR_ATI = 0x8976; + public const int SWIZZLE_STR_DR_ATI = 0x8978; + public const int SYNC_CL_EVENT_ARB = 0x8240; + public const int SYNC_CL_EVENT_COMPLETE_ARB = 0x8241; + public const int SYNC_CONDITION = 0x9113; + public const int SYNC_FENCE = 0x9116; + public const int SYNC_FLAGS = 0x9115; + public const int SYNC_FLUSH_COMMANDS_BIT = 0x00000001; + public const int SYNC_GPU_COMMANDS_COMPLETE = 0x9117; + public const int SYNC_STATUS = 0x9114; + public const int SYNC_X11_FENCE_EXT = 0x90E1; + public const int SYSTEM_FONT_NAME_NV = 0x9073; + public const int T2F_IUI_N3F_V2F_EXT = 0x81B3; + public const int T2F_IUI_N3F_V3F_EXT = 0x81B4; + public const int T2F_IUI_V2F_EXT = 0x81B1; + public const int T2F_IUI_V3F_EXT = 0x81B2; + public const int TABLE_TOO_LARGE_EXT = 0x8031; + public const int TANGENT_ARRAY_EXT = 0x8439; + public const int TANGENT_ARRAY_POINTER_EXT = 0x8442; + public const int TANGENT_ARRAY_STRIDE_EXT = 0x843F; + public const int TANGENT_ARRAY_TYPE_EXT = 0x843E; + public const int TASK_SHADER_BIT_NV = 0x00000080; + public const int TASK_SHADER_NV = 0x955A; + public const int TASK_SUBROUTINE_NV = 0x957D; + public const int TASK_SUBROUTINE_UNIFORM_NV = 0x957F; + public const int TASK_WORK_GROUP_SIZE_NV = 0x953F; + public const int TERMINATE_SEQUENCE_COMMAND_NV = 0x0000; + public const int TESSELLATION_FACTOR_AMD = 0x9005; + public const int TESSELLATION_MODE_AMD = 0x9004; + public const int TESS_CONTROL_OUTPUT_VERTICES = 0x8E75; + public const int TESS_CONTROL_PROGRAM_NV = 0x891E; + public const int TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV = 0x8C74; + public const int TESS_CONTROL_SHADER = 0x8E88; + public const int TESS_CONTROL_SHADER_BIT = 0x00000008; + public const int TESS_CONTROL_SHADER_PATCHES = 0x82F1; + public const int TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1; + public const int TESS_CONTROL_SUBROUTINE = 0x92E9; + public const int TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF; + public const int TESS_CONTROL_TEXTURE = 0x829C; + public const int TESS_EVALUATION_PROGRAM_NV = 0x891F; + public const int TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV = 0x8C75; + public const int TESS_EVALUATION_SHADER = 0x8E87; + public const int TESS_EVALUATION_SHADER_BIT = 0x00000010; + public const int TESS_EVALUATION_SHADER_INVOCATIONS = 0x82F2; + public const int TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2; + public const int TESS_EVALUATION_SUBROUTINE = 0x92EA; + public const int TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0; + public const int TESS_EVALUATION_TEXTURE = 0x829D; + public const int TESS_GEN_MODE = 0x8E76; + public const int TESS_GEN_POINT_MODE = 0x8E79; + public const int TESS_GEN_SPACING = 0x8E77; + public const int TESS_GEN_VERTEX_ORDER = 0x8E78; + public const int TEXCOORD1_BIT_PGI = 0x10000000; + public const int TEXCOORD2_BIT_PGI = 0x20000000; + public const int TEXCOORD3_BIT_PGI = 0x40000000; + public const uint TEXCOORD4_BIT_PGI = 0x80000000; + public const int TEXTURE = 0x1702; + public const int TEXTURE0 = 0x84C0; + public const int TEXTURE0_ARB = 0x84C0; + public const int TEXTURE1 = 0x84C1; + public const int TEXTURE10 = 0x84CA; + public const int TEXTURE10_ARB = 0x84CA; + public const int TEXTURE11 = 0x84CB; + public const int TEXTURE11_ARB = 0x84CB; + public const int TEXTURE12 = 0x84CC; + public const int TEXTURE12_ARB = 0x84CC; + public const int TEXTURE13 = 0x84CD; + public const int TEXTURE13_ARB = 0x84CD; + public const int TEXTURE14 = 0x84CE; + public const int TEXTURE14_ARB = 0x84CE; + public const int TEXTURE15 = 0x84CF; + public const int TEXTURE15_ARB = 0x84CF; + public const int TEXTURE16 = 0x84D0; + public const int TEXTURE16_ARB = 0x84D0; + public const int TEXTURE17 = 0x84D1; + public const int TEXTURE17_ARB = 0x84D1; + public const int TEXTURE18 = 0x84D2; + public const int TEXTURE18_ARB = 0x84D2; + public const int TEXTURE19 = 0x84D3; + public const int TEXTURE19_ARB = 0x84D3; + public const int TEXTURE1_ARB = 0x84C1; + public const int TEXTURE2 = 0x84C2; + public const int TEXTURE20 = 0x84D4; + public const int TEXTURE20_ARB = 0x84D4; + public const int TEXTURE21 = 0x84D5; + public const int TEXTURE21_ARB = 0x84D5; + public const int TEXTURE22 = 0x84D6; + public const int TEXTURE22_ARB = 0x84D6; + public const int TEXTURE23 = 0x84D7; + public const int TEXTURE23_ARB = 0x84D7; + public const int TEXTURE24 = 0x84D8; + public const int TEXTURE24_ARB = 0x84D8; + public const int TEXTURE25 = 0x84D9; + public const int TEXTURE25_ARB = 0x84D9; + public const int TEXTURE26 = 0x84DA; + public const int TEXTURE26_ARB = 0x84DA; + public const int TEXTURE27 = 0x84DB; + public const int TEXTURE27_ARB = 0x84DB; + public const int TEXTURE28 = 0x84DC; + public const int TEXTURE28_ARB = 0x84DC; + public const int TEXTURE29 = 0x84DD; + public const int TEXTURE29_ARB = 0x84DD; + public const int TEXTURE2_ARB = 0x84C2; + public const int TEXTURE3 = 0x84C3; + public const int TEXTURE30 = 0x84DE; + public const int TEXTURE30_ARB = 0x84DE; + public const int TEXTURE31 = 0x84DF; + public const int TEXTURE31_ARB = 0x84DF; + public const int TEXTURE3_ARB = 0x84C3; + public const int TEXTURE4 = 0x84C4; + public const int TEXTURE4_ARB = 0x84C4; + public const int TEXTURE5 = 0x84C5; + public const int TEXTURE5_ARB = 0x84C5; + public const int TEXTURE6 = 0x84C6; + public const int TEXTURE6_ARB = 0x84C6; + public const int TEXTURE7 = 0x84C7; + public const int TEXTURE7_ARB = 0x84C7; + public const int TEXTURE8 = 0x84C8; + public const int TEXTURE8_ARB = 0x84C8; + public const int TEXTURE9 = 0x84C9; + public const int TEXTURE9_ARB = 0x84C9; + public const int TEXTURE_1D = 0x0DE0; + public const int TEXTURE_1D_ARRAY = 0x8C18; + public const int TEXTURE_1D_ARRAY_EXT = 0x8C18; + public const int TEXTURE_1D_BINDING_EXT = 0x8068; + public const int TEXTURE_1D_STACK_BINDING_MESAX = 0x875D; + public const int TEXTURE_1D_STACK_MESAX = 0x8759; + public const int TEXTURE_2D = 0x0DE1; + public const int TEXTURE_2D_ARRAY = 0x8C1A; + public const int TEXTURE_2D_ARRAY_EXT = 0x8C1A; + public const int TEXTURE_2D_BINDING_EXT = 0x8069; + public const int TEXTURE_2D_MULTISAMPLE = 0x9100; + public const int TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; + public const int TEXTURE_2D_STACK_BINDING_MESAX = 0x875E; + public const int TEXTURE_2D_STACK_MESAX = 0x875A; + public const int TEXTURE_3D = 0x806F; + public const int TEXTURE_3D_BINDING_EXT = 0x806A; + public const int TEXTURE_3D_EXT = 0x806F; + public const int TEXTURE_4DSIZE_SGIS = 0x8136; + public const int TEXTURE_4D_BINDING_SGIS = 0x814F; + public const int TEXTURE_4D_SGIS = 0x8134; + public const int TEXTURE_ALPHA_SIZE = 0x805F; + public const int TEXTURE_ALPHA_SIZE_EXT = 0x805F; + public const int TEXTURE_ALPHA_TYPE = 0x8C13; + public const int TEXTURE_ALPHA_TYPE_ARB = 0x8C13; + public const int TEXTURE_APPLICATION_MODE_EXT = 0x834F; + public const int TEXTURE_BASE_LEVEL = 0x813C; + public const int TEXTURE_BASE_LEVEL_SGIS = 0x813C; + public const int TEXTURE_BINDING_1D = 0x8068; + public const int TEXTURE_BINDING_1D_ARRAY = 0x8C1C; + public const int TEXTURE_BINDING_1D_ARRAY_EXT = 0x8C1C; + public const int TEXTURE_BINDING_2D = 0x8069; + public const int TEXTURE_BINDING_2D_ARRAY = 0x8C1D; + public const int TEXTURE_BINDING_2D_ARRAY_EXT = 0x8C1D; + public const int TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104; + public const int TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; + public const int TEXTURE_BINDING_3D = 0x806A; + public const int TEXTURE_BINDING_BUFFER = 0x8C2C; + public const int TEXTURE_BINDING_BUFFER_ARB = 0x8C2C; + public const int TEXTURE_BINDING_BUFFER_EXT = 0x8C2C; + public const int TEXTURE_BINDING_CUBE_MAP = 0x8514; + public const int TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514; + public const int TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A; + public const int TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A; + public const int TEXTURE_BINDING_CUBE_MAP_EXT = 0x8514; + public const int TEXTURE_BINDING_RECTANGLE = 0x84F6; + public const int TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6; + public const int TEXTURE_BINDING_RECTANGLE_NV = 0x84F6; + public const int TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53; + public const int TEXTURE_BLUE_SIZE = 0x805E; + public const int TEXTURE_BLUE_SIZE_EXT = 0x805E; + public const int TEXTURE_BLUE_TYPE = 0x8C12; + public const int TEXTURE_BLUE_TYPE_ARB = 0x8C12; + public const int TEXTURE_BORDER_COLOR = 0x1004; + public const int TEXTURE_BORDER_VALUES_NV = 0x871A; + public const int TEXTURE_BUFFER = 0x8C2A; + public const int TEXTURE_BUFFER_ARB = 0x8C2A; + public const int TEXTURE_BUFFER_BINDING = 0x8C2A; + public const int TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D; + public const int TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D; + public const int TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D; + public const int TEXTURE_BUFFER_EXT = 0x8C2A; + public const int TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E; + public const int TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E; + public const int TEXTURE_BUFFER_OFFSET = 0x919D; + public const int TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; + public const int TEXTURE_BUFFER_SIZE = 0x919E; + public const int TEXTURE_CLIPMAP_CENTER_SGIX = 0x8171; + public const int TEXTURE_CLIPMAP_DEPTH_SGIX = 0x8176; + public const int TEXTURE_CLIPMAP_FRAME_SGIX = 0x8172; + public const int TEXTURE_CLIPMAP_LOD_OFFSET_SGIX = 0x8175; + public const int TEXTURE_CLIPMAP_OFFSET_SGIX = 0x8173; + public const int TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8174; + public const int TEXTURE_COLOR_SAMPLES_NV = 0x9046; + public const int TEXTURE_COLOR_TABLE_SGI = 0x80BC; + public const int TEXTURE_COLOR_WRITEMASK_SGIS = 0x81EF; + public const int TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF; + public const int TEXTURE_COMPARE_FUNC = 0x884D; + public const int TEXTURE_COMPARE_FUNC_ARB = 0x884D; + public const int TEXTURE_COMPARE_MODE = 0x884C; + public const int TEXTURE_COMPARE_MODE_ARB = 0x884C; + public const int TEXTURE_COMPARE_OPERATOR_SGIX = 0x819B; + public const int TEXTURE_COMPARE_SGIX = 0x819A; + public const int TEXTURE_COMPRESSED = 0x86A1; + public const int TEXTURE_COMPRESSED_ARB = 0x86A1; + public const int TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2; + public const int TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3; + public const int TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1; + public const int TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0; + public const int TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0; + public const int TEXTURE_COMPRESSION_HINT = 0x84EF; + public const int TEXTURE_COMPRESSION_HINT_ARB = 0x84EF; + public const int TEXTURE_CONSTANT_DATA_SUNX = 0x81D6; + public const int TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25; + public const int TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A; + public const int TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; + public const int TEXTURE_COORD_ARRAY_EXT = 0x8078; + public const int TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F; + public const int TEXTURE_COORD_ARRAY_LIST_IBM = 103074; + public const int TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM = 103084; + public const int TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F8; + public const int TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; + public const int TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; + public const int TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; + public const int TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; + public const int TEXTURE_COORD_NV = 0x8C79; + public const int TEXTURE_COVERAGE_SAMPLES_NV = 0x9045; + public const int TEXTURE_CUBE_MAP = 0x8513; + public const int TEXTURE_CUBE_MAP_ARB = 0x8513; + public const int TEXTURE_CUBE_MAP_ARRAY = 0x9009; + public const int TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009; + public const int TEXTURE_CUBE_MAP_EXT = 0x8513; + public const int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; + public const int TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516; + public const int TEXTURE_CUBE_MAP_NEGATIVE_X_EXT = 0x8516; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT = 0x8518; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT = 0x851A; + public const int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; + public const int TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515; + public const int TEXTURE_CUBE_MAP_POSITIVE_X_EXT = 0x8515; + public const int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; + public const int TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517; + public const int TEXTURE_CUBE_MAP_POSITIVE_Y_EXT = 0x8517; + public const int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; + public const int TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519; + public const int TEXTURE_CUBE_MAP_POSITIVE_Z_EXT = 0x8519; + public const int TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; + public const int TEXTURE_DEFORMATION_BIT_SGIX = 0x00000001; + public const int TEXTURE_DEFORMATION_SGIX = 0x8195; + public const int TEXTURE_DEPTH = 0x8071; + public const int TEXTURE_DEPTH_EXT = 0x8071; + public const int TEXTURE_DEPTH_SIZE = 0x884A; + public const int TEXTURE_DEPTH_SIZE_ARB = 0x884A; + public const int TEXTURE_DEPTH_TYPE = 0x8C16; + public const int TEXTURE_DEPTH_TYPE_ARB = 0x8C16; + public const int TEXTURE_DS_SIZE_NV = 0x871D; + public const int TEXTURE_DT_SIZE_NV = 0x871E; + public const int TEXTURE_ENV_BIAS_SGIX = 0x80BE; + public const int TEXTURE_FETCH_BARRIER_BIT = 0x00000008; + public const int TEXTURE_FETCH_BARRIER_BIT_EXT = 0x00000008; + public const int TEXTURE_FILTER4_SIZE_SGIS = 0x8147; + public const int TEXTURE_FILTER_CONTROL_EXT = 0x8500; + public const int TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; + public const int TEXTURE_FLOAT_COMPONENTS_NV = 0x888C; + public const int TEXTURE_FREE_MEMORY_ATI = 0x87FC; + public const int TEXTURE_GATHER = 0x82A2; + public const int TEXTURE_GATHER_SHADOW = 0x82A3; + public const int TEXTURE_GEQUAL_R_SGIX = 0x819D; + public const int TEXTURE_GREEN_SIZE = 0x805D; + public const int TEXTURE_GREEN_SIZE_EXT = 0x805D; + public const int TEXTURE_GREEN_TYPE = 0x8C11; + public const int TEXTURE_GREEN_TYPE_ARB = 0x8C11; + public const int TEXTURE_HEIGHT = 0x1001; + public const int TEXTURE_HI_SIZE_NV = 0x871B; + public const int TEXTURE_IMAGE_FORMAT = 0x828F; + public const int TEXTURE_IMAGE_TYPE = 0x8290; + public const int TEXTURE_IMMUTABLE_FORMAT = 0x912F; + public const int TEXTURE_IMMUTABLE_FORMAT_EXT = 0x912F; + public const int TEXTURE_IMMUTABLE_LEVELS = 0x82DF; + public const int TEXTURE_INDEX_SIZE_EXT = 0x80ED; + public const int TEXTURE_INTENSITY_SIZE_EXT = 0x8061; + public const int TEXTURE_INTENSITY_TYPE_ARB = 0x8C15; + public const int TEXTURE_INTERNAL_FORMAT = 0x1003; + public const int TEXTURE_LEQUAL_R_SGIX = 0x819C; + public const int TEXTURE_LIGHTING_MODE_HP = 0x8167; + public const int TEXTURE_LIGHT_EXT = 0x8350; + public const int TEXTURE_LOD_BIAS = 0x8501; + public const int TEXTURE_LOD_BIAS_EXT = 0x8501; + public const int TEXTURE_LOD_BIAS_R_SGIX = 0x8190; + public const int TEXTURE_LOD_BIAS_S_SGIX = 0x818E; + public const int TEXTURE_LOD_BIAS_T_SGIX = 0x818F; + public const int TEXTURE_LO_SIZE_NV = 0x871C; + public const int TEXTURE_LUMINANCE_SIZE_EXT = 0x8060; + public const int TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14; + public const int TEXTURE_MAG_FILTER = 0x2800; + public const int TEXTURE_MAG_SIZE_NV = 0x871F; + public const int TEXTURE_MATERIAL_FACE_EXT = 0x8351; + public const int TEXTURE_MATERIAL_PARAMETER_EXT = 0x8352; + public const int TEXTURE_MAX_ANISOTROPY = 0x84FE; + public const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; + public const int TEXTURE_MAX_CLAMP_R_SGIX = 0x836B; + public const int TEXTURE_MAX_CLAMP_S_SGIX = 0x8369; + public const int TEXTURE_MAX_CLAMP_T_SGIX = 0x836A; + public const int TEXTURE_MAX_LEVEL = 0x813D; + public const int TEXTURE_MAX_LEVEL_SGIS = 0x813D; + public const int TEXTURE_MAX_LOD = 0x813B; + public const int TEXTURE_MAX_LOD_SGIS = 0x813B; + public const int TEXTURE_MEMORY_LAYOUT_INTEL = 0x83FF; + public const int TEXTURE_MIN_FILTER = 0x2801; + public const int TEXTURE_MIN_LOD = 0x813A; + public const int TEXTURE_MIN_LOD_SGIS = 0x813A; + public const int TEXTURE_MULTI_BUFFER_HINT_SGIX = 0x812E; + public const int TEXTURE_NORMAL_EXT = 0x85AF; + public const int TEXTURE_POST_SPECULAR_HP = 0x8168; + public const int TEXTURE_PRE_SPECULAR_HP = 0x8169; + public const int TEXTURE_PRIORITY_EXT = 0x8066; + public const int TEXTURE_RANGE_LENGTH_APPLE = 0x85B7; + public const int TEXTURE_RANGE_POINTER_APPLE = 0x85B8; + public const int TEXTURE_RECTANGLE = 0x84F5; + public const int TEXTURE_RECTANGLE_ARB = 0x84F5; + public const int TEXTURE_RECTANGLE_NV = 0x84F5; + public const int TEXTURE_REDUCTION_MODE_ARB = 0x9366; + public const int TEXTURE_REDUCTION_MODE_EXT = 0x9366; + public const int TEXTURE_RED_SIZE = 0x805C; + public const int TEXTURE_RED_SIZE_EXT = 0x805C; + public const int TEXTURE_RED_TYPE = 0x8C10; + public const int TEXTURE_RED_TYPE_ARB = 0x8C10; + public const int TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54; + public const int TEXTURE_RENDERBUFFER_NV = 0x8E55; + public const int TEXTURE_RESIDENT_EXT = 0x8067; + public const int TEXTURE_SAMPLES = 0x9106; + public const int TEXTURE_SHADER_NV = 0x86DE; + public const int TEXTURE_SHADOW = 0x82A1; + public const int TEXTURE_SHARED_SIZE = 0x8C3F; + public const int TEXTURE_SHARED_SIZE_EXT = 0x8C3F; + public const int TEXTURE_SPARSE_ARB = 0x91A6; + public const int TEXTURE_SRGB_DECODE_EXT = 0x8A48; + public const int TEXTURE_STENCIL_SIZE = 0x88F1; + public const int TEXTURE_STENCIL_SIZE_EXT = 0x88F1; + public const int TEXTURE_STORAGE_HINT_APPLE = 0x85BC; + public const int TEXTURE_STORAGE_SPARSE_BIT_AMD = 0x00000001; + public const int TEXTURE_SWIZZLE_A = 0x8E45; + public const int TEXTURE_SWIZZLE_A_EXT = 0x8E45; + public const int TEXTURE_SWIZZLE_B = 0x8E44; + public const int TEXTURE_SWIZZLE_B_EXT = 0x8E44; + public const int TEXTURE_SWIZZLE_G = 0x8E43; + public const int TEXTURE_SWIZZLE_G_EXT = 0x8E43; + public const int TEXTURE_SWIZZLE_R = 0x8E42; + public const int TEXTURE_SWIZZLE_RGBA = 0x8E46; + public const int TEXTURE_SWIZZLE_RGBA_EXT = 0x8E46; + public const int TEXTURE_SWIZZLE_R_EXT = 0x8E42; + public const int TEXTURE_TARGET = 0x1006; + public const int TEXTURE_TILING_EXT = 0x9580; + public const int TEXTURE_TOO_LARGE_EXT = 0x8065; + public const int TEXTURE_UNSIGNED_REMAP_MODE_NV = 0x888F; + public const int TEXTURE_UPDATE_BARRIER_BIT = 0x00000100; + public const int TEXTURE_UPDATE_BARRIER_BIT_EXT = 0x00000100; + public const int TEXTURE_VIEW = 0x82B5; + public const int TEXTURE_VIEW_MIN_LAYER = 0x82DD; + public const int TEXTURE_VIEW_MIN_LEVEL = 0x82DB; + public const int TEXTURE_VIEW_NUM_LAYERS = 0x82DE; + public const int TEXTURE_VIEW_NUM_LEVELS = 0x82DC; + public const int TEXTURE_WIDTH = 0x1000; + public const int TEXTURE_WRAP_Q_SGIS = 0x8137; + public const int TEXTURE_WRAP_R = 0x8072; + public const int TEXTURE_WRAP_R_EXT = 0x8072; + public const int TEXTURE_WRAP_S = 0x2802; + public const int TEXTURE_WRAP_T = 0x2803; + public const int TEXT_FRAGMENT_SHADER_ATI = 0x8200; + public const int TILE_RASTER_ORDER_FIXED_MESA = 0x8BB8; + public const int TILE_RASTER_ORDER_INCREASING_X_MESA = 0x8BB9; + public const int TILE_RASTER_ORDER_INCREASING_Y_MESA = 0x8BBA; + public const int TILING_TYPES_EXT = 0x9583; + public const int TIMELINE_SEMAPHORE_VALUE_NV = 0x9595; + public const int TIMEOUT_EXPIRED = 0x911B; + public const ulong TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFF; + public const int TIMESTAMP = 0x8E28; + public const int TIME_ELAPSED = 0x88BF; + public const int TIME_ELAPSED_EXT = 0x88BF; + public const int TOP_LEVEL_ARRAY_SIZE = 0x930C; + public const int TOP_LEVEL_ARRAY_STRIDE = 0x930D; + public const int TRACK_MATRIX_NV = 0x8648; + public const int TRACK_MATRIX_TRANSFORM_NV = 0x8649; + public const int TRANSFORM_FEEDBACK = 0x8E22; + public const int TRANSFORM_FEEDBACK_ACTIVE = 0x8E24; + public const int TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8C7E; + public const int TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800; + public const int TRANSFORM_FEEDBACK_BARRIER_BIT_EXT = 0x00000800; + public const int TRANSFORM_FEEDBACK_BINDING = 0x8E25; + public const int TRANSFORM_FEEDBACK_BINDING_NV = 0x8E25; + public const int TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; + public const int TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24; + public const int TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = 0x8E24; + public const int TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; + public const int TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT = 0x8C8F; + public const int TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8C8F; + public const int TRANSFORM_FEEDBACK_BUFFER_EXT = 0x8C8E; + public const int TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B; + public const int TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F; + public const int TRANSFORM_FEEDBACK_BUFFER_MODE_EXT = 0x8C7F; + public const int TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8C7F; + public const int TRANSFORM_FEEDBACK_BUFFER_NV = 0x8C8E; + public const int TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23; + public const int TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = 0x8E23; + public const int TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; + public const int TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT = 0x8C85; + public const int TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8C85; + public const int TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84; + public const int TRANSFORM_FEEDBACK_BUFFER_START_EXT = 0x8C84; + public const int TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8C84; + public const int TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; + public const int TRANSFORM_FEEDBACK_NV = 0x8E22; + public const int TRANSFORM_FEEDBACK_OVERFLOW = 0x82EC; + public const int TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC; + public const int TRANSFORM_FEEDBACK_PAUSED = 0x8E23; + public const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; + public const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT = 0x8C88; + public const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8C88; + public const int TRANSFORM_FEEDBACK_RECORD_NV = 0x8C86; + public const int TRANSFORM_FEEDBACK_STREAM_OVERFLOW = 0x82ED; + public const int TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED; + public const int TRANSFORM_FEEDBACK_VARYING = 0x92F4; + public const int TRANSFORM_FEEDBACK_VARYINGS = 0x8C83; + public const int TRANSFORM_FEEDBACK_VARYINGS_EXT = 0x8C83; + public const int TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8C83; + public const int TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; + public const int TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT = 0x8C76; + public const int TRANSFORM_HINT_APPLE = 0x85B1; + public const int TRANSLATE_2D_NV = 0x9090; + public const int TRANSLATE_3D_NV = 0x9091; + public const int TRANSLATE_X_NV = 0x908E; + public const int TRANSLATE_Y_NV = 0x908F; + public const int TRANSPOSE_AFFINE_2D_NV = 0x9096; + public const int TRANSPOSE_AFFINE_3D_NV = 0x9098; + public const int TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; + public const int TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; + public const int TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3; + public const int TRANSPOSE_NV = 0x862C; + public const int TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E; + public const int TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4; + public const int TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5; + public const int TRIANGLES = 0x0004; + public const int TRIANGLES_ADJACENCY = 0x000C; + public const int TRIANGLES_ADJACENCY_ARB = 0x000C; + public const int TRIANGLES_ADJACENCY_EXT = 0x000C; + public const int TRIANGLE_FAN = 0x0006; + public const int TRIANGLE_LIST_SUN = 0x81D7; + public const int TRIANGLE_MESH_SUN = 0x8615; + public const int TRIANGLE_STRIP = 0x0005; + public const int TRIANGLE_STRIP_ADJACENCY = 0x000D; + public const int TRIANGLE_STRIP_ADJACENCY_ARB = 0x000D; + public const int TRIANGLE_STRIP_ADJACENCY_EXT = 0x000D; + public const int TRIANGULAR_NV = 0x90A5; + public const int TRUE = 1; + public const int TYPE = 0x92FA; + public const int UNCORRELATED_NV = 0x9282; + public const int UNDEFINED_APPLE = 0x8A1C; + public const int UNDEFINED_VERTEX = 0x8260; + public const int UNIFORM = 0x92E1; + public const int UNIFORM_ADDRESS_COMMAND_NV = 0x000A; + public const int UNIFORM_ARRAY_STRIDE = 0x8A3C; + public const int UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; + public const int UNIFORM_BARRIER_BIT = 0x00000004; + public const int UNIFORM_BARRIER_BIT_EXT = 0x00000004; + public const int UNIFORM_BLOCK = 0x92E2; + public const int UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42; + public const int UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43; + public const int UNIFORM_BLOCK_BINDING = 0x8A3F; + public const int UNIFORM_BLOCK_DATA_SIZE = 0x8A40; + public const int UNIFORM_BLOCK_INDEX = 0x8A3A; + public const int UNIFORM_BLOCK_NAME_LENGTH = 0x8A41; + public const int UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; + public const int UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; + public const int UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45; + public const int UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV = 0x959C; + public const int UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV = 0x959D; + public const int UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0; + public const int UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; + public const int UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44; + public const int UNIFORM_BUFFER = 0x8A11; + public const int UNIFORM_BUFFER_ADDRESS_NV = 0x936F; + public const int UNIFORM_BUFFER_BINDING = 0x8A28; + public const int UNIFORM_BUFFER_BINDING_EXT = 0x8DEF; + public const int UNIFORM_BUFFER_EXT = 0x8DEE; + public const int UNIFORM_BUFFER_LENGTH_NV = 0x9370; + public const int UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; + public const int UNIFORM_BUFFER_SIZE = 0x8A2A; + public const int UNIFORM_BUFFER_START = 0x8A29; + public const int UNIFORM_BUFFER_UNIFIED_NV = 0x936E; + public const int UNIFORM_IS_ROW_MAJOR = 0x8A3E; + public const int UNIFORM_MATRIX_STRIDE = 0x8A3D; + public const int UNIFORM_NAME_LENGTH = 0x8A39; + public const int UNIFORM_OFFSET = 0x8A3B; + public const int UNIFORM_SIZE = 0x8A38; + public const int UNIFORM_TYPE = 0x8A37; + public const int UNKNOWN_CONTEXT_RESET = 0x8255; + public const int UNKNOWN_CONTEXT_RESET_ARB = 0x8255; + public const int UNPACK_ALIGNMENT = 0x0CF5; + public const int UNPACK_CLIENT_STORAGE_APPLE = 0x85B2; + public const int UNPACK_CMYK_HINT_EXT = 0x800F; + public const int UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129; + public const int UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128; + public const int UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A; + public const int UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127; + public const int UNPACK_CONSTANT_DATA_SUNX = 0x81D5; + public const int UNPACK_IMAGE_DEPTH_SGIS = 0x8133; + public const int UNPACK_IMAGE_HEIGHT = 0x806E; + public const int UNPACK_IMAGE_HEIGHT_EXT = 0x806E; + public const int UNPACK_LSB_FIRST = 0x0CF1; + public const int UNPACK_RESAMPLE_OML = 0x8985; + public const int UNPACK_RESAMPLE_SGIX = 0x842F; + public const int UNPACK_ROW_BYTES_APPLE = 0x8A16; + public const int UNPACK_ROW_LENGTH = 0x0CF2; + public const int UNPACK_SKIP_IMAGES = 0x806D; + public const int UNPACK_SKIP_IMAGES_EXT = 0x806D; + public const int UNPACK_SKIP_PIXELS = 0x0CF4; + public const int UNPACK_SKIP_ROWS = 0x0CF3; + public const int UNPACK_SKIP_VOLUMES_SGIS = 0x8132; + public const int UNPACK_SUBSAMPLE_RATE_SGIX = 0x85A1; + public const int UNPACK_SWAP_BYTES = 0x0CF0; + public const int UNSIGNALED = 0x9118; + public const int UNSIGNED_BYTE = 0x1401; + public const int UNSIGNED_BYTE_2_3_3_REV = 0x8362; + public const int UNSIGNED_BYTE_3_3_2 = 0x8032; + public const int UNSIGNED_BYTE_3_3_2_EXT = 0x8032; + public const int UNSIGNED_IDENTITY_NV = 0x8536; + public const int UNSIGNED_INT = 0x1405; + public const int UNSIGNED_INT16_NV = 0x8FF0; + public const int UNSIGNED_INT16_VEC2_NV = 0x8FF1; + public const int UNSIGNED_INT16_VEC3_NV = 0x8FF2; + public const int UNSIGNED_INT16_VEC4_NV = 0x8FF3; + public const int UNSIGNED_INT64_AMD = 0x8BC2; + public const int UNSIGNED_INT64_ARB = 0x140F; + public const int UNSIGNED_INT64_NV = 0x140F; + public const int UNSIGNED_INT64_VEC2_ARB = 0x8FF5; + public const int UNSIGNED_INT64_VEC2_NV = 0x8FF5; + public const int UNSIGNED_INT64_VEC3_ARB = 0x8FF6; + public const int UNSIGNED_INT64_VEC3_NV = 0x8FF6; + public const int UNSIGNED_INT64_VEC4_ARB = 0x8FF7; + public const int UNSIGNED_INT64_VEC4_NV = 0x8FF7; + public const int UNSIGNED_INT8_NV = 0x8FEC; + public const int UNSIGNED_INT8_VEC2_NV = 0x8FED; + public const int UNSIGNED_INT8_VEC3_NV = 0x8FEE; + public const int UNSIGNED_INT8_VEC4_NV = 0x8FEF; + public const int UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; + public const int UNSIGNED_INT_10F_11F_11F_REV_EXT = 0x8C3B; + public const int UNSIGNED_INT_10_10_10_2 = 0x8036; + public const int UNSIGNED_INT_10_10_10_2_EXT = 0x8036; + public const int UNSIGNED_INT_24_8 = 0x84FA; + public const int UNSIGNED_INT_24_8_EXT = 0x84FA; + public const int UNSIGNED_INT_24_8_NV = 0x84FA; + public const int UNSIGNED_INT_2_10_10_10_REV = 0x8368; + public const int UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; + public const int UNSIGNED_INT_5_9_9_9_REV_EXT = 0x8C3E; + public const int UNSIGNED_INT_8_8_8_8 = 0x8035; + public const int UNSIGNED_INT_8_8_8_8_EXT = 0x8035; + public const int UNSIGNED_INT_8_8_8_8_REV = 0x8367; + public const int UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB; + public const int UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; + public const int UNSIGNED_INT_IMAGE_1D = 0x9062; + public const int UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068; + public const int UNSIGNED_INT_IMAGE_1D_ARRAY_EXT = 0x9068; + public const int UNSIGNED_INT_IMAGE_1D_EXT = 0x9062; + public const int UNSIGNED_INT_IMAGE_2D = 0x9063; + public const int UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069; + public const int UNSIGNED_INT_IMAGE_2D_ARRAY_EXT = 0x9069; + public const int UNSIGNED_INT_IMAGE_2D_EXT = 0x9063; + public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B; + public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; + public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x906C; + public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x906B; + public const int UNSIGNED_INT_IMAGE_2D_RECT = 0x9065; + public const int UNSIGNED_INT_IMAGE_2D_RECT_EXT = 0x9065; + public const int UNSIGNED_INT_IMAGE_3D = 0x9064; + public const int UNSIGNED_INT_IMAGE_3D_EXT = 0x9064; + public const int UNSIGNED_INT_IMAGE_BUFFER = 0x9067; + public const int UNSIGNED_INT_IMAGE_BUFFER_EXT = 0x9067; + public const int UNSIGNED_INT_IMAGE_CUBE = 0x9066; + public const int UNSIGNED_INT_IMAGE_CUBE_EXT = 0x9066; + public const int UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A; + public const int UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x906A; + public const int UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA; + public const int UNSIGNED_INT_SAMPLER_1D = 0x8DD1; + public const int UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6; + public const int UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT = 0x8DD6; + public const int UNSIGNED_INT_SAMPLER_1D_EXT = 0x8DD1; + public const int UNSIGNED_INT_SAMPLER_2D = 0x8DD2; + public const int UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; + public const int UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT = 0x8DD7; + public const int UNSIGNED_INT_SAMPLER_2D_EXT = 0x8DD2; + public const int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A; + public const int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; + public const int UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5; + public const int UNSIGNED_INT_SAMPLER_2D_RECT_EXT = 0x8DD5; + public const int UNSIGNED_INT_SAMPLER_3D = 0x8DD3; + public const int UNSIGNED_INT_SAMPLER_3D_EXT = 0x8DD3; + public const int UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8; + public const int UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003; + public const int UNSIGNED_INT_SAMPLER_BUFFER_EXT = 0x8DD8; + public const int UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4; + public const int UNSIGNED_INT_SAMPLER_CUBE_EXT = 0x8DD4; + public const int UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F; + public const int UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F; + public const int UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58; + public const int UNSIGNED_INT_VEC2 = 0x8DC6; + public const int UNSIGNED_INT_VEC2_EXT = 0x8DC6; + public const int UNSIGNED_INT_VEC3 = 0x8DC7; + public const int UNSIGNED_INT_VEC3_EXT = 0x8DC7; + public const int UNSIGNED_INT_VEC4 = 0x8DC8; + public const int UNSIGNED_INT_VEC4_EXT = 0x8DC8; + public const int UNSIGNED_INVERT_NV = 0x8537; + public const int UNSIGNED_NORMALIZED = 0x8C17; + public const int UNSIGNED_NORMALIZED_ARB = 0x8C17; + public const int UNSIGNED_SHORT = 0x1403; + public const int UNSIGNED_SHORT_1_5_5_5_REV = 0x8366; + public const int UNSIGNED_SHORT_4_4_4_4 = 0x8033; + public const int UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033; + public const int UNSIGNED_SHORT_4_4_4_4_REV = 0x8365; + public const int UNSIGNED_SHORT_5_5_5_1 = 0x8034; + public const int UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034; + public const int UNSIGNED_SHORT_5_6_5 = 0x8363; + public const int UNSIGNED_SHORT_5_6_5_REV = 0x8364; + public const int UNSIGNED_SHORT_8_8_APPLE = 0x85BA; + public const int UNSIGNED_SHORT_8_8_MESA = 0x85BA; + public const int UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB; + public const int UNSIGNED_SHORT_8_8_REV_MESA = 0x85BB; + public const int UPLOAD_GPU_MASK_NVX = 0x954A; + public const int UPPER_LEFT = 0x8CA2; + public const int USE_MISSING_GLYPH_NV = 0x90AA; + public const int UTF16_NV = 0x909B; + public const int UTF8_NV = 0x909A; + public const int UUID_SIZE_EXT = 16; + public const int VALIDATE_STATUS = 0x8B83; + public const int VARIABLE_A_NV = 0x8523; + public const int VARIABLE_B_NV = 0x8524; + public const int VARIABLE_C_NV = 0x8525; + public const int VARIABLE_D_NV = 0x8526; + public const int VARIABLE_E_NV = 0x8527; + public const int VARIABLE_F_NV = 0x8528; + public const int VARIABLE_G_NV = 0x8529; + public const int VARIANT_ARRAY_EXT = 0x87E8; + public const int VARIANT_ARRAY_POINTER_EXT = 0x87E9; + public const int VARIANT_ARRAY_STRIDE_EXT = 0x87E6; + public const int VARIANT_ARRAY_TYPE_EXT = 0x87E7; + public const int VARIANT_DATATYPE_EXT = 0x87E5; + public const int VARIANT_EXT = 0x87C1; + public const int VARIANT_VALUE_EXT = 0x87E4; + public const int VBO_FREE_MEMORY_ATI = 0x87FB; + public const int VECTOR_EXT = 0x87BF; + public const int VENDOR = 0x1F00; + public const int VERSION = 0x1F02; + public const int VERTEX23_BIT_PGI = 0x00000004; + public const int VERTEX4_BIT_PGI = 0x00000008; + public const int VERTEX_ARRAY = 0x8074; + public const int VERTEX_ARRAY_ADDRESS_NV = 0x8F21; + public const int VERTEX_ARRAY_BINDING = 0x85B5; + public const int VERTEX_ARRAY_BINDING_APPLE = 0x85B5; + public const int VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896; + public const int VERTEX_ARRAY_COUNT_EXT = 0x807D; + public const int VERTEX_ARRAY_EXT = 0x8074; + public const int VERTEX_ARRAY_LENGTH_NV = 0x8F2B; + public const int VERTEX_ARRAY_LIST_IBM = 103070; + public const int VERTEX_ARRAY_LIST_STRIDE_IBM = 103080; + public const int VERTEX_ARRAY_OBJECT_AMD = 0x9154; + public const int VERTEX_ARRAY_OBJECT_EXT = 0x9154; + public const int VERTEX_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F5; + public const int VERTEX_ARRAY_POINTER_EXT = 0x808E; + public const int VERTEX_ARRAY_RANGE_APPLE = 0x851D; + public const int VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E; + public const int VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E; + public const int VERTEX_ARRAY_RANGE_NV = 0x851D; + public const int VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521; + public const int VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521; + public const int VERTEX_ARRAY_RANGE_VALID_NV = 0x851F; + public const int VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533; + public const int VERTEX_ARRAY_SIZE_EXT = 0x807A; + public const int VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F; + public const int VERTEX_ARRAY_STRIDE_EXT = 0x807C; + public const int VERTEX_ARRAY_TYPE_EXT = 0x807B; + public const int VERTEX_ATTRIB_ARRAY0_NV = 0x8650; + public const int VERTEX_ATTRIB_ARRAY10_NV = 0x865A; + public const int VERTEX_ATTRIB_ARRAY11_NV = 0x865B; + public const int VERTEX_ATTRIB_ARRAY12_NV = 0x865C; + public const int VERTEX_ATTRIB_ARRAY13_NV = 0x865D; + public const int VERTEX_ATTRIB_ARRAY14_NV = 0x865E; + public const int VERTEX_ATTRIB_ARRAY15_NV = 0x865F; + public const int VERTEX_ATTRIB_ARRAY1_NV = 0x8651; + public const int VERTEX_ATTRIB_ARRAY2_NV = 0x8652; + public const int VERTEX_ATTRIB_ARRAY3_NV = 0x8653; + public const int VERTEX_ATTRIB_ARRAY4_NV = 0x8654; + public const int VERTEX_ATTRIB_ARRAY5_NV = 0x8655; + public const int VERTEX_ATTRIB_ARRAY6_NV = 0x8656; + public const int VERTEX_ATTRIB_ARRAY7_NV = 0x8657; + public const int VERTEX_ATTRIB_ARRAY8_NV = 0x8658; + public const int VERTEX_ATTRIB_ARRAY9_NV = 0x8659; + public const int VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20; + public const int VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001; + public const int VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT = 0x00000001; + public const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; + public const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F; + public const int VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; + public const int VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE; + public const int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; + public const int VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; + public const int VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; + public const int VERTEX_ATTRIB_ARRAY_INTEGER_EXT = 0x88FD; + public const int VERTEX_ATTRIB_ARRAY_INTEGER_NV = 0x88FD; + public const int VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A; + public const int VERTEX_ATTRIB_ARRAY_LONG = 0x874E; + public const int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; + public const int VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; + public const int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; + public const int VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; + public const int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; + public const int VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; + public const int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; + public const int VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; + public const int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; + public const int VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; + public const int VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E; + public const int VERTEX_ATTRIB_BINDING = 0x82D4; + public const int VERTEX_ATTRIB_MAP1_APPLE = 0x8A00; + public const int VERTEX_ATTRIB_MAP1_COEFF_APPLE = 0x8A03; + public const int VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = 0x8A05; + public const int VERTEX_ATTRIB_MAP1_ORDER_APPLE = 0x8A04; + public const int VERTEX_ATTRIB_MAP1_SIZE_APPLE = 0x8A02; + public const int VERTEX_ATTRIB_MAP2_APPLE = 0x8A01; + public const int VERTEX_ATTRIB_MAP2_COEFF_APPLE = 0x8A07; + public const int VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = 0x8A09; + public const int VERTEX_ATTRIB_MAP2_ORDER_APPLE = 0x8A08; + public const int VERTEX_ATTRIB_MAP2_SIZE_APPLE = 0x8A06; + public const int VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; + public const int VERTEX_BINDING_BUFFER = 0x8F4F; + public const int VERTEX_BINDING_DIVISOR = 0x82D6; + public const int VERTEX_BINDING_OFFSET = 0x82D7; + public const int VERTEX_BINDING_STRIDE = 0x82D8; + public const int VERTEX_BLEND_ARB = 0x86A7; + public const int VERTEX_CONSISTENT_HINT_PGI = 0x1A22B; + public const int VERTEX_DATA_HINT_PGI = 0x1A22A; + public const int VERTEX_ELEMENT_SWIZZLE_AMD = 0x91A4; + public const int VERTEX_ID_NV = 0x8C7B; + public const int VERTEX_ID_SWIZZLE_AMD = 0x91A5; + public const int VERTEX_PRECLIP_HINT_SGIX = 0x83EF; + public const int VERTEX_PRECLIP_SGIX = 0x83EE; + public const int VERTEX_PROGRAM_ARB = 0x8620; + public const int VERTEX_PROGRAM_BINDING_NV = 0x864A; + public const int VERTEX_PROGRAM_NV = 0x8620; + public const int VERTEX_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA2; + public const int VERTEX_PROGRAM_POINT_SIZE = 0x8642; + public const int VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; + public const int VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; + public const int VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; + public const int VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; + public const int VERTEX_SHADER = 0x8B31; + public const int VERTEX_SHADER_ARB = 0x8B31; + public const int VERTEX_SHADER_BINDING_EXT = 0x8781; + public const int VERTEX_SHADER_BIT = 0x00000001; + public const int VERTEX_SHADER_EXT = 0x8780; + public const int VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF; + public const int VERTEX_SHADER_INVARIANTS_EXT = 0x87D1; + public const int VERTEX_SHADER_INVOCATIONS = 0x82F0; + public const int VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0; + public const int VERTEX_SHADER_LOCALS_EXT = 0x87D3; + public const int VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2; + public const int VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4; + public const int VERTEX_SHADER_VARIANTS_EXT = 0x87D0; + public const int VERTEX_SOURCE_ATI = 0x8774; + public const int VERTEX_STATE_PROGRAM_NV = 0x8621; + public const int VERTEX_STREAM0_ATI = 0x876C; + public const int VERTEX_STREAM1_ATI = 0x876D; + public const int VERTEX_STREAM2_ATI = 0x876E; + public const int VERTEX_STREAM3_ATI = 0x876F; + public const int VERTEX_STREAM4_ATI = 0x8770; + public const int VERTEX_STREAM5_ATI = 0x8771; + public const int VERTEX_STREAM6_ATI = 0x8772; + public const int VERTEX_STREAM7_ATI = 0x8773; + public const int VERTEX_SUBROUTINE = 0x92E8; + public const int VERTEX_SUBROUTINE_UNIFORM = 0x92EE; + public const int VERTEX_TEXTURE = 0x829B; + public const int VERTEX_WEIGHTING_EXT = 0x8509; + public const int VERTEX_WEIGHT_ARRAY_EXT = 0x850C; + public const int VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510; + public const int VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D; + public const int VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F; + public const int VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E; + public const int VERTICAL_LINE_TO_NV = 0x08; + public const int VERTICES_SUBMITTED = 0x82EE; + public const int VERTICES_SUBMITTED_ARB = 0x82EE; + public const int VIBRANCE_BIAS_NV = 0x8719; + public const int VIBRANCE_SCALE_NV = 0x8713; + public const int VIDEO_BUFFER_BINDING_NV = 0x9021; + public const int VIDEO_BUFFER_INTERNAL_FORMAT_NV = 0x902D; + public const int VIDEO_BUFFER_NV = 0x9020; + public const int VIDEO_BUFFER_PITCH_NV = 0x9028; + public const int VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV = 0x903B; + public const int VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV = 0x903A; + public const int VIDEO_CAPTURE_FRAME_HEIGHT_NV = 0x9039; + public const int VIDEO_CAPTURE_FRAME_WIDTH_NV = 0x9038; + public const int VIDEO_CAPTURE_SURFACE_ORIGIN_NV = 0x903C; + public const int VIDEO_CAPTURE_TO_422_SUPPORTED_NV = 0x9026; + public const int VIDEO_COLOR_CONVERSION_MATRIX_NV = 0x9029; + public const int VIDEO_COLOR_CONVERSION_MAX_NV = 0x902A; + public const int VIDEO_COLOR_CONVERSION_MIN_NV = 0x902B; + public const int VIDEO_COLOR_CONVERSION_OFFSET_NV = 0x902C; + public const int VIEWPORT = 0x0BA2; + public const int VIEWPORT_BOUNDS_RANGE = 0x825D; + public const int VIEWPORT_COMMAND_NV = 0x0010; + public const int VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; + public const int VIEWPORT_POSITION_W_SCALE_NV = 0x937C; + public const int VIEWPORT_POSITION_W_SCALE_X_COEFF_NV = 0x937D; + public const int VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV = 0x937E; + public const int VIEWPORT_SUBPIXEL_BITS = 0x825C; + public const int VIEWPORT_SWIZZLE_NEGATIVE_W_NV = 0x9357; + public const int VIEWPORT_SWIZZLE_NEGATIVE_X_NV = 0x9351; + public const int VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = 0x9353; + public const int VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = 0x9355; + public const int VIEWPORT_SWIZZLE_POSITIVE_W_NV = 0x9356; + public const int VIEWPORT_SWIZZLE_POSITIVE_X_NV = 0x9350; + public const int VIEWPORT_SWIZZLE_POSITIVE_Y_NV = 0x9352; + public const int VIEWPORT_SWIZZLE_POSITIVE_Z_NV = 0x9354; + public const int VIEWPORT_SWIZZLE_W_NV = 0x935B; + public const int VIEWPORT_SWIZZLE_X_NV = 0x9358; + public const int VIEWPORT_SWIZZLE_Y_NV = 0x9359; + public const int VIEWPORT_SWIZZLE_Z_NV = 0x935A; + public const int VIEW_CLASS_128_BITS = 0x82C4; + public const int VIEW_CLASS_16_BITS = 0x82CA; + public const int VIEW_CLASS_24_BITS = 0x82C9; + public const int VIEW_CLASS_32_BITS = 0x82C8; + public const int VIEW_CLASS_48_BITS = 0x82C7; + public const int VIEW_CLASS_64_BITS = 0x82C6; + public const int VIEW_CLASS_8_BITS = 0x82CB; + public const int VIEW_CLASS_96_BITS = 0x82C5; + public const int VIEW_CLASS_ASTC_10x10_RGBA = 0x9393; + public const int VIEW_CLASS_ASTC_10x5_RGBA = 0x9390; + public const int VIEW_CLASS_ASTC_10x6_RGBA = 0x9391; + public const int VIEW_CLASS_ASTC_10x8_RGBA = 0x9392; + public const int VIEW_CLASS_ASTC_12x10_RGBA = 0x9394; + public const int VIEW_CLASS_ASTC_12x12_RGBA = 0x9395; + public const int VIEW_CLASS_ASTC_4x4_RGBA = 0x9388; + public const int VIEW_CLASS_ASTC_5x4_RGBA = 0x9389; + public const int VIEW_CLASS_ASTC_5x5_RGBA = 0x938A; + public const int VIEW_CLASS_ASTC_6x5_RGBA = 0x938B; + public const int VIEW_CLASS_ASTC_6x6_RGBA = 0x938C; + public const int VIEW_CLASS_ASTC_8x5_RGBA = 0x938D; + public const int VIEW_CLASS_ASTC_8x6_RGBA = 0x938E; + public const int VIEW_CLASS_ASTC_8x8_RGBA = 0x938F; + public const int VIEW_CLASS_BPTC_FLOAT = 0x82D3; + public const int VIEW_CLASS_BPTC_UNORM = 0x82D2; + public const int VIEW_CLASS_EAC_R11 = 0x9383; + public const int VIEW_CLASS_EAC_RG11 = 0x9384; + public const int VIEW_CLASS_ETC2_EAC_RGBA = 0x9387; + public const int VIEW_CLASS_ETC2_RGB = 0x9385; + public const int VIEW_CLASS_ETC2_RGBA = 0x9386; + public const int VIEW_CLASS_RGTC1_RED = 0x82D0; + public const int VIEW_CLASS_RGTC2_RG = 0x82D1; + public const int VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC; + public const int VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD; + public const int VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE; + public const int VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF; + public const int VIEW_COMPATIBILITY_CLASS = 0x82B6; + public const int VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7; + public const int VIRTUAL_PAGE_SIZE_X_AMD = 0x9195; + public const int VIRTUAL_PAGE_SIZE_X_ARB = 0x9195; + public const int VIRTUAL_PAGE_SIZE_Y_AMD = 0x9196; + public const int VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196; + public const int VIRTUAL_PAGE_SIZE_Z_AMD = 0x9197; + public const int VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197; + public const int VIVIDLIGHT_NV = 0x92A6; + public const int VOLATILE_APPLE = 0x8A1A; + public const int WAIT_FAILED = 0x911D; + public const int WARPS_PER_SM_NV = 0x933A; + public const int WARP_SIZE_NV = 0x9339; + public const int WEIGHTED_AVERAGE_ARB = 0x9367; + public const int WEIGHTED_AVERAGE_EXT = 0x9367; + public const int WEIGHT_ARRAY_ARB = 0x86AD; + public const int WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E; + public const int WEIGHT_ARRAY_POINTER_ARB = 0x86AC; + public const int WEIGHT_ARRAY_SIZE_ARB = 0x86AB; + public const int WEIGHT_ARRAY_STRIDE_ARB = 0x86AA; + public const int WEIGHT_ARRAY_TYPE_ARB = 0x86A9; + public const int WEIGHT_SUM_UNITY_ARB = 0x86A6; + public const int WIDE_LINE_HINT_PGI = 0x1A222; + public const int WINDOW_RECTANGLE_EXT = 0x8F12; + public const int WINDOW_RECTANGLE_MODE_EXT = 0x8F13; + public const int WRAP_BORDER_SUN = 0x81D4; + public const int WRITE_DISCARD_NV = 0x88BE; + public const int WRITE_ONLY = 0x88B9; + public const int WRITE_ONLY_ARB = 0x88B9; + public const int WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A; + public const int WRITE_PIXEL_DATA_RANGE_NV = 0x8878; + public const int WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C; + public const int W_EXT = 0x87D8; + public const int XOR = 0x1506; + public const int XOR_NV = 0x1506; + public const int X_EXT = 0x87D5; + public const int YCBAYCR8A_4224_NV = 0x9032; + public const int YCBCR_422_APPLE = 0x85B9; + public const int YCBCR_MESA = 0x8757; + public const int YCBYCR8_422_NV = 0x9031; + public const int YCRCBA_SGIX = 0x8319; + public const int YCRCB_422_SGIX = 0x81BB; + public const int YCRCB_444_SGIX = 0x81BC; + public const int YCRCB_SGIX = 0x8318; + public const int Y_EXT = 0x87D6; + public const int Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV = 0x9036; + public const int Z4Y12Z4CB12Z4CR12_444_NV = 0x9037; + public const int Z4Y12Z4CB12Z4Y12Z4CR12_422_NV = 0x9035; + public const int Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV = 0x9034; + public const int Z6Y10Z6CB10Z6Y10Z6CR10_422_NV = 0x9033; + public const int ZERO = 0; + public const int ZERO_EXT = 0x87DD; + public const int ZERO_TO_ONE = 0x935F; + public const int Z_EXT = 0x87D7; + + #endregion + } + + public static class glAttachment + { + + public const uint Depth = glConst.DEPTH_ATTACHMENT; + public const uint DepthAndStencil = glConst.DEPTH_STENCIL_ATTACHMENT; + public const uint Stencil = glConst.STENCIL_ATTACHMENT; + + public static uint Color(int i) + { + #if DEBUG + if ((i > OpenGLFunction.CurrentGL.AttachmentColorRange) || (i < 0)) + { + throw new ArgumentOutOfRangeException(); + } + #endif + return (uint)(glConst.COLOR_ATTACHMENT0 + i); + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glContext.cs b/StgsSharp.Graphics/OpenGL/glContext.cs similarity index 98% rename from StgSharp.Common/Graphics/OpenGL/glContext.cs rename to StgsSharp.Graphics/OpenGL/glContext.cs index 3dfbb485..ee76cc8d 100644 --- a/StgSharp.Common/Graphics/OpenGL/glContext.cs +++ b/StgsSharp.Graphics/OpenGL/glContext.cs @@ -1,695 +1,695 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glContext" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial struct OpenglContext - { - - internal unsafe delegate* glActiveShaderProgram; - internal unsafe delegate* glActiveTexture; - internal unsafe delegate* glAttachShader; - internal unsafe delegate* glBeginConditionalRender; - internal unsafe delegate* glBeginQuery; - internal unsafe delegate* glBeginQueryIndexed; - internal unsafe delegate* glBeginTransformFeedback; - internal unsafe delegate* glBindAttribLocation; - internal unsafe delegate* glBindBuffer; - internal unsafe delegate* glBindBufferBase; - internal unsafe delegate* glBindBufferRange; - internal unsafe delegate* glBindBuffersBase; - internal unsafe delegate* glBindBuffersRange; - internal unsafe delegate* glBindFragDataLocation; - internal unsafe delegate* glBindFragDataLocationIndexed; - internal unsafe delegate* glBindFramebuffer; - internal unsafe delegate* glBindImageTexture; - internal unsafe delegate* glBindImageTextures; - internal unsafe delegate* glBindProgramPipeline; - internal unsafe delegate* glBindRenderbuffer; - internal unsafe delegate* glBindSampler; - internal unsafe delegate* glBindSamplers; - internal unsafe delegate* glBindTexture; - internal unsafe delegate* glBindTextures; - internal unsafe delegate* glBindTextureUnit; - internal unsafe delegate* glBindTransformFeedback; - internal unsafe delegate* glBindVertexArray; - internal unsafe delegate* glBindVertexBuffer; - internal unsafe delegate* glBindVertexBuffers; - internal unsafe delegate* glBlendColor; - internal unsafe delegate* glBlendEquation; - internal unsafe delegate* glBlendEquationi; - internal unsafe delegate* glBlendEquationSeparate; - internal unsafe delegate* glBlendEquationSeparatei; - internal unsafe delegate* glBlendFunc; - internal unsafe delegate* glBlendFunci; - internal unsafe delegate* glBlendFuncSeparate; - internal unsafe delegate* glBlendFuncSeparatei; - internal unsafe delegate* glBlitFramebuffer; - internal unsafe delegate* glBlitNamedFramebuffer; - internal unsafe delegate* glBufferData; - internal unsafe delegate* glBufferStorage; - internal unsafe delegate* glBufferSubData; - internal unsafe delegate* glCheckFramebufferStatus; - internal unsafe delegate* glCheckNamedFramebufferStatus; - internal unsafe delegate* glClampColor; - internal unsafe delegate* glClear; - internal unsafe delegate* glClearBufferData; - internal unsafe delegate* glClearBufferfi; - internal unsafe delegate* glClearBufferfv; - internal unsafe delegate* glClearBufferiv; - internal unsafe delegate* glClearBufferSubData; - internal unsafe delegate* glClearBufferuiv; - internal unsafe delegate* glClearColor; - internal unsafe delegate* glClearDepth; - internal unsafe delegate* glClearDepthf; - internal unsafe delegate* glClearNamedBufferData; - internal unsafe delegate* glClearNamedBufferSubData; - internal unsafe delegate* glClearNamedFramebufferfi; - internal unsafe delegate* glClearNamedFramebufferfv; - internal unsafe delegate* glClearNamedFramebufferiv; - internal unsafe delegate* glClearNamedFramebufferuiv; - internal unsafe delegate* glClearStencil; - internal unsafe delegate* glClearTexImage; - internal unsafe delegate* glClearTexSubImage; - internal unsafe delegate* glClientWaitSync; - internal unsafe delegate* glClipControl; - internal unsafe delegate* glColorMask; - internal unsafe delegate* glColorMaski; - internal unsafe delegate* glCompileShader; - internal unsafe delegate* glCompressedTexImage1D; - internal unsafe delegate* glCompressedTexImage2D; - internal unsafe delegate* glCompressedTexImage3D; - internal unsafe delegate* glCompressedTexSubImage1D; - internal unsafe delegate* glCompressedTexSubImage2D; - internal unsafe delegate* glCompressedTexSubImage3D; - internal unsafe delegate* glCompressedTextureSubImage1D; - internal unsafe delegate* glCompressedTextureSubImage2D; - internal unsafe delegate* glCompressedTextureSubImage3D; - internal unsafe delegate* glCopyBufferSubData; - internal unsafe delegate* glCopyImageSubData; - internal unsafe delegate* glCopyNamedBufferSubData; - internal unsafe delegate* glCopyTexImage1D; - internal unsafe delegate* glCopyTexImage2D; - internal unsafe delegate* glCopyTexSubImage1D; - internal unsafe delegate* glCopyTexSubImage2D; - internal unsafe delegate* glCopyTexSubImage3D; - internal unsafe delegate* glCopyTextureSubImage1D; - internal unsafe delegate* glCopyTextureSubImage2D; - internal unsafe delegate* glCopyTextureSubImage3D; - internal unsafe delegate* glCreateBuffers; - internal unsafe delegate* glCreateFramebuffers; - internal unsafe delegate* glCreateProgram; - internal unsafe delegate* glCreateProgramPipelines; - internal unsafe delegate* glCreateQueries; - internal unsafe delegate* glCreateRenderbuffers; - internal unsafe delegate* glCreateSamplers; - internal unsafe delegate* glCreateShader; - internal unsafe delegate* glCreateShaderProgramv; - internal unsafe delegate* glCreateTextures; - internal unsafe delegate* glCreateTransformFeedbacks; - internal unsafe delegate* glCreateVertexArrays; - internal unsafe delegate* glCullFace; - internal unsafe delegate* glDebugMessageCallback; - internal unsafe delegate* glDebugMessageControl; - internal unsafe delegate* glDebugMessageInsert; - internal unsafe delegate* glDeleteBuffers; - internal unsafe delegate* glDeleteFramebuffers; - internal unsafe delegate* glDeleteProgram; - internal unsafe delegate* glDeleteProgramPipelines; - internal unsafe delegate* glDeleteQueries; - internal unsafe delegate* glDeleteRenderbuffers; - internal unsafe delegate* glDeleteSamplers; - internal unsafe delegate* glDeleteShader; - internal unsafe delegate* glDeleteSync; - internal unsafe delegate* glDeleteTextures; - internal unsafe delegate* glDeleteTransformFeedbacks; - internal unsafe delegate* glDeleteVertexArrays; - internal unsafe delegate* glDepthFunc; - internal unsafe delegate* glDepthMask; - internal unsafe delegate* glDepthRange; - internal unsafe delegate* glDepthRangeArrayv; - internal unsafe delegate* glDepthRangef; - internal unsafe delegate* glDepthRangeIndexed; - internal unsafe delegate* glDetachShader; - internal unsafe delegate* glDisable; - internal unsafe delegate* glDisablei; - internal unsafe delegate* glDisableVertexArrayAttrib; - internal unsafe delegate* glDisableVertexAttribArray; - internal unsafe delegate* glDispatchCompute; - internal unsafe delegate* glDispatchComputeIndirect; - internal unsafe delegate* glDrawArrays; - internal unsafe delegate* glDrawArraysIndirect; - internal unsafe delegate* glDrawArraysInstanced; - internal unsafe delegate* glDrawArraysInstancedBaseInstance; - internal unsafe delegate* glDrawBuffer; - internal unsafe delegate* glDrawBuffers; - internal unsafe delegate* glDrawElements; - internal unsafe delegate* glDrawElementsBaseVertex; - internal unsafe delegate* glDrawElementsIndirect; - internal unsafe delegate* glDrawElementsInstanced; - internal unsafe delegate* glDrawElementsInstancedBaseInstance; - internal unsafe delegate* glDrawElementsInstancedBaseVertex; - internal unsafe delegate* glDrawElementsInstancedBaseVertexBaseInstance; - internal unsafe delegate* glDrawRangeElements; - internal unsafe delegate* glDrawRangeElementsBaseVertex; - internal unsafe delegate* glDrawTransformFeedback; - internal unsafe delegate* glDrawTransformFeedbackInstanced; - internal unsafe delegate* glDrawTransformFeedbackStream; - internal unsafe delegate* glDrawTransformFeedbackStreamInstanced; - internal unsafe delegate* glEnable; - internal unsafe delegate* glEnablei; - internal unsafe delegate* glEnableVertexArrayAttrib; - internal unsafe delegate* glEnableVertexAttribArray; - internal unsafe delegate* glEndConditionalRender; - internal unsafe delegate* glEndQuery; - internal unsafe delegate* glEndQueryIndexed; - internal unsafe delegate* glEndTransformFeedback; - internal unsafe delegate* glFenceSync; - internal unsafe delegate* glFinish; - internal unsafe delegate* glFlush; - internal unsafe delegate* glFlushMappedBufferRange; - internal unsafe delegate* glFlushMappedNamedBufferRange; - internal unsafe delegate* glFramebufferParameteri; - internal unsafe delegate* glFramebufferRenderbuffer; - internal unsafe delegate* glFramebufferTexture; - internal unsafe delegate* glFramebufferTexture1D; - internal unsafe delegate* glFramebufferTexture2D; - internal unsafe delegate* glFramebufferTexture3D; - internal unsafe delegate* glFramebufferTextureLayer; - internal unsafe delegate* glFrontFace; - internal unsafe delegate* glGenBuffers; - internal unsafe delegate* glGenerateMipmap; - internal unsafe delegate* glGenerateTextureMipmap; - internal unsafe delegate* glGenFramebuffers; - internal unsafe delegate* glGenProgramPipelines; - internal unsafe delegate* glGenQueries; - internal unsafe delegate* glGenRenderbuffers; - internal unsafe delegate* glGenSamplers; - internal unsafe delegate* glGenTextures; - internal unsafe delegate* glGenTransformFeedbacks; - internal unsafe delegate* glGenVertexArrays; - internal unsafe delegate* glGetActiveAtomicCounterBufferiv; - internal unsafe delegate* glGetActiveAttrib; - internal unsafe delegate* glGetActiveSubroutineName; - internal unsafe delegate* glGetActiveSubroutineUniformiv; - internal unsafe delegate* glGetActiveSubroutineUniformName; - internal unsafe delegate* glGetActiveUniform; - internal unsafe delegate* glGetActiveUniformBlockiv; - internal unsafe delegate* glGetActiveUniformBlockName; - internal unsafe delegate* glGetActiveUniformName; - internal unsafe delegate* glGetActiveUniformsiv; - internal unsafe delegate* glGetAttachedShaders; - internal unsafe delegate* glGetAttribLocation; - internal unsafe delegate* glGetBooleani_v; - internal unsafe delegate* glGetBooleanv; - internal unsafe delegate* glGetBufferParameteri64v; - internal unsafe delegate* glGetBufferParameteriv; - internal unsafe delegate* glGetBufferPointerv; - internal unsafe delegate* glGetBufferSubData; - internal unsafe delegate* glGetCompressedTexImage; - internal unsafe delegate* glGetCompressedTextureImage; - internal unsafe delegate* glGetCompressedTextureSubImage; - internal unsafe delegate* glGetDebugMessageLog; - internal unsafe delegate* glGetDoublei_v; - internal unsafe delegate* glGetDoublev; - internal unsafe delegate* glGetError; - internal unsafe delegate* glGetFloati_v; - internal unsafe delegate* glGetFloatv; - internal unsafe delegate* glGetFragDataIndex; - internal unsafe delegate* glGetFragDataLocation; - internal unsafe delegate* glGetFramebufferAttachmentParameteriv; - internal unsafe delegate* glGetFramebufferParameteriv; - internal unsafe delegate* glGetGraphicsResetStatus; - internal unsafe delegate* glGetInteger64i_v; - internal unsafe delegate* glGetInteger64v; - internal unsafe delegate* glGetIntegeri_v; - internal unsafe delegate* glGetIntegerv; - internal unsafe delegate* glGetInternalformati64v; - internal unsafe delegate* glGetInternalformativ; - internal unsafe delegate* glGetMultisamplefv; - internal unsafe delegate* glGetNamedBufferParameteri64v; - internal unsafe delegate* glGetNamedBufferParameteriv; - internal unsafe delegate* glGetNamedBufferPointerv; - internal unsafe delegate* glGetNamedBufferSubData; - internal unsafe delegate* glGetNamedFramebufferAttachmentParameteriv; - internal unsafe delegate* glGetNamedFramebufferParameteriv; - internal unsafe delegate* glGetNamedRenderbufferParameteriv; - internal unsafe delegate* glGetnCompressedTexImage; - internal unsafe delegate* glGetnTexImage; - internal unsafe delegate* glGetnUniformdv; - internal unsafe delegate* glGetnUniformfv; - internal unsafe delegate* glGetnUniformiv; - internal unsafe delegate* glGetnUniformuiv; - internal unsafe delegate* glGetObjectLabel; - internal unsafe delegate* glGetObjectPtrLabel; - internal unsafe delegate* glGetPointerv; - internal unsafe delegate* glGetProgramBinary; - internal unsafe delegate* glGetProgramInfoLog; - internal unsafe delegate* glGetProgramInterfaceiv; - internal unsafe delegate* glGetProgramiv; - internal unsafe delegate* glGetProgramPipelineInfoLog; - internal unsafe delegate* glGetProgramPipelineiv; - internal unsafe delegate* glGetProgramResourceIndex; - internal unsafe delegate* glGetProgramResourceiv; - internal unsafe delegate* glGetProgramResourceLocation; - internal unsafe delegate* glGetProgramResourceLocationIndex; - internal unsafe delegate* glGetProgramResourceName; - internal unsafe delegate* glGetProgramStageiv; - internal unsafe delegate* glGetQueryBufferObjecti64v; - internal unsafe delegate* glGetQueryBufferObjectiv; - internal unsafe delegate* glGetQueryBufferObjectui64v; - internal unsafe delegate* glGetQueryBufferObjectuiv; - internal unsafe delegate* glGetQueryIndexediv; - internal unsafe delegate* glGetQueryiv; - internal unsafe delegate* glGetQueryObjecti64v; - internal unsafe delegate* glGetQueryObjectiv; - internal unsafe delegate* glGetQueryObjectui64v; - internal unsafe delegate* glGetQueryObjectuiv; - internal unsafe delegate* glGetRenderbufferParameteriv; - internal unsafe delegate* glGetSamplerParameterfv; - internal unsafe delegate* glGetSamplerParameterIiv; - internal unsafe delegate* glGetSamplerParameterIuiv; - internal unsafe delegate* glGetSamplerParameteriv; - internal unsafe delegate* glGetShaderInfoLog; - internal unsafe delegate* glGetShaderiv; - internal unsafe delegate* glGetShaderPrecisionFormat; - internal unsafe delegate* glGetShaderSource; - internal unsafe delegate* glGetString; - internal unsafe delegate* glGetStringi; - internal unsafe delegate* glGetSubroutineIndex; - internal unsafe delegate* glGetSubroutineUniformLocation; - internal unsafe delegate* glGetSynciv; - internal unsafe delegate* glGetTexImage; - internal unsafe delegate* glGetTexLevelParameterfv; - internal unsafe delegate* glGetTexLevelParameteriv; - internal unsafe delegate* glGetTexParameterfv; - internal unsafe delegate* glGetTexParameterIiv; - internal unsafe delegate* glGetTexParameterIuiv; - internal unsafe delegate* glGetTexParameteriv; - internal unsafe delegate* glGetTextureImage; - internal unsafe delegate* glGetTextureLevelParameterfv; - internal unsafe delegate* glGetTextureLevelParameteriv; - internal unsafe delegate* glGetTextureParameterfv; - internal unsafe delegate* glGetTextureParameterIiv; - internal unsafe delegate* glGetTextureParameterIuiv; - internal unsafe delegate* glGetTextureParameteriv; - internal unsafe delegate* glGetTextureSubImage; - internal unsafe delegate* glGetTransformFeedbacki_v; - internal unsafe delegate* glGetTransformFeedbacki64_v; - internal unsafe delegate* glGetTransformFeedbackiv; - internal unsafe delegate* glGetTransformFeedbackVarying; - internal unsafe delegate* glGetUniformBlockIndex; - internal unsafe delegate* glGetUniformdv; - internal unsafe delegate* glGetUniformfv; - internal unsafe delegate* glGetUniformIndices; - internal unsafe delegate* glGetUniformiv; - internal unsafe delegate* glGetUniformLocation; - internal unsafe delegate* glGetUniformSubroutineuiv; - internal unsafe delegate* glGetUniformuiv; - internal unsafe delegate* glGetVertexArrayIndexed64iv; - internal unsafe delegate* glGetVertexArrayIndexediv; - internal unsafe delegate* glGetVertexArrayiv; - internal unsafe delegate* glGetVertexAttribdv; - internal unsafe delegate* glGetVertexAttribfv; - internal unsafe delegate* glGetVertexAttribIiv; - internal unsafe delegate* glGetVertexAttribIuiv; - internal unsafe delegate* glGetVertexAttribiv; - internal unsafe delegate* glGetVertexAttribLdv; - internal unsafe delegate* glGetVertexAttribPointerv; - internal unsafe delegate* glHint; - internal unsafe delegate* glInvalidateBufferData; - internal unsafe delegate* glInvalidateBufferSubData; - internal unsafe delegate* glInvalidateFramebuffer; - internal unsafe delegate* glInvalidateNamedFramebufferData; - internal unsafe delegate* glInvalidateNamedFramebufferSubData; - internal unsafe delegate* glInvalidateSubFramebuffer; - internal unsafe delegate* glInvalidateTexImage; - internal unsafe delegate* glInvalidateTexSubImage; - internal unsafe delegate* glIsBuffer; - internal unsafe delegate* glIsEnabled; - internal unsafe delegate* glIsEnabledi; - internal unsafe delegate* glIsFramebuffer; - internal unsafe delegate* glIsProgram; - internal unsafe delegate* glIsProgramPipeline; - internal unsafe delegate* glIsQuery; - internal unsafe delegate* glIsRenderbuffer; - internal unsafe delegate* glIsSampler; - internal unsafe delegate* glIsShader; - internal unsafe delegate* glIsSync; - internal unsafe delegate* glIsTexture; - internal unsafe delegate* glIsTransformFeedback; - internal unsafe delegate* glIsVertexArray; - internal unsafe delegate* glLineWidth; - internal unsafe delegate* glLinkProgram; - internal unsafe delegate* glLogicOp; - internal unsafe delegate* glMapBuffer; - internal unsafe delegate* glMapBufferRange; - internal unsafe delegate* glMapNamedBuffer; - internal unsafe delegate* glMapNamedBufferRange; - internal unsafe delegate* glMemoryBarrier; - internal unsafe delegate* glMemoryBarrierByRegion; - internal unsafe delegate* glMinSampleShading; - internal unsafe delegate* glMultiDrawArrays; - internal unsafe delegate* glMultiDrawArraysIndirect; - internal unsafe delegate* glMultiDrawArraysIndirectCount; - internal unsafe delegate* glMultiDrawElements; - internal unsafe delegate* glMultiDrawElementsBaseVertex; - internal unsafe delegate* glMultiDrawElementsIndirect; - internal unsafe delegate* glMultiDrawElementsIndirectCount; - internal unsafe delegate* glNamedBufferData; - internal unsafe delegate* glNamedBufferStorage; - internal unsafe delegate* glNamedBufferSubData; - internal unsafe delegate* glNamedFramebufferDrawBuffer; - internal unsafe delegate* glNamedFramebufferDrawBuffers; - internal unsafe delegate* glNamedFramebufferParameteri; - internal unsafe delegate* glNamedFramebufferReadBuffer; - internal unsafe delegate* glNamedFramebufferRenderbuffer; - internal unsafe delegate* glNamedFramebufferTexture; - internal unsafe delegate* glNamedFramebufferTextureLayer; - internal unsafe delegate* glNamedRenderbufferStorage; - internal unsafe delegate* glNamedRenderbufferStorageMultisample; - internal unsafe delegate* glObjectLabel; - internal unsafe delegate* glObjectPtrLabel; - internal unsafe delegate* glPatchParameterfv; - internal unsafe delegate* glPatchParameteri; - internal unsafe delegate* glPauseTransformFeedback; - internal unsafe delegate* glPixelStoref; - internal unsafe delegate* glPixelStorei; - internal unsafe delegate* glPointParameterf; - internal unsafe delegate* glPointParameterfv; - internal unsafe delegate* glPointParameteri; - internal unsafe delegate* glPointParameteriv; - internal unsafe delegate* glPointSize; - internal unsafe delegate* glPolygonMode; - internal unsafe delegate* glPolygonOffset; - internal unsafe delegate* glPolygonOffsetClamp; - internal unsafe delegate* glPopDebugGroup; - internal unsafe delegate* glPrimitiveRestartIndex; - internal unsafe delegate* glProgramBinary; - internal unsafe delegate* glProgramParameteri; - internal unsafe delegate* glProgramUniform1d; - internal unsafe delegate* glProgramUniform1dv; - internal unsafe delegate* glProgramUniform1f; - internal unsafe delegate* glProgramUniform1fv; - internal unsafe delegate* glProgramUniform1i; - internal unsafe delegate* glProgramUniform1iv; - internal unsafe delegate* glProgramUniform1ui; - internal unsafe delegate* glProgramUniform1uiv; - internal unsafe delegate* glProgramUniform2d; - internal unsafe delegate* glProgramUniform2dv; - internal unsafe delegate* glProgramUniform2f; - internal unsafe delegate* glProgramUniform2fv; - internal unsafe delegate* glProgramUniform2i; - internal unsafe delegate* glProgramUniform2iv; - internal unsafe delegate* glProgramUniform2ui; - internal unsafe delegate* glProgramUniform2uiv; - internal unsafe delegate* glProgramUniform3d; - internal unsafe delegate* glProgramUniform3dv; - internal unsafe delegate* glProgramUniform3f; - internal unsafe delegate* glProgramUniform3fv; - internal unsafe delegate* glProgramUniform3i; - internal unsafe delegate* glProgramUniform3iv; - internal unsafe delegate* glProgramUniform3ui; - internal unsafe delegate* glProgramUniform3uiv; - internal unsafe delegate* glProgramUniform4d; - internal unsafe delegate* glProgramUniform4dv; - internal unsafe delegate* glProgramUniform4f; - internal unsafe delegate* glProgramUniform4fv; - internal unsafe delegate* glProgramUniform4i; - internal unsafe delegate* glProgramUniform4iv; - internal unsafe delegate* glProgramUniform4ui; - internal unsafe delegate* glProgramUniform4uiv; - internal unsafe delegate* glProgramUniformMatrix2dv; - internal unsafe delegate* glProgramUniformMatrix2fv; - internal unsafe delegate* glProgramUniformMatrix2x3dv; - internal unsafe delegate* glProgramUniformMatrix2x3fv; - internal unsafe delegate* glProgramUniformMatrix2x4dv; - internal unsafe delegate* glProgramUniformMatrix2x4fv; - internal unsafe delegate* glProgramUniformMatrix3dv; - internal unsafe delegate* glProgramUniformMatrix3fv; - internal unsafe delegate* glProgramUniformMatrix3x2dv; - internal unsafe delegate* glProgramUniformMatrix3x2fv; - internal unsafe delegate* glProgramUniformMatrix3x4dv; - internal unsafe delegate* glProgramUniformMatrix3x4fv; - internal unsafe delegate* glProgramUniformMatrix4dv; - internal unsafe delegate* glProgramUniformMatrix4fv; - internal unsafe delegate* glProgramUniformMatrix4x2dv; - internal unsafe delegate* glProgramUniformMatrix4x2fv; - internal unsafe delegate* glProgramUniformMatrix4x3dv; - internal unsafe delegate* glProgramUniformMatrix4x3fv; - internal unsafe delegate* glProvokingVertex; - internal unsafe delegate* glPushDebugGroup; - internal unsafe delegate* glQueryCounter; - internal unsafe delegate* glReadBuffer; - internal unsafe delegate* glReadnPixels; - internal unsafe delegate* glReadPixels; - internal unsafe delegate* glReleaseShaderCompiler; - internal unsafe delegate* glRenderbufferStorage; - internal unsafe delegate* glRenderbufferStorageMultisample; - internal unsafe delegate* glResumeTransformFeedback; - internal unsafe delegate* glSampleCoverage; - internal unsafe delegate* glSampleMaski; - internal unsafe delegate* glSamplerParameterf; - internal unsafe delegate* glSamplerParameterfv; - internal unsafe delegate* glSamplerParameteri; - internal unsafe delegate* glSamplerParameterIiv; - internal unsafe delegate* glSamplerParameterIuiv; - internal unsafe delegate* glSamplerParameteriv; - internal unsafe delegate* glScissor; - internal unsafe delegate* glScissorArrayv; - internal unsafe delegate* glScissorIndexed; - internal unsafe delegate* glScissorIndexedv; - internal unsafe delegate* glShaderBinary; - internal unsafe delegate* glShaderSource; - internal unsafe delegate* glShaderStorageBlockBinding; - internal unsafe delegate* glSpecializeShader; - internal unsafe delegate* glStencilFunc; - internal unsafe delegate* glStencilFuncSeparate; - internal unsafe delegate* glStencilMask; - internal unsafe delegate* glStencilMaskSeparate; - internal unsafe delegate* glStencilOp; - internal unsafe delegate* glStencilOpSeparate; - internal unsafe delegate* glTexBuffer; - internal unsafe delegate* glTexBufferRange; - internal unsafe delegate* glTexImage1D; - internal unsafe delegate* glTexImage2D; - internal unsafe delegate* glTexImage2DMultisample; - internal unsafe delegate* glTexImage3D; - internal unsafe delegate* glTexImage3DMultisample; - internal unsafe delegate* glTexParameterf; - internal unsafe delegate* glTexParameterfv; - internal unsafe delegate* glTexParameteri; - internal unsafe delegate* glTexParameterIiv; - internal unsafe delegate* glTexParameterIuiv; - internal unsafe delegate* glTexParameteriv; - internal unsafe delegate* glTexStorage1D; - internal unsafe delegate* glTexStorage2D; - internal unsafe delegate* glTexStorage2DMultisample; - internal unsafe delegate* glTexStorage3D; - internal unsafe delegate* glTexStorage3DMultisample; - internal unsafe delegate* glTexSubImage1D; - internal unsafe delegate* glTexSubImage2D; - internal unsafe delegate* glTexSubImage3D; - internal unsafe delegate* glTextureBarrier; - internal unsafe delegate* glTextureBuffer; - internal unsafe delegate* glTextureBufferRange; - internal unsafe delegate* glTextureParameterf; - internal unsafe delegate* glTextureParameterfv; - internal unsafe delegate* glTextureParameteri; - internal unsafe delegate* glTextureParameterIiv; - internal unsafe delegate* glTextureParameterIuiv; - internal unsafe delegate* glTextureParameteriv; - internal unsafe delegate* glTextureStorage1D; - internal unsafe delegate* glTextureStorage2D; - internal unsafe delegate* glTextureStorage2DMultisample; - internal unsafe delegate* glTextureStorage3D; - internal unsafe delegate* glTextureStorage3DMultisample; - internal unsafe delegate* glTextureSubImage1D; - internal unsafe delegate* glTextureSubImage2D; - internal unsafe delegate* glTextureSubImage3D; - internal unsafe delegate* glTextureView; - internal unsafe delegate* glTransformFeedbackBufferBase; - internal unsafe delegate* glTransformFeedbackBufferRange; - internal unsafe delegate* glTransformFeedbackVaryings; - internal unsafe delegate* glUniform1d; - internal unsafe delegate* glUniform1dv; - internal unsafe delegate* glUniform1f; - internal unsafe delegate* glUniform1fv; - internal unsafe delegate* glUniform1i; - internal unsafe delegate* glUniform1iv; - internal unsafe delegate* glUniform1ui; - internal unsafe delegate* glUniform1uiv; - internal unsafe delegate* glUniform2d; - internal unsafe delegate* glUniform2dv; - internal unsafe delegate* glUniform2f; - internal unsafe delegate* glUniform2fv; - internal unsafe delegate* glUniform2i; - internal unsafe delegate* glUniform2iv; - internal unsafe delegate* glUniform2ui; - internal unsafe delegate* glUniform2uiv; - internal unsafe delegate* glUniform3d; - internal unsafe delegate* glUniform3dv; - internal unsafe delegate* glUniform3f; - internal unsafe delegate* glUniform3fv; - internal unsafe delegate* glUniform3i; - internal unsafe delegate* glUniform3iv; - internal unsafe delegate* glUniform3ui; - internal unsafe delegate* glUniform3uiv; - internal unsafe delegate* glUniform4d; - internal unsafe delegate* glUniform4dv; - internal unsafe delegate* glUniform4f; - internal unsafe delegate* glUniform4fv; - internal unsafe delegate* glUniform4i; - internal unsafe delegate* glUniform4iv; - internal unsafe delegate* glUniform4ui; - internal unsafe delegate* glUniform4uiv; - internal unsafe delegate* glUniformBlockBinding; - internal unsafe delegate* glUniformMatrix2dv; - internal unsafe delegate* glUniformMatrix2fv; - internal unsafe delegate* glUniformMatrix2x3dv; - internal unsafe delegate* glUniformMatrix2x3fv; - internal unsafe delegate* glUniformMatrix2x4dv; - internal unsafe delegate* glUniformMatrix2x4fv; - internal unsafe delegate* glUniformMatrix3dv; - internal unsafe delegate* glUniformMatrix3fv; - internal unsafe delegate* glUniformMatrix3x2dv; - internal unsafe delegate* glUniformMatrix3x2fv; - internal unsafe delegate* glUniformMatrix3x4dv; - internal unsafe delegate* glUniformMatrix3x4fv; - internal unsafe delegate* glUniformMatrix4dv; - internal unsafe delegate* glUniformMatrix4fv; - internal unsafe delegate* glUniformMatrix4x2dv; - internal unsafe delegate* glUniformMatrix4x2fv; - internal unsafe delegate* glUniformMatrix4x3dv; - internal unsafe delegate* glUniformMatrix4x3fv; - internal unsafe delegate* glUniformSubroutinesuiv; - internal unsafe delegate* glUnmapBuffer; - internal unsafe delegate* glUnmapNamedBuffer; - internal unsafe delegate* glUseProgram; - internal unsafe delegate* glUseProgramStages; - internal unsafe delegate* glValidateProgram; - internal unsafe delegate* glValidateProgramPipeline; - internal unsafe delegate* glVertexArrayAttribBinding; - internal unsafe delegate* glVertexArrayAttribFormat; - internal unsafe delegate* glVertexArrayAttribIFormat; - internal unsafe delegate* glVertexArrayAttribLFormat; - internal unsafe delegate* glVertexArrayBindingDivisor; - internal unsafe delegate* glVertexArrayElementBuffer; - internal unsafe delegate* glVertexArrayVertexBuffer; - internal unsafe delegate* glVertexArrayVertexBuffers; - internal unsafe delegate* glVertexAttrib1d; - internal unsafe delegate* glVertexAttrib1dv; - internal unsafe delegate* glVertexAttrib1f; - internal unsafe delegate* glVertexAttrib1fv; - internal unsafe delegate* glVertexAttrib1s; - internal unsafe delegate* glVertexAttrib1sv; - internal unsafe delegate* glVertexAttrib2d; - internal unsafe delegate* glVertexAttrib2dv; - internal unsafe delegate* glVertexAttrib2f; - internal unsafe delegate* glVertexAttrib2fv; - internal unsafe delegate* glVertexAttrib2s; - internal unsafe delegate* glVertexAttrib2sv; - internal unsafe delegate* glVertexAttrib3d; - internal unsafe delegate* glVertexAttrib3dv; - internal unsafe delegate* glVertexAttrib3f; - internal unsafe delegate* glVertexAttrib3fv; - internal unsafe delegate* glVertexAttrib3s; - internal unsafe delegate* glVertexAttrib3sv; - internal unsafe delegate* glVertexAttrib4bv; - internal unsafe delegate* glVertexAttrib4d; - internal unsafe delegate* glVertexAttrib4dv; - internal unsafe delegate* glVertexAttrib4f; - internal unsafe delegate* glVertexAttrib4fv; - internal unsafe delegate* glVertexAttrib4iv; - internal unsafe delegate* glVertexAttrib4Nbv; - internal unsafe delegate* glVertexAttrib4Niv; - internal unsafe delegate* glVertexAttrib4Nsv; - internal unsafe delegate* glVertexAttrib4Nub; - internal unsafe delegate* glVertexAttrib4Nubv; - internal unsafe delegate* glVertexAttrib4Nuiv; - internal unsafe delegate* glVertexAttrib4Nusv; - internal unsafe delegate* glVertexAttrib4s; - internal unsafe delegate* glVertexAttrib4sv; - internal unsafe delegate* glVertexAttrib4ubv; - internal unsafe delegate* glVertexAttrib4uiv; - internal unsafe delegate* glVertexAttrib4usv; - internal unsafe delegate* glVertexAttribBinding; - internal unsafe delegate* glVertexAttribDivisor; - internal unsafe delegate* glVertexAttribFormat; - internal unsafe delegate* glVertexAttribI1i; - internal unsafe delegate* glVertexAttribI1iv; - internal unsafe delegate* glVertexAttribI1ui; - internal unsafe delegate* glVertexAttribI1uiv; - internal unsafe delegate* glVertexAttribI2i; - internal unsafe delegate* glVertexAttribI2iv; - internal unsafe delegate* glVertexAttribI2ui; - internal unsafe delegate* glVertexAttribI2uiv; - internal unsafe delegate* glVertexAttribI3i; - internal unsafe delegate* glVertexAttribI3iv; - internal unsafe delegate* glVertexAttribI3ui; - internal unsafe delegate* glVertexAttribI3uiv; - internal unsafe delegate* glVertexAttribI4bv; - internal unsafe delegate* glVertexAttribI4i; - internal unsafe delegate* glVertexAttribI4iv; - internal unsafe delegate* glVertexAttribI4sv; - internal unsafe delegate* glVertexAttribI4ubv; - internal unsafe delegate* glVertexAttribI4ui; - internal unsafe delegate* glVertexAttribI4uiv; - internal unsafe delegate* glVertexAttribI4usv; - internal unsafe delegate* glVertexAttribIFormat; - internal unsafe delegate* glVertexAttribIPointer; - internal unsafe delegate* glVertexAttribL1d; - internal unsafe delegate* glVertexAttribL1dv; - internal unsafe delegate* glVertexAttribL2d; - internal unsafe delegate* glVertexAttribL2dv; - internal unsafe delegate* glVertexAttribL3d; - internal unsafe delegate* glVertexAttribL3dv; - internal unsafe delegate* glVertexAttribL4d; - internal unsafe delegate* glVertexAttribL4dv; - internal unsafe delegate* glVertexAttribLFormat; - internal unsafe delegate* glVertexAttribLPointer; - internal unsafe delegate* glVertexAttribP1ui; - internal unsafe delegate* glVertexAttribP1uiv; - internal unsafe delegate* glVertexAttribP2ui; - internal unsafe delegate* glVertexAttribP2uiv; - internal unsafe delegate* glVertexAttribP3ui; - internal unsafe delegate* glVertexAttribP3uiv; - internal unsafe delegate* glVertexAttribP4ui; - internal unsafe delegate* glVertexAttribP4uiv; - internal unsafe delegate* glVertexAttribPointer; - internal unsafe delegate* glVertexBindingDivisor; - internal unsafe delegate* glViewport; - internal unsafe delegate* glViewportArrayv; - internal unsafe delegate* glViewportIndexedf; - internal unsafe delegate* glViewportIndexedfv; - internal unsafe delegate* glWaitSync; - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glContext" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial struct OpenglContext + { + + internal unsafe delegate* glActiveShaderProgram; + internal unsafe delegate* glActiveTexture; + internal unsafe delegate* glAttachShader; + internal unsafe delegate* glBeginConditionalRender; + internal unsafe delegate* glBeginQuery; + internal unsafe delegate* glBeginQueryIndexed; + internal unsafe delegate* glBeginTransformFeedback; + internal unsafe delegate* glBindAttribLocation; + internal unsafe delegate* glBindBuffer; + internal unsafe delegate* glBindBufferBase; + internal unsafe delegate* glBindBufferRange; + internal unsafe delegate* glBindBuffersBase; + internal unsafe delegate* glBindBuffersRange; + internal unsafe delegate* glBindFragDataLocation; + internal unsafe delegate* glBindFragDataLocationIndexed; + internal unsafe delegate* glBindFramebuffer; + internal unsafe delegate* glBindImageTexture; + internal unsafe delegate* glBindImageTextures; + internal unsafe delegate* glBindProgramPipeline; + internal unsafe delegate* glBindRenderbuffer; + internal unsafe delegate* glBindSampler; + internal unsafe delegate* glBindSamplers; + internal unsafe delegate* glBindTexture; + internal unsafe delegate* glBindTextures; + internal unsafe delegate* glBindTextureUnit; + internal unsafe delegate* glBindTransformFeedback; + internal unsafe delegate* glBindVertexArray; + internal unsafe delegate* glBindVertexBuffer; + internal unsafe delegate* glBindVertexBuffers; + internal unsafe delegate* glBlendColor; + internal unsafe delegate* glBlendEquation; + internal unsafe delegate* glBlendEquationi; + internal unsafe delegate* glBlendEquationSeparate; + internal unsafe delegate* glBlendEquationSeparatei; + internal unsafe delegate* glBlendFunc; + internal unsafe delegate* glBlendFunci; + internal unsafe delegate* glBlendFuncSeparate; + internal unsafe delegate* glBlendFuncSeparatei; + internal unsafe delegate* glBlitFramebuffer; + internal unsafe delegate* glBlitNamedFramebuffer; + internal unsafe delegate* glBufferData; + internal unsafe delegate* glBufferStorage; + internal unsafe delegate* glBufferSubData; + internal unsafe delegate* glCheckFramebufferStatus; + internal unsafe delegate* glCheckNamedFramebufferStatus; + internal unsafe delegate* glClampColor; + internal unsafe delegate* glClear; + internal unsafe delegate* glClearBufferData; + internal unsafe delegate* glClearBufferfi; + internal unsafe delegate* glClearBufferfv; + internal unsafe delegate* glClearBufferiv; + internal unsafe delegate* glClearBufferSubData; + internal unsafe delegate* glClearBufferuiv; + internal unsafe delegate* glClearColor; + internal unsafe delegate* glClearDepth; + internal unsafe delegate* glClearDepthf; + internal unsafe delegate* glClearNamedBufferData; + internal unsafe delegate* glClearNamedBufferSubData; + internal unsafe delegate* glClearNamedFramebufferfi; + internal unsafe delegate* glClearNamedFramebufferfv; + internal unsafe delegate* glClearNamedFramebufferiv; + internal unsafe delegate* glClearNamedFramebufferuiv; + internal unsafe delegate* glClearStencil; + internal unsafe delegate* glClearTexImage; + internal unsafe delegate* glClearTexSubImage; + internal unsafe delegate* glClientWaitSync; + internal unsafe delegate* glClipControl; + internal unsafe delegate* glColorMask; + internal unsafe delegate* glColorMaski; + internal unsafe delegate* glCompileShader; + internal unsafe delegate* glCompressedTexImage1D; + internal unsafe delegate* glCompressedTexImage2D; + internal unsafe delegate* glCompressedTexImage3D; + internal unsafe delegate* glCompressedTexSubImage1D; + internal unsafe delegate* glCompressedTexSubImage2D; + internal unsafe delegate* glCompressedTexSubImage3D; + internal unsafe delegate* glCompressedTextureSubImage1D; + internal unsafe delegate* glCompressedTextureSubImage2D; + internal unsafe delegate* glCompressedTextureSubImage3D; + internal unsafe delegate* glCopyBufferSubData; + internal unsafe delegate* glCopyImageSubData; + internal unsafe delegate* glCopyNamedBufferSubData; + internal unsafe delegate* glCopyTexImage1D; + internal unsafe delegate* glCopyTexImage2D; + internal unsafe delegate* glCopyTexSubImage1D; + internal unsafe delegate* glCopyTexSubImage2D; + internal unsafe delegate* glCopyTexSubImage3D; + internal unsafe delegate* glCopyTextureSubImage1D; + internal unsafe delegate* glCopyTextureSubImage2D; + internal unsafe delegate* glCopyTextureSubImage3D; + internal unsafe delegate* glCreateBuffers; + internal unsafe delegate* glCreateFramebuffers; + internal unsafe delegate* glCreateProgram; + internal unsafe delegate* glCreateProgramPipelines; + internal unsafe delegate* glCreateQueries; + internal unsafe delegate* glCreateRenderbuffers; + internal unsafe delegate* glCreateSamplers; + internal unsafe delegate* glCreateShader; + internal unsafe delegate* glCreateShaderProgramv; + internal unsafe delegate* glCreateTextures; + internal unsafe delegate* glCreateTransformFeedbacks; + internal unsafe delegate* glCreateVertexArrays; + internal unsafe delegate* glCullFace; + internal unsafe delegate* glDebugMessageCallback; + internal unsafe delegate* glDebugMessageControl; + internal unsafe delegate* glDebugMessageInsert; + internal unsafe delegate* glDeleteBuffers; + internal unsafe delegate* glDeleteFramebuffers; + internal unsafe delegate* glDeleteProgram; + internal unsafe delegate* glDeleteProgramPipelines; + internal unsafe delegate* glDeleteQueries; + internal unsafe delegate* glDeleteRenderbuffers; + internal unsafe delegate* glDeleteSamplers; + internal unsafe delegate* glDeleteShader; + internal unsafe delegate* glDeleteSync; + internal unsafe delegate* glDeleteTextures; + internal unsafe delegate* glDeleteTransformFeedbacks; + internal unsafe delegate* glDeleteVertexArrays; + internal unsafe delegate* glDepthFunc; + internal unsafe delegate* glDepthMask; + internal unsafe delegate* glDepthRange; + internal unsafe delegate* glDepthRangeArrayv; + internal unsafe delegate* glDepthRangef; + internal unsafe delegate* glDepthRangeIndexed; + internal unsafe delegate* glDetachShader; + internal unsafe delegate* glDisable; + internal unsafe delegate* glDisablei; + internal unsafe delegate* glDisableVertexArrayAttrib; + internal unsafe delegate* glDisableVertexAttribArray; + internal unsafe delegate* glDispatchCompute; + internal unsafe delegate* glDispatchComputeIndirect; + internal unsafe delegate* glDrawArrays; + internal unsafe delegate* glDrawArraysIndirect; + internal unsafe delegate* glDrawArraysInstanced; + internal unsafe delegate* glDrawArraysInstancedBaseInstance; + internal unsafe delegate* glDrawBuffer; + internal unsafe delegate* glDrawBuffers; + internal unsafe delegate* glDrawElements; + internal unsafe delegate* glDrawElementsBaseVertex; + internal unsafe delegate* glDrawElementsIndirect; + internal unsafe delegate* glDrawElementsInstanced; + internal unsafe delegate* glDrawElementsInstancedBaseInstance; + internal unsafe delegate* glDrawElementsInstancedBaseVertex; + internal unsafe delegate* glDrawElementsInstancedBaseVertexBaseInstance; + internal unsafe delegate* glDrawRangeElements; + internal unsafe delegate* glDrawRangeElementsBaseVertex; + internal unsafe delegate* glDrawTransformFeedback; + internal unsafe delegate* glDrawTransformFeedbackInstanced; + internal unsafe delegate* glDrawTransformFeedbackStream; + internal unsafe delegate* glDrawTransformFeedbackStreamInstanced; + internal unsafe delegate* glEnable; + internal unsafe delegate* glEnablei; + internal unsafe delegate* glEnableVertexArrayAttrib; + internal unsafe delegate* glEnableVertexAttribArray; + internal unsafe delegate* glEndConditionalRender; + internal unsafe delegate* glEndQuery; + internal unsafe delegate* glEndQueryIndexed; + internal unsafe delegate* glEndTransformFeedback; + internal unsafe delegate* glFenceSync; + internal unsafe delegate* glFinish; + internal unsafe delegate* glFlush; + internal unsafe delegate* glFlushMappedBufferRange; + internal unsafe delegate* glFlushMappedNamedBufferRange; + internal unsafe delegate* glFramebufferParameteri; + internal unsafe delegate* glFramebufferRenderbuffer; + internal unsafe delegate* glFramebufferTexture; + internal unsafe delegate* glFramebufferTexture1D; + internal unsafe delegate* glFramebufferTexture2D; + internal unsafe delegate* glFramebufferTexture3D; + internal unsafe delegate* glFramebufferTextureLayer; + internal unsafe delegate* glFrontFace; + internal unsafe delegate* glGenBuffers; + internal unsafe delegate* glGenerateMipmap; + internal unsafe delegate* glGenerateTextureMipmap; + internal unsafe delegate* glGenFramebuffers; + internal unsafe delegate* glGenProgramPipelines; + internal unsafe delegate* glGenQueries; + internal unsafe delegate* glGenRenderbuffers; + internal unsafe delegate* glGenSamplers; + internal unsafe delegate* glGenTextures; + internal unsafe delegate* glGenTransformFeedbacks; + internal unsafe delegate* glGenVertexArrays; + internal unsafe delegate* glGetActiveAtomicCounterBufferiv; + internal unsafe delegate* glGetActiveAttrib; + internal unsafe delegate* glGetActiveSubroutineName; + internal unsafe delegate* glGetActiveSubroutineUniformiv; + internal unsafe delegate* glGetActiveSubroutineUniformName; + internal unsafe delegate* glGetActiveUniform; + internal unsafe delegate* glGetActiveUniformBlockiv; + internal unsafe delegate* glGetActiveUniformBlockName; + internal unsafe delegate* glGetActiveUniformName; + internal unsafe delegate* glGetActiveUniformsiv; + internal unsafe delegate* glGetAttachedShaders; + internal unsafe delegate* glGetAttribLocation; + internal unsafe delegate* glGetBooleani_v; + internal unsafe delegate* glGetBooleanv; + internal unsafe delegate* glGetBufferParameteri64v; + internal unsafe delegate* glGetBufferParameteriv; + internal unsafe delegate* glGetBufferPointerv; + internal unsafe delegate* glGetBufferSubData; + internal unsafe delegate* glGetCompressedTexImage; + internal unsafe delegate* glGetCompressedTextureImage; + internal unsafe delegate* glGetCompressedTextureSubImage; + internal unsafe delegate* glGetDebugMessageLog; + internal unsafe delegate* glGetDoublei_v; + internal unsafe delegate* glGetDoublev; + internal unsafe delegate* glGetError; + internal unsafe delegate* glGetFloati_v; + internal unsafe delegate* glGetFloatv; + internal unsafe delegate* glGetFragDataIndex; + internal unsafe delegate* glGetFragDataLocation; + internal unsafe delegate* glGetFramebufferAttachmentParameteriv; + internal unsafe delegate* glGetFramebufferParameteriv; + internal unsafe delegate* glGetGraphicsResetStatus; + internal unsafe delegate* glGetInteger64i_v; + internal unsafe delegate* glGetInteger64v; + internal unsafe delegate* glGetIntegeri_v; + internal unsafe delegate* glGetIntegerv; + internal unsafe delegate* glGetInternalformati64v; + internal unsafe delegate* glGetInternalformativ; + internal unsafe delegate* glGetMultisamplefv; + internal unsafe delegate* glGetNamedBufferParameteri64v; + internal unsafe delegate* glGetNamedBufferParameteriv; + internal unsafe delegate* glGetNamedBufferPointerv; + internal unsafe delegate* glGetNamedBufferSubData; + internal unsafe delegate* glGetNamedFramebufferAttachmentParameteriv; + internal unsafe delegate* glGetNamedFramebufferParameteriv; + internal unsafe delegate* glGetNamedRenderbufferParameteriv; + internal unsafe delegate* glGetnCompressedTexImage; + internal unsafe delegate* glGetnTexImage; + internal unsafe delegate* glGetnUniformdv; + internal unsafe delegate* glGetnUniformfv; + internal unsafe delegate* glGetnUniformiv; + internal unsafe delegate* glGetnUniformuiv; + internal unsafe delegate* glGetObjectLabel; + internal unsafe delegate* glGetObjectPtrLabel; + internal unsafe delegate* glGetPointerv; + internal unsafe delegate* glGetProgramBinary; + internal unsafe delegate* glGetProgramInfoLog; + internal unsafe delegate* glGetProgramInterfaceiv; + internal unsafe delegate* glGetProgramiv; + internal unsafe delegate* glGetProgramPipelineInfoLog; + internal unsafe delegate* glGetProgramPipelineiv; + internal unsafe delegate* glGetProgramResourceIndex; + internal unsafe delegate* glGetProgramResourceiv; + internal unsafe delegate* glGetProgramResourceLocation; + internal unsafe delegate* glGetProgramResourceLocationIndex; + internal unsafe delegate* glGetProgramResourceName; + internal unsafe delegate* glGetProgramStageiv; + internal unsafe delegate* glGetQueryBufferObjecti64v; + internal unsafe delegate* glGetQueryBufferObjectiv; + internal unsafe delegate* glGetQueryBufferObjectui64v; + internal unsafe delegate* glGetQueryBufferObjectuiv; + internal unsafe delegate* glGetQueryIndexediv; + internal unsafe delegate* glGetQueryiv; + internal unsafe delegate* glGetQueryObjecti64v; + internal unsafe delegate* glGetQueryObjectiv; + internal unsafe delegate* glGetQueryObjectui64v; + internal unsafe delegate* glGetQueryObjectuiv; + internal unsafe delegate* glGetRenderbufferParameteriv; + internal unsafe delegate* glGetSamplerParameterfv; + internal unsafe delegate* glGetSamplerParameterIiv; + internal unsafe delegate* glGetSamplerParameterIuiv; + internal unsafe delegate* glGetSamplerParameteriv; + internal unsafe delegate* glGetShaderInfoLog; + internal unsafe delegate* glGetShaderiv; + internal unsafe delegate* glGetShaderPrecisionFormat; + internal unsafe delegate* glGetShaderSource; + internal unsafe delegate* glGetString; + internal unsafe delegate* glGetStringi; + internal unsafe delegate* glGetSubroutineIndex; + internal unsafe delegate* glGetSubroutineUniformLocation; + internal unsafe delegate* glGetSynciv; + internal unsafe delegate* glGetTexImage; + internal unsafe delegate* glGetTexLevelParameterfv; + internal unsafe delegate* glGetTexLevelParameteriv; + internal unsafe delegate* glGetTexParameterfv; + internal unsafe delegate* glGetTexParameterIiv; + internal unsafe delegate* glGetTexParameterIuiv; + internal unsafe delegate* glGetTexParameteriv; + internal unsafe delegate* glGetTextureImage; + internal unsafe delegate* glGetTextureLevelParameterfv; + internal unsafe delegate* glGetTextureLevelParameteriv; + internal unsafe delegate* glGetTextureParameterfv; + internal unsafe delegate* glGetTextureParameterIiv; + internal unsafe delegate* glGetTextureParameterIuiv; + internal unsafe delegate* glGetTextureParameteriv; + internal unsafe delegate* glGetTextureSubImage; + internal unsafe delegate* glGetTransformFeedbacki_v; + internal unsafe delegate* glGetTransformFeedbacki64_v; + internal unsafe delegate* glGetTransformFeedbackiv; + internal unsafe delegate* glGetTransformFeedbackVarying; + internal unsafe delegate* glGetUniformBlockIndex; + internal unsafe delegate* glGetUniformdv; + internal unsafe delegate* glGetUniformfv; + internal unsafe delegate* glGetUniformIndices; + internal unsafe delegate* glGetUniformiv; + internal unsafe delegate* glGetUniformLocation; + internal unsafe delegate* glGetUniformSubroutineuiv; + internal unsafe delegate* glGetUniformuiv; + internal unsafe delegate* glGetVertexArrayIndexed64iv; + internal unsafe delegate* glGetVertexArrayIndexediv; + internal unsafe delegate* glGetVertexArrayiv; + internal unsafe delegate* glGetVertexAttribdv; + internal unsafe delegate* glGetVertexAttribfv; + internal unsafe delegate* glGetVertexAttribIiv; + internal unsafe delegate* glGetVertexAttribIuiv; + internal unsafe delegate* glGetVertexAttribiv; + internal unsafe delegate* glGetVertexAttribLdv; + internal unsafe delegate* glGetVertexAttribPointerv; + internal unsafe delegate* glHint; + internal unsafe delegate* glInvalidateBufferData; + internal unsafe delegate* glInvalidateBufferSubData; + internal unsafe delegate* glInvalidateFramebuffer; + internal unsafe delegate* glInvalidateNamedFramebufferData; + internal unsafe delegate* glInvalidateNamedFramebufferSubData; + internal unsafe delegate* glInvalidateSubFramebuffer; + internal unsafe delegate* glInvalidateTexImage; + internal unsafe delegate* glInvalidateTexSubImage; + internal unsafe delegate* glIsBuffer; + internal unsafe delegate* glIsEnabled; + internal unsafe delegate* glIsEnabledi; + internal unsafe delegate* glIsFramebuffer; + internal unsafe delegate* glIsProgram; + internal unsafe delegate* glIsProgramPipeline; + internal unsafe delegate* glIsQuery; + internal unsafe delegate* glIsRenderbuffer; + internal unsafe delegate* glIsSampler; + internal unsafe delegate* glIsShader; + internal unsafe delegate* glIsSync; + internal unsafe delegate* glIsTexture; + internal unsafe delegate* glIsTransformFeedback; + internal unsafe delegate* glIsVertexArray; + internal unsafe delegate* glLineWidth; + internal unsafe delegate* glLinkProgram; + internal unsafe delegate* glLogicOp; + internal unsafe delegate* glMapBuffer; + internal unsafe delegate* glMapBufferRange; + internal unsafe delegate* glMapNamedBuffer; + internal unsafe delegate* glMapNamedBufferRange; + internal unsafe delegate* glMemoryBarrier; + internal unsafe delegate* glMemoryBarrierByRegion; + internal unsafe delegate* glMinSampleShading; + internal unsafe delegate* glMultiDrawArrays; + internal unsafe delegate* glMultiDrawArraysIndirect; + internal unsafe delegate* glMultiDrawArraysIndirectCount; + internal unsafe delegate* glMultiDrawElements; + internal unsafe delegate* glMultiDrawElementsBaseVertex; + internal unsafe delegate* glMultiDrawElementsIndirect; + internal unsafe delegate* glMultiDrawElementsIndirectCount; + internal unsafe delegate* glNamedBufferData; + internal unsafe delegate* glNamedBufferStorage; + internal unsafe delegate* glNamedBufferSubData; + internal unsafe delegate* glNamedFramebufferDrawBuffer; + internal unsafe delegate* glNamedFramebufferDrawBuffers; + internal unsafe delegate* glNamedFramebufferParameteri; + internal unsafe delegate* glNamedFramebufferReadBuffer; + internal unsafe delegate* glNamedFramebufferRenderbuffer; + internal unsafe delegate* glNamedFramebufferTexture; + internal unsafe delegate* glNamedFramebufferTextureLayer; + internal unsafe delegate* glNamedRenderbufferStorage; + internal unsafe delegate* glNamedRenderbufferStorageMultisample; + internal unsafe delegate* glObjectLabel; + internal unsafe delegate* glObjectPtrLabel; + internal unsafe delegate* glPatchParameterfv; + internal unsafe delegate* glPatchParameteri; + internal unsafe delegate* glPauseTransformFeedback; + internal unsafe delegate* glPixelStoref; + internal unsafe delegate* glPixelStorei; + internal unsafe delegate* glPointParameterf; + internal unsafe delegate* glPointParameterfv; + internal unsafe delegate* glPointParameteri; + internal unsafe delegate* glPointParameteriv; + internal unsafe delegate* glPointSize; + internal unsafe delegate* glPolygonMode; + internal unsafe delegate* glPolygonOffset; + internal unsafe delegate* glPolygonOffsetClamp; + internal unsafe delegate* glPopDebugGroup; + internal unsafe delegate* glPrimitiveRestartIndex; + internal unsafe delegate* glProgramBinary; + internal unsafe delegate* glProgramParameteri; + internal unsafe delegate* glProgramUniform1d; + internal unsafe delegate* glProgramUniform1dv; + internal unsafe delegate* glProgramUniform1f; + internal unsafe delegate* glProgramUniform1fv; + internal unsafe delegate* glProgramUniform1i; + internal unsafe delegate* glProgramUniform1iv; + internal unsafe delegate* glProgramUniform1ui; + internal unsafe delegate* glProgramUniform1uiv; + internal unsafe delegate* glProgramUniform2d; + internal unsafe delegate* glProgramUniform2dv; + internal unsafe delegate* glProgramUniform2f; + internal unsafe delegate* glProgramUniform2fv; + internal unsafe delegate* glProgramUniform2i; + internal unsafe delegate* glProgramUniform2iv; + internal unsafe delegate* glProgramUniform2ui; + internal unsafe delegate* glProgramUniform2uiv; + internal unsafe delegate* glProgramUniform3d; + internal unsafe delegate* glProgramUniform3dv; + internal unsafe delegate* glProgramUniform3f; + internal unsafe delegate* glProgramUniform3fv; + internal unsafe delegate* glProgramUniform3i; + internal unsafe delegate* glProgramUniform3iv; + internal unsafe delegate* glProgramUniform3ui; + internal unsafe delegate* glProgramUniform3uiv; + internal unsafe delegate* glProgramUniform4d; + internal unsafe delegate* glProgramUniform4dv; + internal unsafe delegate* glProgramUniform4f; + internal unsafe delegate* glProgramUniform4fv; + internal unsafe delegate* glProgramUniform4i; + internal unsafe delegate* glProgramUniform4iv; + internal unsafe delegate* glProgramUniform4ui; + internal unsafe delegate* glProgramUniform4uiv; + internal unsafe delegate* glProgramUniformMatrix2dv; + internal unsafe delegate* glProgramUniformMatrix2fv; + internal unsafe delegate* glProgramUniformMatrix2x3dv; + internal unsafe delegate* glProgramUniformMatrix2x3fv; + internal unsafe delegate* glProgramUniformMatrix2x4dv; + internal unsafe delegate* glProgramUniformMatrix2x4fv; + internal unsafe delegate* glProgramUniformMatrix3dv; + internal unsafe delegate* glProgramUniformMatrix3fv; + internal unsafe delegate* glProgramUniformMatrix3x2dv; + internal unsafe delegate* glProgramUniformMatrix3x2fv; + internal unsafe delegate* glProgramUniformMatrix3x4dv; + internal unsafe delegate* glProgramUniformMatrix3x4fv; + internal unsafe delegate* glProgramUniformMatrix4dv; + internal unsafe delegate* glProgramUniformMatrix4fv; + internal unsafe delegate* glProgramUniformMatrix4x2dv; + internal unsafe delegate* glProgramUniformMatrix4x2fv; + internal unsafe delegate* glProgramUniformMatrix4x3dv; + internal unsafe delegate* glProgramUniformMatrix4x3fv; + internal unsafe delegate* glProvokingVertex; + internal unsafe delegate* glPushDebugGroup; + internal unsafe delegate* glQueryCounter; + internal unsafe delegate* glReadBuffer; + internal unsafe delegate* glReadnPixels; + internal unsafe delegate* glReadPixels; + internal unsafe delegate* glReleaseShaderCompiler; + internal unsafe delegate* glRenderbufferStorage; + internal unsafe delegate* glRenderbufferStorageMultisample; + internal unsafe delegate* glResumeTransformFeedback; + internal unsafe delegate* glSampleCoverage; + internal unsafe delegate* glSampleMaski; + internal unsafe delegate* glSamplerParameterf; + internal unsafe delegate* glSamplerParameterfv; + internal unsafe delegate* glSamplerParameteri; + internal unsafe delegate* glSamplerParameterIiv; + internal unsafe delegate* glSamplerParameterIuiv; + internal unsafe delegate* glSamplerParameteriv; + internal unsafe delegate* glScissor; + internal unsafe delegate* glScissorArrayv; + internal unsafe delegate* glScissorIndexed; + internal unsafe delegate* glScissorIndexedv; + internal unsafe delegate* glShaderBinary; + internal unsafe delegate* glShaderSource; + internal unsafe delegate* glShaderStorageBlockBinding; + internal unsafe delegate* glSpecializeShader; + internal unsafe delegate* glStencilFunc; + internal unsafe delegate* glStencilFuncSeparate; + internal unsafe delegate* glStencilMask; + internal unsafe delegate* glStencilMaskSeparate; + internal unsafe delegate* glStencilOp; + internal unsafe delegate* glStencilOpSeparate; + internal unsafe delegate* glTexBuffer; + internal unsafe delegate* glTexBufferRange; + internal unsafe delegate* glTexImage1D; + internal unsafe delegate* glTexImage2D; + internal unsafe delegate* glTexImage2DMultisample; + internal unsafe delegate* glTexImage3D; + internal unsafe delegate* glTexImage3DMultisample; + internal unsafe delegate* glTexParameterf; + internal unsafe delegate* glTexParameterfv; + internal unsafe delegate* glTexParameteri; + internal unsafe delegate* glTexParameterIiv; + internal unsafe delegate* glTexParameterIuiv; + internal unsafe delegate* glTexParameteriv; + internal unsafe delegate* glTexStorage1D; + internal unsafe delegate* glTexStorage2D; + internal unsafe delegate* glTexStorage2DMultisample; + internal unsafe delegate* glTexStorage3D; + internal unsafe delegate* glTexStorage3DMultisample; + internal unsafe delegate* glTexSubImage1D; + internal unsafe delegate* glTexSubImage2D; + internal unsafe delegate* glTexSubImage3D; + internal unsafe delegate* glTextureBarrier; + internal unsafe delegate* glTextureBuffer; + internal unsafe delegate* glTextureBufferRange; + internal unsafe delegate* glTextureParameterf; + internal unsafe delegate* glTextureParameterfv; + internal unsafe delegate* glTextureParameteri; + internal unsafe delegate* glTextureParameterIiv; + internal unsafe delegate* glTextureParameterIuiv; + internal unsafe delegate* glTextureParameteriv; + internal unsafe delegate* glTextureStorage1D; + internal unsafe delegate* glTextureStorage2D; + internal unsafe delegate* glTextureStorage2DMultisample; + internal unsafe delegate* glTextureStorage3D; + internal unsafe delegate* glTextureStorage3DMultisample; + internal unsafe delegate* glTextureSubImage1D; + internal unsafe delegate* glTextureSubImage2D; + internal unsafe delegate* glTextureSubImage3D; + internal unsafe delegate* glTextureView; + internal unsafe delegate* glTransformFeedbackBufferBase; + internal unsafe delegate* glTransformFeedbackBufferRange; + internal unsafe delegate* glTransformFeedbackVaryings; + internal unsafe delegate* glUniform1d; + internal unsafe delegate* glUniform1dv; + internal unsafe delegate* glUniform1f; + internal unsafe delegate* glUniform1fv; + internal unsafe delegate* glUniform1i; + internal unsafe delegate* glUniform1iv; + internal unsafe delegate* glUniform1ui; + internal unsafe delegate* glUniform1uiv; + internal unsafe delegate* glUniform2d; + internal unsafe delegate* glUniform2dv; + internal unsafe delegate* glUniform2f; + internal unsafe delegate* glUniform2fv; + internal unsafe delegate* glUniform2i; + internal unsafe delegate* glUniform2iv; + internal unsafe delegate* glUniform2ui; + internal unsafe delegate* glUniform2uiv; + internal unsafe delegate* glUniform3d; + internal unsafe delegate* glUniform3dv; + internal unsafe delegate* glUniform3f; + internal unsafe delegate* glUniform3fv; + internal unsafe delegate* glUniform3i; + internal unsafe delegate* glUniform3iv; + internal unsafe delegate* glUniform3ui; + internal unsafe delegate* glUniform3uiv; + internal unsafe delegate* glUniform4d; + internal unsafe delegate* glUniform4dv; + internal unsafe delegate* glUniform4f; + internal unsafe delegate* glUniform4fv; + internal unsafe delegate* glUniform4i; + internal unsafe delegate* glUniform4iv; + internal unsafe delegate* glUniform4ui; + internal unsafe delegate* glUniform4uiv; + internal unsafe delegate* glUniformBlockBinding; + internal unsafe delegate* glUniformMatrix2dv; + internal unsafe delegate* glUniformMatrix2fv; + internal unsafe delegate* glUniformMatrix2x3dv; + internal unsafe delegate* glUniformMatrix2x3fv; + internal unsafe delegate* glUniformMatrix2x4dv; + internal unsafe delegate* glUniformMatrix2x4fv; + internal unsafe delegate* glUniformMatrix3dv; + internal unsafe delegate* glUniformMatrix3fv; + internal unsafe delegate* glUniformMatrix3x2dv; + internal unsafe delegate* glUniformMatrix3x2fv; + internal unsafe delegate* glUniformMatrix3x4dv; + internal unsafe delegate* glUniformMatrix3x4fv; + internal unsafe delegate* glUniformMatrix4dv; + internal unsafe delegate* glUniformMatrix4fv; + internal unsafe delegate* glUniformMatrix4x2dv; + internal unsafe delegate* glUniformMatrix4x2fv; + internal unsafe delegate* glUniformMatrix4x3dv; + internal unsafe delegate* glUniformMatrix4x3fv; + internal unsafe delegate* glUniformSubroutinesuiv; + internal unsafe delegate* glUnmapBuffer; + internal unsafe delegate* glUnmapNamedBuffer; + internal unsafe delegate* glUseProgram; + internal unsafe delegate* glUseProgramStages; + internal unsafe delegate* glValidateProgram; + internal unsafe delegate* glValidateProgramPipeline; + internal unsafe delegate* glVertexArrayAttribBinding; + internal unsafe delegate* glVertexArrayAttribFormat; + internal unsafe delegate* glVertexArrayAttribIFormat; + internal unsafe delegate* glVertexArrayAttribLFormat; + internal unsafe delegate* glVertexArrayBindingDivisor; + internal unsafe delegate* glVertexArrayElementBuffer; + internal unsafe delegate* glVertexArrayVertexBuffer; + internal unsafe delegate* glVertexArrayVertexBuffers; + internal unsafe delegate* glVertexAttrib1d; + internal unsafe delegate* glVertexAttrib1dv; + internal unsafe delegate* glVertexAttrib1f; + internal unsafe delegate* glVertexAttrib1fv; + internal unsafe delegate* glVertexAttrib1s; + internal unsafe delegate* glVertexAttrib1sv; + internal unsafe delegate* glVertexAttrib2d; + internal unsafe delegate* glVertexAttrib2dv; + internal unsafe delegate* glVertexAttrib2f; + internal unsafe delegate* glVertexAttrib2fv; + internal unsafe delegate* glVertexAttrib2s; + internal unsafe delegate* glVertexAttrib2sv; + internal unsafe delegate* glVertexAttrib3d; + internal unsafe delegate* glVertexAttrib3dv; + internal unsafe delegate* glVertexAttrib3f; + internal unsafe delegate* glVertexAttrib3fv; + internal unsafe delegate* glVertexAttrib3s; + internal unsafe delegate* glVertexAttrib3sv; + internal unsafe delegate* glVertexAttrib4bv; + internal unsafe delegate* glVertexAttrib4d; + internal unsafe delegate* glVertexAttrib4dv; + internal unsafe delegate* glVertexAttrib4f; + internal unsafe delegate* glVertexAttrib4fv; + internal unsafe delegate* glVertexAttrib4iv; + internal unsafe delegate* glVertexAttrib4Nbv; + internal unsafe delegate* glVertexAttrib4Niv; + internal unsafe delegate* glVertexAttrib4Nsv; + internal unsafe delegate* glVertexAttrib4Nub; + internal unsafe delegate* glVertexAttrib4Nubv; + internal unsafe delegate* glVertexAttrib4Nuiv; + internal unsafe delegate* glVertexAttrib4Nusv; + internal unsafe delegate* glVertexAttrib4s; + internal unsafe delegate* glVertexAttrib4sv; + internal unsafe delegate* glVertexAttrib4ubv; + internal unsafe delegate* glVertexAttrib4uiv; + internal unsafe delegate* glVertexAttrib4usv; + internal unsafe delegate* glVertexAttribBinding; + internal unsafe delegate* glVertexAttribDivisor; + internal unsafe delegate* glVertexAttribFormat; + internal unsafe delegate* glVertexAttribI1i; + internal unsafe delegate* glVertexAttribI1iv; + internal unsafe delegate* glVertexAttribI1ui; + internal unsafe delegate* glVertexAttribI1uiv; + internal unsafe delegate* glVertexAttribI2i; + internal unsafe delegate* glVertexAttribI2iv; + internal unsafe delegate* glVertexAttribI2ui; + internal unsafe delegate* glVertexAttribI2uiv; + internal unsafe delegate* glVertexAttribI3i; + internal unsafe delegate* glVertexAttribI3iv; + internal unsafe delegate* glVertexAttribI3ui; + internal unsafe delegate* glVertexAttribI3uiv; + internal unsafe delegate* glVertexAttribI4bv; + internal unsafe delegate* glVertexAttribI4i; + internal unsafe delegate* glVertexAttribI4iv; + internal unsafe delegate* glVertexAttribI4sv; + internal unsafe delegate* glVertexAttribI4ubv; + internal unsafe delegate* glVertexAttribI4ui; + internal unsafe delegate* glVertexAttribI4uiv; + internal unsafe delegate* glVertexAttribI4usv; + internal unsafe delegate* glVertexAttribIFormat; + internal unsafe delegate* glVertexAttribIPointer; + internal unsafe delegate* glVertexAttribL1d; + internal unsafe delegate* glVertexAttribL1dv; + internal unsafe delegate* glVertexAttribL2d; + internal unsafe delegate* glVertexAttribL2dv; + internal unsafe delegate* glVertexAttribL3d; + internal unsafe delegate* glVertexAttribL3dv; + internal unsafe delegate* glVertexAttribL4d; + internal unsafe delegate* glVertexAttribL4dv; + internal unsafe delegate* glVertexAttribLFormat; + internal unsafe delegate* glVertexAttribLPointer; + internal unsafe delegate* glVertexAttribP1ui; + internal unsafe delegate* glVertexAttribP1uiv; + internal unsafe delegate* glVertexAttribP2ui; + internal unsafe delegate* glVertexAttribP2uiv; + internal unsafe delegate* glVertexAttribP3ui; + internal unsafe delegate* glVertexAttribP3uiv; + internal unsafe delegate* glVertexAttribP4ui; + internal unsafe delegate* glVertexAttribP4uiv; + internal unsafe delegate* glVertexAttribPointer; + internal unsafe delegate* glVertexBindingDivisor; + internal unsafe delegate* glViewport; + internal unsafe delegate* glViewportArrayv; + internal unsafe delegate* glViewportIndexedf; + internal unsafe delegate* glViewportIndexedfv; + internal unsafe delegate* glWaitSync; + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glContextShadow.cs b/StgsSharp.Graphics/OpenGL/glContextShadow.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glContextShadow.cs rename to StgsSharp.Graphics/OpenGL/glContextShadow.cs index 6d6ae10f..b5cf4bce 100644 --- a/StgSharp.Common/Graphics/OpenGL/glContextShadow.cs +++ b/StgsSharp.Graphics/OpenGL/glContextShadow.cs @@ -1,698 +1,698 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glContextShadow" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics.OpenGL -{ - internal struct glContextShadow - { - - internal IntPtr glActiveShaderProgram; - internal IntPtr glActiveTexture; - internal IntPtr glAttachShader; - internal IntPtr glBeginConditionalRender; - internal IntPtr glBeginQuery; - internal IntPtr glBeginQueryIndexed; - internal IntPtr glBeginTransformFeedback; - internal IntPtr glBindAttribLocation; - internal IntPtr glBindBuffer; - internal IntPtr glBindBufferBase; - internal IntPtr glBindBufferRange; - internal IntPtr glBindBuffersBase; - internal IntPtr glBindBuffersRange; - internal IntPtr glBindFragDataLocation; - internal IntPtr glBindFragDataLocationIndexed; - internal IntPtr glBindFramebuffer; - internal IntPtr glBindImageTexture; - internal IntPtr glBindImageTextures; - internal IntPtr glBindProgramPipeline; - internal IntPtr glBindRenderbuffer; - internal IntPtr glBindSampler; - internal IntPtr glBindSamplers; - internal IntPtr glBindTexture; - internal IntPtr glBindTextures; - internal IntPtr glBindTextureUnit; - internal IntPtr glBindTransformFeedback; - internal IntPtr glBindVertexArray; - internal IntPtr glBindVertexBuffer; - internal IntPtr glBindVertexBuffers; - internal IntPtr glBlendColor; - internal IntPtr glBlendEquation; - internal IntPtr glBlendEquationi; - internal IntPtr glBlendEquationSeparate; - internal IntPtr glBlendEquationSeparatei; - internal IntPtr glBlendFunc; - internal IntPtr glBlendFunci; - internal IntPtr glBlendFuncSeparate; - internal IntPtr glBlendFuncSeparatei; - internal IntPtr glBlitFramebuffer; - internal IntPtr glBlitNamedFramebuffer; - internal IntPtr glBufferData; - internal IntPtr glBufferStorage; - internal IntPtr glBufferSubData; - internal IntPtr glCheckFramebufferStatus; - internal IntPtr glCheckNamedFramebufferStatus; - internal IntPtr glClampColor; - internal IntPtr glClear; - internal IntPtr glClearBufferData; - internal IntPtr glClearBufferfi; - internal IntPtr glClearBufferfv; - internal IntPtr glClearBufferiv; - internal IntPtr glClearBufferSubData; - internal IntPtr glClearBufferuiv; - internal IntPtr glClearColor; - internal IntPtr glClearDepth; - internal IntPtr glClearDepthf; - internal IntPtr glClearNamedBufferData; - internal IntPtr glClearNamedBufferSubData; - internal IntPtr glClearNamedFramebufferfi; - internal IntPtr glClearNamedFramebufferfv; - internal IntPtr glClearNamedFramebufferiv; - internal IntPtr glClearNamedFramebufferuiv; - internal IntPtr glClearStencil; - internal IntPtr glClearTexImage; - internal IntPtr glClearTexSubImage; - internal IntPtr glClientWaitSync; - internal IntPtr glClipControl; - internal IntPtr glColorMask; - internal IntPtr glColorMaski; - internal IntPtr glCompileShader; - internal IntPtr glCompressedTexImage1D; - internal IntPtr glCompressedTexImage2D; - internal IntPtr glCompressedTexImage3D; - internal IntPtr glCompressedTexSubImage1D; - internal IntPtr glCompressedTexSubImage2D; - internal IntPtr glCompressedTexSubImage3D; - internal IntPtr glCompressedTextureSubImage1D; - internal IntPtr glCompressedTextureSubImage2D; - internal IntPtr glCompressedTextureSubImage3D; - internal IntPtr glCopyBufferSubData; - internal IntPtr glCopyImageSubData; - internal IntPtr glCopyNamedBufferSubData; - internal IntPtr glCopyTexImage1D; - internal IntPtr glCopyTexImage2D; - internal IntPtr glCopyTexSubImage1D; - internal IntPtr glCopyTexSubImage2D; - internal IntPtr glCopyTexSubImage3D; - internal IntPtr glCopyTextureSubImage1D; - internal IntPtr glCopyTextureSubImage2D; - internal IntPtr glCopyTextureSubImage3D; - internal IntPtr glCreateBuffers; - internal IntPtr glCreateFramebuffers; - internal IntPtr glCreateProgram; - internal IntPtr glCreateProgramPipelines; - internal IntPtr glCreateQueries; - internal IntPtr glCreateRenderbuffers; - internal IntPtr glCreateSamplers; - internal IntPtr glCreateShader; - internal IntPtr glCreateShaderProgramv; - internal IntPtr glCreateTextures; - internal IntPtr glCreateTransformFeedbacks; - internal IntPtr glCreateVertexArrays; - internal IntPtr glCullFace; - internal IntPtr glDebugMessageCallback; - internal IntPtr glDebugMessageControl; - internal IntPtr glDebugMessageInsert; - internal IntPtr glDeleteBuffers; - internal IntPtr glDeleteFramebuffers; - internal IntPtr glDeleteProgram; - internal IntPtr glDeleteProgramPipelines; - internal IntPtr glDeleteQueries; - internal IntPtr glDeleteRenderbuffers; - internal IntPtr glDeleteSamplers; - internal IntPtr glDeleteShader; - internal IntPtr glDeleteSync; - internal IntPtr glDeleteTextures; - internal IntPtr glDeleteTransformFeedbacks; - internal IntPtr glDeleteVertexArrays; - internal IntPtr glDepthFunc; - internal IntPtr glDepthMask; - internal IntPtr glDepthRange; - internal IntPtr glDepthRangeArrayv; - internal IntPtr glDepthRangef; - internal IntPtr glDepthRangeIndexed; - internal IntPtr glDetachShader; - internal IntPtr glDisable; - internal IntPtr glDisablei; - internal IntPtr glDisableVertexArrayAttrib; - internal IntPtr glDisableVertexAttribArray; - internal IntPtr glDispatchCompute; - internal IntPtr glDispatchComputeIndirect; - internal IntPtr glDrawArrays; - internal IntPtr glDrawArraysIndirect; - internal IntPtr glDrawArraysInstanced; - internal IntPtr glDrawArraysInstancedBaseInstance; - internal IntPtr glDrawBuffer; - internal IntPtr glDrawBuffers; - internal IntPtr glDrawElements; - internal IntPtr glDrawElementsBaseVertex; - internal IntPtr glDrawElementsIndirect; - internal IntPtr glDrawElementsInstanced; - internal IntPtr glDrawElementsInstancedBaseInstance; - internal IntPtr glDrawElementsInstancedBaseVertex; - internal IntPtr glDrawElementsInstancedBaseVertexBaseInstance; - internal IntPtr glDrawRangeElements; - internal IntPtr glDrawRangeElementsBaseVertex; - internal IntPtr glDrawTransformFeedback; - internal IntPtr glDrawTransformFeedbackInstanced; - internal IntPtr glDrawTransformFeedbackStream; - internal IntPtr glDrawTransformFeedbackStreamInstanced; - internal IntPtr glEnable; - internal IntPtr glEnablei; - internal IntPtr glEnableVertexArrayAttrib; - internal IntPtr glEnableVertexAttribArray; - internal IntPtr glEndConditionalRender; - internal IntPtr glEndQuery; - internal IntPtr glEndQueryIndexed; - internal IntPtr glEndTransformFeedback; - internal IntPtr glFenceSync; - internal IntPtr glFinish; - internal IntPtr glFlush; - internal IntPtr glFlushMappedBufferRange; - internal IntPtr glFlushMappedNamedBufferRange; - internal IntPtr glFramebufferParameteri; - internal IntPtr glFramebufferRenderbuffer; - internal IntPtr glFramebufferTexture; - internal IntPtr glFramebufferTexture1D; - internal IntPtr glFramebufferTexture2D; - internal IntPtr glFramebufferTexture3D; - internal IntPtr glFramebufferTextureLayer; - internal IntPtr glFrontFace; - internal IntPtr glGenBuffers; - internal IntPtr glGenerateMipmap; - internal IntPtr glGenerateTextureMipmap; - internal IntPtr glGenFramebuffers; - internal IntPtr glGenProgramPipelines; - internal IntPtr glGenQueries; - internal IntPtr glGenRenderbuffers; - internal IntPtr glGenSamplers; - internal IntPtr glGenTextures; - internal IntPtr glGenTransformFeedbacks; - internal IntPtr glGenVertexArrays; - internal IntPtr glGetActiveAtomicCounterBufferiv; - internal IntPtr glGetActiveAttrib; - internal IntPtr glGetActiveSubroutineName; - internal IntPtr glGetActiveSubroutineUniformiv; - internal IntPtr glGetActiveSubroutineUniformName; - internal IntPtr glGetActiveUniform; - internal IntPtr glGetActiveUniformBlockiv; - internal IntPtr glGetActiveUniformBlockName; - internal IntPtr glGetActiveUniformName; - internal IntPtr glGetActiveUniformsiv; - internal IntPtr glGetAttachedShaders; - internal IntPtr glGetAttribLocation; - internal IntPtr glGetBooleani_v; - internal IntPtr glGetBooleanv; - internal IntPtr glGetBufferParameteri64v; - internal IntPtr glGetBufferParameteriv; - internal IntPtr glGetBufferPointerv; - internal IntPtr glGetBufferSubData; - internal IntPtr glGetCompressedTexImage; - internal IntPtr glGetCompressedTextureImage; - internal IntPtr glGetCompressedTextureSubImage; - internal IntPtr glGetDebugMessageLog; - internal IntPtr glGetDoublei_v; - internal IntPtr glGetDoublev; - internal IntPtr glGetError; - internal IntPtr glGetFloati_v; - internal IntPtr glGetFloatv; - internal IntPtr glGetFragDataIndex; - internal IntPtr glGetFragDataLocation; - internal IntPtr glGetFramebufferAttachmentParameteriv; - internal IntPtr glGetFramebufferParameteriv; - internal IntPtr glGetGraphicsResetStatus; - internal IntPtr glGetInteger64i_v; - internal IntPtr glGetInteger64v; - internal IntPtr glGetIntegeri_v; - internal IntPtr glGetIntegerv; - internal IntPtr glGetInternalformati64v; - internal IntPtr glGetInternalformativ; - internal IntPtr glGetMultisamplefv; - internal IntPtr glGetNamedBufferParameteri64v; - internal IntPtr glGetNamedBufferParameteriv; - internal IntPtr glGetNamedBufferPointerv; - internal IntPtr glGetNamedBufferSubData; - internal IntPtr glGetNamedFramebufferAttachmentParameteriv; - internal IntPtr glGetNamedFramebufferParameteriv; - internal IntPtr glGetNamedRenderbufferParameteriv; - internal IntPtr glGetnCompressedTexImage; - internal IntPtr glGetnTexImage; - internal IntPtr glGetnUniformdv; - internal IntPtr glGetnUniformfv; - internal IntPtr glGetnUniformiv; - internal IntPtr glGetnUniformuiv; - internal IntPtr glGetObjectLabel; - internal IntPtr glGetObjectPtrLabel; - internal IntPtr glGetPointerv; - internal IntPtr glGetProgramBinary; - internal IntPtr glGetProgramInfoLog; - internal IntPtr glGetProgramInterfaceiv; - internal IntPtr glGetProgramiv; - internal IntPtr glGetProgramPipelineInfoLog; - internal IntPtr glGetProgramPipelineiv; - internal IntPtr glGetProgramResourceIndex; - internal IntPtr glGetProgramResourceiv; - internal IntPtr glGetProgramResourceLocation; - internal IntPtr glGetProgramResourceLocationIndex; - internal IntPtr glGetProgramResourceName; - internal IntPtr glGetProgramStageiv; - internal IntPtr glGetQueryBufferObjecti64v; - internal IntPtr glGetQueryBufferObjectiv; - internal IntPtr glGetQueryBufferObjectui64v; - internal IntPtr glGetQueryBufferObjectuiv; - internal IntPtr glGetQueryIndexediv; - internal IntPtr glGetQueryiv; - internal IntPtr glGetQueryObjecti64v; - internal IntPtr glGetQueryObjectiv; - internal IntPtr glGetQueryObjectui64v; - internal IntPtr glGetQueryObjectuiv; - internal IntPtr glGetRenderbufferParameteriv; - internal IntPtr glGetSamplerParameterfv; - internal IntPtr glGetSamplerParameterIiv; - internal IntPtr glGetSamplerParameterIuiv; - internal IntPtr glGetSamplerParameteriv; - internal IntPtr glGetShaderInfoLog; - internal IntPtr glGetShaderiv; - internal IntPtr glGetShaderPrecisionFormat; - internal IntPtr glGetShaderSource; - internal IntPtr glGetString; - internal IntPtr glGetStringi; - internal IntPtr glGetSubroutineIndex; - internal IntPtr glGetSubroutineUniformLocation; - internal IntPtr glGetSynciv; - internal IntPtr glGetTexImage; - internal IntPtr glGetTexLevelParameterfv; - internal IntPtr glGetTexLevelParameteriv; - internal IntPtr glGetTexParameterfv; - internal IntPtr glGetTexParameterIiv; - internal IntPtr glGetTexParameterIuiv; - internal IntPtr glGetTexParameteriv; - internal IntPtr glGetTextureImage; - internal IntPtr glGetTextureLevelParameterfv; - internal IntPtr glGetTextureLevelParameteriv; - internal IntPtr glGetTextureParameterfv; - internal IntPtr glGetTextureParameterIiv; - internal IntPtr glGetTextureParameterIuiv; - internal IntPtr glGetTextureParameteriv; - internal IntPtr glGetTextureSubImage; - internal IntPtr glGetTransformFeedbacki_v; - internal IntPtr glGetTransformFeedbacki64_v; - internal IntPtr glGetTransformFeedbackiv; - internal IntPtr glGetTransformFeedbackVarying; - internal IntPtr glGetUniformBlockIndex; - internal IntPtr glGetUniformdv; - internal IntPtr glGetUniformfv; - internal IntPtr glGetUniformIndices; - internal IntPtr glGetUniformiv; - internal IntPtr glGetUniformLocation; - internal IntPtr glGetUniformSubroutineuiv; - internal IntPtr glGetUniformuiv; - internal IntPtr glGetVertexArrayIndexed64iv; - internal IntPtr glGetVertexArrayIndexediv; - internal IntPtr glGetVertexArrayiv; - internal IntPtr glGetVertexAttribdv; - internal IntPtr glGetVertexAttribfv; - internal IntPtr glGetVertexAttribIiv; - internal IntPtr glGetVertexAttribIuiv; - internal IntPtr glGetVertexAttribiv; - internal IntPtr glGetVertexAttribLdv; - internal IntPtr glGetVertexAttribPointerv; - internal IntPtr glHint; - internal IntPtr glInvalidateBufferData; - internal IntPtr glInvalidateBufferSubData; - internal IntPtr glInvalidateFramebuffer; - internal IntPtr glInvalidateNamedFramebufferData; - internal IntPtr glInvalidateNamedFramebufferSubData; - internal IntPtr glInvalidateSubFramebuffer; - internal IntPtr glInvalidateTexImage; - internal IntPtr glInvalidateTexSubImage; - internal IntPtr glIsBuffer; - internal IntPtr glIsEnabled; - internal IntPtr glIsEnabledi; - internal IntPtr glIsFramebuffer; - internal IntPtr glIsProgram; - internal IntPtr glIsProgramPipeline; - internal IntPtr glIsQuery; - internal IntPtr glIsRenderbuffer; - internal IntPtr glIsSampler; - internal IntPtr glIsShader; - internal IntPtr glIsSync; - internal IntPtr glIsTexture; - internal IntPtr glIsTransformFeedback; - internal IntPtr glIsVertexArray; - internal IntPtr glLineWidth; - internal IntPtr glLinkProgram; - internal IntPtr glLogicOp; - internal IntPtr glMapBuffer; - internal IntPtr glMapBufferRange; - internal IntPtr glMapNamedBuffer; - internal IntPtr glMapNamedBufferRange; - internal IntPtr glMemoryBarrier; - internal IntPtr glMemoryBarrierByRegion; - internal IntPtr glMinSampleShading; - internal IntPtr glMultiDrawArrays; - internal IntPtr glMultiDrawArraysIndirect; - internal IntPtr glMultiDrawArraysIndirectCount; - internal IntPtr glMultiDrawElements; - internal IntPtr glMultiDrawElementsBaseVertex; - internal IntPtr glMultiDrawElementsIndirect; - internal IntPtr glMultiDrawElementsIndirectCount; - internal IntPtr glNamedBufferData; - internal IntPtr glNamedBufferStorage; - internal IntPtr glNamedBufferSubData; - internal IntPtr glNamedFramebufferDrawBuffer; - internal IntPtr glNamedFramebufferDrawBuffers; - internal IntPtr glNamedFramebufferParameteri; - internal IntPtr glNamedFramebufferReadBuffer; - internal IntPtr glNamedFramebufferRenderbuffer; - internal IntPtr glNamedFramebufferTexture; - internal IntPtr glNamedFramebufferTextureLayer; - internal IntPtr glNamedRenderbufferStorage; - internal IntPtr glNamedRenderbufferStorageMultisample; - internal IntPtr glObjectLabel; - internal IntPtr glObjectPtrLabel; - internal IntPtr glPatchParameterfv; - internal IntPtr glPatchParameteri; - internal IntPtr glPauseTransformFeedback; - internal IntPtr glPixelStoref; - internal IntPtr glPixelStorei; - internal IntPtr glPointParameterf; - internal IntPtr glPointParameterfv; - internal IntPtr glPointParameteri; - internal IntPtr glPointParameteriv; - internal IntPtr glPointSize; - internal IntPtr glPolygonMode; - internal IntPtr glPolygonOffset; - internal IntPtr glPolygonOffsetClamp; - internal IntPtr glPopDebugGroup; - internal IntPtr glPrimitiveRestartIndex; - internal IntPtr glProgramBinary; - internal IntPtr glProgramParameteri; - internal IntPtr glProgramUniform1d; - internal IntPtr glProgramUniform1dv; - internal IntPtr glProgramUniform1f; - internal IntPtr glProgramUniform1fv; - internal IntPtr glProgramUniform1i; - internal IntPtr glProgramUniform1iv; - internal IntPtr glProgramUniform1ui; - internal IntPtr glProgramUniform1uiv; - internal IntPtr glProgramUniform2d; - internal IntPtr glProgramUniform2dv; - internal IntPtr glProgramUniform2f; - internal IntPtr glProgramUniform2fv; - internal IntPtr glProgramUniform2i; - internal IntPtr glProgramUniform2iv; - internal IntPtr glProgramUniform2ui; - internal IntPtr glProgramUniform2uiv; - internal IntPtr glProgramUniform3d; - internal IntPtr glProgramUniform3dv; - internal IntPtr glProgramUniform3f; - internal IntPtr glProgramUniform3fv; - internal IntPtr glProgramUniform3i; - internal IntPtr glProgramUniform3iv; - internal IntPtr glProgramUniform3ui; - internal IntPtr glProgramUniform3uiv; - internal IntPtr glProgramUniform4d; - internal IntPtr glProgramUniform4dv; - internal IntPtr glProgramUniform4f; - internal IntPtr glProgramUniform4fv; - internal IntPtr glProgramUniform4i; - internal IntPtr glProgramUniform4iv; - internal IntPtr glProgramUniform4ui; - internal IntPtr glProgramUniform4uiv; - internal IntPtr glProgramUniformMatrix2dv; - internal IntPtr glProgramUniformMatrix2fv; - internal IntPtr glProgramUniformMatrix2x3dv; - internal IntPtr glProgramUniformMatrix2x3fv; - internal IntPtr glProgramUniformMatrix2x4dv; - internal IntPtr glProgramUniformMatrix2x4fv; - internal IntPtr glProgramUniformMatrix3dv; - internal IntPtr glProgramUniformMatrix3fv; - internal IntPtr glProgramUniformMatrix3x2dv; - internal IntPtr glProgramUniformMatrix3x2fv; - internal IntPtr glProgramUniformMatrix3x4dv; - internal IntPtr glProgramUniformMatrix3x4fv; - internal IntPtr glProgramUniformMatrix4dv; - internal IntPtr glProgramUniformMatrix4fv; - internal IntPtr glProgramUniformMatrix4x2dv; - internal IntPtr glProgramUniformMatrix4x2fv; - internal IntPtr glProgramUniformMatrix4x3dv; - internal IntPtr glProgramUniformMatrix4x3fv; - internal IntPtr glProvokingVertex; - internal IntPtr glPushDebugGroup; - internal IntPtr glQueryCounter; - internal IntPtr glReadBuffer; - internal IntPtr glReadnPixels; - internal IntPtr glReadPixels; - internal IntPtr glReleaseShaderCompiler; - internal IntPtr glRenderbufferStorage; - internal IntPtr glRenderbufferStorageMultisample; - internal IntPtr glResumeTransformFeedback; - internal IntPtr glSampleCoverage; - internal IntPtr glSampleMaski; - internal IntPtr glSamplerParameterf; - internal IntPtr glSamplerParameterfv; - internal IntPtr glSamplerParameteri; - internal IntPtr glSamplerParameterIiv; - internal IntPtr glSamplerParameterIuiv; - internal IntPtr glSamplerParameteriv; - internal IntPtr glScissor; - internal IntPtr glScissorArrayv; - internal IntPtr glScissorIndexed; - internal IntPtr glScissorIndexedv; - internal IntPtr glShaderBinary; - internal IntPtr glShaderSource; - internal IntPtr glShaderStorageBlockBinding; - internal IntPtr glSpecializeShader; - internal IntPtr glStencilFunc; - internal IntPtr glStencilFuncSeparate; - internal IntPtr glStencilMask; - internal IntPtr glStencilMaskSeparate; - internal IntPtr glStencilOp; - internal IntPtr glStencilOpSeparate; - internal IntPtr glTexBuffer; - internal IntPtr glTexBufferRange; - internal IntPtr glTexImage1D; - internal IntPtr glTexImage2D; - internal IntPtr glTexImage2DMultisample; - internal IntPtr glTexImage3D; - internal IntPtr glTexImage3DMultisample; - internal IntPtr glTexParameterf; - internal IntPtr glTexParameterfv; - internal IntPtr glTexParameteri; - internal IntPtr glTexParameterIiv; - internal IntPtr glTexParameterIuiv; - internal IntPtr glTexParameteriv; - internal IntPtr glTexStorage1D; - internal IntPtr glTexStorage2D; - internal IntPtr glTexStorage2DMultisample; - internal IntPtr glTexStorage3D; - internal IntPtr glTexStorage3DMultisample; - internal IntPtr glTexSubImage1D; - internal IntPtr glTexSubImage2D; - internal IntPtr glTexSubImage3D; - internal IntPtr glTextureBarrier; - internal IntPtr glTextureBuffer; - internal IntPtr glTextureBufferRange; - internal IntPtr glTextureParameterf; - internal IntPtr glTextureParameterfv; - internal IntPtr glTextureParameteri; - internal IntPtr glTextureParameterIiv; - internal IntPtr glTextureParameterIuiv; - internal IntPtr glTextureParameteriv; - internal IntPtr glTextureStorage1D; - internal IntPtr glTextureStorage2D; - internal IntPtr glTextureStorage2DMultisample; - internal IntPtr glTextureStorage3D; - internal IntPtr glTextureStorage3DMultisample; - internal IntPtr glTextureSubImage1D; - internal IntPtr glTextureSubImage2D; - internal IntPtr glTextureSubImage3D; - internal IntPtr glTextureView; - internal IntPtr glTransformFeedbackBufferBase; - internal IntPtr glTransformFeedbackBufferRange; - internal IntPtr glTransformFeedbackVaryings; - internal IntPtr glUniform1d; - internal IntPtr glUniform1dv; - internal IntPtr glUniform1f; - internal IntPtr glUniform1fv; - internal IntPtr glUniform1i; - internal IntPtr glUniform1iv; - internal IntPtr glUniform1ui; - internal IntPtr glUniform1uiv; - internal IntPtr glUniform2d; - internal IntPtr glUniform2dv; - internal IntPtr glUniform2f; - internal IntPtr glUniform2fv; - internal IntPtr glUniform2i; - internal IntPtr glUniform2iv; - internal IntPtr glUniform2ui; - internal IntPtr glUniform2uiv; - internal IntPtr glUniform3d; - internal IntPtr glUniform3dv; - internal IntPtr glUniform3f; - internal IntPtr glUniform3fv; - internal IntPtr glUniform3i; - internal IntPtr glUniform3iv; - internal IntPtr glUniform3ui; - internal IntPtr glUniform3uiv; - internal IntPtr glUniform4d; - internal IntPtr glUniform4dv; - internal IntPtr glUniform4f; - internal IntPtr glUniform4fv; - internal IntPtr glUniform4i; - internal IntPtr glUniform4iv; - internal IntPtr glUniform4ui; - internal IntPtr glUniform4uiv; - internal IntPtr glUniformBlockBinding; - internal IntPtr glUniformMatrix2dv; - internal IntPtr glUniformMatrix2fv; - internal IntPtr glUniformMatrix2x3dv; - internal IntPtr glUniformMatrix2x3fv; - internal IntPtr glUniformMatrix2x4dv; - internal IntPtr glUniformMatrix2x4fv; - internal IntPtr glUniformMatrix3dv; - internal IntPtr glUniformMatrix3fv; - internal IntPtr glUniformMatrix3x2dv; - internal IntPtr glUniformMatrix3x2fv; - internal IntPtr glUniformMatrix3x4dv; - internal IntPtr glUniformMatrix3x4fv; - internal IntPtr glUniformMatrix4dv; - internal IntPtr glUniformMatrix4fv; - internal IntPtr glUniformMatrix4x2dv; - internal IntPtr glUniformMatrix4x2fv; - internal IntPtr glUniformMatrix4x3dv; - internal IntPtr glUniformMatrix4x3fv; - internal IntPtr glUniformSubroutinesuiv; - internal IntPtr glUnmapBuffer; - internal IntPtr glUnmapNamedBuffer; - internal IntPtr glUseProgram; - internal IntPtr glUseProgramStages; - internal IntPtr glValidateProgram; - internal IntPtr glValidateProgramPipeline; - internal IntPtr glVertexArrayAttribBinding; - internal IntPtr glVertexArrayAttribFormat; - internal IntPtr glVertexArrayAttribIFormat; - internal IntPtr glVertexArrayAttribLFormat; - internal IntPtr glVertexArrayBindingDivisor; - internal IntPtr glVertexArrayElementBuffer; - internal IntPtr glVertexArrayVertexBuffer; - internal IntPtr glVertexArrayVertexBuffers; - internal IntPtr glVertexAttrib1d; - internal IntPtr glVertexAttrib1dv; - internal IntPtr glVertexAttrib1f; - internal IntPtr glVertexAttrib1fv; - internal IntPtr glVertexAttrib1s; - internal IntPtr glVertexAttrib1sv; - internal IntPtr glVertexAttrib2d; - internal IntPtr glVertexAttrib2dv; - internal IntPtr glVertexAttrib2f; - internal IntPtr glVertexAttrib2fv; - internal IntPtr glVertexAttrib2s; - internal IntPtr glVertexAttrib2sv; - internal IntPtr glVertexAttrib3d; - internal IntPtr glVertexAttrib3dv; - internal IntPtr glVertexAttrib3f; - internal IntPtr glVertexAttrib3fv; - internal IntPtr glVertexAttrib3s; - internal IntPtr glVertexAttrib3sv; - internal IntPtr glVertexAttrib4bv; - internal IntPtr glVertexAttrib4d; - internal IntPtr glVertexAttrib4dv; - internal IntPtr glVertexAttrib4f; - internal IntPtr glVertexAttrib4fv; - internal IntPtr glVertexAttrib4iv; - internal IntPtr glVertexAttrib4Nbv; - internal IntPtr glVertexAttrib4Niv; - internal IntPtr glVertexAttrib4Nsv; - internal IntPtr glVertexAttrib4Nub; - internal IntPtr glVertexAttrib4Nubv; - internal IntPtr glVertexAttrib4Nuiv; - internal IntPtr glVertexAttrib4Nusv; - internal IntPtr glVertexAttrib4s; - internal IntPtr glVertexAttrib4sv; - internal IntPtr glVertexAttrib4ubv; - internal IntPtr glVertexAttrib4uiv; - internal IntPtr glVertexAttrib4usv; - internal IntPtr glVertexAttribBinding; - internal IntPtr glVertexAttribDivisor; - internal IntPtr glVertexAttribFormat; - internal IntPtr glVertexAttribI1i; - internal IntPtr glVertexAttribI1iv; - internal IntPtr glVertexAttribI1ui; - internal IntPtr glVertexAttribI1uiv; - internal IntPtr glVertexAttribI2i; - internal IntPtr glVertexAttribI2iv; - internal IntPtr glVertexAttribI2ui; - internal IntPtr glVertexAttribI2uiv; - internal IntPtr glVertexAttribI3i; - internal IntPtr glVertexAttribI3iv; - internal IntPtr glVertexAttribI3ui; - internal IntPtr glVertexAttribI3uiv; - internal IntPtr glVertexAttribI4bv; - internal IntPtr glVertexAttribI4i; - internal IntPtr glVertexAttribI4iv; - internal IntPtr glVertexAttribI4sv; - internal IntPtr glVertexAttribI4ubv; - internal IntPtr glVertexAttribI4ui; - internal IntPtr glVertexAttribI4uiv; - internal IntPtr glVertexAttribI4usv; - internal IntPtr glVertexAttribIFormat; - internal IntPtr glVertexAttribIPointer; - internal IntPtr glVertexAttribL1d; - internal IntPtr glVertexAttribL1dv; - internal IntPtr glVertexAttribL2d; - internal IntPtr glVertexAttribL2dv; - internal IntPtr glVertexAttribL3d; - internal IntPtr glVertexAttribL3dv; - internal IntPtr glVertexAttribL4d; - internal IntPtr glVertexAttribL4dv; - internal IntPtr glVertexAttribLFormat; - internal IntPtr glVertexAttribLPointer; - internal IntPtr glVertexAttribP1ui; - internal IntPtr glVertexAttribP1uiv; - internal IntPtr glVertexAttribP2ui; - internal IntPtr glVertexAttribP2uiv; - internal IntPtr glVertexAttribP3ui; - internal IntPtr glVertexAttribP3uiv; - internal IntPtr glVertexAttribP4ui; - internal IntPtr glVertexAttribP4uiv; - internal IntPtr glVertexAttribPointer; - internal IntPtr glVertexBindingDivisor; - internal IntPtr glViewport; - internal IntPtr glViewportArrayv; - internal IntPtr glViewportIndexedf; - internal IntPtr glViewportIndexedfv; - internal IntPtr glWaitSync; - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glContextShadow" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.OpenGL +{ + internal struct glContextShadow + { + + internal IntPtr glActiveShaderProgram; + internal IntPtr glActiveTexture; + internal IntPtr glAttachShader; + internal IntPtr glBeginConditionalRender; + internal IntPtr glBeginQuery; + internal IntPtr glBeginQueryIndexed; + internal IntPtr glBeginTransformFeedback; + internal IntPtr glBindAttribLocation; + internal IntPtr glBindBuffer; + internal IntPtr glBindBufferBase; + internal IntPtr glBindBufferRange; + internal IntPtr glBindBuffersBase; + internal IntPtr glBindBuffersRange; + internal IntPtr glBindFragDataLocation; + internal IntPtr glBindFragDataLocationIndexed; + internal IntPtr glBindFramebuffer; + internal IntPtr glBindImageTexture; + internal IntPtr glBindImageTextures; + internal IntPtr glBindProgramPipeline; + internal IntPtr glBindRenderbuffer; + internal IntPtr glBindSampler; + internal IntPtr glBindSamplers; + internal IntPtr glBindTexture; + internal IntPtr glBindTextures; + internal IntPtr glBindTextureUnit; + internal IntPtr glBindTransformFeedback; + internal IntPtr glBindVertexArray; + internal IntPtr glBindVertexBuffer; + internal IntPtr glBindVertexBuffers; + internal IntPtr glBlendColor; + internal IntPtr glBlendEquation; + internal IntPtr glBlendEquationi; + internal IntPtr glBlendEquationSeparate; + internal IntPtr glBlendEquationSeparatei; + internal IntPtr glBlendFunc; + internal IntPtr glBlendFunci; + internal IntPtr glBlendFuncSeparate; + internal IntPtr glBlendFuncSeparatei; + internal IntPtr glBlitFramebuffer; + internal IntPtr glBlitNamedFramebuffer; + internal IntPtr glBufferData; + internal IntPtr glBufferStorage; + internal IntPtr glBufferSubData; + internal IntPtr glCheckFramebufferStatus; + internal IntPtr glCheckNamedFramebufferStatus; + internal IntPtr glClampColor; + internal IntPtr glClear; + internal IntPtr glClearBufferData; + internal IntPtr glClearBufferfi; + internal IntPtr glClearBufferfv; + internal IntPtr glClearBufferiv; + internal IntPtr glClearBufferSubData; + internal IntPtr glClearBufferuiv; + internal IntPtr glClearColor; + internal IntPtr glClearDepth; + internal IntPtr glClearDepthf; + internal IntPtr glClearNamedBufferData; + internal IntPtr glClearNamedBufferSubData; + internal IntPtr glClearNamedFramebufferfi; + internal IntPtr glClearNamedFramebufferfv; + internal IntPtr glClearNamedFramebufferiv; + internal IntPtr glClearNamedFramebufferuiv; + internal IntPtr glClearStencil; + internal IntPtr glClearTexImage; + internal IntPtr glClearTexSubImage; + internal IntPtr glClientWaitSync; + internal IntPtr glClipControl; + internal IntPtr glColorMask; + internal IntPtr glColorMaski; + internal IntPtr glCompileShader; + internal IntPtr glCompressedTexImage1D; + internal IntPtr glCompressedTexImage2D; + internal IntPtr glCompressedTexImage3D; + internal IntPtr glCompressedTexSubImage1D; + internal IntPtr glCompressedTexSubImage2D; + internal IntPtr glCompressedTexSubImage3D; + internal IntPtr glCompressedTextureSubImage1D; + internal IntPtr glCompressedTextureSubImage2D; + internal IntPtr glCompressedTextureSubImage3D; + internal IntPtr glCopyBufferSubData; + internal IntPtr glCopyImageSubData; + internal IntPtr glCopyNamedBufferSubData; + internal IntPtr glCopyTexImage1D; + internal IntPtr glCopyTexImage2D; + internal IntPtr glCopyTexSubImage1D; + internal IntPtr glCopyTexSubImage2D; + internal IntPtr glCopyTexSubImage3D; + internal IntPtr glCopyTextureSubImage1D; + internal IntPtr glCopyTextureSubImage2D; + internal IntPtr glCopyTextureSubImage3D; + internal IntPtr glCreateBuffers; + internal IntPtr glCreateFramebuffers; + internal IntPtr glCreateProgram; + internal IntPtr glCreateProgramPipelines; + internal IntPtr glCreateQueries; + internal IntPtr glCreateRenderbuffers; + internal IntPtr glCreateSamplers; + internal IntPtr glCreateShader; + internal IntPtr glCreateShaderProgramv; + internal IntPtr glCreateTextures; + internal IntPtr glCreateTransformFeedbacks; + internal IntPtr glCreateVertexArrays; + internal IntPtr glCullFace; + internal IntPtr glDebugMessageCallback; + internal IntPtr glDebugMessageControl; + internal IntPtr glDebugMessageInsert; + internal IntPtr glDeleteBuffers; + internal IntPtr glDeleteFramebuffers; + internal IntPtr glDeleteProgram; + internal IntPtr glDeleteProgramPipelines; + internal IntPtr glDeleteQueries; + internal IntPtr glDeleteRenderbuffers; + internal IntPtr glDeleteSamplers; + internal IntPtr glDeleteShader; + internal IntPtr glDeleteSync; + internal IntPtr glDeleteTextures; + internal IntPtr glDeleteTransformFeedbacks; + internal IntPtr glDeleteVertexArrays; + internal IntPtr glDepthFunc; + internal IntPtr glDepthMask; + internal IntPtr glDepthRange; + internal IntPtr glDepthRangeArrayv; + internal IntPtr glDepthRangef; + internal IntPtr glDepthRangeIndexed; + internal IntPtr glDetachShader; + internal IntPtr glDisable; + internal IntPtr glDisablei; + internal IntPtr glDisableVertexArrayAttrib; + internal IntPtr glDisableVertexAttribArray; + internal IntPtr glDispatchCompute; + internal IntPtr glDispatchComputeIndirect; + internal IntPtr glDrawArrays; + internal IntPtr glDrawArraysIndirect; + internal IntPtr glDrawArraysInstanced; + internal IntPtr glDrawArraysInstancedBaseInstance; + internal IntPtr glDrawBuffer; + internal IntPtr glDrawBuffers; + internal IntPtr glDrawElements; + internal IntPtr glDrawElementsBaseVertex; + internal IntPtr glDrawElementsIndirect; + internal IntPtr glDrawElementsInstanced; + internal IntPtr glDrawElementsInstancedBaseInstance; + internal IntPtr glDrawElementsInstancedBaseVertex; + internal IntPtr glDrawElementsInstancedBaseVertexBaseInstance; + internal IntPtr glDrawRangeElements; + internal IntPtr glDrawRangeElementsBaseVertex; + internal IntPtr glDrawTransformFeedback; + internal IntPtr glDrawTransformFeedbackInstanced; + internal IntPtr glDrawTransformFeedbackStream; + internal IntPtr glDrawTransformFeedbackStreamInstanced; + internal IntPtr glEnable; + internal IntPtr glEnablei; + internal IntPtr glEnableVertexArrayAttrib; + internal IntPtr glEnableVertexAttribArray; + internal IntPtr glEndConditionalRender; + internal IntPtr glEndQuery; + internal IntPtr glEndQueryIndexed; + internal IntPtr glEndTransformFeedback; + internal IntPtr glFenceSync; + internal IntPtr glFinish; + internal IntPtr glFlush; + internal IntPtr glFlushMappedBufferRange; + internal IntPtr glFlushMappedNamedBufferRange; + internal IntPtr glFramebufferParameteri; + internal IntPtr glFramebufferRenderbuffer; + internal IntPtr glFramebufferTexture; + internal IntPtr glFramebufferTexture1D; + internal IntPtr glFramebufferTexture2D; + internal IntPtr glFramebufferTexture3D; + internal IntPtr glFramebufferTextureLayer; + internal IntPtr glFrontFace; + internal IntPtr glGenBuffers; + internal IntPtr glGenerateMipmap; + internal IntPtr glGenerateTextureMipmap; + internal IntPtr glGenFramebuffers; + internal IntPtr glGenProgramPipelines; + internal IntPtr glGenQueries; + internal IntPtr glGenRenderbuffers; + internal IntPtr glGenSamplers; + internal IntPtr glGenTextures; + internal IntPtr glGenTransformFeedbacks; + internal IntPtr glGenVertexArrays; + internal IntPtr glGetActiveAtomicCounterBufferiv; + internal IntPtr glGetActiveAttrib; + internal IntPtr glGetActiveSubroutineName; + internal IntPtr glGetActiveSubroutineUniformiv; + internal IntPtr glGetActiveSubroutineUniformName; + internal IntPtr glGetActiveUniform; + internal IntPtr glGetActiveUniformBlockiv; + internal IntPtr glGetActiveUniformBlockName; + internal IntPtr glGetActiveUniformName; + internal IntPtr glGetActiveUniformsiv; + internal IntPtr glGetAttachedShaders; + internal IntPtr glGetAttribLocation; + internal IntPtr glGetBooleani_v; + internal IntPtr glGetBooleanv; + internal IntPtr glGetBufferParameteri64v; + internal IntPtr glGetBufferParameteriv; + internal IntPtr glGetBufferPointerv; + internal IntPtr glGetBufferSubData; + internal IntPtr glGetCompressedTexImage; + internal IntPtr glGetCompressedTextureImage; + internal IntPtr glGetCompressedTextureSubImage; + internal IntPtr glGetDebugMessageLog; + internal IntPtr glGetDoublei_v; + internal IntPtr glGetDoublev; + internal IntPtr glGetError; + internal IntPtr glGetFloati_v; + internal IntPtr glGetFloatv; + internal IntPtr glGetFragDataIndex; + internal IntPtr glGetFragDataLocation; + internal IntPtr glGetFramebufferAttachmentParameteriv; + internal IntPtr glGetFramebufferParameteriv; + internal IntPtr glGetGraphicsResetStatus; + internal IntPtr glGetInteger64i_v; + internal IntPtr glGetInteger64v; + internal IntPtr glGetIntegeri_v; + internal IntPtr glGetIntegerv; + internal IntPtr glGetInternalformati64v; + internal IntPtr glGetInternalformativ; + internal IntPtr glGetMultisamplefv; + internal IntPtr glGetNamedBufferParameteri64v; + internal IntPtr glGetNamedBufferParameteriv; + internal IntPtr glGetNamedBufferPointerv; + internal IntPtr glGetNamedBufferSubData; + internal IntPtr glGetNamedFramebufferAttachmentParameteriv; + internal IntPtr glGetNamedFramebufferParameteriv; + internal IntPtr glGetNamedRenderbufferParameteriv; + internal IntPtr glGetnCompressedTexImage; + internal IntPtr glGetnTexImage; + internal IntPtr glGetnUniformdv; + internal IntPtr glGetnUniformfv; + internal IntPtr glGetnUniformiv; + internal IntPtr glGetnUniformuiv; + internal IntPtr glGetObjectLabel; + internal IntPtr glGetObjectPtrLabel; + internal IntPtr glGetPointerv; + internal IntPtr glGetProgramBinary; + internal IntPtr glGetProgramInfoLog; + internal IntPtr glGetProgramInterfaceiv; + internal IntPtr glGetProgramiv; + internal IntPtr glGetProgramPipelineInfoLog; + internal IntPtr glGetProgramPipelineiv; + internal IntPtr glGetProgramResourceIndex; + internal IntPtr glGetProgramResourceiv; + internal IntPtr glGetProgramResourceLocation; + internal IntPtr glGetProgramResourceLocationIndex; + internal IntPtr glGetProgramResourceName; + internal IntPtr glGetProgramStageiv; + internal IntPtr glGetQueryBufferObjecti64v; + internal IntPtr glGetQueryBufferObjectiv; + internal IntPtr glGetQueryBufferObjectui64v; + internal IntPtr glGetQueryBufferObjectuiv; + internal IntPtr glGetQueryIndexediv; + internal IntPtr glGetQueryiv; + internal IntPtr glGetQueryObjecti64v; + internal IntPtr glGetQueryObjectiv; + internal IntPtr glGetQueryObjectui64v; + internal IntPtr glGetQueryObjectuiv; + internal IntPtr glGetRenderbufferParameteriv; + internal IntPtr glGetSamplerParameterfv; + internal IntPtr glGetSamplerParameterIiv; + internal IntPtr glGetSamplerParameterIuiv; + internal IntPtr glGetSamplerParameteriv; + internal IntPtr glGetShaderInfoLog; + internal IntPtr glGetShaderiv; + internal IntPtr glGetShaderPrecisionFormat; + internal IntPtr glGetShaderSource; + internal IntPtr glGetString; + internal IntPtr glGetStringi; + internal IntPtr glGetSubroutineIndex; + internal IntPtr glGetSubroutineUniformLocation; + internal IntPtr glGetSynciv; + internal IntPtr glGetTexImage; + internal IntPtr glGetTexLevelParameterfv; + internal IntPtr glGetTexLevelParameteriv; + internal IntPtr glGetTexParameterfv; + internal IntPtr glGetTexParameterIiv; + internal IntPtr glGetTexParameterIuiv; + internal IntPtr glGetTexParameteriv; + internal IntPtr glGetTextureImage; + internal IntPtr glGetTextureLevelParameterfv; + internal IntPtr glGetTextureLevelParameteriv; + internal IntPtr glGetTextureParameterfv; + internal IntPtr glGetTextureParameterIiv; + internal IntPtr glGetTextureParameterIuiv; + internal IntPtr glGetTextureParameteriv; + internal IntPtr glGetTextureSubImage; + internal IntPtr glGetTransformFeedbacki_v; + internal IntPtr glGetTransformFeedbacki64_v; + internal IntPtr glGetTransformFeedbackiv; + internal IntPtr glGetTransformFeedbackVarying; + internal IntPtr glGetUniformBlockIndex; + internal IntPtr glGetUniformdv; + internal IntPtr glGetUniformfv; + internal IntPtr glGetUniformIndices; + internal IntPtr glGetUniformiv; + internal IntPtr glGetUniformLocation; + internal IntPtr glGetUniformSubroutineuiv; + internal IntPtr glGetUniformuiv; + internal IntPtr glGetVertexArrayIndexed64iv; + internal IntPtr glGetVertexArrayIndexediv; + internal IntPtr glGetVertexArrayiv; + internal IntPtr glGetVertexAttribdv; + internal IntPtr glGetVertexAttribfv; + internal IntPtr glGetVertexAttribIiv; + internal IntPtr glGetVertexAttribIuiv; + internal IntPtr glGetVertexAttribiv; + internal IntPtr glGetVertexAttribLdv; + internal IntPtr glGetVertexAttribPointerv; + internal IntPtr glHint; + internal IntPtr glInvalidateBufferData; + internal IntPtr glInvalidateBufferSubData; + internal IntPtr glInvalidateFramebuffer; + internal IntPtr glInvalidateNamedFramebufferData; + internal IntPtr glInvalidateNamedFramebufferSubData; + internal IntPtr glInvalidateSubFramebuffer; + internal IntPtr glInvalidateTexImage; + internal IntPtr glInvalidateTexSubImage; + internal IntPtr glIsBuffer; + internal IntPtr glIsEnabled; + internal IntPtr glIsEnabledi; + internal IntPtr glIsFramebuffer; + internal IntPtr glIsProgram; + internal IntPtr glIsProgramPipeline; + internal IntPtr glIsQuery; + internal IntPtr glIsRenderbuffer; + internal IntPtr glIsSampler; + internal IntPtr glIsShader; + internal IntPtr glIsSync; + internal IntPtr glIsTexture; + internal IntPtr glIsTransformFeedback; + internal IntPtr glIsVertexArray; + internal IntPtr glLineWidth; + internal IntPtr glLinkProgram; + internal IntPtr glLogicOp; + internal IntPtr glMapBuffer; + internal IntPtr glMapBufferRange; + internal IntPtr glMapNamedBuffer; + internal IntPtr glMapNamedBufferRange; + internal IntPtr glMemoryBarrier; + internal IntPtr glMemoryBarrierByRegion; + internal IntPtr glMinSampleShading; + internal IntPtr glMultiDrawArrays; + internal IntPtr glMultiDrawArraysIndirect; + internal IntPtr glMultiDrawArraysIndirectCount; + internal IntPtr glMultiDrawElements; + internal IntPtr glMultiDrawElementsBaseVertex; + internal IntPtr glMultiDrawElementsIndirect; + internal IntPtr glMultiDrawElementsIndirectCount; + internal IntPtr glNamedBufferData; + internal IntPtr glNamedBufferStorage; + internal IntPtr glNamedBufferSubData; + internal IntPtr glNamedFramebufferDrawBuffer; + internal IntPtr glNamedFramebufferDrawBuffers; + internal IntPtr glNamedFramebufferParameteri; + internal IntPtr glNamedFramebufferReadBuffer; + internal IntPtr glNamedFramebufferRenderbuffer; + internal IntPtr glNamedFramebufferTexture; + internal IntPtr glNamedFramebufferTextureLayer; + internal IntPtr glNamedRenderbufferStorage; + internal IntPtr glNamedRenderbufferStorageMultisample; + internal IntPtr glObjectLabel; + internal IntPtr glObjectPtrLabel; + internal IntPtr glPatchParameterfv; + internal IntPtr glPatchParameteri; + internal IntPtr glPauseTransformFeedback; + internal IntPtr glPixelStoref; + internal IntPtr glPixelStorei; + internal IntPtr glPointParameterf; + internal IntPtr glPointParameterfv; + internal IntPtr glPointParameteri; + internal IntPtr glPointParameteriv; + internal IntPtr glPointSize; + internal IntPtr glPolygonMode; + internal IntPtr glPolygonOffset; + internal IntPtr glPolygonOffsetClamp; + internal IntPtr glPopDebugGroup; + internal IntPtr glPrimitiveRestartIndex; + internal IntPtr glProgramBinary; + internal IntPtr glProgramParameteri; + internal IntPtr glProgramUniform1d; + internal IntPtr glProgramUniform1dv; + internal IntPtr glProgramUniform1f; + internal IntPtr glProgramUniform1fv; + internal IntPtr glProgramUniform1i; + internal IntPtr glProgramUniform1iv; + internal IntPtr glProgramUniform1ui; + internal IntPtr glProgramUniform1uiv; + internal IntPtr glProgramUniform2d; + internal IntPtr glProgramUniform2dv; + internal IntPtr glProgramUniform2f; + internal IntPtr glProgramUniform2fv; + internal IntPtr glProgramUniform2i; + internal IntPtr glProgramUniform2iv; + internal IntPtr glProgramUniform2ui; + internal IntPtr glProgramUniform2uiv; + internal IntPtr glProgramUniform3d; + internal IntPtr glProgramUniform3dv; + internal IntPtr glProgramUniform3f; + internal IntPtr glProgramUniform3fv; + internal IntPtr glProgramUniform3i; + internal IntPtr glProgramUniform3iv; + internal IntPtr glProgramUniform3ui; + internal IntPtr glProgramUniform3uiv; + internal IntPtr glProgramUniform4d; + internal IntPtr glProgramUniform4dv; + internal IntPtr glProgramUniform4f; + internal IntPtr glProgramUniform4fv; + internal IntPtr glProgramUniform4i; + internal IntPtr glProgramUniform4iv; + internal IntPtr glProgramUniform4ui; + internal IntPtr glProgramUniform4uiv; + internal IntPtr glProgramUniformMatrix2dv; + internal IntPtr glProgramUniformMatrix2fv; + internal IntPtr glProgramUniformMatrix2x3dv; + internal IntPtr glProgramUniformMatrix2x3fv; + internal IntPtr glProgramUniformMatrix2x4dv; + internal IntPtr glProgramUniformMatrix2x4fv; + internal IntPtr glProgramUniformMatrix3dv; + internal IntPtr glProgramUniformMatrix3fv; + internal IntPtr glProgramUniformMatrix3x2dv; + internal IntPtr glProgramUniformMatrix3x2fv; + internal IntPtr glProgramUniformMatrix3x4dv; + internal IntPtr glProgramUniformMatrix3x4fv; + internal IntPtr glProgramUniformMatrix4dv; + internal IntPtr glProgramUniformMatrix4fv; + internal IntPtr glProgramUniformMatrix4x2dv; + internal IntPtr glProgramUniformMatrix4x2fv; + internal IntPtr glProgramUniformMatrix4x3dv; + internal IntPtr glProgramUniformMatrix4x3fv; + internal IntPtr glProvokingVertex; + internal IntPtr glPushDebugGroup; + internal IntPtr glQueryCounter; + internal IntPtr glReadBuffer; + internal IntPtr glReadnPixels; + internal IntPtr glReadPixels; + internal IntPtr glReleaseShaderCompiler; + internal IntPtr glRenderbufferStorage; + internal IntPtr glRenderbufferStorageMultisample; + internal IntPtr glResumeTransformFeedback; + internal IntPtr glSampleCoverage; + internal IntPtr glSampleMaski; + internal IntPtr glSamplerParameterf; + internal IntPtr glSamplerParameterfv; + internal IntPtr glSamplerParameteri; + internal IntPtr glSamplerParameterIiv; + internal IntPtr glSamplerParameterIuiv; + internal IntPtr glSamplerParameteriv; + internal IntPtr glScissor; + internal IntPtr glScissorArrayv; + internal IntPtr glScissorIndexed; + internal IntPtr glScissorIndexedv; + internal IntPtr glShaderBinary; + internal IntPtr glShaderSource; + internal IntPtr glShaderStorageBlockBinding; + internal IntPtr glSpecializeShader; + internal IntPtr glStencilFunc; + internal IntPtr glStencilFuncSeparate; + internal IntPtr glStencilMask; + internal IntPtr glStencilMaskSeparate; + internal IntPtr glStencilOp; + internal IntPtr glStencilOpSeparate; + internal IntPtr glTexBuffer; + internal IntPtr glTexBufferRange; + internal IntPtr glTexImage1D; + internal IntPtr glTexImage2D; + internal IntPtr glTexImage2DMultisample; + internal IntPtr glTexImage3D; + internal IntPtr glTexImage3DMultisample; + internal IntPtr glTexParameterf; + internal IntPtr glTexParameterfv; + internal IntPtr glTexParameteri; + internal IntPtr glTexParameterIiv; + internal IntPtr glTexParameterIuiv; + internal IntPtr glTexParameteriv; + internal IntPtr glTexStorage1D; + internal IntPtr glTexStorage2D; + internal IntPtr glTexStorage2DMultisample; + internal IntPtr glTexStorage3D; + internal IntPtr glTexStorage3DMultisample; + internal IntPtr glTexSubImage1D; + internal IntPtr glTexSubImage2D; + internal IntPtr glTexSubImage3D; + internal IntPtr glTextureBarrier; + internal IntPtr glTextureBuffer; + internal IntPtr glTextureBufferRange; + internal IntPtr glTextureParameterf; + internal IntPtr glTextureParameterfv; + internal IntPtr glTextureParameteri; + internal IntPtr glTextureParameterIiv; + internal IntPtr glTextureParameterIuiv; + internal IntPtr glTextureParameteriv; + internal IntPtr glTextureStorage1D; + internal IntPtr glTextureStorage2D; + internal IntPtr glTextureStorage2DMultisample; + internal IntPtr glTextureStorage3D; + internal IntPtr glTextureStorage3DMultisample; + internal IntPtr glTextureSubImage1D; + internal IntPtr glTextureSubImage2D; + internal IntPtr glTextureSubImage3D; + internal IntPtr glTextureView; + internal IntPtr glTransformFeedbackBufferBase; + internal IntPtr glTransformFeedbackBufferRange; + internal IntPtr glTransformFeedbackVaryings; + internal IntPtr glUniform1d; + internal IntPtr glUniform1dv; + internal IntPtr glUniform1f; + internal IntPtr glUniform1fv; + internal IntPtr glUniform1i; + internal IntPtr glUniform1iv; + internal IntPtr glUniform1ui; + internal IntPtr glUniform1uiv; + internal IntPtr glUniform2d; + internal IntPtr glUniform2dv; + internal IntPtr glUniform2f; + internal IntPtr glUniform2fv; + internal IntPtr glUniform2i; + internal IntPtr glUniform2iv; + internal IntPtr glUniform2ui; + internal IntPtr glUniform2uiv; + internal IntPtr glUniform3d; + internal IntPtr glUniform3dv; + internal IntPtr glUniform3f; + internal IntPtr glUniform3fv; + internal IntPtr glUniform3i; + internal IntPtr glUniform3iv; + internal IntPtr glUniform3ui; + internal IntPtr glUniform3uiv; + internal IntPtr glUniform4d; + internal IntPtr glUniform4dv; + internal IntPtr glUniform4f; + internal IntPtr glUniform4fv; + internal IntPtr glUniform4i; + internal IntPtr glUniform4iv; + internal IntPtr glUniform4ui; + internal IntPtr glUniform4uiv; + internal IntPtr glUniformBlockBinding; + internal IntPtr glUniformMatrix2dv; + internal IntPtr glUniformMatrix2fv; + internal IntPtr glUniformMatrix2x3dv; + internal IntPtr glUniformMatrix2x3fv; + internal IntPtr glUniformMatrix2x4dv; + internal IntPtr glUniformMatrix2x4fv; + internal IntPtr glUniformMatrix3dv; + internal IntPtr glUniformMatrix3fv; + internal IntPtr glUniformMatrix3x2dv; + internal IntPtr glUniformMatrix3x2fv; + internal IntPtr glUniformMatrix3x4dv; + internal IntPtr glUniformMatrix3x4fv; + internal IntPtr glUniformMatrix4dv; + internal IntPtr glUniformMatrix4fv; + internal IntPtr glUniformMatrix4x2dv; + internal IntPtr glUniformMatrix4x2fv; + internal IntPtr glUniformMatrix4x3dv; + internal IntPtr glUniformMatrix4x3fv; + internal IntPtr glUniformSubroutinesuiv; + internal IntPtr glUnmapBuffer; + internal IntPtr glUnmapNamedBuffer; + internal IntPtr glUseProgram; + internal IntPtr glUseProgramStages; + internal IntPtr glValidateProgram; + internal IntPtr glValidateProgramPipeline; + internal IntPtr glVertexArrayAttribBinding; + internal IntPtr glVertexArrayAttribFormat; + internal IntPtr glVertexArrayAttribIFormat; + internal IntPtr glVertexArrayAttribLFormat; + internal IntPtr glVertexArrayBindingDivisor; + internal IntPtr glVertexArrayElementBuffer; + internal IntPtr glVertexArrayVertexBuffer; + internal IntPtr glVertexArrayVertexBuffers; + internal IntPtr glVertexAttrib1d; + internal IntPtr glVertexAttrib1dv; + internal IntPtr glVertexAttrib1f; + internal IntPtr glVertexAttrib1fv; + internal IntPtr glVertexAttrib1s; + internal IntPtr glVertexAttrib1sv; + internal IntPtr glVertexAttrib2d; + internal IntPtr glVertexAttrib2dv; + internal IntPtr glVertexAttrib2f; + internal IntPtr glVertexAttrib2fv; + internal IntPtr glVertexAttrib2s; + internal IntPtr glVertexAttrib2sv; + internal IntPtr glVertexAttrib3d; + internal IntPtr glVertexAttrib3dv; + internal IntPtr glVertexAttrib3f; + internal IntPtr glVertexAttrib3fv; + internal IntPtr glVertexAttrib3s; + internal IntPtr glVertexAttrib3sv; + internal IntPtr glVertexAttrib4bv; + internal IntPtr glVertexAttrib4d; + internal IntPtr glVertexAttrib4dv; + internal IntPtr glVertexAttrib4f; + internal IntPtr glVertexAttrib4fv; + internal IntPtr glVertexAttrib4iv; + internal IntPtr glVertexAttrib4Nbv; + internal IntPtr glVertexAttrib4Niv; + internal IntPtr glVertexAttrib4Nsv; + internal IntPtr glVertexAttrib4Nub; + internal IntPtr glVertexAttrib4Nubv; + internal IntPtr glVertexAttrib4Nuiv; + internal IntPtr glVertexAttrib4Nusv; + internal IntPtr glVertexAttrib4s; + internal IntPtr glVertexAttrib4sv; + internal IntPtr glVertexAttrib4ubv; + internal IntPtr glVertexAttrib4uiv; + internal IntPtr glVertexAttrib4usv; + internal IntPtr glVertexAttribBinding; + internal IntPtr glVertexAttribDivisor; + internal IntPtr glVertexAttribFormat; + internal IntPtr glVertexAttribI1i; + internal IntPtr glVertexAttribI1iv; + internal IntPtr glVertexAttribI1ui; + internal IntPtr glVertexAttribI1uiv; + internal IntPtr glVertexAttribI2i; + internal IntPtr glVertexAttribI2iv; + internal IntPtr glVertexAttribI2ui; + internal IntPtr glVertexAttribI2uiv; + internal IntPtr glVertexAttribI3i; + internal IntPtr glVertexAttribI3iv; + internal IntPtr glVertexAttribI3ui; + internal IntPtr glVertexAttribI3uiv; + internal IntPtr glVertexAttribI4bv; + internal IntPtr glVertexAttribI4i; + internal IntPtr glVertexAttribI4iv; + internal IntPtr glVertexAttribI4sv; + internal IntPtr glVertexAttribI4ubv; + internal IntPtr glVertexAttribI4ui; + internal IntPtr glVertexAttribI4uiv; + internal IntPtr glVertexAttribI4usv; + internal IntPtr glVertexAttribIFormat; + internal IntPtr glVertexAttribIPointer; + internal IntPtr glVertexAttribL1d; + internal IntPtr glVertexAttribL1dv; + internal IntPtr glVertexAttribL2d; + internal IntPtr glVertexAttribL2dv; + internal IntPtr glVertexAttribL3d; + internal IntPtr glVertexAttribL3dv; + internal IntPtr glVertexAttribL4d; + internal IntPtr glVertexAttribL4dv; + internal IntPtr glVertexAttribLFormat; + internal IntPtr glVertexAttribLPointer; + internal IntPtr glVertexAttribP1ui; + internal IntPtr glVertexAttribP1uiv; + internal IntPtr glVertexAttribP2ui; + internal IntPtr glVertexAttribP2uiv; + internal IntPtr glVertexAttribP3ui; + internal IntPtr glVertexAttribP3uiv; + internal IntPtr glVertexAttribP4ui; + internal IntPtr glVertexAttribP4uiv; + internal IntPtr glVertexAttribPointer; + internal IntPtr glVertexBindingDivisor; + internal IntPtr glViewport; + internal IntPtr glViewportArrayv; + internal IntPtr glViewportIndexedf; + internal IntPtr glViewportIndexedfv; + internal IntPtr glWaitSync; + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glEnum.cs b/StgsSharp.Graphics/OpenGL/glEnum.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glEnum.cs rename to StgsSharp.Graphics/OpenGL/glEnum.cs index 30dbff4f..9ab945b4 100644 --- a/StgSharp.Common/Graphics/OpenGL/glEnum.cs +++ b/StgsSharp.Graphics/OpenGL/glEnum.cs @@ -1,224 +1,224 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glEnum" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -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 - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glEnum" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +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/StgSharp.Common/Graphics/OpenGL/glException.cs b/StgsSharp.Graphics/OpenGL/glException.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glException.cs rename to StgsSharp.Graphics/OpenGL/glException.cs index 8a9721c9..2cf1906b 100644 --- a/StgSharp.Common/Graphics/OpenGL/glException.cs +++ b/StgsSharp.Graphics/OpenGL/glException.cs @@ -1,98 +1,98 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glException" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - public sealed class GlErrorOverflowException : Exception - { - - public GlErrorOverflowException(int errorCount, uint errorCode) - : base( - "Too many opengl error detected at certain position. " + $"The amount of errors exceeds {errorCount}. " + $"Code of the last error is {errorCode}") { } - - } - - public sealed class GlExecutionException : Exception - { - - public GlExecutionException(uint errorCode) : base($"Critical OpenGL error: {errorCode}") { } - - } - - public sealed class GlArrayFormatException : Exception - { - - internal GlArrayFormatException(string message) : base(message) { } - - internal GlArrayFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { } - - internal GlArrayFormatException(string message, Exception innerException) : base(message, innerException) { } - - public GlArrayFormatException(PixelChannelLayout layout, string arrayname) - : base($"{arrayname} cannot be used as layout of {layout}") { } - - } - - public static partial class GlHelper - { - - public static bool CheckArrayFormat(this Array array, PixelChannelLayout layout) - { - return layout switch - { - PixelChannelLayout.Byte or PixelChannelLayout.UByte332 or PixelChannelLayout.UByte233Rev => (array is byte[]) || - (array is sbyte[]), - PixelChannelLayout.Short => array is short[], - PixelChannelLayout.UShort => array is ushort[], - PixelChannelLayout.Int => array is int[], - PixelChannelLayout.Float => array is float[], - PixelChannelLayout.UShort4444 => (array is ushort[]) || (array is byte[]), - PixelChannelLayout.UByte => (array is byte[]) || (array is sbyte[]), - PixelChannelLayout.UInt => array is uint[], - PixelChannelLayout.UShort565 or - PixelChannelLayout.UShort565Rev or - PixelChannelLayout.UShort4444Rev or - PixelChannelLayout.UShort5551 or - PixelChannelLayout.UShort1555Rev => array is ushort[], - PixelChannelLayout.UInt8888Rev or - PixelChannelLayout.UInt1010102 or - PixelChannelLayout.UInt2101010Rev => array is int[], - PixelChannelLayout.UInt8888 => array is uint[] or byte[], - _ => false, - }; - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glException" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.Serialization; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + public sealed class GlErrorOverflowException : Exception + { + + public GlErrorOverflowException(int errorCount, uint errorCode) + : base( + "Too many opengl error detected at certain position. " + $"The amount of errors exceeds {errorCount}. " + $"Code of the last error is {errorCode}") { } + + } + + public sealed class GlExecutionException : Exception + { + + public GlExecutionException(uint errorCode) : base($"Critical OpenGL error: {errorCode}") { } + + } + + public sealed class GlArrayFormatException : Exception + { + + internal GlArrayFormatException(string message) : base(message) { } + + internal GlArrayFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { } + + internal GlArrayFormatException(string message, Exception innerException) : base(message, innerException) { } + + public GlArrayFormatException(PixelChannelLayout layout, string arrayname) + : base($"{arrayname} cannot be used as layout of {layout}") { } + + } + + public static partial class GlHelper + { + + public static bool CheckArrayFormat(this Array array, PixelChannelLayout layout) + { + return layout switch + { + PixelChannelLayout.Byte or PixelChannelLayout.UByte332 or PixelChannelLayout.UByte233Rev => (array is byte[]) || + (array is sbyte[]), + PixelChannelLayout.Short => array is short[], + PixelChannelLayout.UShort => array is ushort[], + PixelChannelLayout.Int => array is int[], + PixelChannelLayout.Float => array is float[], + PixelChannelLayout.UShort4444 => (array is ushort[]) || (array is byte[]), + PixelChannelLayout.UByte => (array is byte[]) || (array is sbyte[]), + PixelChannelLayout.UInt => array is uint[], + PixelChannelLayout.UShort565 or + PixelChannelLayout.UShort565Rev or + PixelChannelLayout.UShort4444Rev or + PixelChannelLayout.UShort5551 or + PixelChannelLayout.UShort1555Rev => array is ushort[], + PixelChannelLayout.UInt8888Rev or + PixelChannelLayout.UInt1010102 or + PixelChannelLayout.UInt2101010Rev => array is int[], + PixelChannelLayout.UInt8888 => array is uint[] or byte[], + _ => false, + }; + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.SourceManager.cs b/StgsSharp.Graphics/OpenGL/glFunction.SourceManager.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glFunction.SourceManager.cs rename to StgsSharp.Graphics/OpenGL/glFunction.SourceManager.cs index 6e4a2bdb..5d967a96 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.SourceManager.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.SourceManager.cs @@ -1,92 +1,92 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFucntionSourceManager" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp; - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Runtime.CompilerServices; - -namespace StgSharp.Graphics.OpenGL -{ - public partial class OpenGLFunction - { - - private readonly int textureUnitCountGetter; - - public int TextureUnitCount - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => textureUnitCountGetter; - } - - private ConcurrentQueue UnusedTextureImageUint - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get; - } = []; - - internal void ReturnAvailableUnit(IEnumerable source) - { - int v = glConst.TEXTURE0 + TextureUnitCount; - foreach (TextureUnit unit in source) - { - if ((int)unit > v) { - throw new InvalidOperationException( - "Source contains texture unit beyond context support."); - } - } - } - - internal int TryGetAvailableTextureUnit(int count, out IEnumerable result) - { - result = new Queue(); - for (int i = 0; i < count; i++) - { - if (UnusedTextureImageUint.TryDequeue(out TextureUnit unit)) - { - (result as Queue)!.Enqueue(unit); - } else - { - return i; - } - } - return count; - } - - private ConcurrentQueue InitializeUnusedTextureImageUint() - { - ConcurrentQueue result = new ConcurrentQueue(); - for (int index = 0; index < TextureUnitCount; index++) { - result.Enqueue((TextureUnit)(glConst.TEXTURE0 + index)); - } - return result; - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFucntionSourceManager" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp; + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace StgSharp.Graphics.OpenGL +{ + public partial class OpenGLFunction + { + + private readonly int textureUnitCountGetter; + + public int TextureUnitCount + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => textureUnitCountGetter; + } + + private ConcurrentQueue UnusedTextureImageUint + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get; + } = []; + + internal void ReturnAvailableUnit(IEnumerable source) + { + int v = glConst.TEXTURE0 + TextureUnitCount; + foreach (TextureUnit unit in source) + { + if ((int)unit > v) { + throw new InvalidOperationException( + "Source contains texture unit beyond context support."); + } + } + } + + internal int TryGetAvailableTextureUnit(int count, out IEnumerable result) + { + result = new Queue(); + for (int i = 0; i < count; i++) + { + if (UnusedTextureImageUint.TryDequeue(out TextureUnit unit)) + { + (result as Queue)!.Enqueue(unit); + } else + { + return i; + } + } + return count; + } + + private ConcurrentQueue InitializeUnusedTextureImageUint() + { + ConcurrentQueue result = new ConcurrentQueue(); + for (int index = 0; index < TextureUnitCount; index++) { + result.Enqueue((TextureUnit)(glConst.TEXTURE0 + index)); + } + return result; + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.cs b/StgsSharp.Graphics/OpenGL/glFunction.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glFunction.cs rename to StgsSharp.Graphics/OpenGL/glFunction.cs index 4b847ab2..1e712421 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.cs @@ -1,817 +1,817 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFunction" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Graphics; -using StgSharp.Internal; -using StgSharp.Mathematics; -using StgSharp.Mathematics.Numeric; - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Diagnostics; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - private static readonly Dictionary contextToGLMap = []; - private static readonly ThreadLocal _currentGL = new ThreadLocal(); - private OpenglContext* _context; - - private Lazy _attachmentColorRange; - - private OpenGLFunction() - { - textureUnitCountGetter = glConst.MAX_TEXTURE_IMAGE_UNITS; - UnusedTextureImageUint = []; - _attachmentColorRange = new Lazy( - () => { return GetMaskInteger((uint)glConst.MAX_COLOR_ATTACHMENTS); }); - } - - public int AttachmentColorRange - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _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); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ActiveTextureUnit( - uint type - ) - { - _context->glActiveTexture(type); - } - - [Conditional("DEBUG")] - public void Assert( - bool shouldReportWhenNormal - ) - { - uint code = _context->glGetError(); - if (code != glConst.NO_ERROR) { - throw new GlExecutionException(code); - } - if (shouldReportWhenNormal) { - Console.WriteLine("OpenGL runs normally"); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBuffer( - BufferType bufferType, - GlHandle handle - ) - { - _context->glBindBuffer((uint)bufferType, handle.Value); - } - - /// - /// Bind a frame BufferHandle to a frame BufferHandle target Same function as glBindFramebuffer. - /// - /// - /// The frame BufferHandle target of the binding operation. - /// - /// - /// The handle of the frame BufferHandle object to bind. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindFrameBuffer( - FrameBufferTarget target, - GlHandle handle - ) - { - _context->glBindFramebuffer((uint)target, handle.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindRenderBuffer( - GlHandle handle - ) - { - _context->glBindRenderbuffer(glConst.RENDERBUFFER, handle.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindVertexArray( - GlHandle handle - ) - { - _context->glBindVertexArray(handle.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public FrameBufferStatus CheckFrameBufferStatus( - FrameBufferTarget target - ) - { - return (FrameBufferStatus)_context->glCheckFramebufferStatus((uint)target); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Clear( - MaskBufferBit mask - ) - { - _context->glClear((uint)mask); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearError() - { - uint code = 0; - for (int i = 0; i < 1024; i++) - { - code = _context->glGetError(); - if (code == 0) { - return; - } - - // Console.WriteLine(code); - } - foreach (ProcessThread thread in Process.GetCurrentProcess().Threads) { - Debugger.Break(); - } - throw new GlErrorOverflowException(1024, code); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void ClearGraphicError() - { - while (_context->glGetError() != 0) { } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CombineFrameBufferRenderBuffer( - FrameBufferAttachment attachment, - GlHandle rboHandle - ) - { - _context->glFramebufferRenderbuffer(glConst.FRAMEBUFFER, (uint)attachment, - glConst.RENDERBUFFER, rboHandle.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe GlHandle CreateGraphicProgram() - { - return GlHandle.Create(_context->glCreateProgram()); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe GlHandle[] CreateProgram( - int count - ) - { - GlHandle[] h = new GlHandle[count]; - for (int i = 0; i < count; i++) { - h.SetValue(i, _context->glCreateProgram()); - } - return h; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public GlHandle[] CreateShaderSet( - int count, - ShaderType type - ) - { - GlHandle[] ret = new GlHandle[count]; - uint t = (uint)type; - for (int i = 0; i < count; i++) - { - uint id = _context->glCreateShader(t); - if (id == 0) - { - uint error = _context->glGetError(); - throw new InvalidOperationException($"Failed in creating shader: {error}"); - } - ret[i] = GlHandle.Create(id); - } - return ret; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void DeleteBuffer( - GlHandle handle - ) - { - _context->glDeleteBuffers(1, (uint*)&handle); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void DeleteBuffers( - GlHandle[] handle - ) - { - if ((handle == null) || (handle.Length == 0)) { - throw new ArgumentNullException(nameof(handle)); - } - fixed (GlHandle* hptr = handle) - { - uint* iptr = (uint*)hptr; - for (int i = 0; i < handle.Length; i++) { - _context->glDeleteBuffers(1, iptr + i); - } - } - } - - /// - /// Delete a render BufferHandle object Very simlilar function as glDeleteRenderbuffers. The only - /// deifference is that this mehtod can only delete one renderbuffer at the same time. - /// - /// - /// Handle to BufferHandle to delete. - /// - public unsafe void DeleteRenderBuffer( - GlHandle bufferHandle - ) - { - _context->glDeleteRenderbuffers(1, &bufferHandle.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void DeleteVertexArrays( - GlHandle[] arrays - ) - { - fixed (GlHandle* hptr = arrays) - { - uint* iptr = (uint*)hptr; - for (int i = 0; i < arrays.Length; i++) { - _context->glDeleteVertexArrays(1, iptr + i); - } - } - } - - public void DepthMaskAccess( - bool isWrite - ) - { - _context->glDepthMask(isWrite ? (byte)1 : (byte)0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Disable( - glOperation operation - ) - { - _context->glDisable((uint)operation); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void DrawArrays( - GeometryType mode, - int first, - int count - ) - { - _context->glDrawArrays((uint)mode, first, count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void DrawElements( - GeometryType mode, - int count, - TypeCode type, - IntPtr ptr - ) - { - uint a; - a = type switch - { - TypeCode.UInt32 => glConst.UNSIGNED_INT, - TypeCode.UInt16 => glConst.UNSIGNED_SHORT, - TypeCode.Byte => glConst.UNSIGNED_BYTE, - _ => throw new ArgumentException( - $"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}") - }; - _context->glDrawElements((uint)mode, count, a, (nint*)ptr); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsInstanced( - GeometryType mode, - int count, - TypeCode type, - IntPtr ptr, - int amount - ) - { - uint a; - a = type switch - { - TypeCode.UInt32 => glConst.UNSIGNED_INT, - TypeCode.UInt16 => glConst.UNSIGNED_SHORT, - TypeCode.Byte => glConst.UNSIGNED_BYTE, - _ => throw new ArgumentException( - $"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}") - }; - _context->glDrawElementsInstanced((uint)mode, count, a, (nint*)ptr, amount); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enable( - glOperation operation - ) - { - _context->glEnable((uint)operation); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FrameBufferTexture2d( - FrameBufferTarget target, - uint attachment, - Texture2DTarget texTarget, - GlHandle textureHandle, - int level - ) - { - _context->glFramebufferTexture2D((uint)target, attachment, (uint)texTarget, - textureHandle.Value, level); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe GlHandle[] GenBuffers( - int count - ) - { - GlHandle[] h = new GlHandle[count]; - fixed (GlHandle* hptr = h) - { - for (int i = 0; i < count; i++) { - _context->glGenBuffers(count, ((uint*)hptr) + i); - } - } - return h; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe GlHandle[] GenRenderBuffer( - int count - ) - { - GlHandle[] h = new GlHandle[count]; - fixed (GlHandle* hptr = h) { - _context->glGenRenderbuffers(count, (uint*)hptr); - } - return h; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe GlHandle[] GenTextures( - int count - ) - { - GlHandle[] h = new GlHandle[count]; - fixed (GlHandle* hptr = h) { - _context->glGenTextures(count, (uint*)hptr); - } - return h; - } - - public unsafe GlHandle[] GenVertexArrays( - int count - ) - { - GlHandle[] h = new GlHandle[count]; - fixed (GlHandle* hptr = h) { - _context->glGenVertexArrays(count, (uint*)hptr); - } - return h; - } - - public unsafe int GetMaskInteger( - uint statusCode - ) - { - int ret = 0; - _context->glGetIntegerv(statusCode, &ret); - return ret; - } - - public string GetShaderStatus( - Shader s, - int index, - int key - ) - { - IntPtr sptr = IntPtr.Zero; - if (GraphicFramework.glCheckShaderStatus(ref Context, s.handle[index].Value, key, - ref sptr) == 0) { - return Marshal.PtrToStringAnsi(sptr); - } - return string.Empty; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void GetTextureImage( - Texture2DTarget target, - int level, - ImageChannel channel, - PixelChannelLayout channelLayout, - T[] dataStream - ) where T : unmanaged,INumber - { - fixed (T* tptr = dataStream) { - _context->glGetTexImage((uint)target, level, (uint)channel, (uint)channelLayout, - (nint*)tptr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureLevelProperty( - uint textureTypeMask, - int level, - uint propertyMask, - out int propertyValue - ) - { - fixed (int* iptr = &propertyValue) { - _context->glGetTexLevelParameteriv(textureTypeMask, level, propertyMask, iptr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe GlHandle GetUniformLocation( - GlHandle program, - string name - ) - { - byte[] code = Encoding.UTF8.GetBytes(name); - fixed (byte* ptr = code) - { - int ret = _context->glGetUniformLocation(program.Value, ptr); - #if DEBUG - if ((ret == glConst.INVALID_OPERATION) || (ret == glConst.INVALID_VALUE)) - { - throw new InvalidOperationException(); - } - if (ret == -1) { - throw new UniformEmptyReferenceException(nameof(program), name); - } - #endif - return GlHandle.CreateSigned(ret); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void LoadShaderSource( - GlHandle shaderHandle, - byte[] codeStream - ) - { - fixed (byte* streamPtr = codeStream) { - _context->glShaderSource(shaderHandle.Value, 1, &streamPtr, (int*)0); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void LoadShaderSource( - GlHandle shaderHandle, - ReadOnlySpan codeStream - ) - { - fixed (char* streamPtr = codeStream) { - _context->glShaderSource(shaderHandle.Value, 1, (byte**)&streamPtr, (int*)0); - } - } - - public unsafe void LoadShaderSource( - GlHandle shaderHandle, - ReadOnlySpan codeStream - ) - { - fixed (byte* streamPtr = codeStream) - { - byte* bptr = streamPtr; - _context->glShaderSource(shaderHandle.Value, 1, &bptr, (int*)0); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PolygonMode( - FaceMode mode - ) - { - _context->glPolygonMode(glConst.FRONT_AND_BACK, (uint)mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReadPixels( - (int X, int Y) beginPosition, - (int width, int height) size, - FrameBufferChannel format, - PixelChannelLayout dataType, - ref byte[] stream - ) - { - fixed (byte* bptr = stream) { - _context->glReadPixels(beginPosition.X, beginPosition.Y, size.width, size.height, - (uint)format, (uint)dataType, (nint*)bptr); - } - } - - public void RereadImage( - in Image i, - (int X, int Y) beginPosition, - FrameBufferChannel format, - PixelChannelLayout dataType - ) - { - byte[] pixels = i.PixelBuffer; - if (!pixels.CheckArrayFormat(dataType)) { - throw new GlArrayFormatException(dataType, "i.PixelArray"); - } - fixed (byte* bptr = pixels) { - _context->glReadPixels(beginPosition.X, beginPosition.Y, i.Width, i.Height, - (uint)format, (uint)dataType, (nint*)bptr); - } - i.PixelUpdateCount++; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetBufferData( - BufferType bufferType, - T bufferData, - BufferUsage usage - ) where T : unmanaged,INumber - { - int size = Marshal.SizeOf(); - - T* p = &bufferData; - - _context->glBufferData((uint)bufferType, (nuint)size, (nint*)p, (uint)usage); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetBufferData( - BufferType bufferType, - T[] bufferArray, - BufferUsage usage - ) where T : unmanaged,INumber - { - int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); - if (bufferArray == null) { - return; - } - - fixed (void* bufferPtr = bufferArray) { - _context->glBufferData((uint)bufferType, (nuint)size, (nint*)bufferPtr, - (uint)usage); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetBufferData( - BufferType bufferType, - ReadOnlySpan bufferSpan, - BufferUsage usage - ) where T : unmanaged,INumber - { - int size = bufferSpan.Length * Marshal.SizeOf(); - if (bufferSpan.IsEmpty) { - return; - } - - fixed (void* bufferPtr = bufferSpan) { - _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, - (uint)usage); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetBufferData( - BufferType bufferType, - Span bufferArray, - BufferUsage usage - ) where T : unmanaged, INumber - { - int size = bufferArray.Length * Marshal.SizeOf(); - if (bufferArray.IsEmpty) { - return; - } - - - fixed (void* bufferPtr = bufferArray) { - _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, - (uint)usage); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetBufferVectorData( - BufferType bufferType, - ReadOnlySpan bufferSpan, - BufferUsage usage - ) where T : unmanaged, IUnmanagedVector - { - int size = bufferSpan.Length * Marshal.SizeOf(); - - fixed (void* bufferPtr = bufferSpan) { - _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, - (uint)usage); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetBufferVectorData( - BufferType bufferType, - T[] bufferArray, - BufferUsage usage - ) where T : unmanaged, IUnmanagedVector - { - int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); - if (bufferArray == null) { - return; - } - fixed (void* bufferPtr = bufferArray) { - _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, - (uint)usage); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetRenderBufferStorage( - RenderBufferInternalFormat internalFormat, - (int width, int height) size - ) - { - _context->glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, size.width, - size.height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetRenderBufferStorage( - RenderBufferInternalFormat internalFormat, - (uint width, uint height) size - ) - { - _context->glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, - (int)size.width, (int)size.height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetVertexAttribute( - uint index, - int size, - TypeCode t, - bool normalized, - int stride, - int pointer - ) - { - uint type = GraphicFramework.GLtype[(int)t]; - _context->glVertexAttribPointer(index, size, type, (byte)(normalized ? 1 : 0), stride, - (nint*)pointer); - _context->glEnableVertexAttribArray(index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureImage2d( - Texture2DTarget target, - int level, - ImageChannel sourceChannel, - int width, - int height, - ImageChannel targetChannel, - PixelChannelLayout type, - T[] pixels - ) where T : unmanaged, INumber - { - fixed (T* tptr = pixels) - { - T* ptr = ((pixels == null) || (pixels.Length == 0)) ? (T*)IntPtr.Zero : tptr; - _context->glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, - (uint)targetChannel, (uint)type, (nint*)tptr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureImage2d( - Texture2DTarget target, - int level, - ImageChannel sourceChannel, - int width, - int height, - ImageChannel targetChannel, - PixelChannelLayout type, - Span pixelSpan - ) where T : unmanaged, INumber - { - fixed (T* tPtr = pixelSpan) { - _context->glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, - (uint)targetChannel, (uint)type, (nint*)tPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameter( - int target, - uint pname, - int param - ) - { - _context->glTexParameteri((uint)target, pname, param); - } - - public static bool TryGetFunctionPackage( - IntPtr handle, - out OpenGLFunction functionPackage - ) - { - return contextToGLMap.TryGetValue(handle, out functionPackage); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttributeDivisor( - uint layoutIndex, - uint divisor - ) - { - _context->glVertexAttribDivisor(layoutIndex, divisor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void WaitAccomplishment() - { - _context->glFinish(); - } - - 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); - } - - } -} - +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFunction" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Graphics; +using StgSharp.Internal; +using StgSharp.Mathematics; +using StgSharp.Mathematics.Numeric; + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial class OpenGLFunction + { + + private static readonly Dictionary contextToGLMap = []; + private static readonly ThreadLocal _currentGL = new ThreadLocal(); + private OpenglContext* _context; + + private Lazy _attachmentColorRange; + + private OpenGLFunction() + { + textureUnitCountGetter = glConst.MAX_TEXTURE_IMAGE_UNITS; + UnusedTextureImageUint = []; + _attachmentColorRange = new Lazy( + () => { return GetMaskInteger((uint)glConst.MAX_COLOR_ATTACHMENTS); }); + } + + public int AttachmentColorRange + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _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); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ActiveTextureUnit( + uint type + ) + { + _context->glActiveTexture(type); + } + + [Conditional("DEBUG")] + public void Assert( + bool shouldReportWhenNormal + ) + { + uint code = _context->glGetError(); + if (code != glConst.NO_ERROR) { + throw new GlExecutionException(code); + } + if (shouldReportWhenNormal) { + Console.WriteLine("OpenGL runs normally"); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindBuffer( + BufferType bufferType, + GlHandle handle + ) + { + _context->glBindBuffer((uint)bufferType, handle.Value); + } + + /// + /// Bind a frame BufferHandle to a frame BufferHandle target Same function as glBindFramebuffer. + /// + /// + /// The frame BufferHandle target of the binding operation. + /// + /// + /// The handle of the frame BufferHandle object to bind. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindFrameBuffer( + FrameBufferTarget target, + GlHandle handle + ) + { + _context->glBindFramebuffer((uint)target, handle.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindRenderBuffer( + GlHandle handle + ) + { + _context->glBindRenderbuffer(glConst.RENDERBUFFER, handle.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindVertexArray( + GlHandle handle + ) + { + _context->glBindVertexArray(handle.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public FrameBufferStatus CheckFrameBufferStatus( + FrameBufferTarget target + ) + { + return (FrameBufferStatus)_context->glCheckFramebufferStatus((uint)target); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Clear( + MaskBufferBit mask + ) + { + _context->glClear((uint)mask); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearError() + { + uint code = 0; + for (int i = 0; i < 1024; i++) + { + code = _context->glGetError(); + if (code == 0) { + return; + } + + // Console.WriteLine(code); + } + foreach (ProcessThread thread in Process.GetCurrentProcess().Threads) { + Debugger.Break(); + } + throw new GlErrorOverflowException(1024, code); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void ClearGraphicError() + { + while (_context->glGetError() != 0) { } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CombineFrameBufferRenderBuffer( + FrameBufferAttachment attachment, + GlHandle rboHandle + ) + { + _context->glFramebufferRenderbuffer(glConst.FRAMEBUFFER, (uint)attachment, + glConst.RENDERBUFFER, rboHandle.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe GlHandle CreateGraphicProgram() + { + return GlHandle.Create(_context->glCreateProgram()); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe GlHandle[] CreateProgram( + int count + ) + { + GlHandle[] h = new GlHandle[count]; + for (int i = 0; i < count; i++) { + h.SetValue(i, _context->glCreateProgram()); + } + return h; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public GlHandle[] CreateShaderSet( + int count, + ShaderType type + ) + { + GlHandle[] ret = new GlHandle[count]; + uint t = (uint)type; + for (int i = 0; i < count; i++) + { + uint id = _context->glCreateShader(t); + if (id == 0) + { + uint error = _context->glGetError(); + throw new InvalidOperationException($"Failed in creating shader: {error}"); + } + ret[i] = GlHandle.Create(id); + } + return ret; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void DeleteBuffer( + GlHandle handle + ) + { + _context->glDeleteBuffers(1, (uint*)&handle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void DeleteBuffers( + GlHandle[] handle + ) + { + if ((handle == null) || (handle.Length == 0)) { + throw new ArgumentNullException(nameof(handle)); + } + fixed (GlHandle* hptr = handle) + { + uint* iptr = (uint*)hptr; + for (int i = 0; i < handle.Length; i++) { + _context->glDeleteBuffers(1, iptr + i); + } + } + } + + /// + /// Delete a render BufferHandle object Very simlilar function as glDeleteRenderbuffers. The only + /// deifference is that this mehtod can only delete one renderbuffer at the same time. + /// + /// + /// Handle to BufferHandle to delete. + /// + public unsafe void DeleteRenderBuffer( + GlHandle bufferHandle + ) + { + _context->glDeleteRenderbuffers(1, &bufferHandle.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void DeleteVertexArrays( + GlHandle[] arrays + ) + { + fixed (GlHandle* hptr = arrays) + { + uint* iptr = (uint*)hptr; + for (int i = 0; i < arrays.Length; i++) { + _context->glDeleteVertexArrays(1, iptr + i); + } + } + } + + public void DepthMaskAccess( + bool isWrite + ) + { + _context->glDepthMask(isWrite ? (byte)1 : (byte)0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Disable( + glOperation operation + ) + { + _context->glDisable((uint)operation); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void DrawArrays( + GeometryType mode, + int first, + int count + ) + { + _context->glDrawArrays((uint)mode, first, count); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void DrawElements( + GeometryType mode, + int count, + TypeCode type, + IntPtr ptr + ) + { + uint a; + a = type switch + { + TypeCode.UInt32 => glConst.UNSIGNED_INT, + TypeCode.UInt16 => glConst.UNSIGNED_SHORT, + TypeCode.Byte => glConst.UNSIGNED_BYTE, + _ => throw new ArgumentException( + $"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}") + }; + _context->glDrawElements((uint)mode, count, a, (nint*)ptr); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawElementsInstanced( + GeometryType mode, + int count, + TypeCode type, + IntPtr ptr, + int amount + ) + { + uint a; + a = type switch + { + TypeCode.UInt32 => glConst.UNSIGNED_INT, + TypeCode.UInt16 => glConst.UNSIGNED_SHORT, + TypeCode.Byte => glConst.UNSIGNED_BYTE, + _ => throw new ArgumentException( + $"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}") + }; + _context->glDrawElementsInstanced((uint)mode, count, a, (nint*)ptr, amount); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Enable( + glOperation operation + ) + { + _context->glEnable((uint)operation); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FrameBufferTexture2d( + FrameBufferTarget target, + uint attachment, + Texture2DTarget texTarget, + GlHandle textureHandle, + int level + ) + { + _context->glFramebufferTexture2D((uint)target, attachment, (uint)texTarget, + textureHandle.Value, level); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe GlHandle[] GenBuffers( + int count + ) + { + GlHandle[] h = new GlHandle[count]; + fixed (GlHandle* hptr = h) + { + for (int i = 0; i < count; i++) { + _context->glGenBuffers(count, ((uint*)hptr) + i); + } + } + return h; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe GlHandle[] GenRenderBuffer( + int count + ) + { + GlHandle[] h = new GlHandle[count]; + fixed (GlHandle* hptr = h) { + _context->glGenRenderbuffers(count, (uint*)hptr); + } + return h; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe GlHandle[] GenTextures( + int count + ) + { + GlHandle[] h = new GlHandle[count]; + fixed (GlHandle* hptr = h) { + _context->glGenTextures(count, (uint*)hptr); + } + return h; + } + + public unsafe GlHandle[] GenVertexArrays( + int count + ) + { + GlHandle[] h = new GlHandle[count]; + fixed (GlHandle* hptr = h) { + _context->glGenVertexArrays(count, (uint*)hptr); + } + return h; + } + + public unsafe int GetMaskInteger( + uint statusCode + ) + { + int ret = 0; + _context->glGetIntegerv(statusCode, &ret); + return ret; + } + + public string GetShaderStatus( + Shader s, + int index, + int key + ) + { + IntPtr sptr = IntPtr.Zero; + if (GraphicFramework.glCheckShaderStatus(ref Context, s.handle[index].Value, key, + ref sptr) == 0) { + return Marshal.PtrToStringAnsi(sptr); + } + return string.Empty; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void GetTextureImage( + Texture2DTarget target, + int level, + ImageChannel channel, + PixelChannelLayout channelLayout, + T[] dataStream + ) where T : unmanaged,INumber + { + fixed (T* tptr = dataStream) { + _context->glGetTexImage((uint)target, level, (uint)channel, (uint)channelLayout, + (nint*)tptr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTextureLevelProperty( + uint textureTypeMask, + int level, + uint propertyMask, + out int propertyValue + ) + { + fixed (int* iptr = &propertyValue) { + _context->glGetTexLevelParameteriv(textureTypeMask, level, propertyMask, iptr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe GlHandle GetUniformLocation( + GlHandle program, + string name + ) + { + byte[] code = Encoding.UTF8.GetBytes(name); + fixed (byte* ptr = code) + { + int ret = _context->glGetUniformLocation(program.Value, ptr); + #if DEBUG + if ((ret == glConst.INVALID_OPERATION) || (ret == glConst.INVALID_VALUE)) + { + throw new InvalidOperationException(); + } + if (ret == -1) { + throw new UniformEmptyReferenceException(nameof(program), name); + } + #endif + return GlHandle.CreateSigned(ret); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void LoadShaderSource( + GlHandle shaderHandle, + byte[] codeStream + ) + { + fixed (byte* streamPtr = codeStream) { + _context->glShaderSource(shaderHandle.Value, 1, &streamPtr, (int*)0); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void LoadShaderSource( + GlHandle shaderHandle, + ReadOnlySpan codeStream + ) + { + fixed (char* streamPtr = codeStream) { + _context->glShaderSource(shaderHandle.Value, 1, (byte**)&streamPtr, (int*)0); + } + } + + public unsafe void LoadShaderSource( + GlHandle shaderHandle, + ReadOnlySpan codeStream + ) + { + fixed (byte* streamPtr = codeStream) + { + byte* bptr = streamPtr; + _context->glShaderSource(shaderHandle.Value, 1, &bptr, (int*)0); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PolygonMode( + FaceMode mode + ) + { + _context->glPolygonMode(glConst.FRONT_AND_BACK, (uint)mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ReadPixels( + (int X, int Y) beginPosition, + (int width, int height) size, + FrameBufferChannel format, + PixelChannelLayout dataType, + ref byte[] stream + ) + { + fixed (byte* bptr = stream) { + _context->glReadPixels(beginPosition.X, beginPosition.Y, size.width, size.height, + (uint)format, (uint)dataType, (nint*)bptr); + } + } + + public void RereadImage( + in Image i, + (int X, int Y) beginPosition, + FrameBufferChannel format, + PixelChannelLayout dataType + ) + { + byte[] pixels = i.PixelBuffer; + if (!pixels.CheckArrayFormat(dataType)) { + throw new GlArrayFormatException(dataType, "i.PixelArray"); + } + fixed (byte* bptr = pixels) { + _context->glReadPixels(beginPosition.X, beginPosition.Y, i.Width, i.Height, + (uint)format, (uint)dataType, (nint*)bptr); + } + i.PixelUpdateCount++; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetBufferData( + BufferType bufferType, + T bufferData, + BufferUsage usage + ) where T : unmanaged,INumber + { + int size = Marshal.SizeOf(); + + T* p = &bufferData; + + _context->glBufferData((uint)bufferType, (nuint)size, (nint*)p, (uint)usage); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetBufferData( + BufferType bufferType, + T[] bufferArray, + BufferUsage usage + ) where T : unmanaged,INumber + { + int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); + if (bufferArray == null) { + return; + } + + fixed (void* bufferPtr = bufferArray) { + _context->glBufferData((uint)bufferType, (nuint)size, (nint*)bufferPtr, + (uint)usage); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetBufferData( + BufferType bufferType, + ReadOnlySpan bufferSpan, + BufferUsage usage + ) where T : unmanaged,INumber + { + int size = bufferSpan.Length * Marshal.SizeOf(); + if (bufferSpan.IsEmpty) { + return; + } + + fixed (void* bufferPtr = bufferSpan) { + _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, + (uint)usage); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetBufferData( + BufferType bufferType, + Span bufferArray, + BufferUsage usage + ) where T : unmanaged, INumber + { + int size = bufferArray.Length * Marshal.SizeOf(); + if (bufferArray.IsEmpty) { + return; + } + + + fixed (void* bufferPtr = bufferArray) { + _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, + (uint)usage); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetBufferVectorData( + BufferType bufferType, + ReadOnlySpan bufferSpan, + BufferUsage usage + ) where T : unmanaged, IUnmanagedVector + { + int size = bufferSpan.Length * Marshal.SizeOf(); + + fixed (void* bufferPtr = bufferSpan) { + _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, + (uint)usage); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetBufferVectorData( + BufferType bufferType, + T[] bufferArray, + BufferUsage usage + ) where T : unmanaged, IUnmanagedVector + { + int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); + if (bufferArray == null) { + return; + } + fixed (void* bufferPtr = bufferArray) { + _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, + (uint)usage); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetRenderBufferStorage( + RenderBufferInternalFormat internalFormat, + (int width, int height) size + ) + { + _context->glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, size.width, + size.height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetRenderBufferStorage( + RenderBufferInternalFormat internalFormat, + (uint width, uint height) size + ) + { + _context->glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, + (int)size.width, (int)size.height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetVertexAttribute( + uint index, + int size, + TypeCode t, + bool normalized, + int stride, + int pointer + ) + { + uint type = GraphicFramework.GLtype[(int)t]; + _context->glVertexAttribPointer(index, size, type, (byte)(normalized ? 1 : 0), stride, + (nint*)pointer); + _context->glEnableVertexAttribArray(index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureImage2d( + Texture2DTarget target, + int level, + ImageChannel sourceChannel, + int width, + int height, + ImageChannel targetChannel, + PixelChannelLayout type, + T[] pixels + ) where T : unmanaged, INumber + { + fixed (T* tptr = pixels) + { + T* ptr = ((pixels == null) || (pixels.Length == 0)) ? (T*)IntPtr.Zero : tptr; + _context->glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, + (uint)targetChannel, (uint)type, (nint*)tptr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureImage2d( + Texture2DTarget target, + int level, + ImageChannel sourceChannel, + int width, + int height, + ImageChannel targetChannel, + PixelChannelLayout type, + Span pixelSpan + ) where T : unmanaged, INumber + { + fixed (T* tPtr = pixelSpan) { + _context->glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, + (uint)targetChannel, (uint)type, (nint*)tPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureParameter( + int target, + uint pname, + int param + ) + { + _context->glTexParameteri((uint)target, pname, param); + } + + public static bool TryGetFunctionPackage( + IntPtr handle, + out OpenGLFunction functionPackage + ) + { + return contextToGLMap.TryGetValue(handle, out functionPackage); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttributeDivisor( + uint layoutIndex, + uint divisor + ) + { + _context->glVertexAttribDivisor(layoutIndex, divisor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void WaitAccomplishment() + { + _context->glFinish(); + } + + 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/StgSharp.Common/Graphics/OpenGL/glFunction.v3_3.cs b/StgsSharp.Graphics/OpenGL/glFunction.v3_3.cs similarity index 96% rename from StgSharp.Common/Graphics/OpenGL/glFunction.v3_3.cs rename to StgsSharp.Graphics/OpenGL/glFunction.v3_3.cs index f976b399..f20162dd 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v3_3.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.v3_3.cs @@ -1,3789 +1,3789 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFunction.v3_3" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ActiveTexture( - uint texture - ) - { - _context->glActiveTexture(texture); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void AttachShader( - GlHandle program, - GlHandle shader - ) - { - _context->glAttachShader(program.Value, shader.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BeginConditionalRender( - uint id, - uint mode - ) - { - _context->glBeginConditionalRender(id, mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BeginQuery( - uint target, - uint id - ) - { - _context->glBeginQuery(target, id); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BeginTransformFeedback( - uint primitiveMode - ) - { - _context->glBeginTransformFeedback(primitiveMode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindAttribLocation( - GlHandle program, - uint index, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - _context->glBindAttribLocation(program.Value, index, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBuffer( - uint target, - GlHandle buffer - ) - { - _context->glBindBuffer(target, buffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBufferBase( - uint target, - uint index, - GlHandle buffer - ) - { - _context->glBindBufferBase(target, index, buffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBufferRange( - uint target, - uint index, - GlHandle buffer, - nint offset, - nuint size - ) - { - _context->glBindBufferRange(target, index, buffer.Value, offset, size); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindFragDataLocation( - GlHandle program, - uint color, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - _context->glBindFragDataLocation(program.Value, color, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindFragDataLocationIndexed( - GlHandle program, - uint colorNumber, - uint index, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - _context->glBindFragDataLocationIndexed(program.Value, colorNumber, index, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindFramebuffer( - uint target, - GlHandle framebuffer - ) - { - _context->glBindFramebuffer(target, framebuffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindRenderbuffer( - uint target, - GlHandle renderbuffer - ) - { - _context->glBindRenderbuffer(target, renderbuffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindSampler( - uint unit, - GlHandle sampler - ) - { - _context->glBindSampler(unit, sampler.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindTexture( - uint target, - GlHandle texture - ) - { - _context->glBindTexture(target, texture.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindVertexArray( - uint array - ) - { - _context->glBindVertexArray(array); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendColor( - float red, - float green, - float blue, - float alpha - ) - { - _context->glBlendColor(red, green, blue, alpha); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendEquation( - uint mode - ) - { - _context->glBlendEquation(mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendEquationSeparate( - uint modeRGB, - uint modeAlpha - ) - { - _context->glBlendEquationSeparate(modeRGB, modeAlpha); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendFunc( - uint sfactor, - uint dfactor - ) - { - _context->glBlendFunc(sfactor, dfactor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendFuncSeparate( - uint sfactorRGB, - uint dfactorRGB, - uint sfactorAlpha, - uint dfactorAlpha - ) - { - _context->glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); - } - - [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 - ) - { - _context->glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, - filter); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BufferData( - uint target, - nuint size, - ReadOnlySpan data, - uint usage - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glBufferData(target, size, dataPtr, usage); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BufferSubData( - uint target, - nint offset, - nuint size, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glBufferSubData(target, offset, size, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint CheckFramebufferStatus( - uint target - ) - { - return _context->glCheckFramebufferStatus(target); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClampColor( - uint target, - uint clamp - ) - { - _context->glClampColor(target, clamp); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Clear( - uint mask - ) - { - _context->glClear(mask); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBufferfi( - uint buffer, - int drawbuffer, - float depth, - int stencil - ) - { - _context->glClearBufferfi(buffer, drawbuffer, depth, stencil); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBufferfv( - uint buffer, - int drawbuffer, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glClearBufferfv(buffer, drawbuffer, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBufferiv( - uint buffer, - int drawbuffer, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glClearBufferiv(buffer, drawbuffer, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBufferuiv( - uint buffer, - int drawbuffer, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glClearBufferuiv(buffer, drawbuffer, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearColor( - float red, - float green, - float blue, - float alpha - ) - { - _context->glClearColor(red, green, blue, alpha); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearDepth( - double depth - ) - { - _context->glClearDepth(depth); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearStencil( - int s - ) - { - _context->glClearStencil(s); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint ClientWaitSync( - glSync sync, - uint flags, - IntPtr timeout - ) - { - return _context->glClientWaitSync(sync, flags, timeout); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ColorMask( - byte red, - byte green, - byte blue, - byte alpha - ) - { - _context->glColorMask(red, green, blue, alpha); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ColorMaski( - uint index, - byte r, - byte g, - byte b, - byte a - ) - { - _context->glColorMaski(index, r, g, b, a); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompileShader( - GlHandle shader - ) - { - _context->glCompileShader(shader.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexImage1D( - uint target, - int level, - uint internalformat, - int width, - int border, - int imageSize, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glCompressedTexImage1D(target, level, internalformat, width, border, - imageSize, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexImage2D( - uint target, - int level, - uint internalformat, - int width, - int height, - int border, - int imageSize, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glCompressedTexImage2D(target, level, internalformat, width, height, border, - imageSize, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexImage3D( - uint target, - int level, - uint internalformat, - int width, - int height, - int depth, - int border, - int imageSize, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glCompressedTexImage3D(target, level, internalformat, width, height, depth, - border, imageSize, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexSubImage1D( - uint target, - int level, - int xoffset, - int width, - uint format, - int imageSize, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, - dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTexSubImage2D( - uint target, - int level, - int xoffset, - int yoffset, - int width, - int height, - uint format, - int imageSize, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, - format, imageSize, dataPtr); - } - } - - [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, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, - height, depth, format, imageSize, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyBufferSubData( - uint readTarget, - uint writeTarget, - nint readOffset, - nint writeOffset, - nuint size - ) - { - _context->glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexImage1D( - uint target, - int level, - uint internalformat, - int x, - int y, - int width, - int border - ) - { - _context->glCopyTexImage1D(target, level, internalformat, x, y, width, border); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexImage2D( - uint target, - int level, - uint internalformat, - int x, - int y, - int width, - int height, - int border - ) - { - _context->glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexSubImage1D( - uint target, - int level, - int xoffset, - int x, - int y, - int width - ) - { - _context->glCopyTexSubImage1D(target, level, xoffset, x, y, width); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexSubImage2D( - uint 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); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTexSubImage3D( - uint 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); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public GlHandle CreateProgram() - { - return GlHandle.Create(_context->glCreateProgram()); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint CreateShader( - ShaderType type - ) - { - return _context->glCreateShader((uint)type); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CullFace( - uint mode - ) - { - _context->glCullFace(mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteBuffers( - int n, - ReadOnlySpan buffers - ) - { - fixed (uint* buffersPtr = buffers) { - _context->glDeleteBuffers(n, buffersPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteFramebuffers( - int n, - ReadOnlySpan framebuffers - ) - { - fixed (uint* framebuffersPtr = framebuffers) { - _context->glDeleteFramebuffers(n, framebuffersPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteProgram( - GlHandle program - ) - { - _context->glDeleteProgram(program.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteQueries( - int n, - ReadOnlySpan ids - ) - { - fixed (uint* idsPtr = ids) { - _context->glDeleteQueries(n, idsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteRenderbuffers( - int n, - ReadOnlySpan renderbuffers - ) - { - fixed (uint* renderbuffersPtr = renderbuffers) { - _context->glDeleteRenderbuffers(n, renderbuffersPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteSamplers( - int count, - ReadOnlySpan samplers - ) - { - fixed (uint* samplersPtr = samplers) { - _context->glDeleteSamplers(count, samplersPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteShader( - GlHandle shader - ) - { - _context->glDeleteShader(shader.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteSync( - glSync sync - ) - { - _context->glDeleteSync(sync); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteTextures( - int n, - ReadOnlySpan textures - ) - { - fixed (uint* texturesPtr = textures) { - _context->glDeleteTextures(n, texturesPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteVertexArrays( - int n, - ReadOnlySpan arrays - ) - { - fixed (uint* arraysPtr = arrays) { - _context->glDeleteVertexArrays(n, arraysPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DepthFunc( - uint func - ) - { - _context->glDepthFunc(func); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DepthMask( - byte flag - ) - { - _context->glDepthMask(flag); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DepthRange( - double n, - double f - ) - { - _context->glDepthRange(n, f); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DetachShader( - GlHandle program, - GlHandle shader - ) - { - _context->glDetachShader(program.Value, shader.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Disable( - uint cap - ) - { - _context->glDisable(cap); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Disablei( - uint target, - uint index - ) - { - _context->glDisablei(target, index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DisableVertexAttribArray( - uint index - ) - { - _context->glDisableVertexAttribArray(index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawArrays( - uint mode, - int first, - int count - ) - { - _context->glDrawArrays(mode, first, count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawArraysInstanced( - uint mode, - int first, - int count, - int instancecount - ) - { - _context->glDrawArraysInstanced(mode, first, count, instancecount); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawBuffer( - uint buf - ) - { - _context->glDrawBuffer(buf); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawBuffers( - int n, - ReadOnlySpan bufs - ) - { - fixed (uint* bufsPtr = bufs) { - _context->glDrawBuffers(n, bufsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElements( - uint mode, - int count, - ShaderType type, - ReadOnlySpan indices - ) - { - fixed (IntPtr* indicesPtr = indices) { - _context->glDrawElements(mode, count, (uint)type, indicesPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsBaseVertex( - uint mode, - int count, - ShaderType type, - ReadOnlySpan indices, - int basevertex - ) - { - fixed (IntPtr* indicesPtr = indices) { - _context->glDrawElementsBaseVertex(mode, count, (uint)type, indicesPtr, basevertex); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsInstanced( - uint mode, - int count, - ShaderType type, - ReadOnlySpan indices, - int instancecount - ) - { - fixed (IntPtr* indicesPtr = indices) { - _context->glDrawElementsInstanced(mode, count, (uint)type, indicesPtr, instancecount); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsInstancedBaseVertex( - uint mode, - int count, - ShaderType type, - ReadOnlySpan indices, - int instancecount, - int basevertex - ) - { - fixed (IntPtr* indicesPtr = indices) { - _context->glDrawElementsInstancedBaseVertex(mode, count, (uint)type, indicesPtr, - instancecount, basevertex); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawRangeElements( - uint mode, - uint start, - uint end, - int count, - ShaderType type, - ReadOnlySpan indices - ) - { - fixed (IntPtr* indicesPtr = indices) { - _context->glDrawRangeElements(mode, start, end, count, (uint)type, indicesPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawRangeElementsBaseVertex( - uint mode, - uint start, - uint end, - int count, - ShaderType type, - ReadOnlySpan indices, - int basevertex - ) - { - fixed (IntPtr* indicesPtr = indices) { - _context->glDrawRangeElementsBaseVertex(mode, start, end, count, (uint)type, - indicesPtr, basevertex); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enable( - uint cap - ) - { - _context->glEnable(cap); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enablei( - uint target, - uint index - ) - { - _context->glEnablei(target, index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void EnableVertexAttribArray( - uint index - ) - { - _context->glEnableVertexAttribArray(index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void EndConditionalRender() - { - _context->glEndConditionalRender(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void EndQuery( - uint target - ) - { - _context->glEndQuery(target); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void EndTransformFeedback() - { - _context->glEndTransformFeedback(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public glSync FenceSync( - uint condition, - uint flags - ) - { - return _context->glFenceSync(condition, flags); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Finish() - { - _context->glFinish(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Flush() - { - _context->glFlush(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FlushMappedBufferRange( - uint target, - nint offset, - nuint length - ) - { - _context->glFlushMappedBufferRange(target, offset, length); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FramebufferRenderbuffer( - uint target, - uint attachment, - uint renderbuffertarget, - GlHandle renderbuffer - ) - { - _context->glFramebufferRenderbuffer(target, attachment, renderbuffertarget, - renderbuffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FramebufferTexture( - uint target, - uint attachment, - GlHandle texture, - int level - ) - { - _context->glFramebufferTexture(target, attachment, texture.Value, level); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FramebufferTexture1D( - uint target, - uint attachment, - uint textarget, - GlHandle texture, - int level - ) - { - _context->glFramebufferTexture1D(target, attachment, textarget, texture.Value, level); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FramebufferTexture2D( - uint target, - uint attachment, - uint textarget, - GlHandle texture, - int level - ) - { - _context->glFramebufferTexture2D(target, attachment, textarget, texture.Value, level); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FramebufferTexture3D( - uint target, - uint attachment, - uint textarget, - GlHandle texture, - int level, - int zoffset - ) - { - _context->glFramebufferTexture3D(target, attachment, textarget, texture.Value, level, - zoffset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FramebufferTextureLayer( - uint target, - uint attachment, - GlHandle texture, - int level, - int layer - ) - { - _context->glFramebufferTextureLayer(target, attachment, texture.Value, level, layer); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FrontFace( - uint mode - ) - { - _context->glFrontFace(mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenBuffers( - int n, - uint* buffers - ) - { - _context->glGenBuffers(n, buffers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenerateMipmap( - Texture2DTarget target - ) - { - _context->glGenerateMipmap((uint)target); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenFrameBuffers( - Span frameBuffers - ) - { - fixed (GlHandle* hPtr = frameBuffers) { - _context->glGenFramebuffers(frameBuffers.Length, (uint*)hPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenQueries( - int n, - uint* ids - ) - { - _context->glGenQueries(n, ids); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenRenderbuffers( - int n, - uint* renderbuffers - ) - { - _context->glGenRenderbuffers(n, renderbuffers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenSamplers( - int count, - uint* samplers - ) - { - _context->glGenSamplers(count, samplers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenTextures( - int n, - uint* textures - ) - { - _context->glGenTextures(n, textures); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenVertexArrays( - int n, - uint* arrays - ) - { - _context->glGenVertexArrays(n, arrays); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveAttrib( - GlHandle program, - uint index, - int bufSize, - int* length, - int* size, - uint* type, - byte* name - ) - { - _context->glGetActiveAttrib(program.Value, index, bufSize, length, size, type, name); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveUniform( - GlHandle program, - uint index, - int bufSize, - int* length, - int* size, - uint* type, - byte* name - ) - { - _context->glGetActiveUniform(program.Value, index, bufSize, length, size, type, name); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveUniformBlockiv( - GlHandle program, - uint uniformBlockIndex, - uint pname, - int* @params - ) - { - _context->glGetActiveUniformBlockiv(program.Value, uniformBlockIndex, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveUniformBlockName( - GlHandle program, - uint uniformBlockIndex, - int bufSize, - int* length, - byte* uniformBlockName - ) - { - _context->glGetActiveUniformBlockName(program.Value, uniformBlockIndex, bufSize, length, - uniformBlockName); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveUniformName( - GlHandle program, - uint uniformIndex, - int bufSize, - int* length, - byte* uniformName - ) - { - _context->glGetActiveUniformName(program.Value, uniformIndex, bufSize, length, - uniformName); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveUniformsiv( - GlHandle program, - int uniformCount, - ReadOnlySpan uniformIndices, - uint pname, - int* @params - ) - { - fixed (uint* uniformIndicesPtr = uniformIndices) { - _context->glGetActiveUniformsiv(program.Value, uniformCount, uniformIndicesPtr, pname, - @params); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetAttachedShaders( - GlHandle program, - int maxCount, - int* count, - uint* shaders - ) - { - _context->glGetAttachedShaders(program.Value, maxCount, count, shaders); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int GetAttribLocation( - GlHandle program, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - return _context->glGetAttribLocation(program.Value, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBooleani_v( - uint target, - uint index, - byte* data - ) - { - _context->glGetBooleani_v(target, index, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBooleanv( - uint pname, - byte* data - ) - { - _context->glGetBooleanv(pname, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBufferParameteri64v( - uint target, - uint pname, - IntPtr* @params - ) - { - _context->glGetBufferParameteri64v(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBufferParameteriv( - uint target, - uint pname, - int* @params - ) - { - _context->glGetBufferParameteriv(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBufferPointerv( - uint target, - uint pname, - IntPtr* @params - ) - { - _context->glGetBufferPointerv(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetBufferSubData( - uint target, - nint offset, - nuint size, - IntPtr* data - ) - { - _context->glGetBufferSubData(target, offset, size, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetCompressedTexImage( - uint target, - int level, - IntPtr* img - ) - { - _context->glGetCompressedTexImage(target, level, img); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetDoublev( - uint pname, - double* data - ) - { - _context->glGetDoublev(pname, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint GetError() - { - return _context->glGetError(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetFloatv( - uint pname, - float* data - ) - { - _context->glGetFloatv(pname, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int GetFragDataIndex( - GlHandle program, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - return _context->glGetFragDataIndex(program.Value, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int GetFragDataLocation( - GlHandle program, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - return _context->glGetFragDataLocation(program.Value, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetFramebufferAttachmentParameteriv( - uint target, - uint attachment, - uint pname, - int* @params - ) - { - _context->glGetFramebufferAttachmentParameteriv(target, attachment, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetInteger64i_v( - uint target, - uint index, - IntPtr* data - ) - { - _context->glGetInteger64i_v(target, index, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetInteger64v( - uint pname, - IntPtr* data - ) - { - _context->glGetInteger64v(pname, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetIntegeri_v( - uint target, - uint index, - int* data - ) - { - _context->glGetIntegeri_v(target, index, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetIntegerv( - uint pname, - int* data - ) - { - _context->glGetIntegerv(pname, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetMultisamplefv( - uint pname, - uint index, - float* val - ) - { - _context->glGetMultisamplefv(pname, index, val); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramInfoLog( - GlHandle program, - int bufSize, - int* length, - byte* infoLog - ) - { - _context->glGetProgramInfoLog(program.Value, bufSize, length, infoLog); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramiv( - GlHandle program, - uint pname, - int* @params - ) - { - _context->glGetProgramiv(program.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryiv( - uint target, - uint pname, - int* @params - ) - { - _context->glGetQueryiv(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryObjecti64v( - uint id, - uint pname, - IntPtr* @params - ) - { - _context->glGetQueryObjecti64v(id, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryObjectiv( - uint id, - uint pname, - int* @params - ) - { - _context->glGetQueryObjectiv(id, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryObjectui64v( - uint id, - uint pname, - IntPtr* @params - ) - { - _context->glGetQueryObjectui64v(id, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryObjectuiv( - uint id, - uint pname, - uint* @params - ) - { - _context->glGetQueryObjectuiv(id, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetRenderbufferParameteriv( - uint target, - uint pname, - int* @params - ) - { - _context->glGetRenderbufferParameteriv(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSamplerParameterfv( - GlHandle sampler, - uint pname, - float* @params - ) - { - _context->glGetSamplerParameterfv(sampler.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSamplerParameterIiv( - GlHandle sampler, - uint pname, - int* @params - ) - { - _context->glGetSamplerParameterIiv(sampler.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSamplerParameterIuiv( - GlHandle sampler, - uint pname, - uint* @params - ) - { - _context->glGetSamplerParameterIuiv(sampler.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSamplerParameteriv( - GlHandle sampler, - uint pname, - int* @params - ) - { - _context->glGetSamplerParameteriv(sampler.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetShaderInfoLog( - GlHandle shader, - int bufSize, - int* length, - byte* infoLog - ) - { - _context->glGetShaderInfoLog(shader.Value, bufSize, length, infoLog); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetShaderiv( - GlHandle shader, - uint pname, - int* @params - ) - { - _context->glGetShaderiv(shader.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetShaderSource( - GlHandle shader, - int bufSize, - int* length, - byte* source - ) - { - _context->glGetShaderSource(shader.Value, bufSize, length, source); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public string GetString( - uint name - ) - { - return Marshal.PtrToStringAuto((nint)_context->glGetString(name)) ?? string.Empty; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public string GetStringi( - uint name, - uint index - ) - { - return Marshal.PtrToStringAuto((nint)_context->glGetStringi(name, index)) ?? string.Empty; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetSynciv( - glSync sync, - uint pname, - int count, - int* length, - int* values - ) - { - _context->glGetSynciv(sync, pname, count, length, values); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTexImage( - uint target, - int level, - uint format, - ShaderType type, - IntPtr* pixels - ) - { - _context->glGetTexImage(target, level, format, (uint)type, pixels); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTexLevelParameterfv( - uint target, - int level, - uint pname, - float* @params - ) - { - _context->glGetTexLevelParameterfv(target, level, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTexLevelParameteriv( - uint target, - int level, - uint pname, - int* @params - ) - { - _context->glGetTexLevelParameteriv(target, level, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTexParameterfv( - uint target, - uint pname, - float* @params - ) - { - _context->glGetTexParameterfv(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTexParameterIiv( - uint target, - uint pname, - int* @params - ) - { - _context->glGetTexParameterIiv(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTexParameterIuiv( - uint target, - uint pname, - uint* @params - ) - { - _context->glGetTexParameterIuiv(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTexParameteriv( - uint target, - uint pname, - int* @params - ) - { - _context->glGetTexParameteriv(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTransformFeedbackVarying( - GlHandle program, - uint index, - int bufSize, - int* length, - int* size, - uint* type, - byte* name - ) - { - _context->glGetTransformFeedbackVarying(program.Value, index, bufSize, length, size, type, - name); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint GetUniformBlockIndex( - GlHandle program, - ReadOnlySpan uniformBlockName - ) - { - fixed (byte* uniformBlockNamePtr = uniformBlockName) { - return _context->glGetUniformBlockIndex(program.Value, uniformBlockNamePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetUniformfv( - GlHandle program, - int location, - float* @params - ) - { - _context->glGetUniformfv(program.Value, location, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetUniformIndices( - GlHandle program, - int uniformCount, - ReadOnlySpan uniformNames, - uint* uniformIndices - ) - { - fixed (byte* uniformNamesPtr = uniformNames) { - _context->glGetUniformIndices(program.Value, uniformCount, uniformNamesPtr, - uniformIndices); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetUniformiv( - GlHandle program, - int location, - int* @params - ) - { - _context->glGetUniformiv(program.Value, location, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int GetUniformLocation( - GlHandle program, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - return _context->glGetUniformLocation(program.Value, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetUniformuiv( - GlHandle program, - int location, - uint* @params - ) - { - _context->glGetUniformuiv(program.Value, location, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribdv( - uint index, - uint pname, - double* @params - ) - { - _context->glGetVertexAttribdv(index, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribfv( - uint index, - uint pname, - float* @params - ) - { - _context->glGetVertexAttribfv(index, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribIiv( - uint index, - uint pname, - int* @params - ) - { - _context->glGetVertexAttribIiv(index, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribIuiv( - uint index, - uint pname, - uint* @params - ) - { - _context->glGetVertexAttribIuiv(index, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribiv( - uint index, - uint pname, - int* @params - ) - { - _context->glGetVertexAttribiv(index, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribPointerv( - uint index, - uint pname, - IntPtr* pointer - ) - { - _context->glGetVertexAttribPointerv(index, pname, pointer); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Hint( - uint target, - uint mode - ) - { - _context->glHint(target, mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsBuffer( - GlHandle buffer - ) - { - return _context->glIsBuffer(buffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsEnabled( - uint cap - ) - { - return _context->glIsEnabled(cap); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsEnabledi( - uint target, - uint index - ) - { - return _context->glIsEnabledi(target, index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsFramebuffer( - GlHandle framebuffer - ) - { - return _context->glIsFramebuffer(framebuffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsProgram( - GlHandle program - ) - { - return _context->glIsProgram(program.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsQuery( - uint id - ) - { - return _context->glIsQuery(id); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsRenderbuffer( - GlHandle renderbuffer - ) - { - return _context->glIsRenderbuffer(renderbuffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsSampler( - GlHandle sampler - ) - { - return _context->glIsSampler(sampler.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsShader( - GlHandle shader - ) - { - return _context->glIsShader(shader.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsSync( - glSync sync - ) - { - return _context->glIsSync(sync); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsTexture( - GlHandle texture - ) - { - return _context->glIsTexture(texture.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsVertexArray( - uint array - ) - { - return _context->glIsVertexArray(array); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void LineWidth( - float width - ) - { - _context->glLineWidth(width); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void LinkProgram( - GlHandle program - ) - { - _context->glLinkProgram(program.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void LogicOp( - uint opcode - ) - { - _context->glLogicOp(opcode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MapBuffer( - uint target, - uint access - ) - { - _context->glMapBuffer(target, access); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MapBufferRange( - uint target, - nint offset, - nuint length, - uint access - ) - { - _context->glMapBufferRange(target, offset, length, access); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawArrays( - uint mode, - ReadOnlySpan first, - ReadOnlySpan count, - int drawcount - ) - { - fixed (int* firstPtr = first) - { - fixed (int* countPtr = count) { - _context->glMultiDrawArrays(mode, firstPtr, countPtr, drawcount); - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawElements( - uint mode, - ReadOnlySpan count, - ShaderType type, - ReadOnlySpan indices, - int drawcount - ) - { - fixed (int* countPtr = count) - { - fixed (IntPtr* indicesPtr = indices) { - _context->glMultiDrawElements(mode, countPtr, (uint)type, indicesPtr, drawcount); - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawElementsBaseVertex( - uint mode, - ReadOnlySpan count, - ShaderType type, - ReadOnlySpan indices, - int drawcount, - ReadOnlySpan basevertex - ) - { - fixed (int* countPtr = count) - { - fixed (IntPtr* indicesPtr = indices) - { - fixed (int* basevertexPtr = basevertex) { - _context->glMultiDrawElementsBaseVertex(mode, countPtr, (uint)type, - indicesPtr, drawcount, basevertexPtr); - } - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PixelStoref( - uint pname, - float param - ) - { - _context->glPixelStoref(pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PixelStorei( - uint pname, - int param - ) - { - _context->glPixelStorei(pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PointParameterf( - uint pname, - float param - ) - { - _context->glPointParameterf(pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PointParameterfv( - uint pname, - ReadOnlySpan @params - ) - { - fixed (float* @paramsPtr = @params) { - _context->glPointParameterfv(pname, @paramsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PointParameteri( - uint pname, - int param - ) - { - _context->glPointParameteri(pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PointParameteriv( - uint pname, - ReadOnlySpan @params - ) - { - fixed (int* @paramsPtr = @params) { - _context->glPointParameteriv(pname, @paramsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PointSize( - float size - ) - { - _context->glPointSize(size); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PolygonMode( - uint face, - uint mode - ) - { - _context->glPolygonMode(face, mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PolygonOffset( - float factor, - float units - ) - { - _context->glPolygonOffset(factor, units); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PrimitiveRestartIndex( - uint index - ) - { - _context->glPrimitiveRestartIndex(index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProvokingVertex( - uint mode - ) - { - _context->glProvokingVertex(mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void QueryCounter( - uint id, - uint target - ) - { - _context->glQueryCounter(id, target); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReadBuffer( - uint src - ) - { - _context->glReadBuffer(src); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReadPixels( - int x, - int y, - int width, - int height, - uint format, - ShaderType type, - IntPtr* pixels - ) - { - _context->glReadPixels(x, y, width, height, format, (uint)type, pixels); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void RenderbufferStorage( - uint target, - uint internalformat, - int width, - int height - ) - { - _context->glRenderbufferStorage(target, internalformat, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void RenderbufferStorageMultisample( - uint target, - int samples, - uint internalformat, - int width, - int height - ) - { - _context->glRenderbufferStorageMultisample(target, samples, internalformat, width, - height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SampleCoverage( - float value, - byte invert - ) - { - _context->glSampleCoverage(value, invert); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SampleMaski( - uint maskNumber, - uint mask - ) - { - _context->glSampleMaski(maskNumber, mask); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameterf( - GlHandle sampler, - uint pname, - float param - ) - { - _context->glSamplerParameterf(sampler.Value, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameterfv( - GlHandle sampler, - uint pname, - ReadOnlySpan param - ) - { - fixed (float* paramPtr = param) { - _context->glSamplerParameterfv(sampler.Value, pname, paramPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameteri( - GlHandle sampler, - uint pname, - int param - ) - { - _context->glSamplerParameteri(sampler.Value, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameterIiv( - GlHandle sampler, - uint pname, - ReadOnlySpan param - ) - { - fixed (int* paramPtr = param) { - _context->glSamplerParameterIiv(sampler.Value, pname, paramPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameterIuiv( - GlHandle sampler, - uint pname, - ReadOnlySpan param - ) - { - fixed (uint* paramPtr = param) { - _context->glSamplerParameterIuiv(sampler.Value, pname, paramPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SamplerParameteriv( - GlHandle sampler, - uint pname, - ReadOnlySpan param - ) - { - fixed (int* paramPtr = param) { - _context->glSamplerParameteriv(sampler.Value, pname, paramPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Scissor( - int x, - int y, - int width, - int height - ) - { - _context->glScissor(x, y, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ShaderSource( - GlHandle shader, - int count, - ReadOnlySpan @string, - ReadOnlySpan length - ) - { - fixed (byte* stringPtr = @string) - { - byte* sPtr = stringPtr; - fixed (int* lengthPtr = length) { - _context->glShaderSource(shader.Value, count, &sPtr, lengthPtr); - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilFunc( - uint func, - int @ref, - uint mask - ) - { - _context->glStencilFunc(func, @ref, mask); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilFuncSeparate( - uint face, - uint func, - int @ref, - uint mask - ) - { - _context->glStencilFuncSeparate(face, func, @ref, mask); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilMask( - uint mask - ) - { - _context->glStencilMask(mask); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilMaskSeparate( - uint face, - uint mask - ) - { - _context->glStencilMaskSeparate(face, mask); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilOp( - uint fail, - uint zfail, - uint zpass - ) - { - _context->glStencilOp(fail, zfail, zpass); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void StencilOpSeparate( - uint face, - uint sfail, - uint dpfail, - uint dppass - ) - { - _context->glStencilOpSeparate(face, sfail, dpfail, dppass); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexBuffer( - uint target, - uint internalformat, - GlHandle buffer - ) - { - _context->glTexBuffer(target, internalformat, buffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage1D( - uint target, - int level, - int internalformat, - int width, - int border, - uint format, - ShaderType type, - ReadOnlySpan pixels - ) - { - fixed (IntPtr* pixelsPtr = pixels) { - _context->glTexImage1D(target, level, internalformat, width, border, format, - (uint)type, pixelsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage2D( - uint target, - int level, - int internalformat, - int width, - int height, - int border, - uint format, - ShaderType type, - ReadOnlySpan pixels - ) - { - fixed (IntPtr* pixelsPtr = pixels) { - _context->glTexImage2D(target, level, internalformat, width, height, border, format, - (uint)type, pixelsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage2DMultisample( - uint target, - int samples, - uint internalformat, - int width, - int height, - byte fixedsamplelocations - ) - { - _context->glTexImage2DMultisample(target, samples, internalformat, width, height, - fixedsamplelocations); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage3D( - uint target, - int level, - int internalformat, - int width, - int height, - int depth, - int border, - uint format, - ShaderType type, - ReadOnlySpan pixels - ) - { - fixed (IntPtr* pixelsPtr = pixels) { - _context->glTexImage3D(target, level, internalformat, width, height, depth, border, - format, (uint)type, pixelsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexImage3DMultisample( - uint target, - int samples, - uint internalformat, - int width, - int height, - int depth, - byte fixedsamplelocations - ) - { - _context->glTexImage3DMultisample(target, samples, internalformat, width, height, depth, - fixedsamplelocations); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexParameterf( - uint target, - uint pname, - float param - ) - { - _context->glTexParameterf(target, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexParameterfv( - uint target, - uint pname, - ReadOnlySpan @params - ) - { - fixed (float* @paramsPtr = @params) { - _context->glTexParameterfv(target, pname, @paramsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexParameteri( - uint target, - uint pname, - int param - ) - { - _context->glTexParameteri(target, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexParameterIiv( - uint target, - uint pname, - ReadOnlySpan @params - ) - { - fixed (int* @paramsPtr = @params) { - _context->glTexParameterIiv(target, pname, @paramsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexParameterIuiv( - uint target, - uint pname, - ReadOnlySpan @params - ) - { - fixed (uint* @paramsPtr = @params) { - _context->glTexParameterIuiv(target, pname, @paramsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexParameteriv( - uint target, - uint pname, - ReadOnlySpan @params - ) - { - fixed (int* @paramsPtr = @params) { - _context->glTexParameteriv(target, pname, @paramsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexSubImage1D( - uint target, - int level, - int xoffset, - int width, - uint format, - ShaderType type, - ReadOnlySpan pixels - ) - { - fixed (IntPtr* pixelsPtr = pixels) { - _context->glTexSubImage1D(target, level, xoffset, width, format, (uint)type, - pixelsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexSubImage2D( - uint target, - int level, - int xoffset, - int yoffset, - int width, - int height, - uint format, - ShaderType type, - ReadOnlySpan pixels - ) - { - fixed (IntPtr* pixelsPtr = pixels) { - _context->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, - (uint)type, pixelsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexSubImage3D( - uint target, - int level, - int xoffset, - int yoffset, - int zoffset, - int width, - int height, - int depth, - uint format, - ShaderType type, - ReadOnlySpan pixels - ) - { - fixed (IntPtr* pixelsPtr = pixels) { - _context->glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, - depth, format, (uint)type, pixelsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TransformFeedbackVaryings( - GlHandle program, - int count, - ReadOnlySpan varyings, - uint bufferMode - ) - { - fixed (byte* varyingsPtr = varyings) { - _context->glTransformFeedbackVaryings(program.Value, count, varyingsPtr, bufferMode); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform1f( - int location, - float v0 - ) - { - _context->glUniform1f(location, v0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform1fv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniform1fv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform1i( - int location, - int v0 - ) - { - _context->glUniform1i(location, v0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform1iv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glUniform1iv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform1ui( - int location, - uint v0 - ) - { - _context->glUniform1ui(location, v0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform1uiv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glUniform1uiv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform2f( - int location, - float v0, - float v1 - ) - { - _context->glUniform2f(location, v0, v1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform2fv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniform2fv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform2i( - int location, - int v0, - int v1 - ) - { - _context->glUniform2i(location, v0, v1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform2iv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glUniform2iv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform2ui( - int location, - uint v0, - uint v1 - ) - { - _context->glUniform2ui(location, v0, v1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform2uiv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glUniform2uiv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform3f( - int location, - float v0, - float v1, - float v2 - ) - { - _context->glUniform3f(location, v0, v1, v2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform3fv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniform3fv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform3i( - int location, - int v0, - int v1, - int v2 - ) - { - _context->glUniform3i(location, v0, v1, v2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform3iv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glUniform3iv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform3ui( - int location, - uint v0, - uint v1, - uint v2 - ) - { - _context->glUniform3ui(location, v0, v1, v2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform3uiv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glUniform3uiv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform4f( - int location, - float v0, - float v1, - float v2, - float v3 - ) - { - _context->glUniform4f(location, v0, v1, v2, v3); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform4fv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniform4fv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform4i( - int location, - int v0, - int v1, - int v2, - int v3 - ) - { - _context->glUniform4i(location, v0, v1, v2, v3); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform4iv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glUniform4iv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform4ui( - int location, - uint v0, - uint v1, - uint v2, - uint v3 - ) - { - _context->glUniform4ui(location, v0, v1, v2, v3); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform4uiv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glUniform4uiv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformBlockBinding( - GlHandle program, - uint uniformBlockIndex, - uint uniformBlockBinding - ) - { - _context->glUniformBlockBinding(program.Value, uniformBlockIndex, uniformBlockBinding); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix2fv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniformMatrix2fv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix2x3fv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniformMatrix2x3fv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix2x4fv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniformMatrix2x4fv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix3fv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniformMatrix3fv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix3x2fv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniformMatrix3x2fv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix3x4fv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniformMatrix3x4fv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix4fv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniformMatrix4fv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix4x2fv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniformMatrix4x2fv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix4x3fv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glUniformMatrix4x3fv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte UnmapBuffer( - uint target - ) - { - return _context->glUnmapBuffer(target); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UseProgram( - GlHandle program - ) - { - _context->glUseProgram(program.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ValidateProgram( - GlHandle program - ) - { - _context->glValidateProgram(program.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib1d( - uint index, - double x - ) - { - _context->glVertexAttrib1d(index, x); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib1dv( - uint index, - ReadOnlySpan v - ) - { - fixed (double* vPtr = v) { - _context->glVertexAttrib1dv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib1f( - uint index, - float x - ) - { - _context->glVertexAttrib1f(index, x); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib1fv( - uint index, - ReadOnlySpan v - ) - { - fixed (float* vPtr = v) { - _context->glVertexAttrib1fv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib1s( - uint index, - short x - ) - { - _context->glVertexAttrib1s(index, x); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib1sv( - uint index, - ReadOnlySpan v - ) - { - fixed (short* vPtr = v) { - _context->glVertexAttrib1sv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib2d( - uint index, - double x, - double y - ) - { - _context->glVertexAttrib2d(index, x, y); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib2dv( - uint index, - ReadOnlySpan v - ) - { - fixed (double* vPtr = v) { - _context->glVertexAttrib2dv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib2f( - uint index, - float x, - float y - ) - { - _context->glVertexAttrib2f(index, x, y); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib2fv( - uint index, - ReadOnlySpan v - ) - { - fixed (float* vPtr = v) { - _context->glVertexAttrib2fv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib2s( - uint index, - short x, - short y - ) - { - _context->glVertexAttrib2s(index, x, y); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib2sv( - uint index, - ReadOnlySpan v - ) - { - fixed (short* vPtr = v) { - _context->glVertexAttrib2sv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib3d( - uint index, - double x, - double y, - double z - ) - { - _context->glVertexAttrib3d(index, x, y, z); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib3dv( - uint index, - ReadOnlySpan v - ) - { - fixed (double* vPtr = v) { - _context->glVertexAttrib3dv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib3f( - uint index, - float x, - float y, - float z - ) - { - _context->glVertexAttrib3f(index, x, y, z); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib3fv( - uint index, - ReadOnlySpan v - ) - { - fixed (float* vPtr = v) { - _context->glVertexAttrib3fv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib3s( - uint index, - short x, - short y, - short z - ) - { - _context->glVertexAttrib3s(index, x, y, z); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib3sv( - uint index, - ReadOnlySpan v - ) - { - fixed (short* vPtr = v) { - _context->glVertexAttrib3sv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4bv( - uint index, - ReadOnlySpan v - ) - { - fixed (sbyte* vPtr = v) { - _context->glVertexAttrib4bv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4d( - uint index, - double x, - double y, - double z, - double w - ) - { - _context->glVertexAttrib4d(index, x, y, z, w); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4dv( - uint index, - ReadOnlySpan v - ) - { - fixed (double* vPtr = v) { - _context->glVertexAttrib4dv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4f( - uint index, - float x, - float y, - float z, - float w - ) - { - _context->glVertexAttrib4f(index, x, y, z, w); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4fv( - uint index, - ReadOnlySpan v - ) - { - fixed (float* vPtr = v) { - _context->glVertexAttrib4fv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4iv( - uint index, - ReadOnlySpan v - ) - { - fixed (int* vPtr = v) { - _context->glVertexAttrib4iv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4Nbv( - uint index, - ReadOnlySpan v - ) - { - fixed (sbyte* vPtr = v) { - _context->glVertexAttrib4Nbv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4Niv( - uint index, - ReadOnlySpan v - ) - { - fixed (int* vPtr = v) { - _context->glVertexAttrib4Niv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4Nsv( - uint index, - ReadOnlySpan v - ) - { - fixed (short* vPtr = v) { - _context->glVertexAttrib4Nsv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4Nub( - uint index, - byte x, - byte y, - byte z, - byte w - ) - { - _context->glVertexAttrib4Nub(index, x, y, z, w); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4Nubv( - uint index, - ReadOnlySpan v - ) - { - fixed (byte* vPtr = v) { - _context->glVertexAttrib4Nubv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4Nuiv( - uint index, - ReadOnlySpan v - ) - { - fixed (uint* vPtr = v) { - _context->glVertexAttrib4Nuiv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4Nusv( - uint index, - ReadOnlySpan v - ) - { - fixed (ushort* vPtr = v) { - _context->glVertexAttrib4Nusv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4s( - uint index, - short x, - short y, - short z, - short w - ) - { - _context->glVertexAttrib4s(index, x, y, z, w); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4sv( - uint index, - ReadOnlySpan v - ) - { - fixed (short* vPtr = v) { - _context->glVertexAttrib4sv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4ubv( - uint index, - ReadOnlySpan v - ) - { - fixed (byte* vPtr = v) { - _context->glVertexAttrib4ubv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4uiv( - uint index, - ReadOnlySpan v - ) - { - fixed (uint* vPtr = v) { - _context->glVertexAttrib4uiv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttrib4usv( - uint index, - ReadOnlySpan v - ) - { - fixed (ushort* vPtr = v) { - _context->glVertexAttrib4usv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribDivisor( - uint index, - uint divisor - ) - { - _context->glVertexAttribDivisor(index, divisor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI1i( - uint index, - int x - ) - { - _context->glVertexAttribI1i(index, x); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI1iv( - uint index, - ReadOnlySpan v - ) - { - fixed (int* vPtr = v) { - _context->glVertexAttribI1iv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI1ui( - uint index, - uint x - ) - { - _context->glVertexAttribI1ui(index, x); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI1uiv( - uint index, - ReadOnlySpan v - ) - { - fixed (uint* vPtr = v) { - _context->glVertexAttribI1uiv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI2i( - uint index, - int x, - int y - ) - { - _context->glVertexAttribI2i(index, x, y); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI2iv( - uint index, - ReadOnlySpan v - ) - { - fixed (int* vPtr = v) { - _context->glVertexAttribI2iv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI2ui( - uint index, - uint x, - uint y - ) - { - _context->glVertexAttribI2ui(index, x, y); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI2uiv( - uint index, - ReadOnlySpan v - ) - { - fixed (uint* vPtr = v) { - _context->glVertexAttribI2uiv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI3i( - uint index, - int x, - int y, - int z - ) - { - _context->glVertexAttribI3i(index, x, y, z); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI3iv( - uint index, - ReadOnlySpan v - ) - { - fixed (int* vPtr = v) { - _context->glVertexAttribI3iv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI3ui( - uint index, - uint x, - uint y, - uint z - ) - { - _context->glVertexAttribI3ui(index, x, y, z); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI3uiv( - uint index, - ReadOnlySpan v - ) - { - fixed (uint* vPtr = v) { - _context->glVertexAttribI3uiv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI4bv( - uint index, - ReadOnlySpan v - ) - { - fixed (sbyte* vPtr = v) { - _context->glVertexAttribI4bv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI4i( - uint index, - int x, - int y, - int z, - int w - ) - { - _context->glVertexAttribI4i(index, x, y, z, w); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI4iv( - uint index, - ReadOnlySpan v - ) - { - fixed (int* vPtr = v) { - _context->glVertexAttribI4iv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI4sv( - uint index, - ReadOnlySpan v - ) - { - fixed (short* vPtr = v) { - _context->glVertexAttribI4sv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI4ubv( - uint index, - ReadOnlySpan v - ) - { - fixed (byte* vPtr = v) { - _context->glVertexAttribI4ubv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI4ui( - uint index, - uint x, - uint y, - uint z, - uint w - ) - { - _context->glVertexAttribI4ui(index, x, y, z, w); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI4uiv( - uint index, - ReadOnlySpan v - ) - { - fixed (uint* vPtr = v) { - _context->glVertexAttribI4uiv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribI4usv( - uint index, - ReadOnlySpan v - ) - { - fixed (ushort* vPtr = v) { - _context->glVertexAttribI4usv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribIPointer( - uint index, - int size, - ShaderType type, - int stride, - ReadOnlySpan pointer - ) - { - fixed (IntPtr* pointerPtr = pointer) { - _context->glVertexAttribIPointer(index, size, (uint)type, stride, pointerPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribP1ui( - uint index, - ShaderType type, - byte normalized, - uint value - ) - { - _context->glVertexAttribP1ui(index, (uint)type, normalized, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribP1uiv( - uint index, - ShaderType type, - byte normalized, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glVertexAttribP1uiv(index, (uint)type, normalized, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribP2ui( - uint index, - ShaderType type, - byte normalized, - uint value - ) - { - _context->glVertexAttribP2ui(index, (uint)type, normalized, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribP2uiv( - uint index, - ShaderType type, - byte normalized, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glVertexAttribP2uiv(index, (uint)type, normalized, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribP3ui( - uint index, - ShaderType type, - byte normalized, - uint value - ) - { - _context->glVertexAttribP3ui(index, (uint)type, normalized, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribP3uiv( - uint index, - ShaderType type, - byte normalized, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glVertexAttribP3uiv(index, (uint)type, normalized, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribP4ui( - uint index, - ShaderType type, - byte normalized, - uint value - ) - { - _context->glVertexAttribP4ui(index, (uint)type, normalized, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribP4uiv( - uint index, - ShaderType type, - byte normalized, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glVertexAttribP4uiv(index, (uint)type, normalized, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribPointer( - uint index, - int size, - ShaderType type, - byte normalized, - int stride, - ReadOnlySpan pointer - ) - { - fixed (IntPtr* pointerPtr = pointer) { - _context->glVertexAttribPointer(index, size, (uint)type, normalized, stride, - pointerPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Viewport( - int x, - int y, - int width, - int height - ) - { - _context->glViewport(x, y, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void WaitSync( - glSync sync, - uint flags, - IntPtr timeout - ) - { - _context->glWaitSync(sync, flags, timeout); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFunction.v3_3" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial class OpenGLFunction + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ActiveTexture( + uint texture + ) + { + _context->glActiveTexture(texture); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AttachShader( + GlHandle program, + GlHandle shader + ) + { + _context->glAttachShader(program.Value, shader.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BeginConditionalRender( + uint id, + uint mode + ) + { + _context->glBeginConditionalRender(id, mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BeginQuery( + uint target, + uint id + ) + { + _context->glBeginQuery(target, id); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BeginTransformFeedback( + uint primitiveMode + ) + { + _context->glBeginTransformFeedback(primitiveMode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindAttribLocation( + GlHandle program, + uint index, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + _context->glBindAttribLocation(program.Value, index, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindBuffer( + uint target, + GlHandle buffer + ) + { + _context->glBindBuffer(target, buffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindBufferBase( + uint target, + uint index, + GlHandle buffer + ) + { + _context->glBindBufferBase(target, index, buffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindBufferRange( + uint target, + uint index, + GlHandle buffer, + nint offset, + nuint size + ) + { + _context->glBindBufferRange(target, index, buffer.Value, offset, size); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindFragDataLocation( + GlHandle program, + uint color, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + _context->glBindFragDataLocation(program.Value, color, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindFragDataLocationIndexed( + GlHandle program, + uint colorNumber, + uint index, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + _context->glBindFragDataLocationIndexed(program.Value, colorNumber, index, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindFramebuffer( + uint target, + GlHandle framebuffer + ) + { + _context->glBindFramebuffer(target, framebuffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindRenderbuffer( + uint target, + GlHandle renderbuffer + ) + { + _context->glBindRenderbuffer(target, renderbuffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindSampler( + uint unit, + GlHandle sampler + ) + { + _context->glBindSampler(unit, sampler.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindTexture( + uint target, + GlHandle texture + ) + { + _context->glBindTexture(target, texture.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindVertexArray( + uint array + ) + { + _context->glBindVertexArray(array); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BlendColor( + float red, + float green, + float blue, + float alpha + ) + { + _context->glBlendColor(red, green, blue, alpha); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BlendEquation( + uint mode + ) + { + _context->glBlendEquation(mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BlendEquationSeparate( + uint modeRGB, + uint modeAlpha + ) + { + _context->glBlendEquationSeparate(modeRGB, modeAlpha); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BlendFunc( + uint sfactor, + uint dfactor + ) + { + _context->glBlendFunc(sfactor, dfactor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BlendFuncSeparate( + uint sfactorRGB, + uint dfactorRGB, + uint sfactorAlpha, + uint dfactorAlpha + ) + { + _context->glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); + } + + [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 + ) + { + _context->glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, + filter); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BufferData( + uint target, + nuint size, + ReadOnlySpan data, + uint usage + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glBufferData(target, size, dataPtr, usage); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BufferSubData( + uint target, + nint offset, + nuint size, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glBufferSubData(target, offset, size, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint CheckFramebufferStatus( + uint target + ) + { + return _context->glCheckFramebufferStatus(target); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClampColor( + uint target, + uint clamp + ) + { + _context->glClampColor(target, clamp); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Clear( + uint mask + ) + { + _context->glClear(mask); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearBufferfi( + uint buffer, + int drawbuffer, + float depth, + int stencil + ) + { + _context->glClearBufferfi(buffer, drawbuffer, depth, stencil); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearBufferfv( + uint buffer, + int drawbuffer, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glClearBufferfv(buffer, drawbuffer, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearBufferiv( + uint buffer, + int drawbuffer, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glClearBufferiv(buffer, drawbuffer, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearBufferuiv( + uint buffer, + int drawbuffer, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glClearBufferuiv(buffer, drawbuffer, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearColor( + float red, + float green, + float blue, + float alpha + ) + { + _context->glClearColor(red, green, blue, alpha); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearDepth( + double depth + ) + { + _context->glClearDepth(depth); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearStencil( + int s + ) + { + _context->glClearStencil(s); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint ClientWaitSync( + glSync sync, + uint flags, + IntPtr timeout + ) + { + return _context->glClientWaitSync(sync, flags, timeout); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ColorMask( + byte red, + byte green, + byte blue, + byte alpha + ) + { + _context->glColorMask(red, green, blue, alpha); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ColorMaski( + uint index, + byte r, + byte g, + byte b, + byte a + ) + { + _context->glColorMaski(index, r, g, b, a); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CompileShader( + GlHandle shader + ) + { + _context->glCompileShader(shader.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CompressedTexImage1D( + uint target, + int level, + uint internalformat, + int width, + int border, + int imageSize, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glCompressedTexImage1D(target, level, internalformat, width, border, + imageSize, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CompressedTexImage2D( + uint target, + int level, + uint internalformat, + int width, + int height, + int border, + int imageSize, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glCompressedTexImage2D(target, level, internalformat, width, height, border, + imageSize, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CompressedTexImage3D( + uint target, + int level, + uint internalformat, + int width, + int height, + int depth, + int border, + int imageSize, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glCompressedTexImage3D(target, level, internalformat, width, height, depth, + border, imageSize, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CompressedTexSubImage1D( + uint target, + int level, + int xoffset, + int width, + uint format, + int imageSize, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, + dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CompressedTexSubImage2D( + uint target, + int level, + int xoffset, + int yoffset, + int width, + int height, + uint format, + int imageSize, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, + format, imageSize, dataPtr); + } + } + + [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, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, + height, depth, format, imageSize, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyBufferSubData( + uint readTarget, + uint writeTarget, + nint readOffset, + nint writeOffset, + nuint size + ) + { + _context->glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTexImage1D( + uint target, + int level, + uint internalformat, + int x, + int y, + int width, + int border + ) + { + _context->glCopyTexImage1D(target, level, internalformat, x, y, width, border); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTexImage2D( + uint target, + int level, + uint internalformat, + int x, + int y, + int width, + int height, + int border + ) + { + _context->glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTexSubImage1D( + uint target, + int level, + int xoffset, + int x, + int y, + int width + ) + { + _context->glCopyTexSubImage1D(target, level, xoffset, x, y, width); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTexSubImage2D( + uint 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); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTexSubImage3D( + uint 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); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public GlHandle CreateProgram() + { + return GlHandle.Create(_context->glCreateProgram()); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint CreateShader( + ShaderType type + ) + { + return _context->glCreateShader((uint)type); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CullFace( + uint mode + ) + { + _context->glCullFace(mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteBuffers( + int n, + ReadOnlySpan buffers + ) + { + fixed (uint* buffersPtr = buffers) { + _context->glDeleteBuffers(n, buffersPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteFramebuffers( + int n, + ReadOnlySpan framebuffers + ) + { + fixed (uint* framebuffersPtr = framebuffers) { + _context->glDeleteFramebuffers(n, framebuffersPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteProgram( + GlHandle program + ) + { + _context->glDeleteProgram(program.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteQueries( + int n, + ReadOnlySpan ids + ) + { + fixed (uint* idsPtr = ids) { + _context->glDeleteQueries(n, idsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteRenderbuffers( + int n, + ReadOnlySpan renderbuffers + ) + { + fixed (uint* renderbuffersPtr = renderbuffers) { + _context->glDeleteRenderbuffers(n, renderbuffersPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteSamplers( + int count, + ReadOnlySpan samplers + ) + { + fixed (uint* samplersPtr = samplers) { + _context->glDeleteSamplers(count, samplersPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteShader( + GlHandle shader + ) + { + _context->glDeleteShader(shader.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteSync( + glSync sync + ) + { + _context->glDeleteSync(sync); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteTextures( + int n, + ReadOnlySpan textures + ) + { + fixed (uint* texturesPtr = textures) { + _context->glDeleteTextures(n, texturesPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteVertexArrays( + int n, + ReadOnlySpan arrays + ) + { + fixed (uint* arraysPtr = arrays) { + _context->glDeleteVertexArrays(n, arraysPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DepthFunc( + uint func + ) + { + _context->glDepthFunc(func); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DepthMask( + byte flag + ) + { + _context->glDepthMask(flag); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DepthRange( + double n, + double f + ) + { + _context->glDepthRange(n, f); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DetachShader( + GlHandle program, + GlHandle shader + ) + { + _context->glDetachShader(program.Value, shader.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Disable( + uint cap + ) + { + _context->glDisable(cap); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Disablei( + uint target, + uint index + ) + { + _context->glDisablei(target, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DisableVertexAttribArray( + uint index + ) + { + _context->glDisableVertexAttribArray(index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawArrays( + uint mode, + int first, + int count + ) + { + _context->glDrawArrays(mode, first, count); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawArraysInstanced( + uint mode, + int first, + int count, + int instancecount + ) + { + _context->glDrawArraysInstanced(mode, first, count, instancecount); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawBuffer( + uint buf + ) + { + _context->glDrawBuffer(buf); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawBuffers( + int n, + ReadOnlySpan bufs + ) + { + fixed (uint* bufsPtr = bufs) { + _context->glDrawBuffers(n, bufsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawElements( + uint mode, + int count, + ShaderType type, + ReadOnlySpan indices + ) + { + fixed (IntPtr* indicesPtr = indices) { + _context->glDrawElements(mode, count, (uint)type, indicesPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawElementsBaseVertex( + uint mode, + int count, + ShaderType type, + ReadOnlySpan indices, + int basevertex + ) + { + fixed (IntPtr* indicesPtr = indices) { + _context->glDrawElementsBaseVertex(mode, count, (uint)type, indicesPtr, basevertex); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawElementsInstanced( + uint mode, + int count, + ShaderType type, + ReadOnlySpan indices, + int instancecount + ) + { + fixed (IntPtr* indicesPtr = indices) { + _context->glDrawElementsInstanced(mode, count, (uint)type, indicesPtr, instancecount); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawElementsInstancedBaseVertex( + uint mode, + int count, + ShaderType type, + ReadOnlySpan indices, + int instancecount, + int basevertex + ) + { + fixed (IntPtr* indicesPtr = indices) { + _context->glDrawElementsInstancedBaseVertex(mode, count, (uint)type, indicesPtr, + instancecount, basevertex); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawRangeElements( + uint mode, + uint start, + uint end, + int count, + ShaderType type, + ReadOnlySpan indices + ) + { + fixed (IntPtr* indicesPtr = indices) { + _context->glDrawRangeElements(mode, start, end, count, (uint)type, indicesPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawRangeElementsBaseVertex( + uint mode, + uint start, + uint end, + int count, + ShaderType type, + ReadOnlySpan indices, + int basevertex + ) + { + fixed (IntPtr* indicesPtr = indices) { + _context->glDrawRangeElementsBaseVertex(mode, start, end, count, (uint)type, + indicesPtr, basevertex); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Enable( + uint cap + ) + { + _context->glEnable(cap); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Enablei( + uint target, + uint index + ) + { + _context->glEnablei(target, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void EnableVertexAttribArray( + uint index + ) + { + _context->glEnableVertexAttribArray(index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void EndConditionalRender() + { + _context->glEndConditionalRender(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void EndQuery( + uint target + ) + { + _context->glEndQuery(target); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void EndTransformFeedback() + { + _context->glEndTransformFeedback(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public glSync FenceSync( + uint condition, + uint flags + ) + { + return _context->glFenceSync(condition, flags); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Finish() + { + _context->glFinish(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Flush() + { + _context->glFlush(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FlushMappedBufferRange( + uint target, + nint offset, + nuint length + ) + { + _context->glFlushMappedBufferRange(target, offset, length); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FramebufferRenderbuffer( + uint target, + uint attachment, + uint renderbuffertarget, + GlHandle renderbuffer + ) + { + _context->glFramebufferRenderbuffer(target, attachment, renderbuffertarget, + renderbuffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FramebufferTexture( + uint target, + uint attachment, + GlHandle texture, + int level + ) + { + _context->glFramebufferTexture(target, attachment, texture.Value, level); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FramebufferTexture1D( + uint target, + uint attachment, + uint textarget, + GlHandle texture, + int level + ) + { + _context->glFramebufferTexture1D(target, attachment, textarget, texture.Value, level); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FramebufferTexture2D( + uint target, + uint attachment, + uint textarget, + GlHandle texture, + int level + ) + { + _context->glFramebufferTexture2D(target, attachment, textarget, texture.Value, level); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FramebufferTexture3D( + uint target, + uint attachment, + uint textarget, + GlHandle texture, + int level, + int zoffset + ) + { + _context->glFramebufferTexture3D(target, attachment, textarget, texture.Value, level, + zoffset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FramebufferTextureLayer( + uint target, + uint attachment, + GlHandle texture, + int level, + int layer + ) + { + _context->glFramebufferTextureLayer(target, attachment, texture.Value, level, layer); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FrontFace( + uint mode + ) + { + _context->glFrontFace(mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenBuffers( + int n, + uint* buffers + ) + { + _context->glGenBuffers(n, buffers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenerateMipmap( + Texture2DTarget target + ) + { + _context->glGenerateMipmap((uint)target); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenFrameBuffers( + Span frameBuffers + ) + { + fixed (GlHandle* hPtr = frameBuffers) { + _context->glGenFramebuffers(frameBuffers.Length, (uint*)hPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenQueries( + int n, + uint* ids + ) + { + _context->glGenQueries(n, ids); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenRenderbuffers( + int n, + uint* renderbuffers + ) + { + _context->glGenRenderbuffers(n, renderbuffers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenSamplers( + int count, + uint* samplers + ) + { + _context->glGenSamplers(count, samplers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenTextures( + int n, + uint* textures + ) + { + _context->glGenTextures(n, textures); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenVertexArrays( + int n, + uint* arrays + ) + { + _context->glGenVertexArrays(n, arrays); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveAttrib( + GlHandle program, + uint index, + int bufSize, + int* length, + int* size, + uint* type, + byte* name + ) + { + _context->glGetActiveAttrib(program.Value, index, bufSize, length, size, type, name); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveUniform( + GlHandle program, + uint index, + int bufSize, + int* length, + int* size, + uint* type, + byte* name + ) + { + _context->glGetActiveUniform(program.Value, index, bufSize, length, size, type, name); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveUniformBlockiv( + GlHandle program, + uint uniformBlockIndex, + uint pname, + int* @params + ) + { + _context->glGetActiveUniformBlockiv(program.Value, uniformBlockIndex, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveUniformBlockName( + GlHandle program, + uint uniformBlockIndex, + int bufSize, + int* length, + byte* uniformBlockName + ) + { + _context->glGetActiveUniformBlockName(program.Value, uniformBlockIndex, bufSize, length, + uniformBlockName); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveUniformName( + GlHandle program, + uint uniformIndex, + int bufSize, + int* length, + byte* uniformName + ) + { + _context->glGetActiveUniformName(program.Value, uniformIndex, bufSize, length, + uniformName); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveUniformsiv( + GlHandle program, + int uniformCount, + ReadOnlySpan uniformIndices, + uint pname, + int* @params + ) + { + fixed (uint* uniformIndicesPtr = uniformIndices) { + _context->glGetActiveUniformsiv(program.Value, uniformCount, uniformIndicesPtr, pname, + @params); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetAttachedShaders( + GlHandle program, + int maxCount, + int* count, + uint* shaders + ) + { + _context->glGetAttachedShaders(program.Value, maxCount, count, shaders); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int GetAttribLocation( + GlHandle program, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + return _context->glGetAttribLocation(program.Value, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetBooleani_v( + uint target, + uint index, + byte* data + ) + { + _context->glGetBooleani_v(target, index, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetBooleanv( + uint pname, + byte* data + ) + { + _context->glGetBooleanv(pname, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetBufferParameteri64v( + uint target, + uint pname, + IntPtr* @params + ) + { + _context->glGetBufferParameteri64v(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetBufferParameteriv( + uint target, + uint pname, + int* @params + ) + { + _context->glGetBufferParameteriv(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetBufferPointerv( + uint target, + uint pname, + IntPtr* @params + ) + { + _context->glGetBufferPointerv(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetBufferSubData( + uint target, + nint offset, + nuint size, + IntPtr* data + ) + { + _context->glGetBufferSubData(target, offset, size, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetCompressedTexImage( + uint target, + int level, + IntPtr* img + ) + { + _context->glGetCompressedTexImage(target, level, img); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetDoublev( + uint pname, + double* data + ) + { + _context->glGetDoublev(pname, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint GetError() + { + return _context->glGetError(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetFloatv( + uint pname, + float* data + ) + { + _context->glGetFloatv(pname, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int GetFragDataIndex( + GlHandle program, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + return _context->glGetFragDataIndex(program.Value, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int GetFragDataLocation( + GlHandle program, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + return _context->glGetFragDataLocation(program.Value, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetFramebufferAttachmentParameteriv( + uint target, + uint attachment, + uint pname, + int* @params + ) + { + _context->glGetFramebufferAttachmentParameteriv(target, attachment, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetInteger64i_v( + uint target, + uint index, + IntPtr* data + ) + { + _context->glGetInteger64i_v(target, index, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetInteger64v( + uint pname, + IntPtr* data + ) + { + _context->glGetInteger64v(pname, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetIntegeri_v( + uint target, + uint index, + int* data + ) + { + _context->glGetIntegeri_v(target, index, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetIntegerv( + uint pname, + int* data + ) + { + _context->glGetIntegerv(pname, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetMultisamplefv( + uint pname, + uint index, + float* val + ) + { + _context->glGetMultisamplefv(pname, index, val); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetProgramInfoLog( + GlHandle program, + int bufSize, + int* length, + byte* infoLog + ) + { + _context->glGetProgramInfoLog(program.Value, bufSize, length, infoLog); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetProgramiv( + GlHandle program, + uint pname, + int* @params + ) + { + _context->glGetProgramiv(program.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryiv( + uint target, + uint pname, + int* @params + ) + { + _context->glGetQueryiv(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryObjecti64v( + uint id, + uint pname, + IntPtr* @params + ) + { + _context->glGetQueryObjecti64v(id, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryObjectiv( + uint id, + uint pname, + int* @params + ) + { + _context->glGetQueryObjectiv(id, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryObjectui64v( + uint id, + uint pname, + IntPtr* @params + ) + { + _context->glGetQueryObjectui64v(id, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryObjectuiv( + uint id, + uint pname, + uint* @params + ) + { + _context->glGetQueryObjectuiv(id, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetRenderbufferParameteriv( + uint target, + uint pname, + int* @params + ) + { + _context->glGetRenderbufferParameteriv(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetSamplerParameterfv( + GlHandle sampler, + uint pname, + float* @params + ) + { + _context->glGetSamplerParameterfv(sampler.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetSamplerParameterIiv( + GlHandle sampler, + uint pname, + int* @params + ) + { + _context->glGetSamplerParameterIiv(sampler.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetSamplerParameterIuiv( + GlHandle sampler, + uint pname, + uint* @params + ) + { + _context->glGetSamplerParameterIuiv(sampler.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetSamplerParameteriv( + GlHandle sampler, + uint pname, + int* @params + ) + { + _context->glGetSamplerParameteriv(sampler.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetShaderInfoLog( + GlHandle shader, + int bufSize, + int* length, + byte* infoLog + ) + { + _context->glGetShaderInfoLog(shader.Value, bufSize, length, infoLog); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetShaderiv( + GlHandle shader, + uint pname, + int* @params + ) + { + _context->glGetShaderiv(shader.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetShaderSource( + GlHandle shader, + int bufSize, + int* length, + byte* source + ) + { + _context->glGetShaderSource(shader.Value, bufSize, length, source); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string GetString( + uint name + ) + { + return Marshal.PtrToStringAuto((nint)_context->glGetString(name)) ?? string.Empty; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string GetStringi( + uint name, + uint index + ) + { + return Marshal.PtrToStringAuto((nint)_context->glGetStringi(name, index)) ?? string.Empty; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetSynciv( + glSync sync, + uint pname, + int count, + int* length, + int* values + ) + { + _context->glGetSynciv(sync, pname, count, length, values); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTexImage( + uint target, + int level, + uint format, + ShaderType type, + IntPtr* pixels + ) + { + _context->glGetTexImage(target, level, format, (uint)type, pixels); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTexLevelParameterfv( + uint target, + int level, + uint pname, + float* @params + ) + { + _context->glGetTexLevelParameterfv(target, level, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTexLevelParameteriv( + uint target, + int level, + uint pname, + int* @params + ) + { + _context->glGetTexLevelParameteriv(target, level, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTexParameterfv( + uint target, + uint pname, + float* @params + ) + { + _context->glGetTexParameterfv(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTexParameterIiv( + uint target, + uint pname, + int* @params + ) + { + _context->glGetTexParameterIiv(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTexParameterIuiv( + uint target, + uint pname, + uint* @params + ) + { + _context->glGetTexParameterIuiv(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTexParameteriv( + uint target, + uint pname, + int* @params + ) + { + _context->glGetTexParameteriv(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTransformFeedbackVarying( + GlHandle program, + uint index, + int bufSize, + int* length, + int* size, + uint* type, + byte* name + ) + { + _context->glGetTransformFeedbackVarying(program.Value, index, bufSize, length, size, type, + name); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint GetUniformBlockIndex( + GlHandle program, + ReadOnlySpan uniformBlockName + ) + { + fixed (byte* uniformBlockNamePtr = uniformBlockName) { + return _context->glGetUniformBlockIndex(program.Value, uniformBlockNamePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetUniformfv( + GlHandle program, + int location, + float* @params + ) + { + _context->glGetUniformfv(program.Value, location, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetUniformIndices( + GlHandle program, + int uniformCount, + ReadOnlySpan uniformNames, + uint* uniformIndices + ) + { + fixed (byte* uniformNamesPtr = uniformNames) { + _context->glGetUniformIndices(program.Value, uniformCount, uniformNamesPtr, + uniformIndices); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetUniformiv( + GlHandle program, + int location, + int* @params + ) + { + _context->glGetUniformiv(program.Value, location, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int GetUniformLocation( + GlHandle program, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + return _context->glGetUniformLocation(program.Value, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetUniformuiv( + GlHandle program, + int location, + uint* @params + ) + { + _context->glGetUniformuiv(program.Value, location, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexAttribdv( + uint index, + uint pname, + double* @params + ) + { + _context->glGetVertexAttribdv(index, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexAttribfv( + uint index, + uint pname, + float* @params + ) + { + _context->glGetVertexAttribfv(index, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexAttribIiv( + uint index, + uint pname, + int* @params + ) + { + _context->glGetVertexAttribIiv(index, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexAttribIuiv( + uint index, + uint pname, + uint* @params + ) + { + _context->glGetVertexAttribIuiv(index, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexAttribiv( + uint index, + uint pname, + int* @params + ) + { + _context->glGetVertexAttribiv(index, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexAttribPointerv( + uint index, + uint pname, + IntPtr* pointer + ) + { + _context->glGetVertexAttribPointerv(index, pname, pointer); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Hint( + uint target, + uint mode + ) + { + _context->glHint(target, mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsBuffer( + GlHandle buffer + ) + { + return _context->glIsBuffer(buffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsEnabled( + uint cap + ) + { + return _context->glIsEnabled(cap); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsEnabledi( + uint target, + uint index + ) + { + return _context->glIsEnabledi(target, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsFramebuffer( + GlHandle framebuffer + ) + { + return _context->glIsFramebuffer(framebuffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsProgram( + GlHandle program + ) + { + return _context->glIsProgram(program.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsQuery( + uint id + ) + { + return _context->glIsQuery(id); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsRenderbuffer( + GlHandle renderbuffer + ) + { + return _context->glIsRenderbuffer(renderbuffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsSampler( + GlHandle sampler + ) + { + return _context->glIsSampler(sampler.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsShader( + GlHandle shader + ) + { + return _context->glIsShader(shader.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsSync( + glSync sync + ) + { + return _context->glIsSync(sync); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsTexture( + GlHandle texture + ) + { + return _context->glIsTexture(texture.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsVertexArray( + uint array + ) + { + return _context->glIsVertexArray(array); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void LineWidth( + float width + ) + { + _context->glLineWidth(width); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void LinkProgram( + GlHandle program + ) + { + _context->glLinkProgram(program.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void LogicOp( + uint opcode + ) + { + _context->glLogicOp(opcode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MapBuffer( + uint target, + uint access + ) + { + _context->glMapBuffer(target, access); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MapBufferRange( + uint target, + nint offset, + nuint length, + uint access + ) + { + _context->glMapBufferRange(target, offset, length, access); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MultiDrawArrays( + uint mode, + ReadOnlySpan first, + ReadOnlySpan count, + int drawcount + ) + { + fixed (int* firstPtr = first) + { + fixed (int* countPtr = count) { + _context->glMultiDrawArrays(mode, firstPtr, countPtr, drawcount); + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MultiDrawElements( + uint mode, + ReadOnlySpan count, + ShaderType type, + ReadOnlySpan indices, + int drawcount + ) + { + fixed (int* countPtr = count) + { + fixed (IntPtr* indicesPtr = indices) { + _context->glMultiDrawElements(mode, countPtr, (uint)type, indicesPtr, drawcount); + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MultiDrawElementsBaseVertex( + uint mode, + ReadOnlySpan count, + ShaderType type, + ReadOnlySpan indices, + int drawcount, + ReadOnlySpan basevertex + ) + { + fixed (int* countPtr = count) + { + fixed (IntPtr* indicesPtr = indices) + { + fixed (int* basevertexPtr = basevertex) { + _context->glMultiDrawElementsBaseVertex(mode, countPtr, (uint)type, + indicesPtr, drawcount, basevertexPtr); + } + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PixelStoref( + uint pname, + float param + ) + { + _context->glPixelStoref(pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PixelStorei( + uint pname, + int param + ) + { + _context->glPixelStorei(pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PointParameterf( + uint pname, + float param + ) + { + _context->glPointParameterf(pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PointParameterfv( + uint pname, + ReadOnlySpan @params + ) + { + fixed (float* @paramsPtr = @params) { + _context->glPointParameterfv(pname, @paramsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PointParameteri( + uint pname, + int param + ) + { + _context->glPointParameteri(pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PointParameteriv( + uint pname, + ReadOnlySpan @params + ) + { + fixed (int* @paramsPtr = @params) { + _context->glPointParameteriv(pname, @paramsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PointSize( + float size + ) + { + _context->glPointSize(size); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PolygonMode( + uint face, + uint mode + ) + { + _context->glPolygonMode(face, mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PolygonOffset( + float factor, + float units + ) + { + _context->glPolygonOffset(factor, units); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PrimitiveRestartIndex( + uint index + ) + { + _context->glPrimitiveRestartIndex(index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProvokingVertex( + uint mode + ) + { + _context->glProvokingVertex(mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void QueryCounter( + uint id, + uint target + ) + { + _context->glQueryCounter(id, target); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ReadBuffer( + uint src + ) + { + _context->glReadBuffer(src); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ReadPixels( + int x, + int y, + int width, + int height, + uint format, + ShaderType type, + IntPtr* pixels + ) + { + _context->glReadPixels(x, y, width, height, format, (uint)type, pixels); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void RenderbufferStorage( + uint target, + uint internalformat, + int width, + int height + ) + { + _context->glRenderbufferStorage(target, internalformat, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void RenderbufferStorageMultisample( + uint target, + int samples, + uint internalformat, + int width, + int height + ) + { + _context->glRenderbufferStorageMultisample(target, samples, internalformat, width, + height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SampleCoverage( + float value, + byte invert + ) + { + _context->glSampleCoverage(value, invert); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SampleMaski( + uint maskNumber, + uint mask + ) + { + _context->glSampleMaski(maskNumber, mask); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SamplerParameterf( + GlHandle sampler, + uint pname, + float param + ) + { + _context->glSamplerParameterf(sampler.Value, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SamplerParameterfv( + GlHandle sampler, + uint pname, + ReadOnlySpan param + ) + { + fixed (float* paramPtr = param) { + _context->glSamplerParameterfv(sampler.Value, pname, paramPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SamplerParameteri( + GlHandle sampler, + uint pname, + int param + ) + { + _context->glSamplerParameteri(sampler.Value, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SamplerParameterIiv( + GlHandle sampler, + uint pname, + ReadOnlySpan param + ) + { + fixed (int* paramPtr = param) { + _context->glSamplerParameterIiv(sampler.Value, pname, paramPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SamplerParameterIuiv( + GlHandle sampler, + uint pname, + ReadOnlySpan param + ) + { + fixed (uint* paramPtr = param) { + _context->glSamplerParameterIuiv(sampler.Value, pname, paramPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SamplerParameteriv( + GlHandle sampler, + uint pname, + ReadOnlySpan param + ) + { + fixed (int* paramPtr = param) { + _context->glSamplerParameteriv(sampler.Value, pname, paramPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Scissor( + int x, + int y, + int width, + int height + ) + { + _context->glScissor(x, y, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ShaderSource( + GlHandle shader, + int count, + ReadOnlySpan @string, + ReadOnlySpan length + ) + { + fixed (byte* stringPtr = @string) + { + byte* sPtr = stringPtr; + fixed (int* lengthPtr = length) { + _context->glShaderSource(shader.Value, count, &sPtr, lengthPtr); + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void StencilFunc( + uint func, + int @ref, + uint mask + ) + { + _context->glStencilFunc(func, @ref, mask); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void StencilFuncSeparate( + uint face, + uint func, + int @ref, + uint mask + ) + { + _context->glStencilFuncSeparate(face, func, @ref, mask); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void StencilMask( + uint mask + ) + { + _context->glStencilMask(mask); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void StencilMaskSeparate( + uint face, + uint mask + ) + { + _context->glStencilMaskSeparate(face, mask); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void StencilOp( + uint fail, + uint zfail, + uint zpass + ) + { + _context->glStencilOp(fail, zfail, zpass); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void StencilOpSeparate( + uint face, + uint sfail, + uint dpfail, + uint dppass + ) + { + _context->glStencilOpSeparate(face, sfail, dpfail, dppass); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexBuffer( + uint target, + uint internalformat, + GlHandle buffer + ) + { + _context->glTexBuffer(target, internalformat, buffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexImage1D( + uint target, + int level, + int internalformat, + int width, + int border, + uint format, + ShaderType type, + ReadOnlySpan pixels + ) + { + fixed (IntPtr* pixelsPtr = pixels) { + _context->glTexImage1D(target, level, internalformat, width, border, format, + (uint)type, pixelsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexImage2D( + uint target, + int level, + int internalformat, + int width, + int height, + int border, + uint format, + ShaderType type, + ReadOnlySpan pixels + ) + { + fixed (IntPtr* pixelsPtr = pixels) { + _context->glTexImage2D(target, level, internalformat, width, height, border, format, + (uint)type, pixelsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexImage2DMultisample( + uint target, + int samples, + uint internalformat, + int width, + int height, + byte fixedsamplelocations + ) + { + _context->glTexImage2DMultisample(target, samples, internalformat, width, height, + fixedsamplelocations); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexImage3D( + uint target, + int level, + int internalformat, + int width, + int height, + int depth, + int border, + uint format, + ShaderType type, + ReadOnlySpan pixels + ) + { + fixed (IntPtr* pixelsPtr = pixels) { + _context->glTexImage3D(target, level, internalformat, width, height, depth, border, + format, (uint)type, pixelsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexImage3DMultisample( + uint target, + int samples, + uint internalformat, + int width, + int height, + int depth, + byte fixedsamplelocations + ) + { + _context->glTexImage3DMultisample(target, samples, internalformat, width, height, depth, + fixedsamplelocations); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexParameterf( + uint target, + uint pname, + float param + ) + { + _context->glTexParameterf(target, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexParameterfv( + uint target, + uint pname, + ReadOnlySpan @params + ) + { + fixed (float* @paramsPtr = @params) { + _context->glTexParameterfv(target, pname, @paramsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexParameteri( + uint target, + uint pname, + int param + ) + { + _context->glTexParameteri(target, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexParameterIiv( + uint target, + uint pname, + ReadOnlySpan @params + ) + { + fixed (int* @paramsPtr = @params) { + _context->glTexParameterIiv(target, pname, @paramsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexParameterIuiv( + uint target, + uint pname, + ReadOnlySpan @params + ) + { + fixed (uint* @paramsPtr = @params) { + _context->glTexParameterIuiv(target, pname, @paramsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexParameteriv( + uint target, + uint pname, + ReadOnlySpan @params + ) + { + fixed (int* @paramsPtr = @params) { + _context->glTexParameteriv(target, pname, @paramsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexSubImage1D( + uint target, + int level, + int xoffset, + int width, + uint format, + ShaderType type, + ReadOnlySpan pixels + ) + { + fixed (IntPtr* pixelsPtr = pixels) { + _context->glTexSubImage1D(target, level, xoffset, width, format, (uint)type, + pixelsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexSubImage2D( + uint target, + int level, + int xoffset, + int yoffset, + int width, + int height, + uint format, + ShaderType type, + ReadOnlySpan pixels + ) + { + fixed (IntPtr* pixelsPtr = pixels) { + _context->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, + (uint)type, pixelsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexSubImage3D( + uint target, + int level, + int xoffset, + int yoffset, + int zoffset, + int width, + int height, + int depth, + uint format, + ShaderType type, + ReadOnlySpan pixels + ) + { + fixed (IntPtr* pixelsPtr = pixels) { + _context->glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, + depth, format, (uint)type, pixelsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TransformFeedbackVaryings( + GlHandle program, + int count, + ReadOnlySpan varyings, + uint bufferMode + ) + { + fixed (byte* varyingsPtr = varyings) { + _context->glTransformFeedbackVaryings(program.Value, count, varyingsPtr, bufferMode); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform1f( + int location, + float v0 + ) + { + _context->glUniform1f(location, v0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform1fv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniform1fv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform1i( + int location, + int v0 + ) + { + _context->glUniform1i(location, v0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform1iv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glUniform1iv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform1ui( + int location, + uint v0 + ) + { + _context->glUniform1ui(location, v0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform1uiv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glUniform1uiv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform2f( + int location, + float v0, + float v1 + ) + { + _context->glUniform2f(location, v0, v1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform2fv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniform2fv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform2i( + int location, + int v0, + int v1 + ) + { + _context->glUniform2i(location, v0, v1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform2iv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glUniform2iv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform2ui( + int location, + uint v0, + uint v1 + ) + { + _context->glUniform2ui(location, v0, v1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform2uiv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glUniform2uiv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform3f( + int location, + float v0, + float v1, + float v2 + ) + { + _context->glUniform3f(location, v0, v1, v2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform3fv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniform3fv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform3i( + int location, + int v0, + int v1, + int v2 + ) + { + _context->glUniform3i(location, v0, v1, v2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform3iv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glUniform3iv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform3ui( + int location, + uint v0, + uint v1, + uint v2 + ) + { + _context->glUniform3ui(location, v0, v1, v2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform3uiv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glUniform3uiv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform4f( + int location, + float v0, + float v1, + float v2, + float v3 + ) + { + _context->glUniform4f(location, v0, v1, v2, v3); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform4fv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniform4fv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform4i( + int location, + int v0, + int v1, + int v2, + int v3 + ) + { + _context->glUniform4i(location, v0, v1, v2, v3); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform4iv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glUniform4iv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform4ui( + int location, + uint v0, + uint v1, + uint v2, + uint v3 + ) + { + _context->glUniform4ui(location, v0, v1, v2, v3); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform4uiv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glUniform4uiv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformBlockBinding( + GlHandle program, + uint uniformBlockIndex, + uint uniformBlockBinding + ) + { + _context->glUniformBlockBinding(program.Value, uniformBlockIndex, uniformBlockBinding); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix2fv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniformMatrix2fv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix2x3fv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniformMatrix2x3fv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix2x4fv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniformMatrix2x4fv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix3fv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniformMatrix3fv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix3x2fv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniformMatrix3x2fv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix3x4fv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniformMatrix3x4fv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix4fv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniformMatrix4fv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix4x2fv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniformMatrix4x2fv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix4x3fv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glUniformMatrix4x3fv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte UnmapBuffer( + uint target + ) + { + return _context->glUnmapBuffer(target); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UseProgram( + GlHandle program + ) + { + _context->glUseProgram(program.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ValidateProgram( + GlHandle program + ) + { + _context->glValidateProgram(program.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib1d( + uint index, + double x + ) + { + _context->glVertexAttrib1d(index, x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib1dv( + uint index, + ReadOnlySpan v + ) + { + fixed (double* vPtr = v) { + _context->glVertexAttrib1dv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib1f( + uint index, + float x + ) + { + _context->glVertexAttrib1f(index, x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib1fv( + uint index, + ReadOnlySpan v + ) + { + fixed (float* vPtr = v) { + _context->glVertexAttrib1fv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib1s( + uint index, + short x + ) + { + _context->glVertexAttrib1s(index, x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib1sv( + uint index, + ReadOnlySpan v + ) + { + fixed (short* vPtr = v) { + _context->glVertexAttrib1sv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib2d( + uint index, + double x, + double y + ) + { + _context->glVertexAttrib2d(index, x, y); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib2dv( + uint index, + ReadOnlySpan v + ) + { + fixed (double* vPtr = v) { + _context->glVertexAttrib2dv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib2f( + uint index, + float x, + float y + ) + { + _context->glVertexAttrib2f(index, x, y); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib2fv( + uint index, + ReadOnlySpan v + ) + { + fixed (float* vPtr = v) { + _context->glVertexAttrib2fv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib2s( + uint index, + short x, + short y + ) + { + _context->glVertexAttrib2s(index, x, y); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib2sv( + uint index, + ReadOnlySpan v + ) + { + fixed (short* vPtr = v) { + _context->glVertexAttrib2sv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib3d( + uint index, + double x, + double y, + double z + ) + { + _context->glVertexAttrib3d(index, x, y, z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib3dv( + uint index, + ReadOnlySpan v + ) + { + fixed (double* vPtr = v) { + _context->glVertexAttrib3dv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib3f( + uint index, + float x, + float y, + float z + ) + { + _context->glVertexAttrib3f(index, x, y, z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib3fv( + uint index, + ReadOnlySpan v + ) + { + fixed (float* vPtr = v) { + _context->glVertexAttrib3fv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib3s( + uint index, + short x, + short y, + short z + ) + { + _context->glVertexAttrib3s(index, x, y, z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib3sv( + uint index, + ReadOnlySpan v + ) + { + fixed (short* vPtr = v) { + _context->glVertexAttrib3sv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4bv( + uint index, + ReadOnlySpan v + ) + { + fixed (sbyte* vPtr = v) { + _context->glVertexAttrib4bv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4d( + uint index, + double x, + double y, + double z, + double w + ) + { + _context->glVertexAttrib4d(index, x, y, z, w); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4dv( + uint index, + ReadOnlySpan v + ) + { + fixed (double* vPtr = v) { + _context->glVertexAttrib4dv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4f( + uint index, + float x, + float y, + float z, + float w + ) + { + _context->glVertexAttrib4f(index, x, y, z, w); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4fv( + uint index, + ReadOnlySpan v + ) + { + fixed (float* vPtr = v) { + _context->glVertexAttrib4fv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4iv( + uint index, + ReadOnlySpan v + ) + { + fixed (int* vPtr = v) { + _context->glVertexAttrib4iv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4Nbv( + uint index, + ReadOnlySpan v + ) + { + fixed (sbyte* vPtr = v) { + _context->glVertexAttrib4Nbv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4Niv( + uint index, + ReadOnlySpan v + ) + { + fixed (int* vPtr = v) { + _context->glVertexAttrib4Niv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4Nsv( + uint index, + ReadOnlySpan v + ) + { + fixed (short* vPtr = v) { + _context->glVertexAttrib4Nsv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4Nub( + uint index, + byte x, + byte y, + byte z, + byte w + ) + { + _context->glVertexAttrib4Nub(index, x, y, z, w); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4Nubv( + uint index, + ReadOnlySpan v + ) + { + fixed (byte* vPtr = v) { + _context->glVertexAttrib4Nubv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4Nuiv( + uint index, + ReadOnlySpan v + ) + { + fixed (uint* vPtr = v) { + _context->glVertexAttrib4Nuiv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4Nusv( + uint index, + ReadOnlySpan v + ) + { + fixed (ushort* vPtr = v) { + _context->glVertexAttrib4Nusv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4s( + uint index, + short x, + short y, + short z, + short w + ) + { + _context->glVertexAttrib4s(index, x, y, z, w); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4sv( + uint index, + ReadOnlySpan v + ) + { + fixed (short* vPtr = v) { + _context->glVertexAttrib4sv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4ubv( + uint index, + ReadOnlySpan v + ) + { + fixed (byte* vPtr = v) { + _context->glVertexAttrib4ubv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4uiv( + uint index, + ReadOnlySpan v + ) + { + fixed (uint* vPtr = v) { + _context->glVertexAttrib4uiv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttrib4usv( + uint index, + ReadOnlySpan v + ) + { + fixed (ushort* vPtr = v) { + _context->glVertexAttrib4usv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribDivisor( + uint index, + uint divisor + ) + { + _context->glVertexAttribDivisor(index, divisor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI1i( + uint index, + int x + ) + { + _context->glVertexAttribI1i(index, x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI1iv( + uint index, + ReadOnlySpan v + ) + { + fixed (int* vPtr = v) { + _context->glVertexAttribI1iv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI1ui( + uint index, + uint x + ) + { + _context->glVertexAttribI1ui(index, x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI1uiv( + uint index, + ReadOnlySpan v + ) + { + fixed (uint* vPtr = v) { + _context->glVertexAttribI1uiv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI2i( + uint index, + int x, + int y + ) + { + _context->glVertexAttribI2i(index, x, y); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI2iv( + uint index, + ReadOnlySpan v + ) + { + fixed (int* vPtr = v) { + _context->glVertexAttribI2iv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI2ui( + uint index, + uint x, + uint y + ) + { + _context->glVertexAttribI2ui(index, x, y); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI2uiv( + uint index, + ReadOnlySpan v + ) + { + fixed (uint* vPtr = v) { + _context->glVertexAttribI2uiv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI3i( + uint index, + int x, + int y, + int z + ) + { + _context->glVertexAttribI3i(index, x, y, z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI3iv( + uint index, + ReadOnlySpan v + ) + { + fixed (int* vPtr = v) { + _context->glVertexAttribI3iv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI3ui( + uint index, + uint x, + uint y, + uint z + ) + { + _context->glVertexAttribI3ui(index, x, y, z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI3uiv( + uint index, + ReadOnlySpan v + ) + { + fixed (uint* vPtr = v) { + _context->glVertexAttribI3uiv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI4bv( + uint index, + ReadOnlySpan v + ) + { + fixed (sbyte* vPtr = v) { + _context->glVertexAttribI4bv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI4i( + uint index, + int x, + int y, + int z, + int w + ) + { + _context->glVertexAttribI4i(index, x, y, z, w); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI4iv( + uint index, + ReadOnlySpan v + ) + { + fixed (int* vPtr = v) { + _context->glVertexAttribI4iv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI4sv( + uint index, + ReadOnlySpan v + ) + { + fixed (short* vPtr = v) { + _context->glVertexAttribI4sv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI4ubv( + uint index, + ReadOnlySpan v + ) + { + fixed (byte* vPtr = v) { + _context->glVertexAttribI4ubv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI4ui( + uint index, + uint x, + uint y, + uint z, + uint w + ) + { + _context->glVertexAttribI4ui(index, x, y, z, w); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI4uiv( + uint index, + ReadOnlySpan v + ) + { + fixed (uint* vPtr = v) { + _context->glVertexAttribI4uiv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribI4usv( + uint index, + ReadOnlySpan v + ) + { + fixed (ushort* vPtr = v) { + _context->glVertexAttribI4usv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribIPointer( + uint index, + int size, + ShaderType type, + int stride, + ReadOnlySpan pointer + ) + { + fixed (IntPtr* pointerPtr = pointer) { + _context->glVertexAttribIPointer(index, size, (uint)type, stride, pointerPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribP1ui( + uint index, + ShaderType type, + byte normalized, + uint value + ) + { + _context->glVertexAttribP1ui(index, (uint)type, normalized, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribP1uiv( + uint index, + ShaderType type, + byte normalized, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glVertexAttribP1uiv(index, (uint)type, normalized, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribP2ui( + uint index, + ShaderType type, + byte normalized, + uint value + ) + { + _context->glVertexAttribP2ui(index, (uint)type, normalized, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribP2uiv( + uint index, + ShaderType type, + byte normalized, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glVertexAttribP2uiv(index, (uint)type, normalized, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribP3ui( + uint index, + ShaderType type, + byte normalized, + uint value + ) + { + _context->glVertexAttribP3ui(index, (uint)type, normalized, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribP3uiv( + uint index, + ShaderType type, + byte normalized, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glVertexAttribP3uiv(index, (uint)type, normalized, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribP4ui( + uint index, + ShaderType type, + byte normalized, + uint value + ) + { + _context->glVertexAttribP4ui(index, (uint)type, normalized, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribP4uiv( + uint index, + ShaderType type, + byte normalized, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glVertexAttribP4uiv(index, (uint)type, normalized, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribPointer( + uint index, + int size, + ShaderType type, + byte normalized, + int stride, + ReadOnlySpan pointer + ) + { + fixed (IntPtr* pointerPtr = pointer) { + _context->glVertexAttribPointer(index, size, (uint)type, normalized, stride, + pointerPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Viewport( + int x, + int y, + int width, + int height + ) + { + _context->glViewport(x, y, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void WaitSync( + glSync sync, + uint flags, + IntPtr timeout + ) + { + _context->glWaitSync(sync, flags, timeout); + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_0.cs b/StgsSharp.Graphics/OpenGL/glFunction.v4_0.cs similarity index 96% rename from StgSharp.Common/Graphics/OpenGL/glFunction.v4_0.cs rename to StgsSharp.Graphics/OpenGL/glFunction.v4_0.cs index efce9e09..236ea9dd 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_0.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.v4_0.cs @@ -1,544 +1,544 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFunction.v4_0" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BeginQueryIndexed( - uint target, - uint index, - uint id - ) - { - _context->glBeginQueryIndexed(target, index, id); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindTransformFeedback( - uint target, - uint id - ) - { - _context->glBindTransformFeedback(target, id); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendEquationi( - uint buf, - uint mode - ) - { - _context->glBlendEquationi(buf, mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendEquationSeparatei( - uint buf, - uint modeRGB, - uint modeAlpha - ) - { - _context->glBlendEquationSeparatei(buf, modeRGB, modeAlpha); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendFunci( - uint buf, - uint src, - uint dst - ) - { - _context->glBlendFunci(buf, src, dst); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BlendFuncSeparatei( - uint buf, - uint srcRGB, - uint dstRGB, - uint srcAlpha, - uint dstAlpha - ) - { - _context->glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteTransformFeedbacks( - int n, - ReadOnlySpan ids - ) - { - fixed (uint* idsPtr = ids) { - _context->glDeleteTransformFeedbacks(n, idsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawArraysIndirect( - uint mode, - ReadOnlySpan indirect - ) - { - fixed (IntPtr* indirectPtr = indirect) { - _context->glDrawArraysIndirect(mode, indirectPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsIndirect( - uint mode, - ShaderType type, - ReadOnlySpan indirect - ) - { - fixed (IntPtr* indirectPtr = indirect) { - _context->glDrawElementsIndirect(mode, (uint)type, indirectPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawTransformFeedback( - uint mode, - uint id - ) - { - _context->glDrawTransformFeedback(mode, id); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawTransformFeedbackStream( - uint mode, - uint id, - uint stream - ) - { - _context->glDrawTransformFeedbackStream(mode, id, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void EndQueryIndexed( - uint target, - uint index - ) - { - _context->glEndQueryIndexed(target, index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenTransformFeedbacks( - int n, - uint* ids - ) - { - _context->glGenTransformFeedbacks(n, ids); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveSubroutineName( - GlHandle program, - ShaderType shaderType, - uint index, - int bufSize, - int* length, - byte* name - ) - { - _context->glGetActiveSubroutineName(program.Value, (uint)shaderType, index, bufSize, - length, name); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveSubroutineUniformiv( - GlHandle program, - ShaderType shaderType, - uint index, - uint pName, - int* values - ) - { - _context->glGetActiveSubroutineUniformiv(program.Value, (uint)shaderType, index, pName, - values); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveSubroutineUniformName( - GlHandle program, - ShaderType shaderType, - uint index, - int bufSize, - int* length, - byte* name - ) - { - _context->glGetActiveSubroutineUniformName(program.Value, (uint)shaderType, index, - bufSize, length, name); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramStageiv( - GlHandle program, - ShaderType shaderType, - uint pName, - int* values - ) - { - _context->glGetProgramStageiv(program.Value, (uint)shaderType, pName, values); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryIndexediv( - uint target, - uint index, - uint pName, - int* @params - ) - { - _context->glGetQueryIndexediv(target, index, pName, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint GetSubroutineIndex( - GlHandle program, - ShaderType shaderType, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - return _context->glGetSubroutineIndex(program.Value, (uint)shaderType, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int GetSubroutineUniformLocation( - GlHandle program, - ShaderType shaderType, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - return _context->glGetSubroutineUniformLocation(program.Value, (uint)shaderType, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetUniformdv( - GlHandle program, - int location, - double* @params - ) - { - _context->glGetUniformdv(program.Value, location, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetUniformSubroutineuiv( - ShaderType shaderType, - int location, - uint* @params - ) - { - _context->glGetUniformSubroutineuiv((uint)shaderType, location, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsTransformFeedback( - uint id - ) - { - return _context->glIsTransformFeedback(id); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MinSampleShading( - float value - ) - { - _context->glMinSampleShading(value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PatchParameterfv( - uint pName, - ReadOnlySpan values - ) - { - fixed (float* valuesPtr = values) { - _context->glPatchParameterfv(pName, valuesPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PatchParameteri( - uint pName, - int value - ) - { - _context->glPatchParameteri(pName, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PauseTransformFeedback() - { - _context->glPauseTransformFeedback(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ResumeTransformFeedback() - { - _context->glResumeTransformFeedback(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform1d( - int location, - double x - ) - { - _context->glUniform1d(location, x); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform1dv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniform1dv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform2d( - int location, - double x, - double y - ) - { - _context->glUniform2d(location, x, y); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform2dv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniform2dv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform3d( - int location, - double x, - double y, - double z - ) - { - _context->glUniform3d(location, x, y, z); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform3dv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniform3dv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform4d( - int location, - double x, - double y, - double z, - double w - ) - { - _context->glUniform4d(location, x, y, z, w); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Uniform4dv( - int location, - int count, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniform4dv(location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix2dv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniformMatrix2dv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix2x3dv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniformMatrix2x3dv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix2x4dv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniformMatrix2x4dv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix3dv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniformMatrix3dv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix3x2dv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniformMatrix3x2dv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix3x4dv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniformMatrix3x4dv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix4dv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniformMatrix4dv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix4x2dv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniformMatrix4x2dv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformMatrix4x3dv( - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glUniformMatrix4x3dv(location, count, transpose, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UniformSubroutinesuiv( - ShaderType shaderType, - int count, - ReadOnlySpan indices - ) - { - fixed (uint* indicesPtr = indices) { - _context->glUniformSubroutinesuiv((uint)shaderType, count, indicesPtr); - } - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFunction.v4_0" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial class OpenGLFunction + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BeginQueryIndexed( + uint target, + uint index, + uint id + ) + { + _context->glBeginQueryIndexed(target, index, id); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindTransformFeedback( + uint target, + uint id + ) + { + _context->glBindTransformFeedback(target, id); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BlendEquationi( + uint buf, + uint mode + ) + { + _context->glBlendEquationi(buf, mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BlendEquationSeparatei( + uint buf, + uint modeRGB, + uint modeAlpha + ) + { + _context->glBlendEquationSeparatei(buf, modeRGB, modeAlpha); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BlendFunci( + uint buf, + uint src, + uint dst + ) + { + _context->glBlendFunci(buf, src, dst); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BlendFuncSeparatei( + uint buf, + uint srcRGB, + uint dstRGB, + uint srcAlpha, + uint dstAlpha + ) + { + _context->glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteTransformFeedbacks( + int n, + ReadOnlySpan ids + ) + { + fixed (uint* idsPtr = ids) { + _context->glDeleteTransformFeedbacks(n, idsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawArraysIndirect( + uint mode, + ReadOnlySpan indirect + ) + { + fixed (IntPtr* indirectPtr = indirect) { + _context->glDrawArraysIndirect(mode, indirectPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawElementsIndirect( + uint mode, + ShaderType type, + ReadOnlySpan indirect + ) + { + fixed (IntPtr* indirectPtr = indirect) { + _context->glDrawElementsIndirect(mode, (uint)type, indirectPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawTransformFeedback( + uint mode, + uint id + ) + { + _context->glDrawTransformFeedback(mode, id); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawTransformFeedbackStream( + uint mode, + uint id, + uint stream + ) + { + _context->glDrawTransformFeedbackStream(mode, id, stream); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void EndQueryIndexed( + uint target, + uint index + ) + { + _context->glEndQueryIndexed(target, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenTransformFeedbacks( + int n, + uint* ids + ) + { + _context->glGenTransformFeedbacks(n, ids); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveSubroutineName( + GlHandle program, + ShaderType shaderType, + uint index, + int bufSize, + int* length, + byte* name + ) + { + _context->glGetActiveSubroutineName(program.Value, (uint)shaderType, index, bufSize, + length, name); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveSubroutineUniformiv( + GlHandle program, + ShaderType shaderType, + uint index, + uint pName, + int* values + ) + { + _context->glGetActiveSubroutineUniformiv(program.Value, (uint)shaderType, index, pName, + values); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveSubroutineUniformName( + GlHandle program, + ShaderType shaderType, + uint index, + int bufSize, + int* length, + byte* name + ) + { + _context->glGetActiveSubroutineUniformName(program.Value, (uint)shaderType, index, + bufSize, length, name); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetProgramStageiv( + GlHandle program, + ShaderType shaderType, + uint pName, + int* values + ) + { + _context->glGetProgramStageiv(program.Value, (uint)shaderType, pName, values); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryIndexediv( + uint target, + uint index, + uint pName, + int* @params + ) + { + _context->glGetQueryIndexediv(target, index, pName, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint GetSubroutineIndex( + GlHandle program, + ShaderType shaderType, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + return _context->glGetSubroutineIndex(program.Value, (uint)shaderType, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int GetSubroutineUniformLocation( + GlHandle program, + ShaderType shaderType, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + return _context->glGetSubroutineUniformLocation(program.Value, (uint)shaderType, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetUniformdv( + GlHandle program, + int location, + double* @params + ) + { + _context->glGetUniformdv(program.Value, location, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetUniformSubroutineuiv( + ShaderType shaderType, + int location, + uint* @params + ) + { + _context->glGetUniformSubroutineuiv((uint)shaderType, location, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsTransformFeedback( + uint id + ) + { + return _context->glIsTransformFeedback(id); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MinSampleShading( + float value + ) + { + _context->glMinSampleShading(value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PatchParameterfv( + uint pName, + ReadOnlySpan values + ) + { + fixed (float* valuesPtr = values) { + _context->glPatchParameterfv(pName, valuesPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PatchParameteri( + uint pName, + int value + ) + { + _context->glPatchParameteri(pName, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PauseTransformFeedback() + { + _context->glPauseTransformFeedback(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ResumeTransformFeedback() + { + _context->glResumeTransformFeedback(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform1d( + int location, + double x + ) + { + _context->glUniform1d(location, x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform1dv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniform1dv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform2d( + int location, + double x, + double y + ) + { + _context->glUniform2d(location, x, y); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform2dv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniform2dv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform3d( + int location, + double x, + double y, + double z + ) + { + _context->glUniform3d(location, x, y, z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform3dv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniform3dv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform4d( + int location, + double x, + double y, + double z, + double w + ) + { + _context->glUniform4d(location, x, y, z, w); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Uniform4dv( + int location, + int count, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniform4dv(location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix2dv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniformMatrix2dv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix2x3dv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniformMatrix2x3dv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix2x4dv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniformMatrix2x4dv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix3dv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniformMatrix3dv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix3x2dv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniformMatrix3x2dv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix3x4dv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniformMatrix3x4dv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix4dv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniformMatrix4dv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix4x2dv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniformMatrix4x2dv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformMatrix4x3dv( + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glUniformMatrix4x3dv(location, count, transpose, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UniformSubroutinesuiv( + ShaderType shaderType, + int count, + ReadOnlySpan indices + ) + { + fixed (uint* indicesPtr = indices) { + _context->glUniformSubroutinesuiv((uint)shaderType, count, indicesPtr); + } + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_1.cs b/StgsSharp.Graphics/OpenGL/glFunction.v4_1.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glFunction.v4_1.cs rename to StgsSharp.Graphics/OpenGL/glFunction.v4_1.cs index 6935107c..82810d51 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_1.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.v4_1.cs @@ -1,1105 +1,1105 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFunction.v4_1" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ActiveShaderProgram( - uint pipeline, - GlHandle program - ) - { - _context->glActiveShaderProgram(pipeline, program.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindProgramPipeline( - uint pipeline - ) - { - _context->glBindProgramPipeline(pipeline); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearDepthf( - float d - ) - { - _context->glClearDepthf(d); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint CreateShaderProgramv( - ShaderType type, - int count, - ReadOnlySpan strings - ) - { - fixed (byte* stringsPtr = strings) { - return _context->glCreateShaderProgramv((uint)type, count, stringsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DeleteProgramPipelines( - int n, - ReadOnlySpan pipelines - ) - { - fixed (uint* pipelinesPtr = pipelines) { - _context->glDeleteProgramPipelines(n, pipelinesPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DepthRangeArrayv( - uint first, - int count, - ReadOnlySpan v - ) - { - fixed (double* vPtr = v) { - _context->glDepthRangeArrayv(first, count, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DepthRangef( - float n, - float f - ) - { - _context->glDepthRangef(n, f); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DepthRangeIndexed( - uint index, - double n, - double f - ) - { - _context->glDepthRangeIndexed(index, n, f); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenProgramPipelines( - int n, - uint* pipelines - ) - { - _context->glGenProgramPipelines(n, pipelines); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetDoublei_v( - uint target, - uint index, - double* data - ) - { - _context->glGetDoublei_v(target, index, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetFloati_v( - uint target, - uint index, - float* data - ) - { - _context->glGetFloati_v(target, index, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramBinary( - GlHandle program, - int bufSize, - int* length, - uint* binaryFormat, - IntPtr* binary - ) - { - _context->glGetProgramBinary(program.Value, bufSize, length, binaryFormat, binary); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramPipelineInfoLog( - uint pipeline, - int bufSize, - int* length, - byte* infoLog - ) - { - _context->glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramPipelineiv( - uint pipeline, - uint pname, - int* @params - ) - { - _context->glGetProgramPipelineiv(pipeline, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetShaderPrecisionFormat( - ShaderType shaderType, - uint precisiontype, - int* range, - int* precision - ) - { - _context->glGetShaderPrecisionFormat((uint)shaderType, precisiontype, range, precision); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexAttribLdv( - uint index, - uint pname, - double* @params - ) - { - _context->glGetVertexAttribLdv(index, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte IsProgramPipeline( - uint pipeline - ) - { - return _context->glIsProgramPipeline(pipeline); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramBinary( - GlHandle program, - uint binaryFormat, - ReadOnlySpan binary, - int length - ) - { - fixed (IntPtr* binaryPtr = binary) { - _context->glProgramBinary(program.Value, binaryFormat, binaryPtr, length); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramParameteri( - GlHandle program, - uint pname, - int value - ) - { - _context->glProgramParameteri(program.Value, pname, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform1d( - GlHandle program, - int location, - double v0 - ) - { - _context->glProgramUniform1d(program.Value, location, v0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform1dv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniform1dv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform1f( - GlHandle program, - int location, - float v0 - ) - { - _context->glProgramUniform1f(program.Value, location, v0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform1fv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniform1fv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform1i( - GlHandle program, - int location, - int v0 - ) - { - _context->glProgramUniform1i(program.Value, location, v0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform1iv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glProgramUniform1iv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform1ui( - GlHandle program, - int location, - uint v0 - ) - { - _context->glProgramUniform1ui(program.Value, location, v0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform1uiv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glProgramUniform1uiv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform2d( - GlHandle program, - int location, - double v0, - double v1 - ) - { - _context->glProgramUniform2d(program.Value, location, v0, v1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform2dv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniform2dv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform2f( - GlHandle program, - int location, - float v0, - float v1 - ) - { - _context->glProgramUniform2f(program.Value, location, v0, v1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform2fv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniform2fv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform2i( - GlHandle program, - int location, - int v0, - int v1 - ) - { - _context->glProgramUniform2i(program.Value, location, v0, v1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform2iv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glProgramUniform2iv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform2ui( - GlHandle program, - int location, - uint v0, - uint v1 - ) - { - _context->glProgramUniform2ui(program.Value, location, v0, v1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform2uiv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glProgramUniform2uiv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform3d( - GlHandle program, - int location, - double v0, - double v1, - double v2 - ) - { - _context->glProgramUniform3d(program.Value, location, v0, v1, v2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform3dv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniform3dv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform3f( - GlHandle program, - int location, - float v0, - float v1, - float v2 - ) - { - _context->glProgramUniform3f(program.Value, location, v0, v1, v2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform3fv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniform3fv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform3i( - GlHandle program, - int location, - int v0, - int v1, - int v2 - ) - { - _context->glProgramUniform3i(program.Value, location, v0, v1, v2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform3iv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glProgramUniform3iv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform3ui( - GlHandle program, - int location, - uint v0, - uint v1, - uint v2 - ) - { - _context->glProgramUniform3ui(program.Value, location, v0, v1, v2); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform3uiv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glProgramUniform3uiv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform4d( - GlHandle program, - int location, - double v0, - double v1, - double v2, - double v3 - ) - { - _context->glProgramUniform4d(program.Value, location, v0, v1, v2, v3); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform4dv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniform4dv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform4f( - GlHandle program, - int location, - float v0, - float v1, - float v2, - float v3 - ) - { - _context->glProgramUniform4f(program.Value, location, v0, v1, v2, v3); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform4fv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniform4fv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform4i( - GlHandle program, - int location, - int v0, - int v1, - int v2, - int v3 - ) - { - _context->glProgramUniform4i(program.Value, location, v0, v1, v2, v3); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform4iv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glProgramUniform4iv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform4ui( - GlHandle program, - int location, - uint v0, - uint v1, - uint v2, - uint v3 - ) - { - _context->glProgramUniform4ui(program.Value, location, v0, v1, v2, v3); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniform4uiv( - GlHandle program, - int location, - int count, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glProgramUniform4uiv(program.Value, location, count, valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix2dv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniformMatrix2dv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix2fv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniformMatrix2fv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix2x3dv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniformMatrix2x3dv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix2x3fv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniformMatrix2x3fv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix2x4dv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniformMatrix2x4dv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix2x4fv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniformMatrix2x4fv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix3dv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniformMatrix3dv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix3fv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniformMatrix3fv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix3x2dv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniformMatrix3x2dv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix3x2fv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniformMatrix3x2fv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix3x4dv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniformMatrix3x4dv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix3x4fv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniformMatrix3x4fv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix4dv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniformMatrix4dv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix4fv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniformMatrix4fv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix4x2dv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniformMatrix4x2dv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix4x2fv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniformMatrix4x2fv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix4x3dv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (double* valuePtr = value) { - _context->glProgramUniformMatrix4x3dv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ProgramUniformMatrix4x3fv( - GlHandle program, - int location, - int count, - byte transpose, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glProgramUniformMatrix4x3fv(program.Value, location, count, transpose, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReleaseShaderCompiler() - { - _context->glReleaseShaderCompiler(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ScissorArrayv( - uint first, - int count, - ReadOnlySpan v - ) - { - fixed (int* vPtr = v) { - _context->glScissorArrayv(first, count, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ScissorIndexed( - uint index, - int left, - int bottom, - int width, - int height - ) - { - _context->glScissorIndexed(index, left, bottom, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ScissorIndexedv( - uint index, - ReadOnlySpan v - ) - { - fixed (int* vPtr = v) { - _context->glScissorIndexedv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ShaderBinary( - int count, - ReadOnlySpan shaders, - uint binaryFormat, - ReadOnlySpan binary, - int length - ) - { - fixed (uint* shadersPtr = shaders) - { - fixed (IntPtr* binaryPtr = binary) { - _context->glShaderBinary(count, shadersPtr, binaryFormat, binaryPtr, length); - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void UseProgramStages( - uint pipeline, - uint stages, - GlHandle program - ) - { - _context->glUseProgramStages(pipeline, stages, program.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ValidateProgramPipeline( - uint pipeline - ) - { - _context->glValidateProgramPipeline(pipeline); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribL1d( - uint index, - double x - ) - { - _context->glVertexAttribL1d(index, x); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribL1dv( - uint index, - ReadOnlySpan v - ) - { - fixed (double* vPtr = v) { - _context->glVertexAttribL1dv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribL2d( - uint index, - double x, - double y - ) - { - _context->glVertexAttribL2d(index, x, y); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribL2dv( - uint index, - ReadOnlySpan v - ) - { - fixed (double* vPtr = v) { - _context->glVertexAttribL2dv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribL3d( - uint index, - double x, - double y, - double z - ) - { - _context->glVertexAttribL3d(index, x, y, z); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribL3dv( - uint index, - ReadOnlySpan v - ) - { - fixed (double* vPtr = v) { - _context->glVertexAttribL3dv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribL4d( - uint index, - double x, - double y, - double z, - double w - ) - { - _context->glVertexAttribL4d(index, x, y, z, w); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribL4dv( - uint index, - ReadOnlySpan v - ) - { - fixed (double* vPtr = v) { - _context->glVertexAttribL4dv(index, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribLPointer( - uint index, - int size, - ShaderType type, - int stride, - ReadOnlySpan pointer - ) - { - fixed (IntPtr* pointerPtr = pointer) { - _context->glVertexAttribLPointer(index, size, (uint)type, stride, pointerPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ViewportArrayv( - uint first, - int count, - ReadOnlySpan v - ) - { - fixed (float* vPtr = v) { - _context->glViewportArrayv(first, count, vPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ViewportIndexedf( - uint index, - float x, - float y, - float w, - float h - ) - { - _context->glViewportIndexedf(index, x, y, w, h); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ViewportIndexedfv( - uint index, - ReadOnlySpan v - ) - { - fixed (float* vPtr = v) { - _context->glViewportIndexedfv(index, vPtr); - } - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFunction.v4_1" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial class OpenGLFunction + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ActiveShaderProgram( + uint pipeline, + GlHandle program + ) + { + _context->glActiveShaderProgram(pipeline, program.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindProgramPipeline( + uint pipeline + ) + { + _context->glBindProgramPipeline(pipeline); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearDepthf( + float d + ) + { + _context->glClearDepthf(d); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint CreateShaderProgramv( + ShaderType type, + int count, + ReadOnlySpan strings + ) + { + fixed (byte* stringsPtr = strings) { + return _context->glCreateShaderProgramv((uint)type, count, stringsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DeleteProgramPipelines( + int n, + ReadOnlySpan pipelines + ) + { + fixed (uint* pipelinesPtr = pipelines) { + _context->glDeleteProgramPipelines(n, pipelinesPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DepthRangeArrayv( + uint first, + int count, + ReadOnlySpan v + ) + { + fixed (double* vPtr = v) { + _context->glDepthRangeArrayv(first, count, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DepthRangef( + float n, + float f + ) + { + _context->glDepthRangef(n, f); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DepthRangeIndexed( + uint index, + double n, + double f + ) + { + _context->glDepthRangeIndexed(index, n, f); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenProgramPipelines( + int n, + uint* pipelines + ) + { + _context->glGenProgramPipelines(n, pipelines); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetDoublei_v( + uint target, + uint index, + double* data + ) + { + _context->glGetDoublei_v(target, index, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetFloati_v( + uint target, + uint index, + float* data + ) + { + _context->glGetFloati_v(target, index, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetProgramBinary( + GlHandle program, + int bufSize, + int* length, + uint* binaryFormat, + IntPtr* binary + ) + { + _context->glGetProgramBinary(program.Value, bufSize, length, binaryFormat, binary); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetProgramPipelineInfoLog( + uint pipeline, + int bufSize, + int* length, + byte* infoLog + ) + { + _context->glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetProgramPipelineiv( + uint pipeline, + uint pname, + int* @params + ) + { + _context->glGetProgramPipelineiv(pipeline, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetShaderPrecisionFormat( + ShaderType shaderType, + uint precisiontype, + int* range, + int* precision + ) + { + _context->glGetShaderPrecisionFormat((uint)shaderType, precisiontype, range, precision); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexAttribLdv( + uint index, + uint pname, + double* @params + ) + { + _context->glGetVertexAttribLdv(index, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte IsProgramPipeline( + uint pipeline + ) + { + return _context->glIsProgramPipeline(pipeline); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramBinary( + GlHandle program, + uint binaryFormat, + ReadOnlySpan binary, + int length + ) + { + fixed (IntPtr* binaryPtr = binary) { + _context->glProgramBinary(program.Value, binaryFormat, binaryPtr, length); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramParameteri( + GlHandle program, + uint pname, + int value + ) + { + _context->glProgramParameteri(program.Value, pname, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform1d( + GlHandle program, + int location, + double v0 + ) + { + _context->glProgramUniform1d(program.Value, location, v0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform1dv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniform1dv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform1f( + GlHandle program, + int location, + float v0 + ) + { + _context->glProgramUniform1f(program.Value, location, v0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform1fv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniform1fv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform1i( + GlHandle program, + int location, + int v0 + ) + { + _context->glProgramUniform1i(program.Value, location, v0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform1iv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glProgramUniform1iv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform1ui( + GlHandle program, + int location, + uint v0 + ) + { + _context->glProgramUniform1ui(program.Value, location, v0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform1uiv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glProgramUniform1uiv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform2d( + GlHandle program, + int location, + double v0, + double v1 + ) + { + _context->glProgramUniform2d(program.Value, location, v0, v1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform2dv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniform2dv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform2f( + GlHandle program, + int location, + float v0, + float v1 + ) + { + _context->glProgramUniform2f(program.Value, location, v0, v1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform2fv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniform2fv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform2i( + GlHandle program, + int location, + int v0, + int v1 + ) + { + _context->glProgramUniform2i(program.Value, location, v0, v1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform2iv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glProgramUniform2iv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform2ui( + GlHandle program, + int location, + uint v0, + uint v1 + ) + { + _context->glProgramUniform2ui(program.Value, location, v0, v1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform2uiv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glProgramUniform2uiv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform3d( + GlHandle program, + int location, + double v0, + double v1, + double v2 + ) + { + _context->glProgramUniform3d(program.Value, location, v0, v1, v2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform3dv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniform3dv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform3f( + GlHandle program, + int location, + float v0, + float v1, + float v2 + ) + { + _context->glProgramUniform3f(program.Value, location, v0, v1, v2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform3fv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniform3fv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform3i( + GlHandle program, + int location, + int v0, + int v1, + int v2 + ) + { + _context->glProgramUniform3i(program.Value, location, v0, v1, v2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform3iv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glProgramUniform3iv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform3ui( + GlHandle program, + int location, + uint v0, + uint v1, + uint v2 + ) + { + _context->glProgramUniform3ui(program.Value, location, v0, v1, v2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform3uiv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glProgramUniform3uiv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform4d( + GlHandle program, + int location, + double v0, + double v1, + double v2, + double v3 + ) + { + _context->glProgramUniform4d(program.Value, location, v0, v1, v2, v3); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform4dv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniform4dv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform4f( + GlHandle program, + int location, + float v0, + float v1, + float v2, + float v3 + ) + { + _context->glProgramUniform4f(program.Value, location, v0, v1, v2, v3); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform4fv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniform4fv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform4i( + GlHandle program, + int location, + int v0, + int v1, + int v2, + int v3 + ) + { + _context->glProgramUniform4i(program.Value, location, v0, v1, v2, v3); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform4iv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glProgramUniform4iv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform4ui( + GlHandle program, + int location, + uint v0, + uint v1, + uint v2, + uint v3 + ) + { + _context->glProgramUniform4ui(program.Value, location, v0, v1, v2, v3); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniform4uiv( + GlHandle program, + int location, + int count, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glProgramUniform4uiv(program.Value, location, count, valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix2dv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniformMatrix2dv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix2fv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniformMatrix2fv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix2x3dv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniformMatrix2x3dv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix2x3fv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniformMatrix2x3fv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix2x4dv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniformMatrix2x4dv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix2x4fv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniformMatrix2x4fv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix3dv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniformMatrix3dv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix3fv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniformMatrix3fv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix3x2dv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniformMatrix3x2dv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix3x2fv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniformMatrix3x2fv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix3x4dv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniformMatrix3x4dv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix3x4fv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniformMatrix3x4fv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix4dv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniformMatrix4dv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix4fv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniformMatrix4fv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix4x2dv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniformMatrix4x2dv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix4x2fv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniformMatrix4x2fv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix4x3dv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (double* valuePtr = value) { + _context->glProgramUniformMatrix4x3dv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ProgramUniformMatrix4x3fv( + GlHandle program, + int location, + int count, + byte transpose, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glProgramUniformMatrix4x3fv(program.Value, location, count, transpose, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ReleaseShaderCompiler() + { + _context->glReleaseShaderCompiler(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ScissorArrayv( + uint first, + int count, + ReadOnlySpan v + ) + { + fixed (int* vPtr = v) { + _context->glScissorArrayv(first, count, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ScissorIndexed( + uint index, + int left, + int bottom, + int width, + int height + ) + { + _context->glScissorIndexed(index, left, bottom, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ScissorIndexedv( + uint index, + ReadOnlySpan v + ) + { + fixed (int* vPtr = v) { + _context->glScissorIndexedv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ShaderBinary( + int count, + ReadOnlySpan shaders, + uint binaryFormat, + ReadOnlySpan binary, + int length + ) + { + fixed (uint* shadersPtr = shaders) + { + fixed (IntPtr* binaryPtr = binary) { + _context->glShaderBinary(count, shadersPtr, binaryFormat, binaryPtr, length); + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UseProgramStages( + uint pipeline, + uint stages, + GlHandle program + ) + { + _context->glUseProgramStages(pipeline, stages, program.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ValidateProgramPipeline( + uint pipeline + ) + { + _context->glValidateProgramPipeline(pipeline); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribL1d( + uint index, + double x + ) + { + _context->glVertexAttribL1d(index, x); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribL1dv( + uint index, + ReadOnlySpan v + ) + { + fixed (double* vPtr = v) { + _context->glVertexAttribL1dv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribL2d( + uint index, + double x, + double y + ) + { + _context->glVertexAttribL2d(index, x, y); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribL2dv( + uint index, + ReadOnlySpan v + ) + { + fixed (double* vPtr = v) { + _context->glVertexAttribL2dv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribL3d( + uint index, + double x, + double y, + double z + ) + { + _context->glVertexAttribL3d(index, x, y, z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribL3dv( + uint index, + ReadOnlySpan v + ) + { + fixed (double* vPtr = v) { + _context->glVertexAttribL3dv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribL4d( + uint index, + double x, + double y, + double z, + double w + ) + { + _context->glVertexAttribL4d(index, x, y, z, w); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribL4dv( + uint index, + ReadOnlySpan v + ) + { + fixed (double* vPtr = v) { + _context->glVertexAttribL4dv(index, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribLPointer( + uint index, + int size, + ShaderType type, + int stride, + ReadOnlySpan pointer + ) + { + fixed (IntPtr* pointerPtr = pointer) { + _context->glVertexAttribLPointer(index, size, (uint)type, stride, pointerPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ViewportArrayv( + uint first, + int count, + ReadOnlySpan v + ) + { + fixed (float* vPtr = v) { + _context->glViewportArrayv(first, count, vPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ViewportIndexedf( + uint index, + float x, + float y, + float w, + float h + ) + { + _context->glViewportIndexedf(index, x, y, w, h); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ViewportIndexedfv( + uint index, + ReadOnlySpan v + ) + { + fixed (float* vPtr = v) { + _context->glViewportIndexedfv(index, vPtr); + } + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_2.cs b/StgsSharp.Graphics/OpenGL/glFunction.v4_2.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glFunction.v4_2.cs rename to StgsSharp.Graphics/OpenGL/glFunction.v4_2.cs index 8ca14a05..666c5168 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_2.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.v4_2.cs @@ -1,190 +1,190 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFunction.v4_2" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindImageTexture( - uint unit, - GlHandle texture, - int level, - byte layered, - int layer, - uint access, - uint format - ) - { - _context->glBindImageTexture(unit, texture.Value, level, layered, layer, access, - format); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawArraysInstancedBaseInstance( - uint mode, - int first, - int count, - int instancecount, - uint baseinstance - ) - { - _context->glDrawArraysInstancedBaseInstance(mode, first, count, instancecount, - baseinstance); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsInstancedBaseInstance( - uint mode, - int count, - ShaderType type, - ReadOnlySpan indices, - int instancecount, - uint baseinstance - ) - { - fixed (IntPtr* indicesPtr = indices) { - _context->glDrawElementsInstancedBaseInstance(mode, count, (uint)type, indicesPtr, - instancecount, baseinstance); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawElementsInstancedBaseVertexBaseInstance( - uint mode, - int count, - ShaderType type, - ReadOnlySpan indices, - int instancecount, - int basevertex, - uint baseinstance - ) - { - fixed (IntPtr* indicesPtr = indices) { - _context->glDrawElementsInstancedBaseVertexBaseInstance(mode, count, (uint)type, - indicesPtr, instancecount, - basevertex, baseinstance); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawTransformFeedbackInstanced( - uint mode, - uint id, - int instancecount - ) - { - _context->glDrawTransformFeedbackInstanced(mode, id, instancecount); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DrawTransformFeedbackStreamInstanced( - uint mode, - uint id, - uint stream, - int instancecount - ) - { - _context->glDrawTransformFeedbackStreamInstanced(mode, id, stream, instancecount); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetActiveAtomicCounterBufferiv( - GlHandle program, - GlHandle bufferIndex, - uint pname, - int* @params - ) - { - _context->glGetActiveAtomicCounterBufferiv(program.Value, bufferIndex.Value, pname, - @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetInternalformativ( - uint target, - uint internalformat, - uint pname, - int count, - int* @params - ) - { - _context->glGetInternalformativ(target, internalformat, pname, count, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MemoryBarrier( - uint barriers - ) - { - _context->glMemoryBarrier(barriers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexStorage1D( - uint target, - int levels, - uint internalformat, - int width - ) - { - _context->glTexStorage1D(target, levels, internalformat, width); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexStorage2D( - uint target, - int levels, - uint internalformat, - int width, - int height - ) - { - _context->glTexStorage2D(target, levels, internalformat, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexStorage3D( - uint target, - int levels, - uint internalformat, - int width, - int height, - int depth - ) - { - _context->glTexStorage3D(target, levels, internalformat, width, height, depth); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFunction.v4_2" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial class OpenGLFunction + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindImageTexture( + uint unit, + GlHandle texture, + int level, + byte layered, + int layer, + uint access, + uint format + ) + { + _context->glBindImageTexture(unit, texture.Value, level, layered, layer, access, + format); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawArraysInstancedBaseInstance( + uint mode, + int first, + int count, + int instancecount, + uint baseinstance + ) + { + _context->glDrawArraysInstancedBaseInstance(mode, first, count, instancecount, + baseinstance); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawElementsInstancedBaseInstance( + uint mode, + int count, + ShaderType type, + ReadOnlySpan indices, + int instancecount, + uint baseinstance + ) + { + fixed (IntPtr* indicesPtr = indices) { + _context->glDrawElementsInstancedBaseInstance(mode, count, (uint)type, indicesPtr, + instancecount, baseinstance); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawElementsInstancedBaseVertexBaseInstance( + uint mode, + int count, + ShaderType type, + ReadOnlySpan indices, + int instancecount, + int basevertex, + uint baseinstance + ) + { + fixed (IntPtr* indicesPtr = indices) { + _context->glDrawElementsInstancedBaseVertexBaseInstance(mode, count, (uint)type, + indicesPtr, instancecount, + basevertex, baseinstance); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawTransformFeedbackInstanced( + uint mode, + uint id, + int instancecount + ) + { + _context->glDrawTransformFeedbackInstanced(mode, id, instancecount); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DrawTransformFeedbackStreamInstanced( + uint mode, + uint id, + uint stream, + int instancecount + ) + { + _context->glDrawTransformFeedbackStreamInstanced(mode, id, stream, instancecount); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetActiveAtomicCounterBufferiv( + GlHandle program, + GlHandle bufferIndex, + uint pname, + int* @params + ) + { + _context->glGetActiveAtomicCounterBufferiv(program.Value, bufferIndex.Value, pname, + @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetInternalformativ( + uint target, + uint internalformat, + uint pname, + int count, + int* @params + ) + { + _context->glGetInternalformativ(target, internalformat, pname, count, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MemoryBarrier( + uint barriers + ) + { + _context->glMemoryBarrier(barriers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexStorage1D( + uint target, + int levels, + uint internalformat, + int width + ) + { + _context->glTexStorage1D(target, levels, internalformat, width); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexStorage2D( + uint target, + int levels, + uint internalformat, + int width, + int height + ) + { + _context->glTexStorage2D(target, levels, internalformat, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexStorage3D( + uint target, + int levels, + uint internalformat, + int width, + int height, + int depth + ) + { + _context->glTexStorage3D(target, levels, internalformat, width, height, depth); + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_3.cs b/StgsSharp.Graphics/OpenGL/glFunction.v4_3.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glFunction.v4_3.cs rename to StgsSharp.Graphics/OpenGL/glFunction.v4_3.cs index 702c54fd..73c3de2a 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_3.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.v4_3.cs @@ -1,584 +1,584 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFunction.v4_3" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindVertexBuffer( - uint bindingindex, - GlHandle buffer, - nint offset, - int stride - ) - { - _context->glBindVertexBuffer(bindingindex, buffer.Value, offset, stride); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBufferData( - uint target, - uint internalformat, - uint format, - ShaderType type, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glClearBufferData(target, internalformat, format, (uint)type, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearBufferSubData( - uint target, - uint internalformat, - nint offset, - nuint size, - uint format, - ShaderType type, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glClearBufferSubData(target, internalformat, offset, size, format, - (uint)type, dataPtr); - } - } - - [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 - ) - { - _context->glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, - dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, - srcDepth); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DebugMessageCallback( - IntPtr callback, - ReadOnlySpan userParam - ) - { - fixed (IntPtr* userParamPtr = userParam) { - _context->glDebugMessageCallback(callback, userParamPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DebugMessageControl( - uint source, - ShaderType type, - uint severity, - int count, - ReadOnlySpan ids, - byte enabled - ) - { - fixed (uint* idsPtr = ids) { - _context->glDebugMessageControl(source, (uint)type, severity, count, idsPtr, - enabled); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DebugMessageInsert( - uint source, - ShaderType type, - uint id, - uint severity, - int length, - ReadOnlySpan buf - ) - { - fixed (byte* bufPtr = buf) { - _context->glDebugMessageInsert(source, (uint)type, id, severity, length, bufPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DispatchCompute( - uint num_groups_x, - uint num_groups_y, - uint num_groups_z - ) - { - _context->glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DispatchComputeIndirect( - nint indirect - ) - { - _context->glDispatchComputeIndirect(indirect); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FramebufferParameteri( - uint target, - uint pname, - int param - ) - { - _context->glFramebufferParameteri(target, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint GetDebugMessageLog( - uint count, - int bufSize, - uint* sources, - uint* types, - uint* ids, - uint* severities, - int* lengths, - byte* messageLog - ) - { - return _context->glGetDebugMessageLog(count, bufSize, sources, types, ids, severities, - lengths, messageLog); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetFramebufferParameteriv( - uint target, - uint pname, - int* @params - ) - { - _context->glGetFramebufferParameteriv(target, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetInternalformati64v( - uint target, - uint internalformat, - uint pname, - int count, - IntPtr* @params - ) - { - _context->glGetInternalformati64v(target, internalformat, pname, count, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetObjectLabel( - uint identifier, - uint name, - int bufSize, - int* length, - byte* label - ) - { - _context->glGetObjectLabel(identifier, name, bufSize, length, label); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetObjectPtrLabel( - ReadOnlySpan ptr, - int bufSize, - int* length, - byte* label - ) - { - fixed (IntPtr* ptrPtr = ptr) { - _context->glGetObjectPtrLabel(ptrPtr, bufSize, length, label); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramInterfaceiv( - GlHandle program, - uint programInterface, - uint pname, - int* @params - ) - { - _context->glGetProgramInterfaceiv(program.Value, programInterface, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint GetProgramResourceIndex( - GlHandle program, - uint programInterface, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - return _context->glGetProgramResourceIndex(program.Value, programInterface, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramResourceiv( - GlHandle program, - uint programInterface, - uint index, - int propCount, - ReadOnlySpan props, - int count, - int* length, - int* @params - ) - { - fixed (uint* propsPtr = props) { - _context->glGetProgramResourceiv(program.Value, programInterface, index, propCount, - propsPtr, count, length, @params); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int GetProgramResourceLocation( - GlHandle program, - uint programInterface, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - return _context->glGetProgramResourceLocation(program.Value, programInterface, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int GetProgramResourceLocationIndex( - GlHandle program, - uint programInterface, - ReadOnlySpan name - ) - { - fixed (byte* namePtr = name) { - return _context->glGetProgramResourceLocationIndex(program.Value, programInterface, namePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetProgramResourceName( - GlHandle program, - uint programInterface, - uint index, - int bufSize, - int* length, - byte* name - ) - { - _context->glGetProgramResourceName(program.Value, programInterface, index, bufSize, - length, name); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateBufferData( - GlHandle buffer - ) - { - _context->glInvalidateBufferData(buffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateBufferSubData( - GlHandle buffer, - nint offset, - nuint length - ) - { - _context->glInvalidateBufferSubData(buffer.Value, offset, length); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateFramebuffer( - uint target, - int numAttachments, - ReadOnlySpan attachments - ) - { - fixed (uint* attachmentsPtr = attachments) { - _context->glInvalidateFramebuffer(target, numAttachments, attachmentsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateSubFramebuffer( - uint target, - int numAttachments, - ReadOnlySpan attachments, - int x, - int y, - int width, - int height - ) - { - fixed (uint* attachmentsPtr = attachments) { - _context->glInvalidateSubFramebuffer(target, numAttachments, attachmentsPtr, x, y, - width, height); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateTexImage( - GlHandle texture, - int level - ) - { - _context->glInvalidateTexImage(texture.Value, level); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateTexSubImage( - GlHandle texture, - int level, - int xoffset, - int yoffset, - int zoffset, - int width, - int height, - int depth - ) - { - _context->glInvalidateTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, - width, height, depth); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawArraysIndirect( - uint mode, - ReadOnlySpan indirect, - int drawcount, - int stride - ) - { - fixed (IntPtr* indirectPtr = indirect) { - _context->glMultiDrawArraysIndirect(mode, indirectPtr, drawcount, stride); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawElementsIndirect( - uint mode, - ShaderType type, - ReadOnlySpan indirect, - int drawcount, - int stride - ) - { - fixed (IntPtr* indirectPtr = indirect) { - _context->glMultiDrawElementsIndirect(mode, (uint)type, indirectPtr, drawcount, - stride); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ObjectLabel( - uint identifier, - uint name, - int length, - ReadOnlySpan label - ) - { - fixed (byte* labelPtr = label) { - _context->glObjectLabel(identifier, name, length, labelPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ObjectPtrLabel( - ReadOnlySpan ptr, - int length, - ReadOnlySpan label - ) - { - fixed (IntPtr* ptrPtr = ptr) - { - fixed (byte* labelPtr = label) { - _context->glObjectPtrLabel(ptrPtr, length, labelPtr); - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PopDebugGroup() - { - _context->glPopDebugGroup(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PushDebugGroup( - uint source, - uint id, - int length, - ReadOnlySpan message - ) - { - fixed (byte* messagePtr = message) { - _context->glPushDebugGroup(source, id, length, messagePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ShaderStorageBlockBinding( - GlHandle program, - uint storageBlockIndex, - uint storageBlockBinding - ) - { - _context->glShaderStorageBlockBinding(program.Value, storageBlockIndex, storageBlockBinding); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexBufferRange( - uint target, - uint internalformat, - GlHandle buffer, - nint offset, - nuint size - ) - { - _context->glTexBufferRange(target, internalformat, buffer.Value, offset, size); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexStorage2DMultisample( - uint target, - int samples, - uint internalformat, - int width, - int height, - byte fixedsamplelocations - ) - { - _context->glTexStorage2DMultisample(target, samples, internalformat, width, height, - fixedsamplelocations); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TexStorage3DMultisample( - uint target, - int samples, - uint internalformat, - int width, - int height, - int depth, - byte fixedsamplelocations - ) - { - _context->glTexStorage3DMultisample(target, samples, internalformat, width, height, - depth, fixedsamplelocations); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureView( - GlHandle texture, - uint target, - GlHandle origtexture, - uint internalformat, - uint minlevel, - uint numlevels, - uint minlayer, - uint numlayers - ) - { - _context->glTextureView(texture.Value, target, origtexture.Value, internalformat, - minlevel, numlevels, minlayer, numlayers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribBinding( - uint attribindex, - uint bindingindex - ) - { - _context->glVertexAttribBinding(attribindex, bindingindex); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribFormat( - uint attribindex, - int size, - ShaderType type, - byte normalized, - uint relativeoffset - ) - { - _context->glVertexAttribFormat(attribindex, size, (uint)type, normalized, - relativeoffset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribIFormat( - uint attribindex, - int size, - ShaderType type, - uint relativeoffset - ) - { - _context->glVertexAttribIFormat(attribindex, size, (uint)type, relativeoffset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexAttribLFormat( - uint attribindex, - int size, - ShaderType type, - uint relativeoffset - ) - { - _context->glVertexAttribLFormat(attribindex, size, (uint)type, relativeoffset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexBindingDivisor( - uint bindingindex, - uint divisor - ) - { - _context->glVertexBindingDivisor(bindingindex, divisor); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFunction.v4_3" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial class OpenGLFunction + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindVertexBuffer( + uint bindingindex, + GlHandle buffer, + nint offset, + int stride + ) + { + _context->glBindVertexBuffer(bindingindex, buffer.Value, offset, stride); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearBufferData( + uint target, + uint internalformat, + uint format, + ShaderType type, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glClearBufferData(target, internalformat, format, (uint)type, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearBufferSubData( + uint target, + uint internalformat, + nint offset, + nuint size, + uint format, + ShaderType type, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glClearBufferSubData(target, internalformat, offset, size, format, + (uint)type, dataPtr); + } + } + + [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 + ) + { + _context->glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, + dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, + srcDepth); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DebugMessageCallback( + IntPtr callback, + ReadOnlySpan userParam + ) + { + fixed (IntPtr* userParamPtr = userParam) { + _context->glDebugMessageCallback(callback, userParamPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DebugMessageControl( + uint source, + ShaderType type, + uint severity, + int count, + ReadOnlySpan ids, + byte enabled + ) + { + fixed (uint* idsPtr = ids) { + _context->glDebugMessageControl(source, (uint)type, severity, count, idsPtr, + enabled); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DebugMessageInsert( + uint source, + ShaderType type, + uint id, + uint severity, + int length, + ReadOnlySpan buf + ) + { + fixed (byte* bufPtr = buf) { + _context->glDebugMessageInsert(source, (uint)type, id, severity, length, bufPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DispatchCompute( + uint num_groups_x, + uint num_groups_y, + uint num_groups_z + ) + { + _context->glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DispatchComputeIndirect( + nint indirect + ) + { + _context->glDispatchComputeIndirect(indirect); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FramebufferParameteri( + uint target, + uint pname, + int param + ) + { + _context->glFramebufferParameteri(target, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint GetDebugMessageLog( + uint count, + int bufSize, + uint* sources, + uint* types, + uint* ids, + uint* severities, + int* lengths, + byte* messageLog + ) + { + return _context->glGetDebugMessageLog(count, bufSize, sources, types, ids, severities, + lengths, messageLog); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetFramebufferParameteriv( + uint target, + uint pname, + int* @params + ) + { + _context->glGetFramebufferParameteriv(target, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetInternalformati64v( + uint target, + uint internalformat, + uint pname, + int count, + IntPtr* @params + ) + { + _context->glGetInternalformati64v(target, internalformat, pname, count, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetObjectLabel( + uint identifier, + uint name, + int bufSize, + int* length, + byte* label + ) + { + _context->glGetObjectLabel(identifier, name, bufSize, length, label); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetObjectPtrLabel( + ReadOnlySpan ptr, + int bufSize, + int* length, + byte* label + ) + { + fixed (IntPtr* ptrPtr = ptr) { + _context->glGetObjectPtrLabel(ptrPtr, bufSize, length, label); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetProgramInterfaceiv( + GlHandle program, + uint programInterface, + uint pname, + int* @params + ) + { + _context->glGetProgramInterfaceiv(program.Value, programInterface, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint GetProgramResourceIndex( + GlHandle program, + uint programInterface, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + return _context->glGetProgramResourceIndex(program.Value, programInterface, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetProgramResourceiv( + GlHandle program, + uint programInterface, + uint index, + int propCount, + ReadOnlySpan props, + int count, + int* length, + int* @params + ) + { + fixed (uint* propsPtr = props) { + _context->glGetProgramResourceiv(program.Value, programInterface, index, propCount, + propsPtr, count, length, @params); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int GetProgramResourceLocation( + GlHandle program, + uint programInterface, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + return _context->glGetProgramResourceLocation(program.Value, programInterface, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int GetProgramResourceLocationIndex( + GlHandle program, + uint programInterface, + ReadOnlySpan name + ) + { + fixed (byte* namePtr = name) { + return _context->glGetProgramResourceLocationIndex(program.Value, programInterface, namePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetProgramResourceName( + GlHandle program, + uint programInterface, + uint index, + int bufSize, + int* length, + byte* name + ) + { + _context->glGetProgramResourceName(program.Value, programInterface, index, bufSize, + length, name); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InvalidateBufferData( + GlHandle buffer + ) + { + _context->glInvalidateBufferData(buffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InvalidateBufferSubData( + GlHandle buffer, + nint offset, + nuint length + ) + { + _context->glInvalidateBufferSubData(buffer.Value, offset, length); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InvalidateFramebuffer( + uint target, + int numAttachments, + ReadOnlySpan attachments + ) + { + fixed (uint* attachmentsPtr = attachments) { + _context->glInvalidateFramebuffer(target, numAttachments, attachmentsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InvalidateSubFramebuffer( + uint target, + int numAttachments, + ReadOnlySpan attachments, + int x, + int y, + int width, + int height + ) + { + fixed (uint* attachmentsPtr = attachments) { + _context->glInvalidateSubFramebuffer(target, numAttachments, attachmentsPtr, x, y, + width, height); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InvalidateTexImage( + GlHandle texture, + int level + ) + { + _context->glInvalidateTexImage(texture.Value, level); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InvalidateTexSubImage( + GlHandle texture, + int level, + int xoffset, + int yoffset, + int zoffset, + int width, + int height, + int depth + ) + { + _context->glInvalidateTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, + width, height, depth); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MultiDrawArraysIndirect( + uint mode, + ReadOnlySpan indirect, + int drawcount, + int stride + ) + { + fixed (IntPtr* indirectPtr = indirect) { + _context->glMultiDrawArraysIndirect(mode, indirectPtr, drawcount, stride); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MultiDrawElementsIndirect( + uint mode, + ShaderType type, + ReadOnlySpan indirect, + int drawcount, + int stride + ) + { + fixed (IntPtr* indirectPtr = indirect) { + _context->glMultiDrawElementsIndirect(mode, (uint)type, indirectPtr, drawcount, + stride); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ObjectLabel( + uint identifier, + uint name, + int length, + ReadOnlySpan label + ) + { + fixed (byte* labelPtr = label) { + _context->glObjectLabel(identifier, name, length, labelPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ObjectPtrLabel( + ReadOnlySpan ptr, + int length, + ReadOnlySpan label + ) + { + fixed (IntPtr* ptrPtr = ptr) + { + fixed (byte* labelPtr = label) { + _context->glObjectPtrLabel(ptrPtr, length, labelPtr); + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PopDebugGroup() + { + _context->glPopDebugGroup(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PushDebugGroup( + uint source, + uint id, + int length, + ReadOnlySpan message + ) + { + fixed (byte* messagePtr = message) { + _context->glPushDebugGroup(source, id, length, messagePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ShaderStorageBlockBinding( + GlHandle program, + uint storageBlockIndex, + uint storageBlockBinding + ) + { + _context->glShaderStorageBlockBinding(program.Value, storageBlockIndex, storageBlockBinding); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexBufferRange( + uint target, + uint internalformat, + GlHandle buffer, + nint offset, + nuint size + ) + { + _context->glTexBufferRange(target, internalformat, buffer.Value, offset, size); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexStorage2DMultisample( + uint target, + int samples, + uint internalformat, + int width, + int height, + byte fixedsamplelocations + ) + { + _context->glTexStorage2DMultisample(target, samples, internalformat, width, height, + fixedsamplelocations); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TexStorage3DMultisample( + uint target, + int samples, + uint internalformat, + int width, + int height, + int depth, + byte fixedsamplelocations + ) + { + _context->glTexStorage3DMultisample(target, samples, internalformat, width, height, + depth, fixedsamplelocations); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureView( + GlHandle texture, + uint target, + GlHandle origtexture, + uint internalformat, + uint minlevel, + uint numlevels, + uint minlayer, + uint numlayers + ) + { + _context->glTextureView(texture.Value, target, origtexture.Value, internalformat, + minlevel, numlevels, minlayer, numlayers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribBinding( + uint attribindex, + uint bindingindex + ) + { + _context->glVertexAttribBinding(attribindex, bindingindex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribFormat( + uint attribindex, + int size, + ShaderType type, + byte normalized, + uint relativeoffset + ) + { + _context->glVertexAttribFormat(attribindex, size, (uint)type, normalized, + relativeoffset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribIFormat( + uint attribindex, + int size, + ShaderType type, + uint relativeoffset + ) + { + _context->glVertexAttribIFormat(attribindex, size, (uint)type, relativeoffset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexAttribLFormat( + uint attribindex, + int size, + ShaderType type, + uint relativeoffset + ) + { + _context->glVertexAttribLFormat(attribindex, size, (uint)type, relativeoffset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexBindingDivisor( + uint bindingindex, + uint divisor + ) + { + _context->glVertexBindingDivisor(bindingindex, divisor); + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_4.cs b/StgsSharp.Graphics/OpenGL/glFunction.v4_4.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glFunction.v4_4.cs rename to StgsSharp.Graphics/OpenGL/glFunction.v4_4.cs index 5901ac78..2ebcc672 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_4.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.v4_4.cs @@ -1,179 +1,179 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFunction.v4_4" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBuffersBase( - uint target, - uint first, - int count, - ReadOnlySpan buffers - ) - { - fixed (uint* buffersPtr = buffers) { - _context->glBindBuffersBase(target, first, count, buffersPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindBuffersRange( - uint target, - uint first, - int count, - ReadOnlySpan buffers, - ReadOnlySpan offsets, - ReadOnlySpan sizes - ) - { - fixed (uint* buffersPtr = buffers) - { - fixed (nint* offsetsPtr = offsets) - { - fixed (nuint* sizesPtr = sizes) { - _context->glBindBuffersRange(target, first, count, buffersPtr, offsetsPtr, - sizesPtr); - } - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindImageTextures( - uint first, - int count, - ReadOnlySpan textures - ) - { - fixed (uint* texturesPtr = textures) { - _context->glBindImageTextures(first, count, texturesPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindSamplers( - uint first, - int count, - ReadOnlySpan samplers - ) - { - fixed (uint* samplersPtr = samplers) { - _context->glBindSamplers(first, count, samplersPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindTextures( - uint first, - int count, - ReadOnlySpan textures - ) - { - fixed (uint* texturesPtr = textures) { - _context->glBindTextures(first, count, texturesPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindVertexBuffers( - uint first, - int count, - ReadOnlySpan buffers, - ReadOnlySpan offsets, - ReadOnlySpan strides - ) - { - fixed (uint* buffersPtr = buffers) - { - fixed (nint* offsetsPtr = offsets) - { - fixed (int* stridesPtr = strides) { - _context->glBindVertexBuffers(first, count, buffersPtr, offsetsPtr, - stridesPtr); - } - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BufferStorage( - uint target, - nuint size, - ReadOnlySpan data, - uint flags - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glBufferStorage(target, size, dataPtr, flags); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearTexImage( - GlHandle texture, - int level, - uint format, - ShaderType type, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glClearTexImage(texture.Value, level, format, (uint)type, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearTexSubImage( - GlHandle texture, - int level, - int xoffset, - int yoffset, - int zoffset, - int width, - int height, - int depth, - uint format, - ShaderType type, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glClearTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, - height, depth, format, (uint)type, dataPtr); - } - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFunction.v4_4" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial class OpenGLFunction + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindBuffersBase( + uint target, + uint first, + int count, + ReadOnlySpan buffers + ) + { + fixed (uint* buffersPtr = buffers) { + _context->glBindBuffersBase(target, first, count, buffersPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindBuffersRange( + uint target, + uint first, + int count, + ReadOnlySpan buffers, + ReadOnlySpan offsets, + ReadOnlySpan sizes + ) + { + fixed (uint* buffersPtr = buffers) + { + fixed (nint* offsetsPtr = offsets) + { + fixed (nuint* sizesPtr = sizes) { + _context->glBindBuffersRange(target, first, count, buffersPtr, offsetsPtr, + sizesPtr); + } + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindImageTextures( + uint first, + int count, + ReadOnlySpan textures + ) + { + fixed (uint* texturesPtr = textures) { + _context->glBindImageTextures(first, count, texturesPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindSamplers( + uint first, + int count, + ReadOnlySpan samplers + ) + { + fixed (uint* samplersPtr = samplers) { + _context->glBindSamplers(first, count, samplersPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindTextures( + uint first, + int count, + ReadOnlySpan textures + ) + { + fixed (uint* texturesPtr = textures) { + _context->glBindTextures(first, count, texturesPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindVertexBuffers( + uint first, + int count, + ReadOnlySpan buffers, + ReadOnlySpan offsets, + ReadOnlySpan strides + ) + { + fixed (uint* buffersPtr = buffers) + { + fixed (nint* offsetsPtr = offsets) + { + fixed (int* stridesPtr = strides) { + _context->glBindVertexBuffers(first, count, buffersPtr, offsetsPtr, + stridesPtr); + } + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BufferStorage( + uint target, + nuint size, + ReadOnlySpan data, + uint flags + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glBufferStorage(target, size, dataPtr, flags); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearTexImage( + GlHandle texture, + int level, + uint format, + ShaderType type, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glClearTexImage(texture.Value, level, format, (uint)type, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearTexSubImage( + GlHandle texture, + int level, + int xoffset, + int yoffset, + int zoffset, + int width, + int height, + int depth, + uint format, + ShaderType type, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glClearTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, + height, depth, format, (uint)type, dataPtr); + } + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_5.cs b/StgsSharp.Graphics/OpenGL/glFunction.v4_5.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glFunction.v4_5.cs rename to StgsSharp.Graphics/OpenGL/glFunction.v4_5.cs index 5fdc7fa0..9e72156d 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_5.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.v4_5.cs @@ -1,1355 +1,1355 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFunction.v4_5" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void BindTextureUnit( - uint unit, - GlHandle texture - ) - { - _context->glBindTextureUnit(unit, texture.Value); - } - - [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 - ) - { - _context->glBlitNamedFramebuffer(readFramebuffer.Value, drawFramebuffer.Value, srcX0, - srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, - filter); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint CheckNamedFramebufferStatus( - GlHandle framebuffer, - uint target - ) - { - return _context->glCheckNamedFramebufferStatus(framebuffer.Value, target); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedBufferData( - GlHandle buffer, - uint internalformat, - uint format, - ShaderType type, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glClearNamedBufferData(buffer.Value, internalformat, format, (uint)type, - dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedBufferSubData( - GlHandle buffer, - uint internalformat, - nint offset, - nuint size, - uint format, - ShaderType type, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glClearNamedBufferSubData(buffer.Value, internalformat, offset, size, - format, (uint)type, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedFramebufferfi( - GlHandle framebuffer, - uint buffer, - int drawbuffer, - float depth, - int stencil - ) - { - _context->glClearNamedFramebufferfi(framebuffer.Value, buffer, drawbuffer, depth, - stencil); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedFramebufferfv( - GlHandle framebuffer, - uint buffer, - int drawbuffer, - ReadOnlySpan value - ) - { - fixed (float* valuePtr = value) { - _context->glClearNamedFramebufferfv(framebuffer.Value, buffer, drawbuffer, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedFramebufferiv( - GlHandle framebuffer, - uint buffer, - int drawbuffer, - ReadOnlySpan value - ) - { - fixed (int* valuePtr = value) { - _context->glClearNamedFramebufferiv(framebuffer.Value, buffer, drawbuffer, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClearNamedFramebufferuiv( - GlHandle framebuffer, - uint buffer, - int drawbuffer, - ReadOnlySpan value - ) - { - fixed (uint* valuePtr = value) { - _context->glClearNamedFramebufferuiv(framebuffer.Value, buffer, drawbuffer, - valuePtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ClipControl( - uint origin, - uint depth - ) - { - _context->glClipControl(origin, depth); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTextureSubImage1D( - GlHandle texture, - int level, - int xoffset, - int width, - uint format, - int imageSize, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glCompressedTextureSubImage1D(texture.Value, level, xoffset, width, - format, imageSize, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CompressedTextureSubImage2D( - GlHandle texture, - int level, - int xoffset, - int yoffset, - int width, - int height, - uint format, - int imageSize, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glCompressedTextureSubImage2D(texture.Value, level, xoffset, yoffset, - width, height, format, imageSize, dataPtr); - } - } - - [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, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glCompressedTextureSubImage3D(texture.Value, level, xoffset, yoffset, - zoffset, width, height, depth, format, - imageSize, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyNamedBufferSubData( - GlHandle readBuffer, - GlHandle writeBuffer, - nint readOffset, - nint writeOffset, - nuint size - ) - { - _context->glCopyNamedBufferSubData(readBuffer.Value, writeBuffer.Value, readOffset, - writeOffset, size); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTextureSubImage1D( - GlHandle texture, - int level, - int xoffset, - int x, - int y, - int width - ) - { - _context->glCopyTextureSubImage1D(texture.Value, level, xoffset, x, y, width); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTextureSubImage2D( - GlHandle texture, - int level, - int xoffset, - int yoffset, - int x, - int y, - int width, - int height - ) - { - _context->glCopyTextureSubImage2D(texture.Value, level, xoffset, yoffset, x, y, width, - height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyTextureSubImage3D( - GlHandle texture, - int level, - int xoffset, - int yoffset, - int zoffset, - int x, - int y, - int width, - int height - ) - { - _context->glCopyTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, x, y, - width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateBuffers( - int n, - uint* buffers - ) - { - _context->glCreateBuffers(n, buffers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateFramebuffers( - int n, - uint* framebuffers - ) - { - _context->glCreateFramebuffers(n, framebuffers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateProgramPipelines( - int n, - uint* pipelines - ) - { - _context->glCreateProgramPipelines(n, pipelines); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateQueries( - uint target, - int n, - uint* ids - ) - { - _context->glCreateQueries(target, n, ids); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateRenderbuffers( - int n, - uint* renderbuffers - ) - { - _context->glCreateRenderbuffers(n, renderbuffers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateSamplers( - int n, - uint* samplers - ) - { - _context->glCreateSamplers(n, samplers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateTextures( - uint target, - int n, - uint* textures - ) - { - _context->glCreateTextures(target, n, textures); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateTransformFeedbacks( - int n, - uint* ids - ) - { - _context->glCreateTransformFeedbacks(n, ids); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CreateVertexArrays( - int n, - uint* arrays - ) - { - _context->glCreateVertexArrays(n, arrays); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void DisableVertexArrayAttrib( - uint vaobj, - uint index - ) - { - _context->glDisableVertexArrayAttrib(vaobj, index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void EnableVertexArrayAttrib( - uint vaobj, - uint index - ) - { - _context->glEnableVertexArrayAttrib(vaobj, index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void FlushMappedNamedBufferRange( - GlHandle buffer, - nint offset, - nuint length - ) - { - _context->glFlushMappedNamedBufferRange(buffer.Value, offset, length); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenerateTextureMipmap( - GlHandle texture - ) - { - _context->glGenerateTextureMipmap(texture.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetCompressedTextureImage( - GlHandle texture, - int level, - int bufSize, - IntPtr* pixels - ) - { - _context->glGetCompressedTextureImage(texture.Value, level, bufSize, pixels); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetCompressedTextureSubImage( - GlHandle texture, - int level, - int xoffset, - int yoffset, - int zoffset, - int width, - int height, - int depth, - int bufSize, - IntPtr* pixels - ) - { - _context->glGetCompressedTextureSubImage(texture.Value, level, xoffset, yoffset, - zoffset, width, height, depth, bufSize, - pixels); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public uint GetGraphicsResetStatus() - { - return _context->glGetGraphicsResetStatus(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedBufferParameteri64v( - GlHandle buffer, - uint pname, - IntPtr* @params - ) - { - _context->glGetNamedBufferParameteri64v(buffer.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedBufferParameteriv( - GlHandle buffer, - uint pname, - int* @params - ) - { - _context->glGetNamedBufferParameteriv(buffer.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedBufferPointerv( - GlHandle buffer, - uint pname, - IntPtr* @params - ) - { - _context->glGetNamedBufferPointerv(buffer.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedBufferSubData( - GlHandle buffer, - nint offset, - nuint size, - IntPtr* data - ) - { - _context->glGetNamedBufferSubData(buffer.Value, offset, size, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedFramebufferAttachmentParameteriv( - GlHandle framebuffer, - uint attachment, - uint pname, - int* @params - ) - { - _context->glGetNamedFramebufferAttachmentParameteriv(framebuffer.Value, attachment, - pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedFramebufferParameteriv( - GlHandle framebuffer, - uint pname, - int* param - ) - { - _context->glGetNamedFramebufferParameteriv(framebuffer.Value, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetNamedRenderbufferParameteriv( - GlHandle renderbuffer, - uint pname, - int* @params - ) - { - _context->glGetNamedRenderbufferParameteriv(renderbuffer.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetnCompressedTexImage( - uint target, - int lod, - int bufSize, - IntPtr* pixels - ) - { - _context->glGetnCompressedTexImage(target, lod, bufSize, pixels); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetnTexImage( - uint target, - int level, - uint format, - ShaderType type, - int bufSize, - IntPtr* pixels - ) - { - _context->glGetnTexImage(target, level, format, (uint)type, bufSize, pixels); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetnUniformdv( - GlHandle program, - int location, - int bufSize, - double* @params - ) - { - _context->glGetnUniformdv(program.Value, location, bufSize, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetnUniformfv( - GlHandle program, - int location, - int bufSize, - float* @params - ) - { - _context->glGetnUniformfv(program.Value, location, bufSize, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetnUniformiv( - GlHandle program, - int location, - int bufSize, - int* @params - ) - { - _context->glGetnUniformiv(program.Value, location, bufSize, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetnUniformuiv( - GlHandle program, - int location, - int bufSize, - uint* @params - ) - { - _context->glGetnUniformuiv(program.Value, location, bufSize, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryBufferObjecti64v( - uint id, - GlHandle buffer, - uint pname, - nint offset - ) - { - _context->glGetQueryBufferObjecti64v(id, buffer.Value, pname, offset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryBufferObjectiv( - uint id, - GlHandle buffer, - uint pname, - nint offset - ) - { - _context->glGetQueryBufferObjectiv(id, buffer.Value, pname, offset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryBufferObjectui64v( - uint id, - GlHandle buffer, - uint pname, - nint offset - ) - { - _context->glGetQueryBufferObjectui64v(id, buffer.Value, pname, offset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetQueryBufferObjectuiv( - uint id, - GlHandle buffer, - uint pname, - nint offset - ) - { - _context->glGetQueryBufferObjectuiv(id, buffer.Value, pname, offset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureImage( - GlHandle texture, - int level, - uint format, - ShaderType type, - int bufSize, - IntPtr* pixels - ) - { - _context->glGetTextureImage(texture.Value, level, format, (uint)type, bufSize, pixels); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureLevelParameterfv( - GlHandle texture, - int level, - uint pname, - float* @params - ) - { - _context->glGetTextureLevelParameterfv(texture.Value, level, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureLevelParameteriv( - GlHandle texture, - int level, - uint pname, - int* @params - ) - { - _context->glGetTextureLevelParameteriv(texture.Value, level, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureParameterfv( - GlHandle texture, - uint pname, - float* @params - ) - { - _context->glGetTextureParameterfv(texture.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureParameterIiv( - GlHandle texture, - uint pname, - int* @params - ) - { - _context->glGetTextureParameterIiv(texture.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureParameterIuiv( - GlHandle texture, - uint pname, - uint* @params - ) - { - _context->glGetTextureParameterIuiv(texture.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureParameteriv( - GlHandle texture, - uint pname, - int* @params - ) - { - _context->glGetTextureParameteriv(texture.Value, pname, @params); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTextureSubImage( - GlHandle texture, - int level, - int xoffset, - int yoffset, - int zoffset, - int width, - int height, - int depth, - uint format, - ShaderType type, - int bufSize, - IntPtr* pixels - ) - { - _context->glGetTextureSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, - height, depth, format, (uint)type, bufSize, pixels); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTransformFeedbacki_v( - uint xfb, - uint pname, - uint index, - int* param - ) - { - _context->glGetTransformFeedbacki_v(xfb, pname, index, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTransformFeedbacki64_v( - uint xfb, - uint pname, - uint index, - IntPtr* param - ) - { - _context->glGetTransformFeedbacki64_v(xfb, pname, index, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetTransformFeedbackiv( - uint xfb, - uint pname, - int* param - ) - { - _context->glGetTransformFeedbackiv(xfb, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexArrayIndexed64iv( - uint vaobj, - uint index, - uint pname, - IntPtr* param - ) - { - _context->glGetVertexArrayIndexed64iv(vaobj, index, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexArrayIndexediv( - uint vaobj, - uint index, - uint pname, - int* param - ) - { - _context->glGetVertexArrayIndexediv(vaobj, index, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GetVertexArrayiv( - uint vaobj, - uint pname, - int* param - ) - { - _context->glGetVertexArrayiv(vaobj, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateNamedFramebufferData( - GlHandle framebuffer, - int numAttachments, - ReadOnlySpan attachments - ) - { - fixed (uint* attachmentsPtr = attachments) { - _context->glInvalidateNamedFramebufferData(framebuffer.Value, numAttachments, attachmentsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InvalidateNamedFramebufferSubData( - GlHandle framebuffer, - int numAttachments, - ReadOnlySpan attachments, - int x, - int y, - int width, - int height - ) - { - fixed (uint* attachmentsPtr = attachments) { - _context->glInvalidateNamedFramebufferSubData(framebuffer.Value, numAttachments, - attachmentsPtr, x, y, width, height); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MapNamedBuffer( - GlHandle buffer, - uint access - ) - { - _context->glMapNamedBuffer(buffer.Value, access); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MapNamedBufferRange( - GlHandle buffer, - nint offset, - nuint length, - uint access - ) - { - _context->glMapNamedBufferRange(buffer.Value, offset, length, access); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MemoryBarrierByRegion( - uint barriers - ) - { - _context->glMemoryBarrierByRegion(barriers); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedBufferData( - GlHandle buffer, - nuint size, - ReadOnlySpan data, - uint usage - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glNamedBufferData(buffer.Value, size, dataPtr, usage); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedBufferStorage( - GlHandle buffer, - nuint size, - ReadOnlySpan data, - uint flags - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glNamedBufferStorage(buffer.Value, size, dataPtr, flags); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedBufferSubData( - GlHandle buffer, - nint offset, - nuint size, - ReadOnlySpan data - ) - { - fixed (IntPtr* dataPtr = data) { - _context->glNamedBufferSubData(buffer.Value, offset, size, dataPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFramebufferDrawBuffer( - GlHandle framebuffer, - uint buf - ) - { - _context->glNamedFramebufferDrawBuffer(framebuffer.Value, buf); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFramebufferDrawBuffers( - GlHandle framebuffer, - int n, - ReadOnlySpan bufs - ) - { - fixed (uint* bufsPtr = bufs) { - _context->glNamedFramebufferDrawBuffers(framebuffer.Value, n, bufsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFramebufferParameteri( - GlHandle framebuffer, - uint pname, - int param - ) - { - _context->glNamedFramebufferParameteri(framebuffer.Value, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFramebufferReadBuffer( - GlHandle framebuffer, - uint src - ) - { - _context->glNamedFramebufferReadBuffer(framebuffer.Value, src); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFramebufferRenderbuffer( - GlHandle framebuffer, - uint attachment, - uint renderbuffertarget, - GlHandle renderbuffer - ) - { - _context->glNamedFramebufferRenderbuffer(framebuffer.Value, attachment, - renderbuffertarget, renderbuffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFramebufferTexture( - GlHandle framebuffer, - uint attachment, - GlHandle texture, - int level - ) - { - _context->glNamedFramebufferTexture(framebuffer.Value, attachment, texture.Value, - level); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedFramebufferTextureLayer( - GlHandle framebuffer, - uint attachment, - GlHandle texture, - int level, - int layer - ) - { - _context->glNamedFramebufferTextureLayer(framebuffer.Value, attachment, texture.Value, - level, layer); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedRenderbufferStorage( - GlHandle renderbuffer, - uint internalformat, - int width, - int height - ) - { - _context->glNamedRenderbufferStorage(renderbuffer.Value, internalformat, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void NamedRenderbufferStorageMultisample( - GlHandle renderbuffer, - int samples, - uint internalformat, - int width, - int height - ) - { - _context->glNamedRenderbufferStorageMultisample(renderbuffer.Value, samples, - internalformat, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ReadnPixels( - int x, - int y, - int width, - int height, - uint format, - ShaderType type, - int bufSize, - IntPtr* data - ) - { - _context->glReadnPixels(x, y, width, height, format, (uint)type, bufSize, data); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureBarrier() - { - _context->glTextureBarrier(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureBuffer( - GlHandle texture, - uint internalformat, - GlHandle buffer - ) - { - _context->glTextureBuffer(texture.Value, internalformat, buffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureBufferRange( - GlHandle texture, - uint internalformat, - GlHandle buffer, - nint offset, - nuint size - ) - { - _context->glTextureBufferRange(texture.Value, internalformat, buffer.Value, offset, - size); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameterf( - GlHandle texture, - uint pname, - float param - ) - { - _context->glTextureParameterf(texture.Value, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameterfv( - GlHandle texture, - uint pname, - ReadOnlySpan param - ) - { - fixed (float* paramPtr = param) { - _context->glTextureParameterfv(texture.Value, pname, paramPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameteri( - GlHandle texture, - uint pname, - int param - ) - { - _context->glTextureParameteri(texture.Value, pname, param); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameterIiv( - GlHandle texture, - uint pname, - ReadOnlySpan @params - ) - { - fixed (int* @paramsPtr = @params) { - _context->glTextureParameterIiv(texture.Value, pname, @paramsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameterIuiv( - GlHandle texture, - uint pname, - ReadOnlySpan @params - ) - { - fixed (uint* @paramsPtr = @params) { - _context->glTextureParameterIuiv(texture.Value, pname, @paramsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureParameteriv( - GlHandle texture, - uint pname, - ReadOnlySpan param - ) - { - fixed (int* paramPtr = param) { - _context->glTextureParameteriv(texture.Value, pname, paramPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage1D( - GlHandle texture, - int levels, - uint internalformat, - int width - ) - { - _context->glTextureStorage1D(texture.Value, levels, internalformat, width); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage2D( - GlHandle texture, - int levels, - uint internalformat, - int width, - int height - ) - { - _context->glTextureStorage2D(texture.Value, levels, internalformat, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage2DMultisample( - GlHandle texture, - int samples, - uint internalformat, - int width, - int height, - byte fixedsamplelocations - ) - { - _context->glTextureStorage2DMultisample(texture.Value, samples, internalformat, width, - height, fixedsamplelocations); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage3D( - GlHandle texture, - int levels, - uint internalformat, - int width, - int height, - int depth - ) - { - _context->glTextureStorage3D(texture.Value, levels, internalformat, width, height, - depth); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureStorage3DMultisample( - GlHandle texture, - int samples, - uint internalformat, - int width, - int height, - int depth, - byte fixedsamplelocations - ) - { - _context->glTextureStorage3DMultisample(texture.Value, samples, internalformat, width, - height, depth, fixedsamplelocations); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureSubImage1D( - GlHandle texture, - int level, - int xoffset, - int width, - uint format, - ShaderType type, - ReadOnlySpan pixels - ) - { - fixed (IntPtr* pixelsPtr = pixels) { - _context->glTextureSubImage1D(texture.Value, level, xoffset, width, format, - (uint)type, pixelsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureSubImage2D( - GlHandle texture, - int level, - int xoffset, - int yoffset, - int width, - int height, - uint format, - ShaderType type, - ReadOnlySpan pixels - ) - { - fixed (IntPtr* pixelsPtr = pixels) { - _context->glTextureSubImage2D(texture.Value, level, xoffset, yoffset, width, height, - format, (uint)type, pixelsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TextureSubImage3D( - GlHandle texture, - int level, - int xoffset, - int yoffset, - int zoffset, - int width, - int height, - int depth, - uint format, - ShaderType type, - ReadOnlySpan pixels - ) - { - fixed (IntPtr* pixelsPtr = pixels) { - _context->glTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, - width, height, depth, format, (uint)type, pixelsPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TransformFeedbackBufferBase( - uint xfb, - uint index, - GlHandle buffer - ) - { - _context->glTransformFeedbackBufferBase(xfb, index, buffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TransformFeedbackBufferRange( - uint xfb, - uint index, - GlHandle buffer, - nint offset, - nuint size - ) - { - _context->glTransformFeedbackBufferRange(xfb, index, buffer.Value, offset, size); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public byte UnmapNamedBuffer( - GlHandle buffer - ) - { - return _context->glUnmapNamedBuffer(buffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayAttribBinding( - uint vaobj, - uint attribindex, - uint bindingindex - ) - { - _context->glVertexArrayAttribBinding(vaobj, attribindex, bindingindex); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayAttribFormat( - uint vaobj, - uint attribindex, - int size, - ShaderType type, - byte normalized, - uint relativeoffset - ) - { - _context->glVertexArrayAttribFormat(vaobj, attribindex, size, (uint)type, normalized, - relativeoffset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayAttribIFormat( - uint vaobj, - uint attribindex, - int size, - ShaderType type, - uint relativeoffset - ) - { - _context->glVertexArrayAttribIFormat(vaobj, attribindex, size, (uint)type, - relativeoffset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayAttribLFormat( - uint vaobj, - uint attribindex, - int size, - ShaderType type, - uint relativeoffset - ) - { - _context->glVertexArrayAttribLFormat(vaobj, attribindex, size, (uint)type, - relativeoffset); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayBindingDivisor( - uint vaobj, - uint bindingindex, - uint divisor - ) - { - _context->glVertexArrayBindingDivisor(vaobj, bindingindex, divisor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayElementBuffer( - uint vaobj, - GlHandle buffer - ) - { - _context->glVertexArrayElementBuffer(vaobj, buffer.Value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayVertexBuffer( - uint vaobj, - uint bindingindex, - GlHandle buffer, - nint offset, - int stride - ) - { - _context->glVertexArrayVertexBuffer(vaobj, bindingindex, buffer.Value, offset, stride); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void VertexArrayVertexBuffers( - uint vaobj, - uint first, - int count, - ReadOnlySpan buffers, - ReadOnlySpan offsets, - ReadOnlySpan strides - ) - { - fixed (uint* buffersPtr = buffers) - { - fixed (nint* offsetsPtr = offsets) - { - fixed (int* stridesPtr = strides) { - _context->glVertexArrayVertexBuffers(vaobj, first, count, buffersPtr, - offsetsPtr, stridesPtr); - } - } - } - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFunction.v4_5" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial class OpenGLFunction + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void BindTextureUnit( + uint unit, + GlHandle texture + ) + { + _context->glBindTextureUnit(unit, texture.Value); + } + + [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 + ) + { + _context->glBlitNamedFramebuffer(readFramebuffer.Value, drawFramebuffer.Value, srcX0, + srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, + filter); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint CheckNamedFramebufferStatus( + GlHandle framebuffer, + uint target + ) + { + return _context->glCheckNamedFramebufferStatus(framebuffer.Value, target); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearNamedBufferData( + GlHandle buffer, + uint internalformat, + uint format, + ShaderType type, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glClearNamedBufferData(buffer.Value, internalformat, format, (uint)type, + dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearNamedBufferSubData( + GlHandle buffer, + uint internalformat, + nint offset, + nuint size, + uint format, + ShaderType type, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glClearNamedBufferSubData(buffer.Value, internalformat, offset, size, + format, (uint)type, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearNamedFramebufferfi( + GlHandle framebuffer, + uint buffer, + int drawbuffer, + float depth, + int stencil + ) + { + _context->glClearNamedFramebufferfi(framebuffer.Value, buffer, drawbuffer, depth, + stencil); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearNamedFramebufferfv( + GlHandle framebuffer, + uint buffer, + int drawbuffer, + ReadOnlySpan value + ) + { + fixed (float* valuePtr = value) { + _context->glClearNamedFramebufferfv(framebuffer.Value, buffer, drawbuffer, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearNamedFramebufferiv( + GlHandle framebuffer, + uint buffer, + int drawbuffer, + ReadOnlySpan value + ) + { + fixed (int* valuePtr = value) { + _context->glClearNamedFramebufferiv(framebuffer.Value, buffer, drawbuffer, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClearNamedFramebufferuiv( + GlHandle framebuffer, + uint buffer, + int drawbuffer, + ReadOnlySpan value + ) + { + fixed (uint* valuePtr = value) { + _context->glClearNamedFramebufferuiv(framebuffer.Value, buffer, drawbuffer, + valuePtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ClipControl( + uint origin, + uint depth + ) + { + _context->glClipControl(origin, depth); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CompressedTextureSubImage1D( + GlHandle texture, + int level, + int xoffset, + int width, + uint format, + int imageSize, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glCompressedTextureSubImage1D(texture.Value, level, xoffset, width, + format, imageSize, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CompressedTextureSubImage2D( + GlHandle texture, + int level, + int xoffset, + int yoffset, + int width, + int height, + uint format, + int imageSize, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glCompressedTextureSubImage2D(texture.Value, level, xoffset, yoffset, + width, height, format, imageSize, dataPtr); + } + } + + [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, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glCompressedTextureSubImage3D(texture.Value, level, xoffset, yoffset, + zoffset, width, height, depth, format, + imageSize, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyNamedBufferSubData( + GlHandle readBuffer, + GlHandle writeBuffer, + nint readOffset, + nint writeOffset, + nuint size + ) + { + _context->glCopyNamedBufferSubData(readBuffer.Value, writeBuffer.Value, readOffset, + writeOffset, size); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTextureSubImage1D( + GlHandle texture, + int level, + int xoffset, + int x, + int y, + int width + ) + { + _context->glCopyTextureSubImage1D(texture.Value, level, xoffset, x, y, width); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTextureSubImage2D( + GlHandle texture, + int level, + int xoffset, + int yoffset, + int x, + int y, + int width, + int height + ) + { + _context->glCopyTextureSubImage2D(texture.Value, level, xoffset, yoffset, x, y, width, + height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTextureSubImage3D( + GlHandle texture, + int level, + int xoffset, + int yoffset, + int zoffset, + int x, + int y, + int width, + int height + ) + { + _context->glCopyTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, x, y, + width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CreateBuffers( + int n, + uint* buffers + ) + { + _context->glCreateBuffers(n, buffers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CreateFramebuffers( + int n, + uint* framebuffers + ) + { + _context->glCreateFramebuffers(n, framebuffers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CreateProgramPipelines( + int n, + uint* pipelines + ) + { + _context->glCreateProgramPipelines(n, pipelines); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CreateQueries( + uint target, + int n, + uint* ids + ) + { + _context->glCreateQueries(target, n, ids); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CreateRenderbuffers( + int n, + uint* renderbuffers + ) + { + _context->glCreateRenderbuffers(n, renderbuffers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CreateSamplers( + int n, + uint* samplers + ) + { + _context->glCreateSamplers(n, samplers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CreateTextures( + uint target, + int n, + uint* textures + ) + { + _context->glCreateTextures(target, n, textures); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CreateTransformFeedbacks( + int n, + uint* ids + ) + { + _context->glCreateTransformFeedbacks(n, ids); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CreateVertexArrays( + int n, + uint* arrays + ) + { + _context->glCreateVertexArrays(n, arrays); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void DisableVertexArrayAttrib( + uint vaobj, + uint index + ) + { + _context->glDisableVertexArrayAttrib(vaobj, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void EnableVertexArrayAttrib( + uint vaobj, + uint index + ) + { + _context->glEnableVertexArrayAttrib(vaobj, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void FlushMappedNamedBufferRange( + GlHandle buffer, + nint offset, + nuint length + ) + { + _context->glFlushMappedNamedBufferRange(buffer.Value, offset, length); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GenerateTextureMipmap( + GlHandle texture + ) + { + _context->glGenerateTextureMipmap(texture.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetCompressedTextureImage( + GlHandle texture, + int level, + int bufSize, + IntPtr* pixels + ) + { + _context->glGetCompressedTextureImage(texture.Value, level, bufSize, pixels); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetCompressedTextureSubImage( + GlHandle texture, + int level, + int xoffset, + int yoffset, + int zoffset, + int width, + int height, + int depth, + int bufSize, + IntPtr* pixels + ) + { + _context->glGetCompressedTextureSubImage(texture.Value, level, xoffset, yoffset, + zoffset, width, height, depth, bufSize, + pixels); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint GetGraphicsResetStatus() + { + return _context->glGetGraphicsResetStatus(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetNamedBufferParameteri64v( + GlHandle buffer, + uint pname, + IntPtr* @params + ) + { + _context->glGetNamedBufferParameteri64v(buffer.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetNamedBufferParameteriv( + GlHandle buffer, + uint pname, + int* @params + ) + { + _context->glGetNamedBufferParameteriv(buffer.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetNamedBufferPointerv( + GlHandle buffer, + uint pname, + IntPtr* @params + ) + { + _context->glGetNamedBufferPointerv(buffer.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetNamedBufferSubData( + GlHandle buffer, + nint offset, + nuint size, + IntPtr* data + ) + { + _context->glGetNamedBufferSubData(buffer.Value, offset, size, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetNamedFramebufferAttachmentParameteriv( + GlHandle framebuffer, + uint attachment, + uint pname, + int* @params + ) + { + _context->glGetNamedFramebufferAttachmentParameteriv(framebuffer.Value, attachment, + pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetNamedFramebufferParameteriv( + GlHandle framebuffer, + uint pname, + int* param + ) + { + _context->glGetNamedFramebufferParameteriv(framebuffer.Value, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetNamedRenderbufferParameteriv( + GlHandle renderbuffer, + uint pname, + int* @params + ) + { + _context->glGetNamedRenderbufferParameteriv(renderbuffer.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetnCompressedTexImage( + uint target, + int lod, + int bufSize, + IntPtr* pixels + ) + { + _context->glGetnCompressedTexImage(target, lod, bufSize, pixels); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetnTexImage( + uint target, + int level, + uint format, + ShaderType type, + int bufSize, + IntPtr* pixels + ) + { + _context->glGetnTexImage(target, level, format, (uint)type, bufSize, pixels); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetnUniformdv( + GlHandle program, + int location, + int bufSize, + double* @params + ) + { + _context->glGetnUniformdv(program.Value, location, bufSize, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetnUniformfv( + GlHandle program, + int location, + int bufSize, + float* @params + ) + { + _context->glGetnUniformfv(program.Value, location, bufSize, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetnUniformiv( + GlHandle program, + int location, + int bufSize, + int* @params + ) + { + _context->glGetnUniformiv(program.Value, location, bufSize, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetnUniformuiv( + GlHandle program, + int location, + int bufSize, + uint* @params + ) + { + _context->glGetnUniformuiv(program.Value, location, bufSize, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryBufferObjecti64v( + uint id, + GlHandle buffer, + uint pname, + nint offset + ) + { + _context->glGetQueryBufferObjecti64v(id, buffer.Value, pname, offset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryBufferObjectiv( + uint id, + GlHandle buffer, + uint pname, + nint offset + ) + { + _context->glGetQueryBufferObjectiv(id, buffer.Value, pname, offset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryBufferObjectui64v( + uint id, + GlHandle buffer, + uint pname, + nint offset + ) + { + _context->glGetQueryBufferObjectui64v(id, buffer.Value, pname, offset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetQueryBufferObjectuiv( + uint id, + GlHandle buffer, + uint pname, + nint offset + ) + { + _context->glGetQueryBufferObjectuiv(id, buffer.Value, pname, offset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTextureImage( + GlHandle texture, + int level, + uint format, + ShaderType type, + int bufSize, + IntPtr* pixels + ) + { + _context->glGetTextureImage(texture.Value, level, format, (uint)type, bufSize, pixels); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTextureLevelParameterfv( + GlHandle texture, + int level, + uint pname, + float* @params + ) + { + _context->glGetTextureLevelParameterfv(texture.Value, level, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTextureLevelParameteriv( + GlHandle texture, + int level, + uint pname, + int* @params + ) + { + _context->glGetTextureLevelParameteriv(texture.Value, level, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTextureParameterfv( + GlHandle texture, + uint pname, + float* @params + ) + { + _context->glGetTextureParameterfv(texture.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTextureParameterIiv( + GlHandle texture, + uint pname, + int* @params + ) + { + _context->glGetTextureParameterIiv(texture.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTextureParameterIuiv( + GlHandle texture, + uint pname, + uint* @params + ) + { + _context->glGetTextureParameterIuiv(texture.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTextureParameteriv( + GlHandle texture, + uint pname, + int* @params + ) + { + _context->glGetTextureParameteriv(texture.Value, pname, @params); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTextureSubImage( + GlHandle texture, + int level, + int xoffset, + int yoffset, + int zoffset, + int width, + int height, + int depth, + uint format, + ShaderType type, + int bufSize, + IntPtr* pixels + ) + { + _context->glGetTextureSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, + height, depth, format, (uint)type, bufSize, pixels); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTransformFeedbacki_v( + uint xfb, + uint pname, + uint index, + int* param + ) + { + _context->glGetTransformFeedbacki_v(xfb, pname, index, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTransformFeedbacki64_v( + uint xfb, + uint pname, + uint index, + IntPtr* param + ) + { + _context->glGetTransformFeedbacki64_v(xfb, pname, index, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetTransformFeedbackiv( + uint xfb, + uint pname, + int* param + ) + { + _context->glGetTransformFeedbackiv(xfb, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexArrayIndexed64iv( + uint vaobj, + uint index, + uint pname, + IntPtr* param + ) + { + _context->glGetVertexArrayIndexed64iv(vaobj, index, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexArrayIndexediv( + uint vaobj, + uint index, + uint pname, + int* param + ) + { + _context->glGetVertexArrayIndexediv(vaobj, index, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetVertexArrayiv( + uint vaobj, + uint pname, + int* param + ) + { + _context->glGetVertexArrayiv(vaobj, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InvalidateNamedFramebufferData( + GlHandle framebuffer, + int numAttachments, + ReadOnlySpan attachments + ) + { + fixed (uint* attachmentsPtr = attachments) { + _context->glInvalidateNamedFramebufferData(framebuffer.Value, numAttachments, attachmentsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InvalidateNamedFramebufferSubData( + GlHandle framebuffer, + int numAttachments, + ReadOnlySpan attachments, + int x, + int y, + int width, + int height + ) + { + fixed (uint* attachmentsPtr = attachments) { + _context->glInvalidateNamedFramebufferSubData(framebuffer.Value, numAttachments, + attachmentsPtr, x, y, width, height); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MapNamedBuffer( + GlHandle buffer, + uint access + ) + { + _context->glMapNamedBuffer(buffer.Value, access); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MapNamedBufferRange( + GlHandle buffer, + nint offset, + nuint length, + uint access + ) + { + _context->glMapNamedBufferRange(buffer.Value, offset, length, access); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MemoryBarrierByRegion( + uint barriers + ) + { + _context->glMemoryBarrierByRegion(barriers); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedBufferData( + GlHandle buffer, + nuint size, + ReadOnlySpan data, + uint usage + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glNamedBufferData(buffer.Value, size, dataPtr, usage); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedBufferStorage( + GlHandle buffer, + nuint size, + ReadOnlySpan data, + uint flags + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glNamedBufferStorage(buffer.Value, size, dataPtr, flags); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedBufferSubData( + GlHandle buffer, + nint offset, + nuint size, + ReadOnlySpan data + ) + { + fixed (IntPtr* dataPtr = data) { + _context->glNamedBufferSubData(buffer.Value, offset, size, dataPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedFramebufferDrawBuffer( + GlHandle framebuffer, + uint buf + ) + { + _context->glNamedFramebufferDrawBuffer(framebuffer.Value, buf); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedFramebufferDrawBuffers( + GlHandle framebuffer, + int n, + ReadOnlySpan bufs + ) + { + fixed (uint* bufsPtr = bufs) { + _context->glNamedFramebufferDrawBuffers(framebuffer.Value, n, bufsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedFramebufferParameteri( + GlHandle framebuffer, + uint pname, + int param + ) + { + _context->glNamedFramebufferParameteri(framebuffer.Value, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedFramebufferReadBuffer( + GlHandle framebuffer, + uint src + ) + { + _context->glNamedFramebufferReadBuffer(framebuffer.Value, src); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedFramebufferRenderbuffer( + GlHandle framebuffer, + uint attachment, + uint renderbuffertarget, + GlHandle renderbuffer + ) + { + _context->glNamedFramebufferRenderbuffer(framebuffer.Value, attachment, + renderbuffertarget, renderbuffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedFramebufferTexture( + GlHandle framebuffer, + uint attachment, + GlHandle texture, + int level + ) + { + _context->glNamedFramebufferTexture(framebuffer.Value, attachment, texture.Value, + level); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedFramebufferTextureLayer( + GlHandle framebuffer, + uint attachment, + GlHandle texture, + int level, + int layer + ) + { + _context->glNamedFramebufferTextureLayer(framebuffer.Value, attachment, texture.Value, + level, layer); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedRenderbufferStorage( + GlHandle renderbuffer, + uint internalformat, + int width, + int height + ) + { + _context->glNamedRenderbufferStorage(renderbuffer.Value, internalformat, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void NamedRenderbufferStorageMultisample( + GlHandle renderbuffer, + int samples, + uint internalformat, + int width, + int height + ) + { + _context->glNamedRenderbufferStorageMultisample(renderbuffer.Value, samples, + internalformat, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ReadnPixels( + int x, + int y, + int width, + int height, + uint format, + ShaderType type, + int bufSize, + IntPtr* data + ) + { + _context->glReadnPixels(x, y, width, height, format, (uint)type, bufSize, data); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureBarrier() + { + _context->glTextureBarrier(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureBuffer( + GlHandle texture, + uint internalformat, + GlHandle buffer + ) + { + _context->glTextureBuffer(texture.Value, internalformat, buffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureBufferRange( + GlHandle texture, + uint internalformat, + GlHandle buffer, + nint offset, + nuint size + ) + { + _context->glTextureBufferRange(texture.Value, internalformat, buffer.Value, offset, + size); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureParameterf( + GlHandle texture, + uint pname, + float param + ) + { + _context->glTextureParameterf(texture.Value, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureParameterfv( + GlHandle texture, + uint pname, + ReadOnlySpan param + ) + { + fixed (float* paramPtr = param) { + _context->glTextureParameterfv(texture.Value, pname, paramPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureParameteri( + GlHandle texture, + uint pname, + int param + ) + { + _context->glTextureParameteri(texture.Value, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureParameterIiv( + GlHandle texture, + uint pname, + ReadOnlySpan @params + ) + { + fixed (int* @paramsPtr = @params) { + _context->glTextureParameterIiv(texture.Value, pname, @paramsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureParameterIuiv( + GlHandle texture, + uint pname, + ReadOnlySpan @params + ) + { + fixed (uint* @paramsPtr = @params) { + _context->glTextureParameterIuiv(texture.Value, pname, @paramsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureParameteriv( + GlHandle texture, + uint pname, + ReadOnlySpan param + ) + { + fixed (int* paramPtr = param) { + _context->glTextureParameteriv(texture.Value, pname, paramPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureStorage1D( + GlHandle texture, + int levels, + uint internalformat, + int width + ) + { + _context->glTextureStorage1D(texture.Value, levels, internalformat, width); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureStorage2D( + GlHandle texture, + int levels, + uint internalformat, + int width, + int height + ) + { + _context->glTextureStorage2D(texture.Value, levels, internalformat, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureStorage2DMultisample( + GlHandle texture, + int samples, + uint internalformat, + int width, + int height, + byte fixedsamplelocations + ) + { + _context->glTextureStorage2DMultisample(texture.Value, samples, internalformat, width, + height, fixedsamplelocations); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureStorage3D( + GlHandle texture, + int levels, + uint internalformat, + int width, + int height, + int depth + ) + { + _context->glTextureStorage3D(texture.Value, levels, internalformat, width, height, + depth); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureStorage3DMultisample( + GlHandle texture, + int samples, + uint internalformat, + int width, + int height, + int depth, + byte fixedsamplelocations + ) + { + _context->glTextureStorage3DMultisample(texture.Value, samples, internalformat, width, + height, depth, fixedsamplelocations); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureSubImage1D( + GlHandle texture, + int level, + int xoffset, + int width, + uint format, + ShaderType type, + ReadOnlySpan pixels + ) + { + fixed (IntPtr* pixelsPtr = pixels) { + _context->glTextureSubImage1D(texture.Value, level, xoffset, width, format, + (uint)type, pixelsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureSubImage2D( + GlHandle texture, + int level, + int xoffset, + int yoffset, + int width, + int height, + uint format, + ShaderType type, + ReadOnlySpan pixels + ) + { + fixed (IntPtr* pixelsPtr = pixels) { + _context->glTextureSubImage2D(texture.Value, level, xoffset, yoffset, width, height, + format, (uint)type, pixelsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TextureSubImage3D( + GlHandle texture, + int level, + int xoffset, + int yoffset, + int zoffset, + int width, + int height, + int depth, + uint format, + ShaderType type, + ReadOnlySpan pixels + ) + { + fixed (IntPtr* pixelsPtr = pixels) { + _context->glTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, + width, height, depth, format, (uint)type, pixelsPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TransformFeedbackBufferBase( + uint xfb, + uint index, + GlHandle buffer + ) + { + _context->glTransformFeedbackBufferBase(xfb, index, buffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TransformFeedbackBufferRange( + uint xfb, + uint index, + GlHandle buffer, + nint offset, + nuint size + ) + { + _context->glTransformFeedbackBufferRange(xfb, index, buffer.Value, offset, size); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public byte UnmapNamedBuffer( + GlHandle buffer + ) + { + return _context->glUnmapNamedBuffer(buffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexArrayAttribBinding( + uint vaobj, + uint attribindex, + uint bindingindex + ) + { + _context->glVertexArrayAttribBinding(vaobj, attribindex, bindingindex); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexArrayAttribFormat( + uint vaobj, + uint attribindex, + int size, + ShaderType type, + byte normalized, + uint relativeoffset + ) + { + _context->glVertexArrayAttribFormat(vaobj, attribindex, size, (uint)type, normalized, + relativeoffset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexArrayAttribIFormat( + uint vaobj, + uint attribindex, + int size, + ShaderType type, + uint relativeoffset + ) + { + _context->glVertexArrayAttribIFormat(vaobj, attribindex, size, (uint)type, + relativeoffset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexArrayAttribLFormat( + uint vaobj, + uint attribindex, + int size, + ShaderType type, + uint relativeoffset + ) + { + _context->glVertexArrayAttribLFormat(vaobj, attribindex, size, (uint)type, + relativeoffset); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexArrayBindingDivisor( + uint vaobj, + uint bindingindex, + uint divisor + ) + { + _context->glVertexArrayBindingDivisor(vaobj, bindingindex, divisor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexArrayElementBuffer( + uint vaobj, + GlHandle buffer + ) + { + _context->glVertexArrayElementBuffer(vaobj, buffer.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexArrayVertexBuffer( + uint vaobj, + uint bindingindex, + GlHandle buffer, + nint offset, + int stride + ) + { + _context->glVertexArrayVertexBuffer(vaobj, bindingindex, buffer.Value, offset, stride); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void VertexArrayVertexBuffers( + uint vaobj, + uint first, + int count, + ReadOnlySpan buffers, + ReadOnlySpan offsets, + ReadOnlySpan strides + ) + { + fixed (uint* buffersPtr = buffers) + { + fixed (nint* offsetsPtr = offsets) + { + fixed (int* stridesPtr = strides) { + _context->glVertexArrayVertexBuffers(vaobj, first, count, buffersPtr, + offsetsPtr, stridesPtr); + } + } + } + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_6.cs b/StgsSharp.Graphics/OpenGL/glFunction.v4_6.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glFunction.v4_6.cs rename to StgsSharp.Graphics/OpenGL/glFunction.v4_6.cs index 973d134c..f7bcec58 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_6.cs +++ b/StgsSharp.Graphics/OpenGL/glFunction.v4_6.cs @@ -1,102 +1,102 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glFunction.v4_6" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Graphics.OpenGL -{ - public unsafe partial class OpenGLFunction - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawArraysIndirectCount( - uint mode, - ReadOnlySpan indirect, - nint drawcount, - int maxdrawcount, - int stride - ) - { - fixed (IntPtr* indirectPtr = indirect) { - _context->glMultiDrawArraysIndirectCount(mode, indirectPtr, drawcount, maxdrawcount, - stride); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MultiDrawElementsIndirectCount( - uint mode, - ShaderType type, - ReadOnlySpan indirect, - nint drawcount, - int maxdrawcount, - int stride - ) - { - fixed (IntPtr* indirectPtr = indirect) { - _context->glMultiDrawElementsIndirectCount(mode, (uint)type, indirectPtr, drawcount, - maxdrawcount, stride); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void PolygonOffsetClamp( - float factor, - float units, - float clamp - ) - { - _context->glPolygonOffsetClamp(factor, units, clamp); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SpecializeShader( - GlHandle shader, - ReadOnlySpan pEntryPoint, - uint numSpecializationConstants, - ReadOnlySpan pConstantIndex, - ReadOnlySpan pConstantValue - ) - { - fixed (byte* pEntryPointPtr = pEntryPoint) - { - fixed (uint* pConstantIndexPtr = pConstantIndex) - { - fixed (uint* pConstantValuePtr = pConstantValue) { - _context->glSpecializeShader(shader.Value, pEntryPointPtr, - numSpecializationConstants, pConstantIndexPtr, - pConstantValuePtr); - } - } - } - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glFunction.v4_6" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics.OpenGL +{ + public unsafe partial class OpenGLFunction + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MultiDrawArraysIndirectCount( + uint mode, + ReadOnlySpan indirect, + nint drawcount, + int maxdrawcount, + int stride + ) + { + fixed (IntPtr* indirectPtr = indirect) { + _context->glMultiDrawArraysIndirectCount(mode, indirectPtr, drawcount, maxdrawcount, + stride); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void MultiDrawElementsIndirectCount( + uint mode, + ShaderType type, + ReadOnlySpan indirect, + nint drawcount, + int maxdrawcount, + int stride + ) + { + fixed (IntPtr* indirectPtr = indirect) { + _context->glMultiDrawElementsIndirectCount(mode, (uint)type, indirectPtr, drawcount, + maxdrawcount, stride); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PolygonOffsetClamp( + float factor, + float units, + float clamp + ) + { + _context->glPolygonOffsetClamp(factor, units, clamp); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SpecializeShader( + GlHandle shader, + ReadOnlySpan pEntryPoint, + uint numSpecializationConstants, + ReadOnlySpan pConstantIndex, + ReadOnlySpan pConstantValue + ) + { + fixed (byte* pEntryPointPtr = pEntryPoint) + { + fixed (uint* pConstantIndexPtr = pConstantIndex) + { + fixed (uint* pConstantValuePtr = pConstantValue) { + _context->glSpecializeShader(shader.Value, pEntryPointPtr, + numSpecializationConstants, pConstantIndexPtr, + pConstantValuePtr); + } + } + } + } + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glHandle.cs b/StgsSharp.Graphics/OpenGL/glHandle.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glHandle.cs rename to StgsSharp.Graphics/OpenGL/glHandle.cs index 5c0a41bc..4f0c2f7f 100644 --- a/StgSharp.Common/Graphics/OpenGL/glHandle.cs +++ b/StgsSharp.Graphics/OpenGL/glHandle.cs @@ -1,84 +1,84 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glHandle" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Data.Common; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Versioning; -using System.Security.AccessControl; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics.OpenGL -{ - [StructLayout(LayoutKind.Explicit, Size = 4)] - 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); - } - - public static GlHandle Zero - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new GlHandle - { - Value = 0 - }; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static GlHandle Create(uint value) - { - return new GlHandle - { - Value = value - }; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static GlHandle CreateSigned(int value) - { - return new GlHandle - { - SignedValue = value - }; - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glHandle" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Data.Common; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Versioning; +using System.Security.AccessControl; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.OpenGL +{ + [StructLayout(LayoutKind.Explicit, Size = 4)] + 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); + } + + public static GlHandle Zero + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new GlHandle + { + Value = 0 + }; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static GlHandle Create(uint value) + { + return new GlHandle + { + Value = value + }; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static GlHandle CreateSigned(int value) + { + return new GlHandle + { + SignedValue = value + }; + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/glRenderObjectGenrator.cs b/StgsSharp.Graphics/OpenGL/glRenderObjectGenrator.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glRenderObjectGenrator.cs rename to StgsSharp.Graphics/OpenGL/glRenderObjectGenrator.cs index 0583c373..7e5eb4d8 100644 --- a/StgSharp.Common/Graphics/OpenGL/glRenderObjectGenrator.cs +++ b/StgsSharp.Graphics/OpenGL/glRenderObjectGenrator.cs @@ -1,120 +1,120 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glRenderObjectGenrator" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics.OpenGL -{ - public partial class glRender - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected AutoTextureGL CreateAutoTexture(int count) - { - return new AutoTextureGL(count, this); - } - - /// - /// Create a set of . - /// - /// - /// Amount of EBO to be created. - /// - /// - /// - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected ElementBuffer CreateElementBuffer(int count) - { - return new ElementBuffer(count, this); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected FrameBuffer CreateFrameBuffer(int count) - { - return new FrameBuffer(count, this); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected RenderBuffer CreateRenderBuffer(int count) - { - return new RenderBuffer(count, this); - } - - /// - /// Create a sets of - /// - /// - /// Amount of textures to be created. - /// - /// - /// - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected TextureGL CreateTexture(int count) - { - return new TextureGL(count, this); - } - - /// - /// Create a set of . - /// - /// - /// Amount of VAO to be created. - /// - /// - /// - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected VertexArray CreateVertexArray(int count) - { - return new VertexArray(count, this); - } - - /// - /// Create a set of . - /// - /// - /// Amount of Object to be created. - /// - /// - /// - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected VertexBuffer CreateVertexBuffer(int count) - { - return new VertexBuffer(count, this); - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glRenderObjectGenrator" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.OpenGL +{ + public partial class glRender + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected AutoTextureGL CreateAutoTexture(int count) + { + return new AutoTextureGL(count, this); + } + + /// + /// Create a set of . + /// + /// + /// Amount of EBO to be created. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected ElementBuffer CreateElementBuffer(int count) + { + return new ElementBuffer(count, this); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected FrameBuffer CreateFrameBuffer(int count) + { + return new FrameBuffer(count, this); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected RenderBuffer CreateRenderBuffer(int count) + { + return new RenderBuffer(count, this); + } + + /// + /// Create a sets of + /// + /// + /// Amount of textures to be created. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected TextureGL CreateTexture(int count) + { + return new TextureGL(count, this); + } + + /// + /// Create a set of . + /// + /// + /// Amount of VAO to be created. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected VertexArray CreateVertexArray(int count) + { + return new VertexArray(count, this); + } + + /// + /// Create a set of . + /// + /// + /// Amount of Object to be created. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected VertexBuffer CreateVertexBuffer(int count) + { + return new VertexBuffer(count, this); + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/OpenGL/glRenderStream.ThreadSecurity.cs b/StgsSharp.Graphics/OpenGL/glRenderStream.ThreadSecurity.cs similarity index 97% rename from StgSharp.Common/Graphics/OpenGL/glRenderStream.ThreadSecurity.cs rename to StgsSharp.Graphics/OpenGL/glRenderStream.ThreadSecurity.cs index f6d25be4..4476103d 100644 --- a/StgSharp.Common/Graphics/OpenGL/glRenderStream.ThreadSecurity.cs +++ b/StgsSharp.Graphics/OpenGL/glRenderStream.ThreadSecurity.cs @@ -1,46 +1,46 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glRenderThreadSecurity" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace StgSharp.Graphics.OpenGL -{ - public partial class glRender - { - - private static ConcurrentDictionary threadLocalIndex - = new(); - private readonly SynchronizationContext mainThreadContext = SynchronizationContext.Current; - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glRenderThreadSecurity" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.OpenGL +{ + public partial class glRender + { + + private static ConcurrentDictionary threadLocalIndex + = new(); + private readonly SynchronizationContext mainThreadContext = SynchronizationContext.Current; + + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glRenderStream.cs b/StgsSharp.Graphics/OpenGL/glRenderStream.cs similarity index 96% rename from StgSharp.Common/Graphics/OpenGL/glRenderStream.cs rename to StgsSharp.Graphics/OpenGL/glRenderStream.cs index 9ff49577..e1aa3911 100644 --- a/StgSharp.Common/Graphics/OpenGL/glRenderStream.cs +++ b/StgsSharp.Graphics/OpenGL/glRenderStream.cs @@ -1,197 +1,197 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glRenderStream" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; -using StgSharp.Threading; - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace StgSharp.Graphics.OpenGL -{ - public abstract partial class glRender : RenderStream - { - - private protected static readonly ConcurrentDictionary renderToThread - = new ConcurrentDictionary(); - - private OpenGLFunction _context; - - protected internal OpenGLFunction GL - { - get { return _context; } - } - - /// - /// Initialize an opengl context and load all opengl functions. - /// - public unsafe void InitializeContext() - { - if (ContextHandle == default) - { - ContextHandle = Marshal.AllocHGlobal(Marshal.SizeOf()); - OpenglContext* contextID = (OpenglContext*)ContextHandle; - contextID->glGetString = (delegate*)IntPtr.Zero; - } - if (GL == null) { - _context = OpenGLFunction.BuildGlFunctionPackage(ContextHandle); - } - } - - /// - /// Initialize an OpenGl viewPortDisplay if current form has not been binded to any - /// viewPortDisplay. and set the viewPortDisplay binded to current form as current OpenGL - /// viewPortDisplay. - /// - /// - /// Something goes wrong and World fails in creating a new OpenGL viewPortDisplay. - /// - public unsafe void MakeAsCurrentContext() - { - GraphicFramework.glfwMakeContextCurrent(CanvasHandle); - OpenGLFunction.CurrentGL = this.GL; - } - - /// - public override void RenderEnd() - { - if (!renderToThread.TryGetValue(this, out Thread t) || t != Thread.CurrentThread) { - throw new InvalidOperationException( - $"Current render has had been binded to thread {t!.ManagedThreadId}"); - } - SwapBuffers(); - renderToThread[this] = ThreadHelper.EmptyThread; - GraphicFramework.glfwMakeContextCurrent(IntPtr.Zero); - OpenGLFunction.CurrentGL = null; - } - - /// - public override void RenderStart() - { - Thread current = Thread.CurrentThread; - if (!renderToThread.TryGetValue(this, out Thread t) || t == ThreadHelper.EmptyThread) - { - renderToThread[this] = current; - MakeAsCurrentContext(); - return; - } - if (t != current) { - throw new InvalidOperationException( - $"Current render has had been binded to thread {t!.ManagedThreadId}"); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override void SetSizeLimit( - int minWidth, - int minHeight, - int maxWidth, - int maxHeight - ) - { - GraphicFramework.glfwSetWindowSizeLimits(this.CanvasHandle, minWidth, minHeight, - maxWidth, maxHeight); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal sealed override void PlatformSpecifiedInitialize() - { - InitializeContext(); - MakeAsCurrentContext(); - glManager.LoadOpenGLApiTo(BindedViewPortContext.GraphicHandle); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal sealed override void Terminate() - { - CustomizeDeinit(); - } - - protected sealed override Uniform NativeCameraUniform( - ShaderProgram source, - string name - ) - { - NativeCamera.GainAllUniforms(source, name); - return NativeCamera.convertedUniform; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected sealed override void NativeCameraViewRange( - Radius fieldOfRange, - Vec2 offset, - (float frontDepth, float backDepth) viewDepth - ) - { - NativeCamera.SetViewRange(fieldOfRange, this.Size, offset, viewDepth); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected sealed override void NativeCameraViewTarget( - Vec3 position, - Vec3 direction, - Vec3 up - ) - { - NativeCamera.SetViewDirection(position, direction, up); - } - - #region Key Control - - protected KeyStatus CheckKey( - KeyboardKey key - ) - { - return GraphicFramework.glfwGetKey(this.CanvasHandle, (int)key); - } - - protected KeyStatus CheckKey( - Mouse key - ) - { - return GraphicFramework.glfwGetKey(this.CanvasHandle, (int)key); - } - - protected KeyStatus CheckKey( - Joystick key - ) - { - return GraphicFramework.glfwGetKey(this.CanvasHandle, (int)key); - } - - #endregion - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glRenderStream" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Graphics; +using StgSharp.Threading; + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.OpenGL +{ + public abstract partial class glRender : RenderStream + { + + private protected static readonly ConcurrentDictionary renderToThread + = new ConcurrentDictionary(); + + private OpenGLFunction _context; + + protected internal OpenGLFunction GL + { + get { return _context; } + } + + /// + /// Initialize an opengl context and load all opengl functions. + /// + public unsafe void InitializeContext() + { + if (ContextHandle == default) + { + ContextHandle = Marshal.AllocHGlobal(Marshal.SizeOf()); + OpenglContext* contextID = (OpenglContext*)ContextHandle; + contextID->glGetString = (delegate*)IntPtr.Zero; + } + if (GL == null) { + _context = OpenGLFunction.BuildGlFunctionPackage(ContextHandle); + } + } + + /// + /// Initialize an OpenGl viewPortDisplay if current form has not been binded to any + /// viewPortDisplay. and set the viewPortDisplay binded to current form as current OpenGL + /// viewPortDisplay. + /// + /// + /// Something goes wrong and World fails in creating a new OpenGL viewPortDisplay. + /// + public unsafe void MakeAsCurrentContext() + { + GraphicFramework.glfwMakeContextCurrent(CanvasHandle); + OpenGLFunction.CurrentGL = this.GL; + } + + /// + public override void RenderEnd() + { + if (!renderToThread.TryGetValue(this, out Thread t) || t != Thread.CurrentThread) { + throw new InvalidOperationException( + $"Current render has had been binded to thread {t!.ManagedThreadId}"); + } + SwapBuffers(); + renderToThread[this] = ThreadHelper.EmptyThread; + GraphicFramework.glfwMakeContextCurrent(IntPtr.Zero); + OpenGLFunction.CurrentGL = null; + } + + /// + public override void RenderStart() + { + Thread current = Thread.CurrentThread; + if (!renderToThread.TryGetValue(this, out Thread t) || t == ThreadHelper.EmptyThread) + { + renderToThread[this] = current; + MakeAsCurrentContext(); + return; + } + if (t != current) { + throw new InvalidOperationException( + $"Current render has had been binded to thread {t!.ManagedThreadId}"); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override void SetSizeLimit( + int minWidth, + int minHeight, + int maxWidth, + int maxHeight + ) + { + GraphicFramework.glfwSetWindowSizeLimits(this.CanvasHandle, minWidth, minHeight, + maxWidth, maxHeight); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal sealed override void PlatformSpecifiedInitialize() + { + InitializeContext(); + MakeAsCurrentContext(); + glManager.LoadOpenGLApiTo(BindedViewPortContext.GraphicHandle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal sealed override void Terminate() + { + CustomizeDeinit(); + } + + protected sealed override Uniform NativeCameraUniform( + ShaderProgram source, + string name + ) + { + NativeCamera.GainAllUniforms(source, name); + return NativeCamera.convertedUniform; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected sealed override void NativeCameraViewRange( + Radius fieldOfRange, + Vec2 offset, + (float frontDepth, float backDepth) viewDepth + ) + { + NativeCamera.SetViewRange(fieldOfRange, this.Size, offset, viewDepth); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected sealed override void NativeCameraViewTarget( + Vec3 position, + Vec3 direction, + Vec3 up + ) + { + NativeCamera.SetViewDirection(position, direction, up); + } + + #region Key Control + + protected KeyStatus CheckKey( + KeyboardKey key + ) + { + return GraphicFramework.glfwGetKey(this.CanvasHandle, (int)key); + } + + protected KeyStatus CheckKey( + Mouse key + ) + { + return GraphicFramework.glfwGetKey(this.CanvasHandle, (int)key); + } + + protected KeyStatus CheckKey( + Joystick key + ) + { + return GraphicFramework.glfwGetKey(this.CanvasHandle, (int)key); + } + + #endregion + } +} diff --git a/StgSharp.Common/Graphics/OpenGL/glType.cs b/StgsSharp.Graphics/OpenGL/glType.cs similarity index 96% rename from StgSharp.Common/Graphics/OpenGL/glType.cs rename to StgsSharp.Graphics/OpenGL/glType.cs index 8ddef99b..f430fbad 100644 --- a/StgSharp.Common/Graphics/OpenGL/glType.cs +++ b/StgsSharp.Graphics/OpenGL/glType.cs @@ -1,111 +1,111 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glType" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - internal delegate void GLVULKANPROCNV(); - - public unsafe struct glHandleARB( - IntPtr value - ) { } - - /// - /// OpenGL numeric type. An IEEE-754 floating-point value, clamped to the range [0,1]. - /// - [StructLayout(LayoutKind.Sequential)] - public struct GlClampF - { - - public float value; - - public GlClampF( - float a - ) - { - value = a; - } - - } - - [StructLayout(LayoutKind.Explicit, Size = 16)] - public struct glHalfNv( - Half bin - ) - { - - [FieldOffset(0)] public Half binary = bin; - - public float ToSingle() - { - return (float)binary; - } - - } - - [StructLayout(LayoutKind.Sequential)] - public struct glSync - { - - public IntPtr Handle; - - } - - [StructLayout(LayoutKind.Explicit, Size = 8)] - public struct GlFixed - { - - [FieldOffset(0)] public int All; - [FieldOffset(0)] public short Decimals; - [FieldOffset(4)] public short Integer; - - } - - /// - /// OpenGL numeric type. An IEEE-754 double precision floating-point value, clamped to the - /// range [0,1]. - /// - [StructLayout(LayoutKind.Sequential)] - public struct GlClampD - { - - public double value; - - public GlClampD( - double a - ) - { - value = a; - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glType" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + internal delegate void GLVULKANPROCNV(); + + public unsafe struct glHandleARB( + IntPtr value + ) { } + + /// + /// OpenGL numeric type. An IEEE-754 floating-point value, clamped to the range [0,1]. + /// + [StructLayout(LayoutKind.Sequential)] + public struct GlClampF + { + + public float value; + + public GlClampF( + float a + ) + { + value = a; + } + + } + + [StructLayout(LayoutKind.Explicit, Size = 16)] + public struct glHalfNv( + Half bin + ) + { + + [FieldOffset(0)] public Half binary = bin; + + public float ToSingle() + { + return (float)binary; + } + + } + + [StructLayout(LayoutKind.Sequential)] + public struct glSync + { + + public IntPtr Handle; + + } + + [StructLayout(LayoutKind.Explicit, Size = 8)] + public struct GlFixed + { + + [FieldOffset(0)] public int All; + [FieldOffset(0)] public short Decimals; + [FieldOffset(4)] public short Integer; + + } + + /// + /// OpenGL numeric type. An IEEE-754 double precision floating-point value, clamped to the + /// range [0,1]. + /// + [StructLayout(LayoutKind.Sequential)] + public struct GlClampD + { + + public double value; + + public GlClampD( + double a + ) + { + value = a; + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/Pixels.cs b/StgsSharp.Graphics/Pixels.cs similarity index 97% rename from StgSharp.Common/Graphics/Pixels.cs rename to StgsSharp.Graphics/Pixels.cs index 318cf68c..12c5318d 100644 --- a/StgSharp.Common/Graphics/Pixels.cs +++ b/StgsSharp.Graphics/Pixels.cs @@ -1,83 +1,83 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Pixels" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Graphics -{ - public interface IPixel - { - - public float Red { get; set; } - - public float Green { get; set; } - - public float Blue { get; set; } - - public float Alpha { get; set; } - - internal int Size { get; } - - } - - [StructLayout(LayoutKind.Explicit, Size = 32)] - public unsafe struct Pixel32RGBA : IPixel - { - - [FieldOffset(0)] private unsafe fixed byte data[4]; - - public int Size => 4; - - float IPixel.Alpha - { - get => data[3] / 256 ; - set => data[3] = (byte)(value * 256); - } - - float IPixel.Blue - { - get => data[2] / 256 ; - set => data[2] = (byte)(value * 256); - } - - float IPixel.Green - { - get => data[1] / 256 ; - set => data[1] = (byte)(value * 256); - } - - float IPixel.Red - { - get => data[0] / 256 ; - set => data[0] = (byte)(value * 256); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Pixels" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics +{ + public interface IPixel + { + + public float Red { get; set; } + + public float Green { get; set; } + + public float Blue { get; set; } + + public float Alpha { get; set; } + + internal int Size { get; } + + } + + [StructLayout(LayoutKind.Explicit, Size = 32)] + public unsafe struct Pixel32RGBA : IPixel + { + + [FieldOffset(0)] private unsafe fixed byte data[4]; + + public int Size => 4; + + float IPixel.Alpha + { + get => data[3] / 256 ; + set => data[3] = (byte)(value * 256); + } + + float IPixel.Blue + { + get => data[2] / 256 ; + set => data[2] = (byte)(value * 256); + } + + float IPixel.Green + { + get => data[1] / 256 ; + set => data[1] = (byte)(value * 256); + } + + float IPixel.Red + { + get => data[0] / 256 ; + set => data[0] = (byte)(value * 256); + } + + } +} diff --git a/StgSharp.Common/Graphics/PlainGeometryMesh.cs b/StgsSharp.Graphics/PlainGeometryMesh.cs similarity index 86% rename from StgSharp.Common/Graphics/PlainGeometryMesh.cs rename to StgsSharp.Graphics/PlainGeometryMesh.cs index 278f8892..cb4e5ad2 100644 --- a/StgSharp.Common/Graphics/PlainGeometryMesh.cs +++ b/StgsSharp.Graphics/PlainGeometryMesh.cs @@ -1,92 +1,101 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="PlainGeometryMesh" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Geometries; -using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; - -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 Image _texture; - - public PlainGeometryMesh(PlainGeometry shape, Image texture, Vec2[] texCoord) - { - ArgumentNullException.ThrowIfNull(shape); - ArgumentNullException.ThrowIfNull(texCoord); - - if (shape.VertexCount > texCoord.Length) { - throw new ArgumentException( - paramName:nameof(texCoord), - message:"Amount of texture coordination is too less"); - } - _texture = new TextureProvider(texture, texCoord); - } - - public Vec4[] VertexArray => _shape.VertexStream; - - public Image TextureImage - { - get => _texture.ProvideImage(); - internal set => _texture.ReadImage(value); - } - - public ReadOnlySpan MeshIndices => _shape.VertexIndices; - - public ReadOnlySpan TextureCoord => MemoryMarshal.Cast( - _texture.TextureCoordinate); - - public PlainGeometryMesh Resize(PlainGeometry newShape) - { - return new PlainGeometryMesh(newShape, _texture); - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="PlainGeometryMesh" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Geometries; +using StgSharp.Mathematics; +using StgSharp.Mathematics.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 Image _texture; + + public PlainGeometryMesh( + PlainGeometry shape, + Image texture, + Vec2[] texCoord + ) + { + ArgumentNullException.ThrowIfNull(shape); + ArgumentNullException.ThrowIfNull(texCoord); + + if (shape.VertexCount > texCoord.Length) { + throw new ArgumentException( + paramName:nameof(texCoord), + message:"Amount of texture coordination is too less"); + } + _texture = new TextureProvider(texture, texCoord); + } + + public Vec4[] VertexArray => _shape.VertexStream; + + public Image TextureImage + { + get => _texture.ProvideImage(); + internal set => _texture.ReadImage(value); + } + + public ReadOnlySpan MeshIndices => _shape.VertexIndices; + + public ReadOnlySpan TextureCoord => MemoryMarshal.Cast( + _texture.TextureCoordinate); + + public PlainGeometryMesh Resize( + PlainGeometry newShape + ) + { + return new PlainGeometryMesh(newShape, _texture); + } + + } +} diff --git a/StgSharp.Common/Graphics/RenderStream.cs b/StgsSharp.Graphics/RenderStream.cs similarity index 86% rename from StgSharp.Common/Graphics/RenderStream.cs rename to StgsSharp.Graphics/RenderStream.cs index a9e5e8dd..6b0aafbd 100644 --- a/StgSharp.Common/Graphics/RenderStream.cs +++ b/StgsSharp.Graphics/RenderStream.cs @@ -1,249 +1,268 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="RenderStream" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics.OpenGL; -using StgSharp.Mathematics; -using StgSharp.Mathematics.Graphic; -using StgSharp.MVVM; -using StgSharp.Timing; - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics -{ - public abstract class RenderStream - { - - private Camera nativeCamera; - - private protected ViewPort primeArgs; - internal TimeSpanProvider _timeProvider; - - public (int width, int height) Size - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => (Width, Height); - } - - public abstract bool IsContextSharable { get; } - - public int Height - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => primeArgs.Height; - } - - public int Width - { - get => primeArgs.Width; - } - - public IntPtr Monitor - { - get => primeArgs.Monitor; - internal set => primeArgs.Monitor = value; - } - - public string Name - { - get => primeArgs.Name; - } - - public ViewPort BindedViewPortContext - { - get => primeArgs; - internal set => primeArgs = value; - } - - internal IntPtr CanvasHandle - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => primeArgs.ViewPortHandle; - } - - internal IntPtr ContextHandle - { - get => primeArgs.GraphicHandle; - private protected set => primeArgs.GraphicHandle = value; - } - - protected internal Camera NativeCamera - { - get => nativeCamera; - internal set => nativeCamera = value; - } - - protected float FramePassed - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _timeProvider.CurrentSpan; - } - - protected int PassedFrames - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _timeProvider.CurrentSpan; - } - - protected float TimePassed - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => (float)_timeProvider.CurrentSecond; - } - - protected TimeSpanProvider TimeProvider - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _timeProvider; - } - - /// - /// Set the Size limit of current form - /// - /// - /// Minimum width of current form - /// - /// - /// Minimum height of current form - /// - /// - /// Maximum width of current form - /// - /// - /// Maximum height of current form - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public abstract void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight); - - public static TTarget ShareContextFrom([NotNull]TSource source) where TSource : RenderStream - where TTarget : RenderStream, new() - { - TTarget target = new TTarget(); - target.Initialize(source.BindedViewPortContext, source._timeProvider); - return target; - } - - /**/ - protected internal static void PollEvents() - { - GraphicFramework.glfwPollEvents(); - } - - private protected void SwapBuffers() - { - GraphicFramework.glfwSwapBuffers(CanvasHandle); - } - - /**/ - - #region native camera operation - - protected abstract void NativeCameraViewRange( - Radius fieldOfRange, - Vec2 offset, - (float frontDepth, float backDepth) viewDepth); - - protected abstract void NativeCameraViewTarget(Vec3 position, Vec3 direction, Vec3 up); - - /// - /// Get (TView is ) uniform from a shader. - /// This uniform will be used as projection matrix of this camera. Additionally, for - /// multi- shader rendering, each shader requires a uniform, so do not ignore return - /// value of this method. - /// - /// - /// Shader using this camera - /// - /// - /// ContextName of projection camera named in shader - /// - /// - /// (TView is ) representing projection - /// matrix in shader program. - /// - protected abstract Uniform NativeCameraUniform(ShaderProgram source, string name); - - #endregion - - #region internal operation - - public void Initialize(ViewPort v, TimeSpanProvider timeProvider) - { - if (v == null) { - throw new ArgumentNullException(nameof(v)); - } - primeArgs = v; - this._timeProvider = timeProvider; - nativeCamera = new Camera(); - PlatformSpecifiedInitialize(); - CustomizeInit(); - GraphicFramework.glfwMakeContextCurrent(IntPtr.Zero); - } - - internal abstract void PlatformSpecifiedInitialize(); - - internal abstract void Terminate(); - - #endregion - - #region public operation - - protected abstract void CustomizeDeinit(); - - protected abstract void CustomizeInit(); - - /// - /// Marking the start of current render operations, and set this renser context as - /// current. - /// - public abstract void RenderStart(); - - /// - /// Marking the end of current render operations, and release the binding of this renser - /// context to current, making it available for another thread as current. - /// - public abstract void RenderEnd(); - - #endregion - - #region public resource generator - - protected abstract Shader CreateShaderSegment(ShaderType type, int count); - - protected abstract ShaderProgram CreateShaderProgram(); - - #endregion - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="RenderStream" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics.OpenGL; +using StgSharp.Mathematics; +using StgSharp.Mathematics.Graphics; +using StgSharp.Timing; + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics +{ + public abstract class RenderStream + { + + private Camera nativeCamera; + + private protected ViewPort primeArgs; + internal TimeSpanProvider _timeProvider; + + public (int width, int height) Size + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => (Width, Height); + } + + public abstract bool IsContextSharable { get; } + + public int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => primeArgs.Height; + } + + public int Width + { + get => primeArgs.Width; + } + + public IntPtr Monitor + { + get => primeArgs.Monitor; + internal set => primeArgs.Monitor = value; + } + + public string Name + { + get => primeArgs.Name; + } + + public ViewPort BindedViewPortContext + { + get => primeArgs; + internal set => primeArgs = value; + } + + internal IntPtr CanvasHandle + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => primeArgs.ViewPortHandle; + } + + internal IntPtr ContextHandle + { + get => primeArgs.GraphicHandle; + private protected set => primeArgs.GraphicHandle = value; + } + + protected internal Camera NativeCamera + { + get => nativeCamera; + internal set => nativeCamera = value; + } + + protected float FramePassed + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _timeProvider.CurrentSpan; + } + + protected int PassedFrames + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _timeProvider.CurrentSpan; + } + + protected float TimePassed + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => (float)_timeProvider.CurrentSecond; + } + + protected TimeSpanProvider TimeProvider + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _timeProvider; + } + + /// + /// Set the Size limit of current form + /// + /// + /// Minimum width of current form + /// + /// + /// Minimum height of current form + /// + /// + /// Maximum width of current form + /// + /// + /// Maximum height of current form + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public abstract void SetSizeLimit( + int minWidth, + int minHeight, + int maxWidth, + int maxHeight + ); + + public static TTarget ShareContextFrom( + [NotNull]TSource source + ) where TSource : RenderStream where TTarget : RenderStream, new() + { + TTarget target = new TTarget(); + target.Initialize(source.BindedViewPortContext, source._timeProvider); + return target; + } + + /**/ + protected internal static void PollEvents() + { + GraphicFramework.glfwPollEvents(); + } + + private protected void SwapBuffers() + { + GraphicFramework.glfwSwapBuffers(CanvasHandle); + } + + /**/ + + #region native camera operation + + protected abstract void NativeCameraViewRange( + Radius fieldOfRange, + Vec2 offset, + (float frontDepth, float backDepth) viewDepth + ); + + protected abstract void NativeCameraViewTarget( + Vec3 position, + Vec3 direction, + Vec3 up + ); + + /// + /// Get (TView is ) uniform from a shader. + /// This uniform will be used as projection matrix of this camera. Additionally, for + /// multi- shader rendering, each shader requires a uniform, so do not ignore return + /// value of this method. + /// + /// + /// Shader using this camera + /// + /// + /// ContextName of projection camera named in shader + /// + /// + /// (TView is ) representing projection + /// matrix in shader program. + /// + protected abstract Uniform NativeCameraUniform( + ShaderProgram source, + string name + ); + + #endregion + + #region internal operation + + public void Initialize( + ViewPort v, + TimeSpanProvider timeProvider + ) + { + if (v == null) { + throw new ArgumentNullException(nameof(v)); + } + primeArgs = v; + this._timeProvider = timeProvider; + nativeCamera = new Camera(); + PlatformSpecifiedInitialize(); + CustomizeInit(); + GraphicFramework.glfwMakeContextCurrent(IntPtr.Zero); + } + + internal abstract void PlatformSpecifiedInitialize(); + + internal abstract void Terminate(); + + #endregion + + #region public operation + + protected abstract void CustomizeDeinit(); + + protected abstract void CustomizeInit(); + + /// + /// Marking the start of current render operations, and set this renser context as + /// current. + /// + public abstract void RenderStart(); + + /// + /// Marking the end of current render operations, and release the binding of this renser + /// context to current, making it available for another thread as current. + /// + public abstract void RenderEnd(); + + #endregion + + #region public resource generator + + protected abstract Shader CreateShaderSegment( + ShaderType type, + int count + ); + + protected abstract ShaderProgram CreateShaderProgram(); + + #endregion + } +} diff --git a/StgSharp.Common/Graphics/ShaderEdit/ShaderGenerator.cs b/StgsSharp.Graphics/ShaderEdit/ShaderGenerator.cs similarity index 97% rename from StgSharp.Common/Graphics/ShaderEdit/ShaderGenerator.cs rename to StgsSharp.Graphics/ShaderEdit/ShaderGenerator.cs index f5a3ef02..4850604f 100644 --- a/StgSharp.Common/Graphics/ShaderEdit/ShaderGenerator.cs +++ b/StgsSharp.Graphics/ShaderEdit/ShaderGenerator.cs @@ -1,203 +1,203 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ShaderGenerator" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Graphics.OpenGL; -using StgSharp.Mathematics; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics.ShaderEdit -{ - public class ShaderGenerator - { - - private Dictionary uniformDefine; - private List codeList; - private List usedShaderFunctions; - - public Uniform DefineUniform(string name, int index) where T: unmanaged - { - ShaderParameter p = new ShaderParameter(name, ShaderParameter.TypeMarshal()); - uniformDefine.Add(index, p); - - // return new Uniform(); - throw new NotImplementedException(); - } - - } - - public class ShaderFunction - { - - private List codeList; - private List inputList; - private ShaderParameter outPut; - private string name; - - public int ParameterCount => inputList.Count; - - public void EmitCall(ShaderFunction function, ShaderParameter outPut, params ShaderParameter[] inputParams) - { - if (inputParams.Length != function.ParameterCount) - { - // Param list length not equal - throw new ArgumentException( - "Provided parameters does not match function's parameter list."); - } - if (!ShaderParameter.IsSameType(outPut, function.outPut)) - { - // Type of returning value not equal - throw new ArgumentException( - "Provided parameters does not match function's parameter list."); - } - for (int i = 0; i < inputParams.Length; i++) - { - if (!ShaderParameter.IsSameType(function.inputList[i], inputParams[i])) - { - // Input type not match - throw new InvalidCastException( - "Provided parameters does not match function's parameter list."); - } - } - string codeLine = string.Empty; // adding a line like " outvalue = Func(input1, input2,...); " - if (outPut != ShaderParameter.Void) { - codeLine += $"{outPut.name} = "; - } - codeLine += $"{function.name}("; - foreach (ShaderParameter inputParam in inputParams) { - codeLine += inputParam.name; - } - codeLine += ");\n"; - codeList.Add(codeLine); - } - - } - - public class ShaderParameter - { - - public static readonly ShaderParameter Void = new ShaderParameter( - string.Empty, InternalShaderType.Void); - internal readonly bool isReadOnly; - internal readonly InternalShaderType type; - internal readonly string name; - - public ShaderParameter(string name, InternalShaderType type) - { - this.name = name; - this.type = type; - isReadOnly = false; - } - - public static bool IsSameType(ShaderParameter param1, ShaderParameter param2) - { - if (param1.type != InternalShaderType.Struct) - { - return param1.type == param2.type; - } else - { - throw new Exception("Struct is currently not supported."); - } - } - - public static InternalShaderType TypeMarshal() where T: unmanaged - { - switch (Type.GetTypeCode(typeof(T))) - { - case TypeCode.Single: - return InternalShaderType.Float; - case TypeCode.Double: - return InternalShaderType.Double; - case TypeCode.Int32: - return InternalShaderType.Int; - case TypeCode.UInt32: - return InternalShaderType.UInt; - default: - break; - } - switch (typeof(T).Name) - { - case "vec4d": - return InternalShaderType.Vector4; - case "Matrix2x2": - return InternalShaderType.Matrix2x2; - case "Matrix2x3": - return InternalShaderType.Matrix2x3; - case "Matrix2x4": - return InternalShaderType.Matrix2x4; - case "Matrix3x2": - return InternalShaderType.Matrix3x2; - case "Matrix3x3": - return InternalShaderType.Matrix3x3; - case "Matrix3x4": - return InternalShaderType.Matrix3x4; - case "Matrix4x2": - return InternalShaderType.Matrix4x2; - case "Matrix4x3": - return InternalShaderType.Matrix4x3; - case "Matrix4x4": - return InternalShaderType.Matrix4x4; - default: - throw new ArgumentException("Not supported shader data type."); - } - } - - } - - public enum InternalShaderType - { -#pragma warning disable CS1591 - Struct, - Void, - Int, - UInt, - Float, - Double, - Vector2, - Vector3, - Vector4, - VectorD2, - VectorD3, - VectorD4, - Matrix2x2, - Matrix2x3, - Matrix2x4, - Matrix3x2, - Matrix3x3, - Matrix3x4, - Matrix4x2, - Matrix4x3, - Matrix4x4, -#pragma warning restore CS1591 - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ShaderGenerator" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Graphics.OpenGL; +using StgSharp.Mathematics; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.ShaderEdit +{ + public class ShaderGenerator + { + + private Dictionary uniformDefine; + private List codeList; + private List usedShaderFunctions; + + public Uniform DefineUniform(string name, int index) where T: unmanaged + { + ShaderParameter p = new ShaderParameter(name, ShaderParameter.TypeMarshal()); + uniformDefine.Add(index, p); + + // return new Uniform(); + throw new NotImplementedException(); + } + + } + + public class ShaderFunction + { + + private List codeList; + private List inputList; + private ShaderParameter outPut; + private string name; + + public int ParameterCount => inputList.Count; + + public void EmitCall(ShaderFunction function, ShaderParameter outPut, params ShaderParameter[] inputParams) + { + if (inputParams.Length != function.ParameterCount) + { + // Param list length not equal + throw new ArgumentException( + "Provided parameters does not match function's parameter list."); + } + if (!ShaderParameter.IsSameType(outPut, function.outPut)) + { + // Type of returning value not equal + throw new ArgumentException( + "Provided parameters does not match function's parameter list."); + } + for (int i = 0; i < inputParams.Length; i++) + { + if (!ShaderParameter.IsSameType(function.inputList[i], inputParams[i])) + { + // Input type not match + throw new InvalidCastException( + "Provided parameters does not match function's parameter list."); + } + } + string codeLine = string.Empty; // adding a line like " outvalue = Func(input1, input2,...); " + if (outPut != ShaderParameter.Void) { + codeLine += $"{outPut.name} = "; + } + codeLine += $"{function.name}("; + foreach (ShaderParameter inputParam in inputParams) { + codeLine += inputParam.name; + } + codeLine += ");\n"; + codeList.Add(codeLine); + } + + } + + public class ShaderParameter + { + + public static readonly ShaderParameter Void = new ShaderParameter( + string.Empty, InternalShaderType.Void); + internal readonly bool isReadOnly; + internal readonly InternalShaderType type; + internal readonly string name; + + public ShaderParameter(string name, InternalShaderType type) + { + this.name = name; + this.type = type; + isReadOnly = false; + } + + public static bool IsSameType(ShaderParameter param1, ShaderParameter param2) + { + if (param1.type != InternalShaderType.Struct) + { + return param1.type == param2.type; + } else + { + throw new Exception("Struct is currently not supported."); + } + } + + public static InternalShaderType TypeMarshal() where T: unmanaged + { + switch (Type.GetTypeCode(typeof(T))) + { + case TypeCode.Single: + return InternalShaderType.Float; + case TypeCode.Double: + return InternalShaderType.Double; + case TypeCode.Int32: + return InternalShaderType.Int; + case TypeCode.UInt32: + return InternalShaderType.UInt; + default: + break; + } + switch (typeof(T).Name) + { + case "vec4d": + return InternalShaderType.Vector4; + case "Matrix2x2": + return InternalShaderType.Matrix2x2; + case "Matrix2x3": + return InternalShaderType.Matrix2x3; + case "Matrix2x4": + return InternalShaderType.Matrix2x4; + case "Matrix3x2": + return InternalShaderType.Matrix3x2; + case "Matrix3x3": + return InternalShaderType.Matrix3x3; + case "Matrix3x4": + return InternalShaderType.Matrix3x4; + case "Matrix4x2": + return InternalShaderType.Matrix4x2; + case "Matrix4x3": + return InternalShaderType.Matrix4x3; + case "Matrix4x4": + return InternalShaderType.Matrix4x4; + default: + throw new ArgumentException("Not supported shader data type."); + } + } + + } + + public enum InternalShaderType + { +#pragma warning disable CS1591 + Struct, + Void, + Int, + UInt, + Float, + Double, + Vector2, + Vector3, + Vector4, + VectorD2, + VectorD3, + VectorD4, + Matrix2x2, + Matrix2x3, + Matrix2x4, + Matrix3x2, + Matrix3x3, + Matrix3x4, + Matrix4x2, + Matrix4x3, + Matrix4x4, +#pragma warning restore CS1591 + } } \ No newline at end of file diff --git a/StgSharp.Common/Graphics/ShaderEdit/ShaderStruct.cs b/StgsSharp.Graphics/ShaderEdit/ShaderStruct.cs similarity index 97% rename from StgSharp.Common/Graphics/ShaderEdit/ShaderStruct.cs rename to StgsSharp.Graphics/ShaderEdit/ShaderStruct.cs index 4473d030..bc75b401 100644 --- a/StgSharp.Common/Graphics/ShaderEdit/ShaderStruct.cs +++ b/StgsSharp.Graphics/ShaderEdit/ShaderStruct.cs @@ -1,96 +1,96 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ShaderStruct" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Graphics.OpenGL; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics.ShaderEdit -{ - public class ShaderStructMember - { - - internal InternalShaderType type; - internal object value; - - } - - public class ShaderStruct - { - - internal Dictionary uniformPair; - - internal ShaderStruct() { } - - public ShaderStruct(params (GlHandle, ShaderStructMember)[] uniformPairs) - { - uniformPair = new Dictionary(); - if (uniformPairs.Length == 0) { - return; - } - - foreach ((GlHandle, ShaderStructMember) item in uniformPairs) { - uniformPair.Add(item.Item1, item.Item2); - } - } - - public unsafe void SetAllUniforms() - { - OpenglContext* gl = (OpenglContext*)OpenGL.OpenGLFunction.CurrentGL.ContextHandle; - foreach (KeyValuePair uniform in uniformPair) - { - int id = uniform.Key.SignedValue; - ShaderStructMember s = uniform.Value; - switch (s.type) - { - case InternalShaderType.Struct: - throw new ArgumentException( - "Incorrect type \"Struct\" defined in this self define type"); - case InternalShaderType.Void: - throw new ArgumentException( - "Incorrect type \"Void\" defined in this self define type"); - case InternalShaderType.Float: - gl->glUniform1f(id, (float)s.value); - break; - case InternalShaderType.Int: - gl->glUniform1f(id, (int)s.value); - break; - default: - throw new NotImplementedException(); - throw new ArgumentException( - "Incorrect type \"Unknown\" defined in this self define type"); - } - } - }//------------------------------------ End of Class --------------------------------------- - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ShaderStruct" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Graphics.OpenGL; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.ShaderEdit +{ + public class ShaderStructMember + { + + internal InternalShaderType type; + internal object value; + + } + + public class ShaderStruct + { + + internal Dictionary uniformPair; + + internal ShaderStruct() { } + + public ShaderStruct(params (GlHandle, ShaderStructMember)[] uniformPairs) + { + uniformPair = new Dictionary(); + if (uniformPairs.Length == 0) { + return; + } + + foreach ((GlHandle, ShaderStructMember) item in uniformPairs) { + uniformPair.Add(item.Item1, item.Item2); + } + } + + public unsafe void SetAllUniforms() + { + OpenglContext* gl = (OpenglContext*)OpenGL.OpenGLFunction.CurrentGL.ContextHandle; + foreach (KeyValuePair uniform in uniformPair) + { + int id = uniform.Key.SignedValue; + ShaderStructMember s = uniform.Value; + switch (s.type) + { + case InternalShaderType.Struct: + throw new ArgumentException( + "Incorrect type \"Struct\" defined in this self define type"); + case InternalShaderType.Void: + throw new ArgumentException( + "Incorrect type \"Void\" defined in this self define type"); + case InternalShaderType.Float: + gl->glUniform1f(id, (float)s.value); + break; + case InternalShaderType.Int: + gl->glUniform1f(id, (int)s.value); + break; + default: + throw new NotImplementedException(); + throw new ArgumentException( + "Incorrect type \"Unknown\" defined in this self define type"); + } + } + }//------------------------------------ End of Class --------------------------------------- + + } +} diff --git a/StgsSharp.Graphics/StgsSharp.Graphics.csproj b/StgsSharp.Graphics/StgsSharp.Graphics.csproj new file mode 100644 index 00000000..42df950d --- /dev/null +++ b/StgsSharp.Graphics/StgsSharp.Graphics.csproj @@ -0,0 +1,33 @@ + + + + net8.0 + enable + enable + preview + True + + + + none + + + + + + + + none + + + + + + + + + + + + + diff --git a/StgSharp.Common/Graphics/TexturePipeline.cs b/StgsSharp.Graphics/TexturePipeline.cs similarity index 97% rename from StgSharp.Common/Graphics/TexturePipeline.cs rename to StgsSharp.Graphics/TexturePipeline.cs index 4e260337..3f43390e 100644 --- a/StgSharp.Common/Graphics/TexturePipeline.cs +++ b/StgsSharp.Graphics/TexturePipeline.cs @@ -1,64 +1,64 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="TexturePipeline" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.PipeLine; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics -{ - public class TexturePipeline : IPipeLineConnectionPayload - { - - private Image _value; - - public TexturePipeline(Image i) - { - _value = i; - } - - public object? ValueDefault => null; - - public object Value - { - get => _value; - set - { - ArgumentNullException.ThrowIfNull(value); - if (value is not Image image) { - throw new ArgumentException("Value must be of type Image"); - } - _value = image; - } - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="TexturePipeline" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.PipeLine; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics +{ + public class TexturePipeline : IPipeLineConnectionPayload + { + + private Image _value; + + public TexturePipeline(Image i) + { + _value = i; + } + + public object? ValueDefault => null; + + public object Value + { + get => _value; + set + { + ArgumentNullException.ThrowIfNull(value); + if (value is not Image image) { + throw new ArgumentException("Value must be of type Image"); + } + _value = image; + } + } + + } +} diff --git a/StgSharp.Common/Graphics/TextureProvider.cs b/StgsSharp.Graphics/TextureProvider.cs similarity index 84% rename from StgSharp.Common/Graphics/TextureProvider.cs rename to StgsSharp.Graphics/TextureProvider.cs index 5ea32b23..20c82578 100644 --- a/StgSharp.Common/Graphics/TextureProvider.cs +++ b/StgsSharp.Graphics/TextureProvider.cs @@ -1,86 +1,95 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="TextureProvider" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Mathematics.Graphic; - -using System; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.CompilerServices; - -namespace StgSharp.Graphics -{ - public class TextureProvider : IImageProvider - { - - private Vec2[] _texCoord; - private Image _tex; - - public TextureProvider(Image image, Vec2[] coord) - { - _tex = image; - _texCoord = coord; - } - - public ref Vec2 this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => ref _texCoord[index]; - } - - public Span TextureCoordinate - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new Span(_texCoord); - } - - public Image ProvideImage() - { - return _tex; - } - - public void ReadImage(IImageProvider provider) - { - _tex = provider.ProvideImage(); - } - - public void UpdateFromImage([NotNull]Image i) - { - if (i == _tex) { - return; - } - if (i.Size == _tex.Size) - { - _tex = i; - } else - { - throw new ArgumentException( - $"Size of {nameof(i)} does not equals to current image."); - } - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="TextureProvider" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics.Graphics; + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; + +namespace StgSharp.Graphics +{ + public class TextureProvider : IImageProvider + { + + private Vec2[] _texCoord; + private Image _tex; + + public TextureProvider( + Image image, + Vec2[] coord + ) + { + _tex = image; + _texCoord = coord; + } + + public ref Vec2 this[ + int index + ] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => ref _texCoord[index]; + } + + public Span TextureCoordinate + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new Span(_texCoord); + } + + public Image ProvideImage() + { + return _tex; + } + + public void ReadImage( + IImageProvider provider + ) + { + _tex = provider.ProvideImage(); + } + + public void UpdateFromImage( + [NotNull]Image i + ) + { + if (i == _tex) { + return; + } + if (i.Size == _tex.Size) + { + _tex = i; + } else + { + throw new ArgumentException( + $"Size of {nameof(i)} does not equals to current image."); + } + } + + } +} diff --git a/StgsSharp.Graphics/ViewPort.cs b/StgsSharp.Graphics/ViewPort.cs new file mode 100644 index 00000000..d79221db --- /dev/null +++ b/StgsSharp.Graphics/ViewPort.cs @@ -0,0 +1,132 @@ +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ViewPort" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Concurrent; +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading; + +namespace StgSharp.Graphics +{ + public class ViewPort + { + + private static readonly ConcurrentDictionary _handleToViewPortIndex = []; + private int _width, _height, _newWidth, _newHeight; + + internal unsafe ViewPort() + { + _newHeight = 600; + _newWidth = 800; + FlushSize(); + Name = new StackFrame(1, false). + GetMethod()!.DeclaringType!.Name; + Monitor = IntPtr.Zero; + ViewPortHandle = GraphicFramework.glfwCreateWindow(_newWidth, _newHeight, + Encoding.UTF8.GetBytes(Name), + Monitor, IntPtr.Zero); + if (ViewPortHandle == IntPtr.Zero) { + throw new InvalidOperationException("Unable to create viewport handle."); + } + _ = _handleToViewPortIndex.TryAdd(ViewPortHandle, this); + } + + public unsafe ViewPort( + int width, + int height, + string name, + IntPtr monitor + ) + { + _newWidth = width; + _newHeight = height; + FlushSize(); + Name = name; + Monitor = monitor; + ViewPortHandle = GraphicFramework.glfwCreateWindow(_newWidth, _newHeight, + Encoding.UTF8.GetBytes(Name), + Monitor, IntPtr.Zero); + if (ViewPortHandle == IntPtr.Zero) { + throw new InvalidOperationException("Unable to create viewport handle."); + } + _ = _handleToViewPortIndex.TryAdd(ViewPortHandle, this); + } + + public unsafe int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _height; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal set => Interlocked.Exchange(ref _height, value); + } + + public unsafe int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _width; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal set => Interlocked.Exchange(ref _width, value); + } + + public IntPtr GraphicHandle { get; internal set; } + + public IntPtr Monitor { get; internal set; } + + public IntPtr ViewPortHandle { get; private set; } + + public string Name { get; set; } + + // [BlueprintNodeExecution] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool GetExistedViewPort( + IntPtr handle, + out ViewPort port + ) + { + return _handleToViewPortIndex.TryGetValue(handle, out port); + } + + internal unsafe void FlushSize() + { + _ = Interlocked.Exchange(ref _height, _newHeight); + _ = Interlocked.Exchange(ref _width, _newWidth); + } + + internal void RequestFlushSizeInNextFrame( + int width, + int height + ) + { + _ = Interlocked.Exchange(ref _newHeight, height); + _ = Interlocked .Exchange(ref _newWidth, width); + } + + } +} diff --git a/StgSharp.Common/Graphics/Vulkan/vkEnum.cs b/StgsSharp.Graphics/Vulkan/vkEnum.cs similarity index 97% rename from StgSharp.Common/Graphics/Vulkan/vkEnum.cs rename to StgsSharp.Graphics/Vulkan/vkEnum.cs index b8e83aaa..abac24ca 100644 --- a/StgSharp.Common/Graphics/Vulkan/vkEnum.cs +++ b/StgsSharp.Graphics/Vulkan/vkEnum.cs @@ -1,76 +1,76 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="vkEnum" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Graphics.Vulkan -{ - internal enum VkStructureType : uint - { - - VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, - VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, - VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, - VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, - VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, - VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000217000, - VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF - - } - - internal enum VkResult - { - - VK_SUCCESS = 0, - VK_NOT_READY = 1, - VK_TIMEOUT = 2, - VK_EVENT_SET = 3, - VK_EVENT_RESET = 4, - VK_INCOMPLETE = 5, - VK_ERROR_OUT_OF_HOST_MEMORY = -1, - VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, - VK_ERROR_INITIALIZATION_FAILED = -3, - VK_ERROR_DEVICE_LOST = -4, - VK_ERROR_MEMORY_MAP_FAILED = -5, - VK_ERROR_LAYER_NOT_PRESENT = -6, - VK_ERROR_EXTENSION_NOT_PRESENT = -7, - VK_ERROR_FEATURE_NOT_PRESENT = -8, - VK_ERROR_INCOMPATIBLE_DRIVER = -9, - VK_ERROR_TOO_MANY_OBJECTS = -10, - VK_ERROR_FORMAT_NOT_SUPPORTED = -11, - VK_ERROR_SURFACE_LOST_KHR = -1000000000, - VK_SUBOPTIMAL_KHR = 1000001003, - VK_ERROR_OUT_OF_DATE_KHR = -1000001004, - VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, - VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, - VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, - VK_RESULT_MAX_ENUM = 0x7FFFFFFF - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="vkEnum" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Graphics.Vulkan +{ + internal enum VkStructureType : uint + { + + VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, + VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, + VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, + VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, + VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, + VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000217000, + VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF + + } + + internal enum VkResult + { + + VK_SUCCESS = 0, + VK_NOT_READY = 1, + VK_TIMEOUT = 2, + VK_EVENT_SET = 3, + VK_EVENT_RESET = 4, + VK_INCOMPLETE = 5, + VK_ERROR_OUT_OF_HOST_MEMORY = -1, + VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, + VK_ERROR_INITIALIZATION_FAILED = -3, + VK_ERROR_DEVICE_LOST = -4, + VK_ERROR_MEMORY_MAP_FAILED = -5, + VK_ERROR_LAYER_NOT_PRESENT = -6, + VK_ERROR_EXTENSION_NOT_PRESENT = -7, + VK_ERROR_FEATURE_NOT_PRESENT = -8, + VK_ERROR_INCOMPATIBLE_DRIVER = -9, + VK_ERROR_TOO_MANY_OBJECTS = -10, + VK_ERROR_FORMAT_NOT_SUPPORTED = -11, + VK_ERROR_SURFACE_LOST_KHR = -1000000000, + VK_SUBOPTIMAL_KHR = 1000001003, + VK_ERROR_OUT_OF_DATE_KHR = -1000001004, + VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, + VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, + VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, + VK_RESULT_MAX_ENUM = 0x7FFFFFFF + + } +} diff --git a/StgSharp.Common/Graphics/Vulkan/vkHandle.cs b/StgsSharp.Graphics/Vulkan/vkHandle.cs similarity index 97% rename from StgSharp.Common/Graphics/Vulkan/vkHandle.cs rename to StgsSharp.Graphics/Vulkan/vkHandle.cs index 11066606..db4bd73d 100644 --- a/StgSharp.Common/Graphics/Vulkan/vkHandle.cs +++ b/StgsSharp.Graphics/Vulkan/vkHandle.cs @@ -1,48 +1,48 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="vkHandle" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Security; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics.Vulkan -{ - [StructLayout(LayoutKind.Explicit, Size = 8)] - public struct vkHandle - { - - [FieldOffset(0)] public int SignedHalfValue; - [FieldOffset(0)] public IntPtr Handle; - [FieldOffset(0)] public IntPtr UnsignedHandle; - [FieldOffset(0)] public uint HalfValue; - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="vkHandle" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.Vulkan +{ + [StructLayout(LayoutKind.Explicit, Size = 8)] + public struct vkHandle + { + + [FieldOffset(0)] public int SignedHalfValue; + [FieldOffset(0)] public IntPtr Handle; + [FieldOffset(0)] public IntPtr UnsignedHandle; + [FieldOffset(0)] public uint HalfValue; + + } +} diff --git a/StgSharp.Common/Graphics/framework.cs b/StgsSharp.Graphics/framework.cs similarity index 97% rename from StgSharp.Common/Graphics/framework.cs rename to StgsSharp.Graphics/framework.cs index dfba8d3c..87bf5aae 100644 --- a/StgSharp.Common/Graphics/framework.cs +++ b/StgsSharp.Graphics/framework.cs @@ -1,109 +1,109 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="framework" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.InteropServices; - -#if Windows -// using Windows.Win32; -#endif - -namespace StgSharp.Graphics -{ - /// - /// Function handler to load an opengl function by searching its _label. - /// - /// - /// the _label of the Opengl function - /// - /// - /// An Intptr value representing the pointer to the function - /// - public delegate IntPtr glLoader( - string name - ); - - #region StgSharpDele - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void FrameBufferSizeHandler( - IntPtr window, - int width, - int height - ); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void FramePositionHandler( - IntPtr window, - float width, - float height - ); - - #endregion - - - #region glDEBUG - - internal unsafe delegate void GLDEBUGPROC( - int source, - int type, - uint id, - int severity, - int length, - sbyte* message, - void* userParam - ); - internal unsafe delegate void GLDEBUGPROCARB( - int source, - int type, - uint id, - int severity, - int length, - sbyte* message, - void* userParam - ); - internal unsafe delegate void GLDEBUGPROCKHR( - int source, - int type, - uint id, - int severity, - int length, - sbyte* message, - void* userParam - ); - internal unsafe delegate void GLDEBUGPROCAMD( - uint id, - int category, - int severity, - int length, - sbyte* message, - void* userParam - ); - -#endregion - -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="framework" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.InteropServices; + +#if Windows +// using Windows.Win32; +#endif + +namespace StgSharp.Graphics +{ + /// + /// Function handler to load an opengl function by searching its _label. + /// + /// + /// the _label of the Opengl function + /// + /// + /// An Intptr value representing the pointer to the function + /// + public delegate IntPtr glLoader( + string name + ); + + #region StgSharpDele + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void FrameBufferSizeHandler( + IntPtr window, + int width, + int height + ); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void FramePositionHandler( + IntPtr window, + float width, + float height + ); + + #endregion + + + #region glDEBUG + + internal unsafe delegate void GLDEBUGPROC( + int source, + int type, + uint id, + int severity, + int length, + sbyte* message, + void* userParam + ); + internal unsafe delegate void GLDEBUGPROCARB( + int source, + int type, + uint id, + int severity, + int length, + sbyte* message, + void* userParam + ); + internal unsafe delegate void GLDEBUGPROCKHR( + int source, + int type, + uint id, + int severity, + int length, + sbyte* message, + void* userParam + ); + internal unsafe delegate void GLDEBUGPROCAMD( + uint id, + int category, + int severity, + int length, + sbyte* message, + void* userParam + ); + +#endregion + +} diff --git a/StgSharp.Common/Graphics/frameworkSyncContext.cs b/StgsSharp.Graphics/frameworkSyncContext.cs similarity index 97% rename from StgSharp.Common/Graphics/frameworkSyncContext.cs rename to StgsSharp.Graphics/frameworkSyncContext.cs index 0f22fe37..6644605c 100644 --- a/StgSharp.Common/Graphics/frameworkSyncContext.cs +++ b/StgsSharp.Graphics/frameworkSyncContext.cs @@ -1,74 +1,74 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="frameworkSyncContext" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -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); - } - } - - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="frameworkSyncContext" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +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/StgSharp.Common/Internal/Graphic/gl.cs b/StgsSharp.Graphics/gl.cs similarity index 78% rename from StgSharp.Common/Internal/Graphic/gl.cs rename to StgsSharp.Graphics/gl.cs index e2d5c661..8ef3bfac 100644 --- a/StgSharp.Common/Internal/Graphic/gl.cs +++ b/StgsSharp.Graphics/gl.cs @@ -1,104 +1,114 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="gl" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Graphics.OpenGL; - -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Internal -{ - internal static partial class GraphicFramework - { - - internal static uint[] GLtype = new uint[16]; - - static GraphicFramework() - { - GLtype[(int)TypeCode.Single] = glConst.FLOAT; - GLtype[(int)TypeCode.Int32] = glConst.INT; - GLtype[(int)TypeCode.UInt32] = glConst.UNSIGNED_INT; - GLtype[(int)TypeCode.Int16] = glConst.SHORT; - GLtype[(int)TypeCode.UInt16] = glConst.UNSIGNED_SHORT; - GLtype[(int)TypeCode.SByte] = glConst.BYTE; - GLtype[(int)TypeCode.Byte] = glConst.UNSIGNED_BYTE; - } - - [LibraryImport(Native.LibName, EntryPoint = "glCheckShaderStat")] - [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] - #pragma warning disable CA5392 - internal static partial int glCheckShaderStatus( - ref OpenglContext context, - uint shaderHandle, - int key, - ref IntPtr logPtr); - #pragma warning restore CA5392 - - - #region ssgc api define - - [LibraryImport(Native.LibName, EntryPoint = "initGL")] - [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] - internal static partial void InternalInitGL(int majorVersion, int minorVersion); - - [LibraryImport( - Native.LibName, - EntryPoint = "loadGlfuncDefault", - StringMarshalling = StringMarshalling.Utf8)] - [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] - internal static partial IntPtr InternalLoadGlFuncDefault(string name); - - [LibraryImport(Native.LibName, EntryPoint = "linkShaderProgram")] - [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] - internal static unsafe partial uint InternalLinkShaderProgram( - OpenglContext* context, - uint shaderProgram); - - [LibraryImport(Native.LibName, EntryPoint = "readLog")] - [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] - internal static unsafe partial IntPtr InternalReadSSCLog(); - - [LibraryImport( - Native.LibName, - EntryPoint = "loadImageData", - StringMarshalling = StringMarshalling.Utf8)] - [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] - internal static unsafe partial void InternalLoadImage( - string fileName, - ImageInfo* output, - ImageLoader loader); - - [LibraryImport(Native.LibName, EntryPoint = "unloadImageData")] - [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] - internal static unsafe partial void InternalUnloadImage(ImageInfo* output); - - #endregion ssgc api define - } -} +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="gl" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Graphics.OpenGL; + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Internal +{ + internal static partial class GraphicFramework + { + + internal static uint[] GLtype = new uint[16]; + + static GraphicFramework() + { + GLtype[(int)TypeCode.Single] = glConst.FLOAT; + GLtype[(int)TypeCode.Int32] = glConst.INT; + GLtype[(int)TypeCode.UInt32] = glConst.UNSIGNED_INT; + GLtype[(int)TypeCode.Int16] = glConst.SHORT; + GLtype[(int)TypeCode.UInt16] = glConst.UNSIGNED_SHORT; + GLtype[(int)TypeCode.SByte] = glConst.BYTE; + GLtype[(int)TypeCode.Byte] = glConst.UNSIGNED_BYTE; + } + + [LibraryImport(Native.LibName, EntryPoint = "glCheckShaderStat")] + [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + #pragma warning disable CA5392 + internal static partial int glCheckShaderStatus( + ref OpenglContext context, + uint shaderHandle, + int key, + ref IntPtr logPtr + ); + #pragma warning restore CA5392 + + + #region ssgc api define + + [LibraryImport(Native.LibName, EntryPoint = "initGL")] + [UnmanagedCallConv(CallConvs =[typeof(CallConvCdecl)])] + internal static partial void InternalInitGL( + int majorVersion, + int minorVersion + ); + + [LibraryImport( + Native.LibName, + EntryPoint = "loadGlfuncDefault", + StringMarshalling = StringMarshalling.Utf8)] + [UnmanagedCallConv(CallConvs =[typeof(CallConvCdecl)])] + internal static partial IntPtr InternalLoadGlFuncDefault( + string name + ); + + [LibraryImport(Native.LibName, EntryPoint = "linkShaderProgram")] + [UnmanagedCallConv(CallConvs =[typeof(CallConvCdecl)])] + internal static unsafe partial uint InternalLinkShaderProgram( + OpenglContext* context, + uint shaderProgram + ); + + [LibraryImport(Native.LibName, EntryPoint = "readLog")] + [UnmanagedCallConv(CallConvs =[typeof(CallConvCdecl)])] + internal static unsafe partial IntPtr InternalReadSSCLog(); + + [LibraryImport( + Native.LibName, + EntryPoint = "loadImageData", + StringMarshalling = StringMarshalling.Utf8)] + [UnmanagedCallConv(CallConvs =[typeof(CallConvCdecl)])] + internal static unsafe partial void InternalLoadImage( + string fileName, + ImageInfo* output, + ImageLoader loader + ); + + [LibraryImport(Native.LibName, EntryPoint = "unloadImageData")] + [UnmanagedCallConv(CallConvs =[typeof(CallConvCdecl)])] + internal static unsafe partial void InternalUnloadImage( + ImageInfo* output + ); + + #endregion ssgc api define + } +} diff --git a/StgSharp.Common/Internal/Graphic/glfw.cs b/StgsSharp.Graphics/glfw.cs similarity index 96% rename from StgSharp.Common/Internal/Graphic/glfw.cs rename to StgsSharp.Graphics/glfw.cs index 5dfda431..c1394228 100644 --- a/StgSharp.Common/Internal/Graphic/glfw.cs +++ b/StgsSharp.Graphics/glfw.cs @@ -1,1101 +1,1102 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glfw" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Internal -{ - public class GraphicModule : IStaticModule - { - - public string ModuleName => "Graphic"; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void InitializeModule() - { - GraphicFramework.LoadGlfw(); - } - - } - - internal static unsafe partial class GraphicFramework - { - - private static GLFWFunction _glfw ; - - public static GLFWFunction glfwContext => _glfw; - - [LibraryImport(Native.LibName, EntryPoint = "load_glfw_functions")] - internal static unsafe partial void glfwLoadLibrary( - GLFWFunction* context - ); - - internal static unsafe void LoadGlfw() - { - _glfw = new GLFWFunction(); - fixed (GLFWFunction* func = &_glfw) { - glfwLoadLibrary(func); - } - } - - #region api call - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwInit() - { - return _glfw.glfwInit(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwTerminate() - { - _glfw.glfwTerminate(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwInitHint( - int hint, - int value - ) - { - _glfw.glfwInitHint(hint, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetVersion( - int* major, - int* minor, - int* rev - ) - { - _glfw.glfwGetVersion(major, minor, rev); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte* glfwGetVersionString() - { - return _glfw.glfwGetVersionString(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwGetError( - byte** description - ) - { - return _glfw.glfwGetError(description); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetErrorCallback( - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetErrorCallback(callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr* glfwGetMonitors( - int* count - ) - { - return _glfw.glfwGetMonitors(count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr glfwGetPrimaryMonitor() - { - return _glfw.glfwGetPrimaryMonitor(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetMonitorPos( - IntPtr monitor, - int* xpos, - int* ypos - ) - { - _glfw.glfwGetMonitorPos(monitor, xpos, ypos); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetMonitorWorkArea( - IntPtr monitor, - int* xPos, - int* yPos, - int* width, - int* height - ) - { - _glfw.glfwGetMonitorWorkarea(monitor, xPos, yPos, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetMonitorPhysicalSize( - IntPtr monitor, - int* widthMM, - int* heightMM - ) - { - _glfw.glfwGetMonitorPhysicalSize(monitor, widthMM, heightMM); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetMonitorContentScale( - IntPtr monitor, - float* xscale, - float* yscale - ) - { - _glfw.glfwGetMonitorContentScale(monitor, xscale, yscale); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte* glfwGetMonitorName( - IntPtr monitor - ) - { - return _glfw.glfwGetMonitorName(monitor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetMonitorUserPointer( - IntPtr monitor, - void* pointer - ) - { - _glfw.glfwSetMonitorUserPointer(monitor, pointer); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void* glfwGetMonitorUserPointer( - IntPtr monitor - ) - { - return _glfw.glfwGetMonitorUserPointer(monitor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetMonitorCallback( - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetMonitorCallback(callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe glfwVideomode* glfwGetVideoModes( - IntPtr monitor, - int* count - ) - { - return (glfwVideomode*)_glfw.glfwGetVideoModes(monitor, count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe glfwVideomode* glfwGetVideoMode( - IntPtr monitor - ) - { - return (glfwVideomode*)_glfw.glfwGetVideoMode(monitor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetGamma( - IntPtr monitor, - float gamma - ) - { - _glfw.glfwSetGamma(monitor, gamma); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe glfwGammaramp* glfwGetGammaRamp( - IntPtr monitor - ) - { - return (glfwGammaramp*)_glfw.glfwGetGammaRamp(monitor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetGammaRamp( - IntPtr monitor, - glfwGammaramp* ramp - ) - { - _glfw.glfwSetGammaRamp(monitor, (IntPtr)ramp); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwDefaultWindowHints() - { - _glfw.glfwDefaultWindowHints(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwWindowHint( - int hint, - int value - ) - { - _glfw.glfwWindowHint(hint, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwWindowHintString( - int hint, - byte* value - ) - { - _glfw.glfwWindowHintString(hint, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr glfwCreateWindow( - int width, - int height, - Span title, - IntPtr monitor, - IntPtr share - ) - { - nint handle; - fixed (byte* titlePtr = title) { - handle = _glfw.glfwCreateWindow(width, height, titlePtr, monitor, share); - } - if (handle == 0) - { - byte* desc; - int code = _glfw.glfwGetError(&desc); - string msg = $"{code}: {Marshal.PtrToStringUTF8((nint)desc)}"; - throw new InvalidOperationException(msg); - } - return handle; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwDestroyWindow( - IntPtr window - ) - { - _glfw.glfwDestroyWindow(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwWindowShouldClose( - IntPtr window - ) - { - return _glfw.glfwWindowShouldClose(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowShouldClose( - IntPtr window, - int value - ) - { - _glfw.glfwSetWindowShouldClose(window, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowTitle( - IntPtr window, - byte* title - ) - { - _glfw.glfwSetWindowTitle(window, title); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowIcon( - IntPtr window, - int count, - GLFWimage* images - ) - { - _glfw.glfwSetWindowIcon(window, count, (IntPtr)images); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetWindowPos( - IntPtr window, - int* xpos, - int* ypos - ) - { - _glfw.glfwGetWindowPos(window, xpos, ypos); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowPos( - IntPtr window, - int xpos, - int ypos - ) - { - _glfw.glfwSetWindowPos(window, xpos, ypos); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetWindowSize( - IntPtr window, - int* width, - int* height - ) - { - _glfw.glfwGetWindowSize(window, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowSizeLimits( - IntPtr window, - int minWidth, - int minHeight, - int maxWidth, - int maxHeight - ) - { - _glfw.glfwSetWindowSizeLimits(window, minWidth, minHeight, maxWidth, maxHeight); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowAspectRatio( - IntPtr window, - int numer, - int denom - ) - { - _glfw.glfwSetWindowAspectRatio(window, numer, denom); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowSize( - IntPtr window, - int width, - int height - ) - { - _glfw.glfwSetWindowSize(window, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetFramebufferSize( - IntPtr window, - int* width, - int* height - ) - { - _glfw.glfwGetFrameBufferSize(window, width, height); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetWindowFrameSize( - IntPtr window, - int* left, - int* top, - int* right, - int* bottom - ) - { - _glfw.glfwGetWindowFrameSize(window, left, top, right, bottom); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetWindowContentScale( - IntPtr window, - float* xscale, - float* yscale - ) - { - _glfw.glfwGetWindowContentScale(window, xscale, yscale); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe float glfwGetWindowOpacity( - IntPtr window - ) - { - return _glfw.glfwGetWindowOpacity(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowOpacity( - IntPtr window, - float opacity - ) - { - _glfw.glfwSetWindowOpacity(window, opacity); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwIconifyWindow( - IntPtr window - ) - { - _glfw.glfwIconifyWindow(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwRestoreWindow( - IntPtr window - ) - { - _glfw.glfwRestoreWindow(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwMaximizeWindow( - IntPtr window - ) - { - _glfw.glfwMaximizeWindow(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwShowWindow( - IntPtr window - ) - { - _glfw.glfwShowWindow(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwHideWindow( - IntPtr window - ) - { - _glfw.glfwHideWindow(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwFocusWindow( - IntPtr window - ) - { - _glfw.glfwFocusWindow(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwRequestWindowAttention( - IntPtr window - ) - { - _glfw.glfwRequestWindowAttention(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr glfwGetWindowMonitor( - IntPtr window - ) - { - return _glfw.glfwGetWindowMonitor(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowMonitor( - IntPtr window, - IntPtr monitor, - int xpos, - int ypos, - int width, - int height, - int refreshRate - ) - { - _glfw.glfwSetWindowMonitor(window, monitor, xpos, ypos, width, height, refreshRate); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwGetWindowAttrib( - IntPtr window, - int attrib - ) - { - return _glfw.glfwGetWindowAttrib(window, attrib); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowAttrib( - IntPtr window, - int attrib, - int value - ) - { - _glfw.glfwSetWindowAttrib(window, attrib, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetWindowUserPointer( - IntPtr window, - void* pointer - ) - { - _glfw.glfwSetWindowUserPointer(window, pointer); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void* glfwGetWindowUserPointer( - IntPtr window - ) - { - return _glfw.glfwGetWindowUserPointer(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowPosCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetWindowPosCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowSizeCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetWindowSizeCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowCloseCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetWindowCloseCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowRefreshCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetWindowRefreshCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowFocusCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetWindowFocusCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowIconifyCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetWindowIconifyCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowMaximizeCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetWindowMaximizeCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetFrameBufferSizeCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetFramebufferSizeCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowContentScaleCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetWindowContentScaleCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwPollEvents() - { - _glfw.glfwPollEvents(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwWaitEvents() - { - _glfw.glfwWaitEvents(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwWaitEventsTimeout( - double timeout - ) - { - _glfw.glfwWaitEventsTimeout(timeout); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwPostEmptyEvent() - { - _glfw.glfwPostEmptyEvent(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwGetInputMode( - IntPtr window, - int mode - ) - { - return _glfw.glfwGetInputMode(window, mode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetInputMode( - IntPtr window, - int mode, - int value - ) - { - _glfw.glfwSetInputMode(window, mode, value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwRawMouseMotionSupported() - { - return _glfw.glfwRawMouseMotionSupported(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte* glfwGetKeyName( - int key, - int scancode - ) - { - return _glfw.glfwGetKeyName(key, scancode); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwGetKeyScancode( - int key - ) - { - return _glfw.glfwGetKeyScancode(key); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe KeyStatus glfwGetKey( - IntPtr window, - int key - ) - { - return _glfw.glfwGetKey(window, key); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwGetMouseButton( - IntPtr window, - int button - ) - { - return _glfw.glfwGetMouseButton(window, button); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwGetCursorPos( - IntPtr window, - double* xpos, - double* ypos - ) - { - _glfw.glfwGetCursorPos(window, xpos, ypos); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetCursorPos( - IntPtr window, - double xpos, - double ypos - ) - { - _glfw.glfwSetCursorPos(window, xpos, ypos); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr glfwCreateCursor( - GLFWimage* image, - int xhot, - int yhot - ) - { - return _glfw.glfwCreateCursor((IntPtr)image, xhot, yhot); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr glfwCreateStandardCursor( - int shape - ) - { - return _glfw.glfwCreateStandardCursor(shape); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwDestroyCursor( - IntPtr cursor - ) - { - _glfw.glfwDestroyCursor(cursor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetCursor( - IntPtr window, - IntPtr cursor - ) - { - _glfw.glfwSetCursor(window, cursor); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetKeyCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetKeyCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetCharCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetCharCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetCharModsCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetCharModsCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetMouseButtonCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetMouseButtonCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetCursorPosCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetCursorPosCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetCursorEnterCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetCursorEnterCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetScrollCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetScrollCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetDropCallback( - IntPtr window, - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetDropCallback(window, callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwJoystickPresent( - int jid - ) - { - return _glfw.glfwJoystickPresent(jid); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe float* glfwGetJoystickAxes( - int jid, - int* count - ) - { - return _glfw.glfwGetJoystickAxes(jid, count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte* glfwGetJoystickButtons( - int jid, - int* count - ) - { - return _glfw.glfwGetJoystickButtons(jid, count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte* glfwGetJoystickHats( - int jid, - int* count - ) - { - return _glfw.glfwGetJoystickHats(jid, count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte* glfwGetJoystickName( - int jid - ) - { - return _glfw.glfwGetJoystickName(jid); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte* glfwGetJoystickGUID( - int jid - ) - { - return _glfw.glfwGetJoystickGUID(jid); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetJoystickUserPointer( - int jid, - void* pointer - ) - { - _glfw.glfwSetJoystickUserPointer(jid, pointer); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void* glfwGetJoystickUserPointer( - int jid - ) - { - return _glfw.glfwGetJoystickUserPointer(jid); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwJoystickIsGamepad( - int jid - ) - { - return _glfw.glfwJoystickIsGamePad(jid); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe delegate* unmanaged[Cdecl] glfwSetJoystickCallback( - delegate* unmanaged[Cdecl] callback - ) - { - return _glfw.glfwSetJoystickCallback(callback); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwUpdateGamePadMappings( - byte* str - ) - { - return _glfw.glfwUpdateGamePadMappings(str); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte* glfwGetGamePadName( - int jid - ) - { - return _glfw.glfwGetGamepadName(jid); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwGetGamePadState( - int jid, - GLFWgamepadstate* state - ) - { - return _glfw.glfwGetGamepadState(jid, (IntPtr)state); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetClipboardString( - IntPtr window, - byte* str - ) - { - _glfw.glfwSetClipboardString(window, str); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte* glfwGetClipboardString( - IntPtr window - ) - { - return _glfw.glfwGetClipboardString(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe double glfwGetTime() - { - return _glfw.glfwGetTime(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSetTime( - double time - ) - { - _glfw.glfwSetTime(time); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe ulong glfwGetTimerValue() - { - return _glfw.glfwGetTimerValue(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe ulong glfwGetTimerFrequency() - { - return _glfw.glfwGetTimerFrequency(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwMakeContextCurrent( - IntPtr window - ) - { - _glfw.glfwMakeContextCurrent(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr glfwGetCurrentContext() - { - return _glfw.glfwGetCurrentContext(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSwapBuffers( - IntPtr window - ) - { - _glfw.glfwSwapBuffers(window); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe void glfwSwapInterval( - int interval - ) - { - _glfw.glfwSwapInterval(interval); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwExtensionSupported( - byte* extension - ) - { - return _glfw.glfwExtensionSupported(extension); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr glfwGetProcAddress( - string procName - ) - { - return glfwGetProcAddress(Encoding.UTF8.GetBytes(procName)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr glfwGetProcAddress( - ReadOnlySpan procName - ) - { - fixed (byte* sPtr = procName) { - return _glfw.glfwGetProcAddress(sPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe IntPtr glfwGetProcAddress( - Span procName - ) - { - fixed (byte* bPtr = procName) { - return _glfw.glfwGetProcAddress(bPtr); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe int glfwVulkanSupported() - { - return _glfw.glfwVulkanSupported(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe byte** glfwGetRequiredInstanceExtensions( - uint* count - ) - { - return _glfw.glfwGetRequiredInstanceExtensions(count); - } - - } -} - -#endregion - +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glfw" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Internal; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics +{ + public class GraphicModule : IStaticModule + { + + public string ModuleName => "Graphic"; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InitializeModule() + { + GraphicFramework.LoadGlfw(); + } + + } + + internal static unsafe partial class GraphicFramework + { + + private static GLFWFunction _glfw ; + + public static GLFWFunction glfwContext => _glfw; + + [LibraryImport(Native.LibName, EntryPoint = "load_glfw_functions")] + internal static unsafe partial void glfwLoadLibrary( + GLFWFunction* context + ); + + internal static unsafe void LoadGlfw() + { + _glfw = new GLFWFunction(); + fixed (GLFWFunction* func = &_glfw) { + glfwLoadLibrary(func); + } + } + + #region api call + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwInit() + { + return _glfw.glfwInit(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwTerminate() + { + _glfw.glfwTerminate(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwInitHint( + int hint, + int value + ) + { + _glfw.glfwInitHint(hint, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetVersion( + int* major, + int* minor, + int* rev + ) + { + _glfw.glfwGetVersion(major, minor, rev); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte* glfwGetVersionString() + { + return _glfw.glfwGetVersionString(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwGetError( + byte** description + ) + { + return _glfw.glfwGetError(description); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetErrorCallback( + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetErrorCallback(callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe IntPtr* glfwGetMonitors( + int* count + ) + { + return _glfw.glfwGetMonitors(count); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe IntPtr glfwGetPrimaryMonitor() + { + return _glfw.glfwGetPrimaryMonitor(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetMonitorPos( + IntPtr monitor, + int* xpos, + int* ypos + ) + { + _glfw.glfwGetMonitorPos(monitor, xpos, ypos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetMonitorWorkArea( + IntPtr monitor, + int* xPos, + int* yPos, + int* width, + int* height + ) + { + _glfw.glfwGetMonitorWorkarea(monitor, xPos, yPos, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetMonitorPhysicalSize( + IntPtr monitor, + int* widthMM, + int* heightMM + ) + { + _glfw.glfwGetMonitorPhysicalSize(monitor, widthMM, heightMM); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetMonitorContentScale( + IntPtr monitor, + float* xscale, + float* yscale + ) + { + _glfw.glfwGetMonitorContentScale(monitor, xscale, yscale); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte* glfwGetMonitorName( + IntPtr monitor + ) + { + return _glfw.glfwGetMonitorName(monitor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetMonitorUserPointer( + IntPtr monitor, + void* pointer + ) + { + _glfw.glfwSetMonitorUserPointer(monitor, pointer); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void* glfwGetMonitorUserPointer( + IntPtr monitor + ) + { + return _glfw.glfwGetMonitorUserPointer(monitor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetMonitorCallback( + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetMonitorCallback(callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe glfwVideomode* glfwGetVideoModes( + IntPtr monitor, + int* count + ) + { + return (glfwVideomode*)_glfw.glfwGetVideoModes(monitor, count); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe glfwVideomode* glfwGetVideoMode( + IntPtr monitor + ) + { + return (glfwVideomode*)_glfw.glfwGetVideoMode(monitor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetGamma( + IntPtr monitor, + float gamma + ) + { + _glfw.glfwSetGamma(monitor, gamma); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe glfwGammaramp* glfwGetGammaRamp( + IntPtr monitor + ) + { + return (glfwGammaramp*)_glfw.glfwGetGammaRamp(monitor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetGammaRamp( + IntPtr monitor, + glfwGammaramp* ramp + ) + { + _glfw.glfwSetGammaRamp(monitor, (IntPtr)ramp); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwDefaultWindowHints() + { + _glfw.glfwDefaultWindowHints(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwWindowHint( + int hint, + int value + ) + { + _glfw.glfwWindowHint(hint, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwWindowHintString( + int hint, + byte* value + ) + { + _glfw.glfwWindowHintString(hint, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe nint glfwCreateWindow( + int width, + int height, + Span title, + IntPtr monitor, + IntPtr share + ) + { + nint handle; + fixed (byte* titlePtr = title) { + handle = _glfw.glfwCreateWindow(width, height, titlePtr, monitor, share); + } + if (handle == 0) + { + byte* desc; + int code = _glfw.glfwGetError(&desc); + string msg = $"{code}: {Marshal.PtrToStringUTF8((nint)desc)}"; + throw new InvalidOperationException(msg); + } + return handle; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwDestroyWindow( + IntPtr window + ) + { + _glfw.glfwDestroyWindow(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwWindowShouldClose( + IntPtr window + ) + { + return _glfw.glfwWindowShouldClose(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowShouldClose( + IntPtr window, + int value + ) + { + _glfw.glfwSetWindowShouldClose(window, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowTitle( + IntPtr window, + byte* title + ) + { + _glfw.glfwSetWindowTitle(window, title); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowIcon( + IntPtr window, + int count, + GLFWimage* images + ) + { + _glfw.glfwSetWindowIcon(window, count, (IntPtr)images); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetWindowPos( + IntPtr window, + int* xpos, + int* ypos + ) + { + _glfw.glfwGetWindowPos(window, xpos, ypos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowPos( + IntPtr window, + int xpos, + int ypos + ) + { + _glfw.glfwSetWindowPos(window, xpos, ypos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetWindowSize( + IntPtr window, + int* width, + int* height + ) + { + _glfw.glfwGetWindowSize(window, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowSizeLimits( + IntPtr window, + int minWidth, + int minHeight, + int maxWidth, + int maxHeight + ) + { + _glfw.glfwSetWindowSizeLimits(window, minWidth, minHeight, maxWidth, maxHeight); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowAspectRatio( + IntPtr window, + int numer, + int denom + ) + { + _glfw.glfwSetWindowAspectRatio(window, numer, denom); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowSize( + IntPtr window, + int width, + int height + ) + { + _glfw.glfwSetWindowSize(window, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetFramebufferSize( + IntPtr window, + int* width, + int* height + ) + { + _glfw.glfwGetFrameBufferSize(window, width, height); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetWindowFrameSize( + IntPtr window, + int* left, + int* top, + int* right, + int* bottom + ) + { + _glfw.glfwGetWindowFrameSize(window, left, top, right, bottom); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetWindowContentScale( + IntPtr window, + float* xscale, + float* yscale + ) + { + _glfw.glfwGetWindowContentScale(window, xscale, yscale); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe float glfwGetWindowOpacity( + IntPtr window + ) + { + return _glfw.glfwGetWindowOpacity(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowOpacity( + IntPtr window, + float opacity + ) + { + _glfw.glfwSetWindowOpacity(window, opacity); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwIconifyWindow( + IntPtr window + ) + { + _glfw.glfwIconifyWindow(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwRestoreWindow( + IntPtr window + ) + { + _glfw.glfwRestoreWindow(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwMaximizeWindow( + IntPtr window + ) + { + _glfw.glfwMaximizeWindow(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwShowWindow( + IntPtr window + ) + { + _glfw.glfwShowWindow(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwHideWindow( + IntPtr window + ) + { + _glfw.glfwHideWindow(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwFocusWindow( + IntPtr window + ) + { + _glfw.glfwFocusWindow(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwRequestWindowAttention( + IntPtr window + ) + { + _glfw.glfwRequestWindowAttention(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe IntPtr glfwGetWindowMonitor( + IntPtr window + ) + { + return _glfw.glfwGetWindowMonitor(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowMonitor( + IntPtr window, + IntPtr monitor, + int xpos, + int ypos, + int width, + int height, + int refreshRate + ) + { + _glfw.glfwSetWindowMonitor(window, monitor, xpos, ypos, width, height, refreshRate); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwGetWindowAttrib( + IntPtr window, + int attrib + ) + { + return _glfw.glfwGetWindowAttrib(window, attrib); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowAttrib( + IntPtr window, + int attrib, + int value + ) + { + _glfw.glfwSetWindowAttrib(window, attrib, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetWindowUserPointer( + IntPtr window, + void* pointer + ) + { + _glfw.glfwSetWindowUserPointer(window, pointer); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void* glfwGetWindowUserPointer( + IntPtr window + ) + { + return _glfw.glfwGetWindowUserPointer(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowPosCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetWindowPosCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowSizeCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetWindowSizeCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowCloseCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetWindowCloseCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowRefreshCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetWindowRefreshCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowFocusCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetWindowFocusCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowIconifyCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetWindowIconifyCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowMaximizeCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetWindowMaximizeCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetFrameBufferSizeCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetFramebufferSizeCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetWindowContentScaleCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetWindowContentScaleCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwPollEvents() + { + _glfw.glfwPollEvents(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwWaitEvents() + { + _glfw.glfwWaitEvents(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwWaitEventsTimeout( + double timeout + ) + { + _glfw.glfwWaitEventsTimeout(timeout); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwPostEmptyEvent() + { + _glfw.glfwPostEmptyEvent(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwGetInputMode( + IntPtr window, + int mode + ) + { + return _glfw.glfwGetInputMode(window, mode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetInputMode( + IntPtr window, + int mode, + int value + ) + { + _glfw.glfwSetInputMode(window, mode, value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwRawMouseMotionSupported() + { + return _glfw.glfwRawMouseMotionSupported(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte* glfwGetKeyName( + int key, + int scancode + ) + { + return _glfw.glfwGetKeyName(key, scancode); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwGetKeyScancode( + int key + ) + { + return _glfw.glfwGetKeyScancode(key); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe KeyStatus glfwGetKey( + IntPtr window, + int key + ) + { + return _glfw.glfwGetKey(window, key); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwGetMouseButton( + IntPtr window, + int button + ) + { + return _glfw.glfwGetMouseButton(window, button); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwGetCursorPos( + IntPtr window, + double* xpos, + double* ypos + ) + { + _glfw.glfwGetCursorPos(window, xpos, ypos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetCursorPos( + IntPtr window, + double xpos, + double ypos + ) + { + _glfw.glfwSetCursorPos(window, xpos, ypos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe IntPtr glfwCreateCursor( + GLFWimage* image, + int xhot, + int yhot + ) + { + return _glfw.glfwCreateCursor((IntPtr)image, xhot, yhot); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe IntPtr glfwCreateStandardCursor( + int shape + ) + { + return _glfw.glfwCreateStandardCursor(shape); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwDestroyCursor( + IntPtr cursor + ) + { + _glfw.glfwDestroyCursor(cursor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetCursor( + IntPtr window, + IntPtr cursor + ) + { + _glfw.glfwSetCursor(window, cursor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetKeyCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetKeyCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetCharCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetCharCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetCharModsCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetCharModsCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetMouseButtonCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetMouseButtonCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetCursorPosCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetCursorPosCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetCursorEnterCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetCursorEnterCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetScrollCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetScrollCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetDropCallback( + IntPtr window, + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetDropCallback(window, callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwJoystickPresent( + int jid + ) + { + return _glfw.glfwJoystickPresent(jid); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe float* glfwGetJoystickAxes( + int jid, + int* count + ) + { + return _glfw.glfwGetJoystickAxes(jid, count); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte* glfwGetJoystickButtons( + int jid, + int* count + ) + { + return _glfw.glfwGetJoystickButtons(jid, count); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte* glfwGetJoystickHats( + int jid, + int* count + ) + { + return _glfw.glfwGetJoystickHats(jid, count); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte* glfwGetJoystickName( + int jid + ) + { + return _glfw.glfwGetJoystickName(jid); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte* glfwGetJoystickGUID( + int jid + ) + { + return _glfw.glfwGetJoystickGUID(jid); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetJoystickUserPointer( + int jid, + void* pointer + ) + { + _glfw.glfwSetJoystickUserPointer(jid, pointer); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void* glfwGetJoystickUserPointer( + int jid + ) + { + return _glfw.glfwGetJoystickUserPointer(jid); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwJoystickIsGamepad( + int jid + ) + { + return _glfw.glfwJoystickIsGamePad(jid); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe delegate* unmanaged[Cdecl] glfwSetJoystickCallback( + delegate* unmanaged[Cdecl] callback + ) + { + return _glfw.glfwSetJoystickCallback(callback); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwUpdateGamePadMappings( + byte* str + ) + { + return _glfw.glfwUpdateGamePadMappings(str); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte* glfwGetGamePadName( + int jid + ) + { + return _glfw.glfwGetGamepadName(jid); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwGetGamePadState( + int jid, + GLFWgamepadstate* state + ) + { + return _glfw.glfwGetGamepadState(jid, (IntPtr)state); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetClipboardString( + IntPtr window, + byte* str + ) + { + _glfw.glfwSetClipboardString(window, str); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte* glfwGetClipboardString( + IntPtr window + ) + { + return _glfw.glfwGetClipboardString(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe double glfwGetTime() + { + return _glfw.glfwGetTime(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSetTime( + double time + ) + { + _glfw.glfwSetTime(time); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe ulong glfwGetTimerValue() + { + return _glfw.glfwGetTimerValue(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe ulong glfwGetTimerFrequency() + { + return _glfw.glfwGetTimerFrequency(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwMakeContextCurrent( + IntPtr window + ) + { + _glfw.glfwMakeContextCurrent(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe IntPtr glfwGetCurrentContext() + { + return _glfw.glfwGetCurrentContext(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSwapBuffers( + IntPtr window + ) + { + _glfw.glfwSwapBuffers(window); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe void glfwSwapInterval( + int interval + ) + { + _glfw.glfwSwapInterval(interval); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwExtensionSupported( + byte* extension + ) + { + return _glfw.glfwExtensionSupported(extension); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe IntPtr glfwGetProcAddress( + string procName + ) + { + return glfwGetProcAddress(Encoding.UTF8.GetBytes(procName)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe IntPtr glfwGetProcAddress( + ReadOnlySpan procName + ) + { + fixed (byte* sPtr = procName) { + return _glfw.glfwGetProcAddress(sPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe IntPtr glfwGetProcAddress( + Span procName + ) + { + fixed (byte* bPtr = procName) { + return _glfw.glfwGetProcAddress(bPtr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe int glfwVulkanSupported() + { + return _glfw.glfwVulkanSupported(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe byte** glfwGetRequiredInstanceExtensions( + uint* count + ) + { + return _glfw.glfwGetRequiredInstanceExtensions(count); + } + + } +} + +#endregion + diff --git a/StgsSharp.Graphics/glfw.dtruct.cs b/StgsSharp.Graphics/glfw.dtruct.cs new file mode 100644 index 00000000..fce7234a --- /dev/null +++ b/StgsSharp.Graphics/glfw.dtruct.cs @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="StructDefine" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Graphics.OpenGL; + +using System; +using System.Runtime.InteropServices; + +/**/ + +namespace StgSharp.Internal +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct glfwContext { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct glfwVideomode { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct glfwGammaramp { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWimage { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWgamepadstate { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWallocator { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct glfwMonitor { } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct glfwWindow { } + + [StructLayout(LayoutKind.Sequential)] + public struct GLFWwindowCallback { } + + [StructLayout(LayoutKind.Sequential)] + public struct GLFWcursor { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWinitconfig { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWwndconfig { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWctxconfig { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWfbconfig { } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct GLFWlibrary { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWmapelement { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWmapping { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWjoystick { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWls { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWplatform { } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWmutex { } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct VkExtensionProperties { } + + [StructLayout(LayoutKind.Explicit, Size = 16)] + public struct uintptr_t { } +} + +/**/ \ No newline at end of file diff --git a/StgSharp.Common/Internal/Graphic/glfw.function.cs b/StgsSharp.Graphics/glfw.function.cs similarity index 98% rename from StgSharp.Common/Internal/Graphic/glfw.function.cs rename to StgsSharp.Graphics/glfw.function.cs index d55a2700..4dc85105 100644 --- a/StgSharp.Common/Internal/Graphic/glfw.function.cs +++ b/StgsSharp.Graphics/glfw.function.cs @@ -1,161 +1,161 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glfw.function" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Internal -{ - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct GLFWFunction - { - - public delegate* unmanaged[Cdecl] glfwCreateCursor; - public delegate* unmanaged[Cdecl] glfwCreateStandardCursor; - public delegate* unmanaged[Cdecl] glfwCreateWindow; - public delegate* unmanaged[Cdecl] glfwDefaultWindowHints; - public delegate* unmanaged[Cdecl] glfwDestroyCursor; - public delegate* unmanaged[Cdecl] glfwDestroyWindow; - public delegate* unmanaged[Cdecl] glfwExtensionSupported; - public delegate* unmanaged[Cdecl] glfwFocusWindow; - public delegate* unmanaged[Cdecl] glfwGetClipboardString; - public delegate* unmanaged[Cdecl] glfwGetCurrentContext; - public delegate* unmanaged[Cdecl] glfwGetCursorPos; - public delegate* unmanaged[Cdecl] glfwGetError; - public delegate* unmanaged[Cdecl] glfwGetFrameBufferSize; - public delegate* unmanaged[Cdecl] glfwGetGamepadName; - public delegate* unmanaged[Cdecl] glfwGetGamepadState; - public delegate* unmanaged[Cdecl] glfwGetGammaRamp; - public delegate* unmanaged[Cdecl] glfwGetInputMode; - public delegate* unmanaged[Cdecl] glfwGetJoystickAxes; - public delegate* unmanaged[Cdecl] glfwGetJoystickButtons; - public delegate* unmanaged[Cdecl] glfwGetJoystickGUID; - public delegate* unmanaged[Cdecl] glfwGetJoystickHats; - public delegate* unmanaged[Cdecl] glfwGetJoystickName; - public delegate* unmanaged[Cdecl] glfwGetJoystickUserPointer; - public delegate* unmanaged[Cdecl] glfwGetKey; - public delegate* unmanaged[Cdecl] glfwGetKeyName; - public delegate* unmanaged[Cdecl] glfwGetKeyScancode; - public delegate* unmanaged[Cdecl] glfwGetMonitorContentScale; - public delegate* unmanaged[Cdecl] glfwGetMonitorName; - public delegate* unmanaged[Cdecl] glfwGetMonitorPhysicalSize; - public delegate* unmanaged[Cdecl] glfwGetMonitorPos; - public delegate* unmanaged[Cdecl] glfwGetMonitors; - public delegate* unmanaged[Cdecl] glfwGetMonitorUserPointer; - public delegate* unmanaged[Cdecl] glfwGetMonitorWorkarea; - public delegate* unmanaged[Cdecl] glfwGetMouseButton; - public delegate* unmanaged[Cdecl] glfwGetPrimaryMonitor; - public delegate* unmanaged[Cdecl] glfwGetProcAddress; - public delegate* unmanaged[Cdecl] glfwGetRequiredInstanceExtensions; - public delegate* unmanaged[Cdecl] glfwGetTime; - public delegate* unmanaged[Cdecl] glfwGetTimerFrequency; - public delegate* unmanaged[Cdecl] glfwGetTimerValue; - public delegate* unmanaged[Cdecl] glfwGetVersion; - public delegate* unmanaged[Cdecl] glfwGetVersionString; - public delegate* unmanaged[Cdecl] glfwGetVideoMode; - public delegate* unmanaged[Cdecl] glfwGetVideoModes; - public delegate* unmanaged[Cdecl] glfwGetWindowAttrib; - public delegate* unmanaged[Cdecl] glfwGetWindowContentScale; - public delegate* unmanaged[Cdecl] glfwGetWindowFrameSize; - public delegate* unmanaged[Cdecl] glfwGetWindowMonitor; - public delegate* unmanaged[Cdecl] glfwGetWindowOpacity; - public delegate* unmanaged[Cdecl] glfwGetWindowPos; - public delegate* unmanaged[Cdecl] glfwGetWindowSize; - public delegate* unmanaged[Cdecl] glfwGetWindowUserPointer; - public delegate* unmanaged[Cdecl] glfwHideWindow; - public delegate* unmanaged[Cdecl] glfwIconifyWindow; - public delegate* unmanaged[Cdecl] glfwInit; - public delegate* unmanaged[Cdecl] glfwInitHint; - public delegate* unmanaged[Cdecl] glfwJoystickIsGamePad; - public delegate* unmanaged[Cdecl] glfwJoystickPresent; - public delegate* unmanaged[Cdecl] glfwMakeContextCurrent; - public delegate* unmanaged[Cdecl] glfwMaximizeWindow; - public delegate* unmanaged[Cdecl] glfwPollEvents; - public delegate* unmanaged[Cdecl] glfwPostEmptyEvent; - public delegate* unmanaged[Cdecl] glfwRawMouseMotionSupported; - public delegate* unmanaged[Cdecl] glfwRequestWindowAttention; - public delegate* unmanaged[Cdecl] glfwRestoreWindow; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetCharCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetCharModsCallback; - public delegate* unmanaged[Cdecl] glfwSetClipboardString; - public delegate* unmanaged[Cdecl] glfwSetCursor; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetCursorEnterCallback; - public delegate* unmanaged[Cdecl] glfwSetCursorPos; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetCursorPosCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetDropCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetErrorCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetFramebufferSizeCallback; - public delegate* unmanaged[Cdecl] glfwSetGamma; - public delegate* unmanaged[Cdecl] glfwSetGammaRamp; - public delegate* unmanaged[Cdecl] glfwSetInputMode; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetJoystickCallback; - public delegate* unmanaged[Cdecl] glfwSetJoystickUserPointer; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetKeyCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetMonitorCallback; - public delegate* unmanaged[Cdecl] glfwSetMonitorUserPointer; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetMouseButtonCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetScrollCallback; - public delegate* unmanaged[Cdecl] glfwSetTime; - public delegate* unmanaged[Cdecl] glfwSetWindowAspectRatio; - public delegate* unmanaged[Cdecl] glfwSetWindowAttrib; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowCloseCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowContentScaleCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowFocusCallback; - public delegate* unmanaged[Cdecl] glfwSetWindowIcon; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowIconifyCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowMaximizeCallback; - public delegate* unmanaged[Cdecl] glfwSetWindowMonitor; - public delegate* unmanaged[Cdecl] glfwSetWindowOpacity; - public delegate* unmanaged[Cdecl] glfwSetWindowPos; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowPosCallback; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowRefreshCallback; - public delegate* unmanaged[Cdecl] glfwSetWindowShouldClose; - public delegate* unmanaged[Cdecl] glfwSetWindowSize; - public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowSizeCallback; - public delegate* unmanaged[Cdecl] glfwSetWindowSizeLimits; - public delegate* unmanaged[Cdecl] glfwSetWindowTitle; - public delegate* unmanaged[Cdecl] glfwSetWindowUserPointer; - public delegate* unmanaged[Cdecl] glfwShowWindow; - public delegate* unmanaged[Cdecl] glfwSwapBuffers; - public delegate* unmanaged[Cdecl] glfwSwapInterval; - public delegate* unmanaged[Cdecl] glfwTerminate; - public delegate* unmanaged[Cdecl] glfwUpdateGamePadMappings; - public delegate* unmanaged[Cdecl] glfwVulkanSupported; - public delegate* unmanaged[Cdecl] glfwWaitEvents; - public delegate* unmanaged[Cdecl] glfwWaitEventsTimeout; - public delegate* unmanaged[Cdecl] glfwWindowHint; - public delegate* unmanaged[Cdecl] glfwWindowHintString; - public delegate* unmanaged[Cdecl] glfwWindowShouldClose; - - public GLFWFunction() - { - Unsafe.SkipInit(out this); - } - - } +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glfw.function" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Internal +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct GLFWFunction + { + + public delegate* unmanaged[Cdecl] glfwCreateCursor; + public delegate* unmanaged[Cdecl] glfwCreateStandardCursor; + public delegate* unmanaged[Cdecl] glfwCreateWindow; + public delegate* unmanaged[Cdecl] glfwDefaultWindowHints; + public delegate* unmanaged[Cdecl] glfwDestroyCursor; + public delegate* unmanaged[Cdecl] glfwDestroyWindow; + public delegate* unmanaged[Cdecl] glfwExtensionSupported; + public delegate* unmanaged[Cdecl] glfwFocusWindow; + public delegate* unmanaged[Cdecl] glfwGetClipboardString; + public delegate* unmanaged[Cdecl] glfwGetCurrentContext; + public delegate* unmanaged[Cdecl] glfwGetCursorPos; + public delegate* unmanaged[Cdecl] glfwGetError; + public delegate* unmanaged[Cdecl] glfwGetFrameBufferSize; + public delegate* unmanaged[Cdecl] glfwGetGamepadName; + public delegate* unmanaged[Cdecl] glfwGetGamepadState; + public delegate* unmanaged[Cdecl] glfwGetGammaRamp; + public delegate* unmanaged[Cdecl] glfwGetInputMode; + public delegate* unmanaged[Cdecl] glfwGetJoystickAxes; + public delegate* unmanaged[Cdecl] glfwGetJoystickButtons; + public delegate* unmanaged[Cdecl] glfwGetJoystickGUID; + public delegate* unmanaged[Cdecl] glfwGetJoystickHats; + public delegate* unmanaged[Cdecl] glfwGetJoystickName; + public delegate* unmanaged[Cdecl] glfwGetJoystickUserPointer; + public delegate* unmanaged[Cdecl] glfwGetKey; + public delegate* unmanaged[Cdecl] glfwGetKeyName; + public delegate* unmanaged[Cdecl] glfwGetKeyScancode; + public delegate* unmanaged[Cdecl] glfwGetMonitorContentScale; + public delegate* unmanaged[Cdecl] glfwGetMonitorName; + public delegate* unmanaged[Cdecl] glfwGetMonitorPhysicalSize; + public delegate* unmanaged[Cdecl] glfwGetMonitorPos; + public delegate* unmanaged[Cdecl] glfwGetMonitors; + public delegate* unmanaged[Cdecl] glfwGetMonitorUserPointer; + public delegate* unmanaged[Cdecl] glfwGetMonitorWorkarea; + public delegate* unmanaged[Cdecl] glfwGetMouseButton; + public delegate* unmanaged[Cdecl] glfwGetPrimaryMonitor; + public delegate* unmanaged[Cdecl] glfwGetProcAddress; + public delegate* unmanaged[Cdecl] glfwGetRequiredInstanceExtensions; + public delegate* unmanaged[Cdecl] glfwGetTime; + public delegate* unmanaged[Cdecl] glfwGetTimerFrequency; + public delegate* unmanaged[Cdecl] glfwGetTimerValue; + public delegate* unmanaged[Cdecl] glfwGetVersion; + public delegate* unmanaged[Cdecl] glfwGetVersionString; + public delegate* unmanaged[Cdecl] glfwGetVideoMode; + public delegate* unmanaged[Cdecl] glfwGetVideoModes; + public delegate* unmanaged[Cdecl] glfwGetWindowAttrib; + public delegate* unmanaged[Cdecl] glfwGetWindowContentScale; + public delegate* unmanaged[Cdecl] glfwGetWindowFrameSize; + public delegate* unmanaged[Cdecl] glfwGetWindowMonitor; + public delegate* unmanaged[Cdecl] glfwGetWindowOpacity; + public delegate* unmanaged[Cdecl] glfwGetWindowPos; + public delegate* unmanaged[Cdecl] glfwGetWindowSize; + public delegate* unmanaged[Cdecl] glfwGetWindowUserPointer; + public delegate* unmanaged[Cdecl] glfwHideWindow; + public delegate* unmanaged[Cdecl] glfwIconifyWindow; + public delegate* unmanaged[Cdecl] glfwInit; + public delegate* unmanaged[Cdecl] glfwInitHint; + public delegate* unmanaged[Cdecl] glfwJoystickIsGamePad; + public delegate* unmanaged[Cdecl] glfwJoystickPresent; + public delegate* unmanaged[Cdecl] glfwMakeContextCurrent; + public delegate* unmanaged[Cdecl] glfwMaximizeWindow; + public delegate* unmanaged[Cdecl] glfwPollEvents; + public delegate* unmanaged[Cdecl] glfwPostEmptyEvent; + public delegate* unmanaged[Cdecl] glfwRawMouseMotionSupported; + public delegate* unmanaged[Cdecl] glfwRequestWindowAttention; + public delegate* unmanaged[Cdecl] glfwRestoreWindow; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetCharCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetCharModsCallback; + public delegate* unmanaged[Cdecl] glfwSetClipboardString; + public delegate* unmanaged[Cdecl] glfwSetCursor; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetCursorEnterCallback; + public delegate* unmanaged[Cdecl] glfwSetCursorPos; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetCursorPosCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetDropCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetErrorCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetFramebufferSizeCallback; + public delegate* unmanaged[Cdecl] glfwSetGamma; + public delegate* unmanaged[Cdecl] glfwSetGammaRamp; + public delegate* unmanaged[Cdecl] glfwSetInputMode; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetJoystickCallback; + public delegate* unmanaged[Cdecl] glfwSetJoystickUserPointer; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetKeyCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetMonitorCallback; + public delegate* unmanaged[Cdecl] glfwSetMonitorUserPointer; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetMouseButtonCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetScrollCallback; + public delegate* unmanaged[Cdecl] glfwSetTime; + public delegate* unmanaged[Cdecl] glfwSetWindowAspectRatio; + public delegate* unmanaged[Cdecl] glfwSetWindowAttrib; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowCloseCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowContentScaleCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowFocusCallback; + public delegate* unmanaged[Cdecl] glfwSetWindowIcon; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowIconifyCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowMaximizeCallback; + public delegate* unmanaged[Cdecl] glfwSetWindowMonitor; + public delegate* unmanaged[Cdecl] glfwSetWindowOpacity; + public delegate* unmanaged[Cdecl] glfwSetWindowPos; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowPosCallback; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowRefreshCallback; + public delegate* unmanaged[Cdecl] glfwSetWindowShouldClose; + public delegate* unmanaged[Cdecl] glfwSetWindowSize; + public delegate* unmanaged[Cdecl], delegate* unmanaged[Cdecl]> glfwSetWindowSizeCallback; + public delegate* unmanaged[Cdecl] glfwSetWindowSizeLimits; + public delegate* unmanaged[Cdecl] glfwSetWindowTitle; + public delegate* unmanaged[Cdecl] glfwSetWindowUserPointer; + public delegate* unmanaged[Cdecl] glfwShowWindow; + public delegate* unmanaged[Cdecl] glfwSwapBuffers; + public delegate* unmanaged[Cdecl] glfwSwapInterval; + public delegate* unmanaged[Cdecl] glfwTerminate; + public delegate* unmanaged[Cdecl] glfwUpdateGamePadMappings; + public delegate* unmanaged[Cdecl] glfwVulkanSupported; + public delegate* unmanaged[Cdecl] glfwWaitEvents; + public delegate* unmanaged[Cdecl] glfwWaitEventsTimeout; + public delegate* unmanaged[Cdecl] glfwWindowHint; + public delegate* unmanaged[Cdecl] glfwWindowHintString; + public delegate* unmanaged[Cdecl] glfwWindowShouldClose; + + public GLFWFunction() + { + Unsafe.SkipInit(out this); + } + + } } \ No newline at end of file