daily update on 2024.03.18 by itload youmu

This commit is contained in:
YoumuLiu
2024-03-19 02:41:04 +08:00
parent 15bf989285
commit 0c50c6282e
200 changed files with 7663 additions and 3455 deletions
+297 -159
View File
@@ -1,4 +1,34 @@
using System;
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="StructDefine.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.Runtime.InteropServices;
/**/
@@ -16,6 +46,7 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWcontext
{
private int client;
private int source;
private int major, minor, revision;
@@ -51,6 +82,7 @@ namespace StgSharp.Graphics
internal struct egl
{
/*
EGLConfig config;
EGLContext handle;
@@ -60,16 +92,19 @@ namespace StgSharp.Graphics
private void* handle;
private void* surface;
private void* client;
}
internal struct osmesa
{
//OSMesaContext handle;
private void* handle;
private int width;
private int height;
private void* buffer;
}
// This is defined in platform.h
@@ -79,6 +114,7 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWvidmode
{
/*! The width, in screen coordinates, of the video mode.
*/
public int width;
@@ -97,11 +133,13 @@ namespace StgSharp.Graphics
/*! The refresh rate, in Hz, of the video mode.
*/
private int refreshRate;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWgammaramp
{
/*! An array of value describing the response of the red channel.
*/
private ushort* red;
@@ -114,11 +152,13 @@ namespace StgSharp.Graphics
/*! The number of elements in each array.
*/
private uint size;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWimage
{
/*! The width, in pixels, of this image.
*/
private int width;
@@ -128,11 +168,13 @@ namespace StgSharp.Graphics
/*! The pixel data of this image, arranged left-to-right, top-to-bottom.
*/
private byte* pixels;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWgamepadstate
{
/*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS`
* or `GLFW_RELEASE`.
*/
@@ -141,11 +183,13 @@ namespace StgSharp.Graphics
* to 1.0 inclusive.
*/
public fixed float axes[6];
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWallocator
{
//GLFWallocatefun allocate;
private IntPtr allocate;
@@ -156,11 +200,13 @@ namespace StgSharp.Graphics
private IntPtr deallocate;
private void* user;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWmonitor
{
private byte[] name = new byte[128];
private void* userPointer;
@@ -185,53 +231,116 @@ namespace StgSharp.Graphics
public GLFWmonitor()
{ }
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWwindow
{
//struct GLFWwindow* next in GLFW
public IntPtr next = IntPtr.Zero;
public GLFWwindow* next;
public bool resizable = false;
public bool decorated = false;
public bool autoIconify = false;
public bool floating = false;
public bool focusOnShow = false;
public bool mousePassthrough = false;
public bool shouldClose = false;
public void* userPointer = (void*)0;
public bool doublebuffer = false;
public GLFWvidmode videoMode = default;
public IntPtr monitor = IntPtr.Zero; //public GLFWmonitor* monitor;
public GLFWcursor* cursor = (GLFWcursor*)0;
private int resizable;
private int decorated;
private int autoIconify;
private int floating;
private int focusOnShow;
private int mousePassthrough;
internal int shouldClose;
private void* userPointer = (void*)0;
private bool doubleBuffer;
private GLFWvidmode videoMode = default;
private IntPtr monitor = IntPtr.Zero; //public GLFWmonitor* monitor;
private GLFWcursor* cursor = (GLFWcursor*)0;
public int minwidth = 0, minheight = 0;
public int maxwidth = 0, maxheight = 0;
public int numer = 0, denom = 0;
public bool stickyKeys = false;
public bool stickyMouseButtons = false;
public bool lockKeyMods = false;
public int cursorMode = 0;
public fixed byte mouseButtons[8];
public fixed byte keys[349];
private int minWidth = 0, minHeight = 0;
private int maxWidth = 0, maxHeight = 0;
private int numer = 0, denom = 0;
private int stickyKeys;
private int stickyMouseButtons;
private int lockKeyMods;
private int cursorMode = 0;
private fixed byte mouseButtons[8];
private fixed byte keys[349];
// Virtual cursor position when cursor is disabled
public double virtualCursorPosX = 0, virtualCursorPosY = 0;
public bool rawMouseMotion = false;
private int rawMouseMotion;
public GLFWcontext context = default;
private fixed long callBacks[17];
public GLFWwindow()
{
}
public bool AutoIconify
{
get => autoIconify != 0;
set => autoIconify = value ? 1 : 0;
}
public bool Decorated
{
get => decorated != 0;
set => decorated = value ? 1 : 0;
}
public bool Floating
{
get => floating != 0;
set => floating = value ? 1 : 0;
}
public bool FocusOnShow
{
get => focusOnShow != 0;
set => focusOnShow = value ? 1 : 0;
}
public bool LockKeyMods
{
get => lockKeyMods != 0;
set => lockKeyMods = value ? 1 : 0;
}
public bool MousePassThrough
{
get => mousePassthrough != 0;
set => mousePassthrough = value ? 1 : 0;
}
public bool RawMouseMotion { get => rawMouseMotion != 0; set => rawMouseMotion = value ? 1 : 0; }
public bool Resizable
{
get => resizable != 0;
set => resizable = value ? 1 : 0;
}
public bool ShouldClose
{
get => shouldClose != 0;
set => shouldClose = value ? 1 : 0;
}
public bool StickyKey
{
get => stickyKeys != 0;
set => stickyKeys = value ? 1 : 0;
}
public bool StickyMouseButtons
{
get => stickyMouseButtons != 0;
set => stickyMouseButtons = value ? 1 : 0;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct GLFWwindowCallback
{
}
[StructLayout(LayoutKind.Sequential)]
public struct GLFWcursor
{
//GLFWcursor* next;
private IntPtr next;
@@ -259,6 +368,7 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWinitconfig
{
private GLFWbool hatButtons;
private int angleType;
private int platformID;
@@ -266,26 +376,12 @@ namespace StgSharp.Graphics
//PFN_vkGetInstanceProcAddr vulkanLoader;
private IntPtr vulkanLoader;
private struct ns
{
private GLFWbool menubar;
private GLFWbool chdir;
}
private struct x11
{
private GLFWbool xcbVulkanSurface;
}
private struct wl
{
private int libdecorMode;
}
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWwndconfig
{
private int xpos;
private int ypos;
private int width;
@@ -303,56 +399,66 @@ namespace StgSharp.Graphics
private GLFWbool mousePassthrough;
private GLFWbool scaleToMonitor;
internal struct Ns
{
private GLFWbool retina = false;
public fixed byte frameName[256];
public Ns()
{
}
}
internal Ns ns = new Ns();
internal struct X11
{
public fixed byte className[256];
public fixed byte instanceName[256];
public X11()
{
}
}
internal X11 x11 = new X11();
internal struct Win32
{
private GLFWbool keymenu;
}
internal Win32 win32 = new Win32();
internal struct Wl
{
public fixed byte appId[256];
public Wl()
{
}
}
internal Wl wl = new Wl();
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 int client;
private int source;
private int major;
@@ -367,21 +473,25 @@ namespace StgSharp.Graphics
//GLFWwindow* share;
private IntPtr share;
internal struct Nsgl
{
private GLFWbool offline;
}
internal Nsgl nsgl = new Nsgl();
public GLFWctxconfig()
{
}
internal struct Nsgl
{
private GLFWbool offline;
}
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWfbconfig
{
private int redBits;
private int greenBits;
private int blueBits;
@@ -399,25 +509,18 @@ namespace StgSharp.Graphics
private GLFWbool doublebuffer;
private GLFWbool transparent;
private uintptr_t handle;
}
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct GLFWlibrary
{
private GLFWbool initialized;
private GLFWallocator allocator;
private GLFWplatform platform;
internal unsafe struct Hints
{
private GLFWinitconfig init;
private GLFWfbconfig framebuffer;
private GLFWwndconfig window;
private GLFWctxconfig context;
private int refreshRate;
}
internal Hints hints = new Hints();
//GLFWerror* errorListHead;
@@ -448,8 +551,30 @@ namespace StgSharp.Graphics
private GLFWls contextSlot;
private GLFWmutex errorLock;
internal Egl egl = new Egl();
internal Osmesa osmesa = new Osmesa();
internal Callbacks callbacks = new Callbacks();
public GLFWlibrary()
{
}
internal unsafe struct Hints
{
private GLFWinitconfig init;
private GLFWfbconfig framebuffer;
private GLFWwndconfig window;
private GLFWctxconfig context;
private int refreshRate;
}
internal unsafe struct timer
{
private ulong offset;
// This is defined in platform.h
@@ -459,6 +584,7 @@ namespace StgSharp.Graphics
internal unsafe struct Egl
{
internal int platform;
internal void* display;
internal int major, minor;
@@ -466,7 +592,7 @@ namespace StgSharp.Graphics
internal bool KHR_create_context;
internal bool KHR_create_context_no_error;
internal bool KHR_colorspace;
internal bool KHR_colorSpace;
internal bool KHR_get_all_proc_addresses;
internal bool KHR_context_flush_control;
internal bool EXT_client_extensions;
@@ -501,12 +627,12 @@ namespace StgSharp.Graphics
internal IntPtr GetPlatformDisplayEXT;
internal IntPtr CreatePlatformWindowSurfaceEXT;
}
internal Egl egl = new Egl();
}
internal unsafe struct Osmesa
{
private void* handle;
private IntPtr CreateContextExt;
@@ -516,12 +642,12 @@ namespace StgSharp.Graphics
private IntPtr GetColorBuffer;
private IntPtr GetDepthBuffer;
private IntPtr GetProcAddress;
}
internal Osmesa osmesa = new Osmesa();
}
internal unsafe struct vk
{
private GLFWbool available;
private void* handle;
private fixed ulong extensions[2];
@@ -537,33 +663,34 @@ namespace StgSharp.Graphics
public vk()
{
}
}
internal unsafe struct Callbacks
{
private IntPtr monitor;
private IntPtr joystick;
}
internal Callbacks callbacks = new Callbacks();
public GLFWlibrary()
{
}
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWmapelement
{
private byte type;
private byte index;
private sbyte axisScale;
private sbyte axisOffset;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWmapping
{
private fixed byte name[128];
private fixed byte guid[33];
@@ -575,11 +702,13 @@ namespace StgSharp.Graphics
public GLFWmapping()
{ }
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWjoystick
{
private GLFWbool allocated;
private GLFWbool connected;
private float* axes;
@@ -601,6 +730,7 @@ namespace StgSharp.Graphics
public GLFWjoystick()
{ }
}
[StructLayout(LayoutKind.Sequential)]
@@ -614,6 +744,7 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWplatform
{
private int platformID;
// init
@@ -623,73 +754,75 @@ namespace StgSharp.Graphics
//void (* terminate) (void);
private IntPtr terminate;
// input
#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*);
GLFWvidmode* (* getVideoModes) (GLFWmonitor*, int*);
void (* getVideoMode) (GLFWmonitor*, GLFWvidmode*);
GLFWbool(*getGammaRamp)(GLFWmonitor*, GLFWgammaramp*);
void (* setGammaRamp) (GLFWmonitor*,const GLFWgammaramp*);
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*);
GLFWvidmode* (* getVideoModes) (GLFWmonitor*, int*);
void (* getVideoMode) (GLFWmonitor*, GLFWvidmode*);
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 (* 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);
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 setCursorMode;
internal IntPtr setRawMouseMotion;
@@ -776,6 +909,7 @@ namespace StgSharp.Graphics
internal IntPtr VkPhysicalDevice;
internal IntPtr GLFWwindow;
}
[StructLayout(LayoutKind.Sequential)]
@@ -790,12 +924,14 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct VkExtensionProperties
{
private fixed byte extensionName[256];
private uint specVersion;
public VkExtensionProperties()
{
}
}
/*
@@ -816,11 +952,13 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Explicit, Size = 16)]
public struct uintptr_t
{
[FieldOffset(0)]
private long part1;
[FieldOffset(8)]
private long part2;
}
#endregion GLFW3 struct
@@ -1,4 +1,34 @@
/*
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="glApiDefine.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.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
/*
* This file is created to link functions in OpenGL to version in C#
* The name of delegates and organization to init all these delegates
* are refferd from GLAD1 in agreement of MIT license generated from
@@ -7,12 +37,19 @@
using StgSharp.Math;
using System;
using System.Numerics;
using System.Runtime.InteropServices;
namespace StgSharp.Graphics
{
#region StgSharpDele
public unsafe delegate void FrameBufferSizeHandler(IntPtr window, uint width, uint height);
#endregion
/// <summary>
/// Function handler to load an opengl function by serching its name.
/// </summary>
@@ -143,12 +180,6 @@ namespace StgSharp.Graphics
//[UnmanagedFunctionPointer(callingConvention: CallingConvention.Cdecl, CharSet = CharSet.Ansi)] internal unsafe delegate VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
#endregion
#region StgSharpDele
public unsafe delegate void FrameBufferSizeHandler(IntPtr window, uint width, uint height);
#endregion
#region glDEBUG
+35 -5
View File
@@ -1,4 +1,34 @@
using System;
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="glConst.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;
namespace StgSharp.Graphics
{
@@ -22,10 +52,10 @@ namespace StgSharp.Graphics
internal const int GLFW_HAT_RIGHT = 2;
internal const int GLFW_HAT_DOWN = 4;
internal const int GLFW_HAT_LEFT = 8;
internal const int GLFW_HAT_RIGHT_UP = (GLFW_HAT_RIGHT | GLFW_HAT_UP);
internal const int GLFW_HAT_RIGHT_DOWN = (GLFW_HAT_RIGHT | GLFW_HAT_DOWN);
internal const int GLFW_HAT_LEFT_UP = (GLFW_HAT_LEFT | GLFW_HAT_UP);
internal const int GLFW_HAT_LEFT_DOWN = (GLFW_HAT_LEFT | GLFW_HAT_DOWN);
internal const int GLFW_HAT_RIGHT_UP = GLFW_HAT_RIGHT | GLFW_HAT_UP;
internal const int GLFW_HAT_RIGHT_DOWN = GLFW_HAT_RIGHT | GLFW_HAT_DOWN;
internal const int GLFW_HAT_LEFT_UP = GLFW_HAT_LEFT | GLFW_HAT_UP;
internal const int GLFW_HAT_LEFT_DOWN = GLFW_HAT_LEFT | GLFW_HAT_DOWN;
internal const int GLFW_KEY_UNKNOWN = -1;
internal const int GLFW_KEY_SPACE = 32;
internal const int GLFW_KEY_APOSTROPHE = 39;
+31 -1
View File
@@ -1,4 +1,34 @@
namespace StgSharp.Graphics
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// 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.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
namespace StgSharp.Graphics
{
internal enum VkStructureType : uint
{
+61 -29
View File
@@ -1,4 +1,35 @@
using StgSharp.Geometries;
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// 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 StgSharp.Geometries;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -9,35 +40,10 @@ using System.Text;
namespace StgSharp.Graphics
{
public delegate IntPtr GLfuncLoader(string name);
internal delegate void GLVULKANPROCNV();
#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 FramebuffersizeHandler(IntPtr window, int width, int height); //window is the pointer to a GLFWwindow instance
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
public unsafe struct GLhandleARB
{
@@ -80,6 +86,32 @@ namespace StgSharp.Graphics
}
public delegate IntPtr GLfuncLoader(string name);
#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 FramebuffersizeHandler(IntPtr window, int width, int height); //window is the pointer to a GLFWwindow instance
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
}