daily update on 20250127 by nitload youmu, schema and element splitter complete, builtin defination building

This commit is contained in:
Nitload
2025-01-28 08:52:16 +08:00
parent 190d67a034
commit e687473132
134 changed files with 17949 additions and 867 deletions
@@ -29,8 +29,7 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Collections;
using StgSharp.Commom.Collections;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@@ -0,0 +1,49 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="GLfixed.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 System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Internal
{
[StructLayout( LayoutKind.Explicit, Size = 8 )]
public struct GLfixed
{
[FieldOffset( 0 )] public int All;
[FieldOffset( 0 )] public short Decimals;
[FieldOffset( 4 )] public short Inertger;
}
}
@@ -0,0 +1,92 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="glClampf.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 System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Internal
{
/// <summary>
/// OpenGL numeric type. An IEEE-754 floating-point value, clamped to the range [0,1].
/// </summary>
[StructLayout( LayoutKind.Sequential )]
public struct GLclampf
{
public float value;
public GLclampf( float a )
{
value = a;
}
public static explicit operator float( GLclampf v )
{
return v.value;
}
public static explicit operator GLclampf( float v )
{
return new GLclampf( v );
}
}
/// <summary>
/// OpenGL numeric type. An IEEE-754 double precision floating-point value, clamped to the range
/// [0,1].
/// </summary>
[StructLayout( LayoutKind.Sequential )]
public struct GLclampd
{
public double value;
public GLclampd( double a )
{
value = a;
}
public static explicit operator double( GLclampd v )
{
return v.value;
}
public static explicit operator GLclampd( double v )
{
return new GLclampd( v );
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,263 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="glEnum.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.Graphics.OpenGL;
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
}
}
namespace StgSharp.Internal.OpenGL
{
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
}
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
}
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,
}
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
}
#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,
COPY_READ_BUFFER = 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,
SHADER_STORAGE_BUFFER = 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
}
}
@@ -30,7 +30,6 @@
//-----------------------------------------------------------------------
using StgSharp.Graphics;
using StgSharp.Internal;
using StgSharp.Internal.OpenGL;
using StgSharp.Math;
using System;
@@ -0,0 +1,72 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="glHalfNV.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 System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Internal.OpenGL
{
[StructLayout( LayoutKind.Explicit, Size = 16 )]
public struct glHalfNV
{
[FieldOffset( 0 )] public short binary;
public glHalfNV( short bin )
{
binary = bin;
}
public static glHalfNV FromInt16(short x)
{
return new glHalfNV(x);
}
public static explicit operator glHalfNV( short x )
{
return new glHalfNV( x );
}
public static short ToInt16(glHalfNV half)
{
return half.binary;
}
public static explicit operator short( glHalfNV x )
{
return x.binary;
}
}
}
@@ -0,0 +1,107 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="glRenderSourceGenrator.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 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 );
}
/// <summary>
/// Create a set of <see cref="ElementBuffer" />.
/// </summary>
/// <param _name="count"> Amount of EBO to be created. </param>
/// <returns></returns>
[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 );
}
/// <summary>
/// Create a sets of <see cref="TextureGL" />
/// </summary>
/// <param _name="count"> Amount of textures to be created. </param>
/// <returns></returns>
[MethodImpl( MethodImplOptions.AggressiveInlining )]
protected TextureGL CreateTexture( int count )
{
return new TextureGL( count, this );
}
/// <summary>
/// Create a set of <see cref="VertexArray" />.
/// </summary>
/// <param _name="count"> Amount of VAO to be created. </param>
/// <returns></returns>
[MethodImpl( MethodImplOptions.AggressiveInlining )]
protected VertexArray CreateVertexArray( int count )
{
return new VertexArray( count, this );
}
/// <summary>
/// Create a set of <see cref="VertexBuffer" />.
/// </summary>
/// <param _name="count"> Amount of Object to be created. </param>
/// <returns></returns>
[MethodImpl( MethodImplOptions.AggressiveInlining )]
protected VertexBuffer CreateVertexBuffer( int count )
{
return new VertexBuffer( count, this );
}
}
}
@@ -0,0 +1,148 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="glType.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 System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.InteropServices;
using System.Text;
namespace StgSharp.Internal.OpenGL
{
public delegate IntPtr GLfuncLoader( string name );
internal delegate void GLVULKANPROCNV();
public unsafe struct GLhandleARB
{
private dynamic value;
public unsafe GLhandleARB( dynamic value )
{
if( !RuntimeInformation.IsOSPlatform( OSPlatform.OSX ) ) {
if( value.GetType().Name != "Uint32" ) {
goto errorlog;
}
this.value = value;
} else {
if( value.GetType().Name != "IntPtr" ) {
goto errorlog;
}
this.value = value;
}
errorlog:
{
InternalIO.InternalWriteLog(
$"{value.GetType().Name} does not match definination of GLhandlARB on OS {Environment.OSVersion.Platform} ",
LogType.Error );
}
}
public static implicit operator uint( GLhandleARB value )
{
return ( uint )value;
}
}
#region GLFW_dele
internal unsafe delegate void GLFWwindowsizefun(
glfwWindow* window,
int width,
int height );
internal unsafe delegate void GLFWwindowrefreshfun( glfwWindow* window );
internal unsafe delegate void GLFWwindowposfun(
glfwWindow* window,
int xpos,
int ypos );
internal unsafe delegate void GLFWwindowmaximizefun(
glfwWindow* window,
int maximized );
internal unsafe delegate void GLFWwindowiconifyfun(
glfwWindow* window,
int iconified );
internal unsafe delegate void GLFWwindowfocusfun(
glfwWindow* window,
int focused );
internal unsafe delegate void GLFWwindowcontentscalefun(
glfwWindow* window,
float xscale,
float yscale );
internal unsafe delegate void GLFWwindowclosefun( glfwWindow* window );
internal unsafe delegate void GLFWvkproc();
internal unsafe delegate void GLFWscrollfun(
glfwWindow* window,
double xoffset,
double yoffset );
internal unsafe delegate void GLFWmousebuttonfun(
glfwWindow* window,
int button,
int action,
int mods );
internal unsafe delegate void GLFWmonitorfun(
glfwMonitor* monitor,
int monitorevent );
internal unsafe delegate void GLFWkeyfun(
glfwWindow* window,
int key,
int scancode,
int action,
int mods );
internal unsafe delegate void GLFWjoystickfun( int jid, int keyevent );
public unsafe delegate void GLFWglproc();
internal unsafe delegate void GLFWerrorfun(
int error_code,
sbyte* description );
internal unsafe delegate void GLFWdropfun(
glfwWindow* window,
int path_count,
sbyte*[] paths );
internal unsafe delegate void GLFWcursorposfun(
glfwWindow* window,
double xpos,
double ypos );
internal unsafe delegate void GLFWcursorenterfun(
glfwWindow* window,
int entered );
internal unsafe delegate void GLFWcharmodsfun(
glfwWindow* window,
uint codepoint,
int mods );
internal unsafe delegate void GLFWcharfun(
glfwWindow* window,
uint codepoint );
#endregion
}