daily update on 20230911 by nitload youmu, uncertain bug of gl api loading

This commit is contained in:
Nitload
2023-09-11 23:34:34 +08:00
parent c6f4b3dd53
commit 5d701bce0c
172 changed files with 15161 additions and 9614 deletions
+4 -4
View File
@@ -1,10 +1,10 @@
using StgSharp.Control;
using StgSharp.Controlling;
using StgSharp.Math;
using System;
namespace StgSharp
{
public static partial class Instruction
public static partial class Control
{
/// <summary>
/// Add a pool to timeline controller, and return the instance of the pool.
@@ -19,8 +19,8 @@ namespace StgSharp
public static void AddPool(Pool pool)
{
TimeLine.allPool.Add(pool);
TimeLine._currentPool = pool;
StgSharp.Controlling.TimeLine.allPool.Add(pool);
StgSharp.Controlling.TimeLine._currentPool = pool;
}
public static void LoadTimeline()
+1 -1
View File
@@ -1,7 +1,7 @@
namespace StgSharp
{
public static partial class Instruction
public static partial class Control
{
//method used for chaging the value of paameters will be listed here
+15 -3
View File
@@ -1,12 +1,13 @@
using StgSharp.Control;
using StgSharp.Controlling;
using StgSharp.Graphics;
using StgSharp.Logic;
using StgSharp.Math;
namespace StgSharp
{
public static unsafe partial class Instruction
public static unsafe partial class Control
{
public static LinkedList<T> GetAllActivatedPool<T>() where T:Pool
public static LinkedList<T> GetAllActivatedPool<T>() where T : Pool
{
/**/
LinkedList<T> pool = new LinkedList<T>();
@@ -47,5 +48,16 @@ namespace StgSharp
return ptr;
}
/// <summary>
/// Get the status of a certain key on the keyboard.
/// </summary>
/// <param name="form"></param>
/// <param name="key"></param>
/// <returns></returns>
public static KeyStatus GetKeyStatus(Form form, Key key)
{
return internalIO.glfwGetKey(form.windowID, (int)key);
}
}
}
+400
View File
@@ -0,0 +1,400 @@
using StgSharp.Controlling;
using StgSharp.Graphics;
using System;
using System.Runtime.InteropServices;
namespace StgSharp
{
internal static partial class internalIO
{
[DllImport(SSGC_libname, EntryPoint = "initGL",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern unsafe void InternalInitGL(int majorVersion, int minorVersion);
[DllImport(SSGC_libname, EntryPoint = "initGLAD",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern unsafe int InternalInitGLAD();
[DllImport(SSGC_libname, EntryPoint = "glfwGetWindowUserPointer",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void* glfwGetWindowUserPointer(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwGetMonitorUserPointer", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void* glfwGetMonitorUserPointer(GLFWmonitor* monitor);
[DllImport(SSGC_libname, EntryPoint = "glfwGetJoystickUserPointer", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void* glfwGetJoystickUserPointer(int jid);
[DllImport(SSGC_libname, EntryPoint = "glfwWindowHintString", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwWindowHintString(int hint, byte* value);
[DllImport(SSGC_libname, EntryPoint = "glfwWindowHint", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwWindowHint(int hint, int value);
[DllImport(SSGC_libname, EntryPoint = "glfwWaitEventsTimeout", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwWaitEventsTimeout(double timeout);
[DllImport(SSGC_libname, EntryPoint = "glfwWaitEvents", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwWaitEvents();
[DllImport(SSGC_libname, EntryPoint = "glfwTerminate", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwTerminate();
[DllImport(SSGC_libname, EntryPoint = "glfwSwapInterval", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSwapInterval(int interval);
//window is the pointer to a glfwwindow instance
[DllImport(SSGC_libname, EntryPoint = "glfwSwapBuffers", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSwapBuffers(IntPtr window);
[DllImport(SSGC_libname, EntryPoint = "glfwShowWindow", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwShowWindow(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowUserPointer", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowTitle", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowTitle(GLFWwindow* window, byte* title);
//window is the pointer of glfwwindow instance
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowSizeLimits", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight);
//window is the pointer of glfwwindow instance
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowSize", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowSize(IntPtr window, int width, int height);
//window is the pointer of glfwwindow instance
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowShouldClose", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowShouldClose(IntPtr window, int value);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowPos", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowOpacity", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowOpacity(GLFWwindow* window, float opacity);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowMonitor", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowIcon", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowIcon(GLFWwindow* window, int count, GLFWimage* images);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowAttrib", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowAttrib(GLFWwindow* window, int attrib, int value);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowAspectRatio", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom);
[DllImport(SSGC_libname, EntryPoint = "glfwSetTime", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetTime(double time);
[DllImport(SSGC_libname, EntryPoint = "glfwSetMonitorUserPointer", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetMonitorUserPointer(GLFWmonitor* monitor, void* pointer);
[DllImport(SSGC_libname, EntryPoint = "glfwSetJoystickUserPointer", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetJoystickUserPointer(int jid, void* pointer);
[DllImport(SSGC_libname, EntryPoint = "glfwSetInputMode", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetInputMode(GLFWwindow* window, int mode, int value);
[DllImport(SSGC_libname, EntryPoint = "glfwSetGammaRamp", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetGammaRamp(GLFWmonitor* monitor, GLFWgammaramp* ramp);
[DllImport(SSGC_libname, EntryPoint = "glfwSetGamma", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetGamma(GLFWmonitor* monitor, float gamma);
[DllImport(SSGC_libname, EntryPoint = "glfwSetCursorPos", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
[DllImport(SSGC_libname, EntryPoint = "glfwSetCursor", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
[DllImport(SSGC_libname, EntryPoint = "glfwSetClipboardString", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwSetClipboardString(GLFWwindow* window, byte* str);
[DllImport(SSGC_libname, EntryPoint = "glfwRestoreWindow", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwRestoreWindow(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwRequestWindowAttention", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwRequestWindowAttention(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwPostEmptyEvent", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwPostEmptyEvent();
[DllImport(SSGC_libname, EntryPoint = "glfwPollEvents", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwPollEvents();
[DllImport(SSGC_libname, EntryPoint = "glfwMaximizeWindow", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwMaximizeWindow(GLFWwindow* window);
//window is the pointer to a glfwwindow instance
[DllImport(SSGC_libname, EntryPoint = "glfwMakeContextCurrent", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwMakeContextCurrent(IntPtr window);
[DllImport(SSGC_libname, EntryPoint = "glfwInitHint", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwInitHint(int hint, int value);
[DllImport(SSGC_libname, EntryPoint = "glfwIconifyWindow", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwIconifyWindow(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwHideWindow", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwHideWindow(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwGetWindowSize", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
[DllImport(SSGC_libname, EntryPoint = "glfwGetWindowPos", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
[DllImport(SSGC_libname, EntryPoint = "glfwGetWindowFrameSize", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
[DllImport(SSGC_libname, EntryPoint = "glfwGetWindowContentScale", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetWindowContentScale(GLFWwindow* window, float* xscale, float* yscale);
[DllImport(SSGC_libname, EntryPoint = "glfwGetVersion", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetVersion(int* major, int* minor, int* rev);
[DllImport(SSGC_libname, EntryPoint = "glfwGetMonitorWorkarea", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetMonitorWorkarea(GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
[DllImport(SSGC_libname, EntryPoint = "glfwGetMonitorPos", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
[DllImport(SSGC_libname, EntryPoint = "glfwGetMonitorPhysicalSize", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM);
[DllImport(SSGC_libname, EntryPoint = "glfwGetMonitorContentScale", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetMonitorContentScale(GLFWmonitor* monitor, float* xscale, float* yscale);
[DllImport(SSGC_libname, EntryPoint = "glfwGetFramebufferSize", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);
[DllImport(SSGC_libname, EntryPoint = "glfwGetCursorPos", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
[DllImport(SSGC_libname, EntryPoint = "glfwFocusWindow", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwFocusWindow(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwDestroyWindow", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwDestroyWindow(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwDestroyCursor", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwDestroyCursor(GLFWcursor* cursor);
[DllImport(SSGC_libname, EntryPoint = "glfwDefaultWindowHints", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void glfwDefaultWindowHints();
[DllImport(SSGC_libname, EntryPoint = "glfwGetTimerValue", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe ulong glfwGetTimerValue();
[DllImport(SSGC_libname, EntryPoint = "glfwGetTimerFrequency", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe ulong glfwGetTimerFrequency();
//window is the pointer to a glfwwindow instance
[DllImport(SSGC_libname, EntryPoint = "glfwWindowShouldClose", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwWindowShouldClose(IntPtr window);
[DllImport(SSGC_libname, EntryPoint = "glfwVulkanSupported", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwVulkanSupported();
[DllImport(SSGC_libname, EntryPoint = "glfwUpdateGamepadMappings", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwUpdateGamepadMappings(byte* str);
[DllImport(SSGC_libname, EntryPoint = "glfwRawMouseMotionSupported", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwRawMouseMotionSupported();
[DllImport(SSGC_libname, EntryPoint = "glfwJoystickPresent", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwJoystickPresent(int jid);
[DllImport(SSGC_libname, EntryPoint = "glfwJoystickIsGamepad", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwJoystickIsGamepad(int jid);
[DllImport(SSGC_libname, EntryPoint = "glfwGetWindowAttrib", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
[DllImport(SSGC_libname, EntryPoint = "glfwGetMouseButton", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwGetMouseButton(GLFWwindow* window, int button);
[DllImport(SSGC_libname, EntryPoint = "glfwGetKeyScancode", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwGetKeyScancode(int key);
//window is the pointer to GLFWwindow instance
[DllImport(SSGC_libname, EntryPoint = "glfwGetKey", CallingConvention = CallingConvention.Cdecl)]
internal static extern KeyStatus glfwGetKey(IntPtr window, int key);
[DllImport(SSGC_libname, EntryPoint = "glfwGetInputMode", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwGetInputMode(GLFWwindow* window, int mode);
[DllImport(SSGC_libname, EntryPoint = "glfwGetGamepadState", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
[DllImport(SSGC_libname, EntryPoint = "glfwGetError", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwGetError(byte** description);
[DllImport(SSGC_libname, EntryPoint = "glfwExtensionSupported", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe int glfwExtensionSupported(byte* extension);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowSizeCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowRefreshCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowPosCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowMaximizeCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowIconifyCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowFocusCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowContentScaleCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetWindowCloseCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwGetCurrentContext", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWwindow* glfwGetCurrentContext();
//monitor and share are pointers to instance of glfwmonitor and glfwwindow
//the method returns a pointer to glfw window instance
[DllImport(SSGC_libname, EntryPoint = "glfwCreateWindow", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe IntPtr glfwCreateWindow(
int width, int height, byte[] title, IntPtr monitor, IntPtr share);
[DllImport(SSGC_libname, EntryPoint = "glfwSetScrollCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetMouseButtonCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetMonitorCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwGetMonitors",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWmonitor** glfwGetMonitors(int* count);
[DllImport(SSGC_libname, EntryPoint = "glfwGetWindowMonitor",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwGetPrimaryMonitor",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWmonitor* glfwGetPrimaryMonitor();
[DllImport(SSGC_libname, EntryPoint = "glfwSetKeyCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetJoystickCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwGetProcAddress",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern unsafe IntPtr glfwGetProcAddress(string procName);
//window is the pointer to a glfwwindow instance
[DllImport(SSGC_libname, EntryPoint = "glfwSetFramebufferSizeCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWframebuffersizefun glfwSetFramebufferSizeCallback(IntPtr window, GLFWframebuffersizefun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetErrorCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetDropCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetCursorPosCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetCursorEnterCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwCreateStandardCursor",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWcursor* glfwCreateStandardCursor(int shape);
[DllImport(SSGC_libname, EntryPoint = "glfwCreateCursor",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot);
[DllImport(SSGC_libname, EntryPoint = "glfwSetCharModsCallback", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetCharCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun callback);
[DllImport(SSGC_libname, EntryPoint = "glfwGetWindowOpacity",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe float glfwGetWindowOpacity(GLFWwindow* window);
[DllImport(SSGC_libname, EntryPoint = "glfwGetTime",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe double glfwGetTime();
[DllImport(SSGC_libname, EntryPoint = "unsigned", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetJoystickHats(int jid, int* count);
[DllImport(SSGC_libname, EntryPoint = "unsigned", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetJoystickButtons(int jid, int* count);
[DllImport(SSGC_libname, EntryPoint = "GLFWvidmode*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);
[DllImport(SSGC_libname, EntryPoint = "GLFWvidmode*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
[DllImport(SSGC_libname, EntryPoint = "GLFWgammaramp*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);
[DllImport(SSGC_libname, EntryPoint = "float*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe float* glfwGetJoystickAxes(int jid, int* count);
[DllImport(SSGC_libname, EntryPoint = "byte**", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte** glfwGetRequiredInstanceExtensions(uint* count);
[DllImport(SSGC_libname, EntryPoint = "byte*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetVersionString();
[DllImport(SSGC_libname, EntryPoint = "byte*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetMonitorName(GLFWmonitor* monitor);
[DllImport(SSGC_libname, EntryPoint = "byte*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetKeyName(int key, int scancode);
[DllImport(SSGC_libname, EntryPoint = "byte*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetJoystickName(int jid);
[DllImport(SSGC_libname, EntryPoint = "byte*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetJoystickGUID(int jid);
[DllImport(SSGC_libname, EntryPoint = "byte*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetGamepadName(int jid);
[DllImport(SSGC_libname, EntryPoint = "byte*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetClipboardString(GLFWwindow* window);
//
}
}
@@ -1,25 +0,0 @@
using StgSharp.Control;
using StgSharp.Graphics;
using System;
using System.Runtime.InteropServices;
namespace StgSharp
{
internal static partial class internalIO
{
[DllImport("StgSharpGraphic",EntryPoint = "loadGLApi",
CallingConvention = CallingConvention.Cdecl,CharSet =CharSet.Ansi)]
internal static extern GraphicIOPack InternalInitGraphicApi();
[DllImport("StgSharpGraphic",EntryPoint = "initGL",
CallingConvention = CallingConvention.Cdecl,CharSet = CharSet.Ansi)]
internal static extern unsafe void InternalInitGL();
[DllImport("StgSharpGraphic",EntryPoint = "initGLAD",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern unsafe int InternalInitGLAD();
//
}
}
@@ -1,48 +0,0 @@
using System;
using System.Runtime.InteropServices;
namespace StgSharp.Control
{
//these are gl functions used to create a window
internal delegate void InternalInitGLDelegate();
internal delegate IntPtr InternalGLcreateWindowDelegate
(int width, int height, byte[] tittle, IntPtr monitor, IntPtr share);
internal delegate void InternalGLmakeContextCurrent(IntPtr window);
internal delegate void InternalGLswapInterval(int interval);
internal delegate void InternalGLclearColorDelegate
(float red, float green, float blue, float alpha);
internal delegate GLFWproc internalglGetProcAddress(char[] name);
internal delegate int internalGLADloadGLloader(InternalGLADloadproc load);
internal delegate int InternalGLwindowShouldClose(IntPtr window);
internal delegate void InternalGLswapBuffers(IntPtr window);
//these are gl functions used to set a callback
internal delegate FrameBufferSizeCallback InternalsetBufferSizeCallback(IntPtr window, FrameBufferSizeCallback callback);
///
internal delegate void GLFWproc();
internal unsafe delegate void* InternalGLADloadproc(byte[] name);
[StructLayout(LayoutKind.Sequential)]
internal struct GraphicIOPack
{
//these are gl functions used to create a window
internal InternalGLcreateWindowDelegate internalGLcreateWindow;
internal InternalGLmakeContextCurrent internalGLmakeContextCurrent;
internal InternalGLswapInterval internalGLswapInterval;
internal InternalGLclearColorDelegate internalGLclearColor;
internal InternalGLwindowShouldClose internalGLwindowShouldClose;
internal InternalGLswapBuffers internalGLswapBuffers;
//these are gl functions used to set a callback
internal InternalsetBufferSizeCallback internalGLsetBufferSize;
}
}
@@ -18,6 +18,8 @@ namespace StgSharp
internal static unsafe partial class internalIO
{
internal const string SSGC_libname =
"StgSharpGraphic";
}
}
+175
View File
@@ -0,0 +1,175 @@
namespace StgSharp
{
public static partial class Control
{
public enum Key : int
{
UNKNOWN = -1,
SPACE = 32,
APOSTROPHE = 39/*'*/,
COMMA = 44/*,*/,
MINUS = 45/*-*/,
PERIOD = 46/*.*/,
SLASH = 47/*/*/,
ZERO = 48,
ONE = 49,
TWO = 50,
THREE = 51,
FOUR = 52,
FIVE = 53,
SIX = 54,
SEVEN = 55,
EIGHT = 56,
NINE = 57,
SEMICOLON = 59/*,*/,
EQUAL = 61/*=*/,
A = 65,
B = 66,
C = 67,
D = 68,
E = 69,
F = 70,
G = 71,
H = 72,
I = 73,
J = 74,
K = 75,
L = 76,
M = 77,
N = 78,
O = 79,
P = 80,
Q = 81,
R = 82,
S = 83,
T = 84,
U = 85,
V = 86,
W = 87,
X = 88,
Y = 89,
Z = 90,
LEFT_BRACKET = 91/*[*/,
BACKSLASH = 92/*\*/,
RIGHT_BRACKET = 93/*]*/,
GRAVE_ACCENT = 96/*`*/,
WORLD_1 = 161/*non-US#1*/,
WORLD_2 = 162/*non-US#2*/,
ESCAPE = 256,
ENTER = 257,
TAB = 258,
BACKSPACE = 259,
INSERT = 260,
DELETE = 261,
RIGHT = 262,
LEFT = 263,
DOWN = 264,
UP = 265,
PAGE_UP = 266,
PAGE_DOWN = 267,
HOME = 268,
END = 269,
CAPS_LOCK = 280,
SCROLL_LOCK = 281,
NUM_LOCK = 282,
PRINT_SCREEN = 283,
PAUSE = 284,
F1 = 290,
F2 = 291,
F3 = 292,
F4 = 293,
F5 = 294,
F6 = 295,
F7 = 296,
F8 = 297,
F9 = 298,
F10 = 299,
F11 = 300,
F12 = 301,
F13 = 302,
F14 = 303,
F15 = 304,
F16 = 305,
F17 = 306,
F18 = 307,
F19 = 308,
F20 = 309,
F21 = 310,
F22 = 311,
F23 = 312,
F24 = 313,
F25 = 314,
KP_0 = 320,
KP_1 = 321,
KP_2 = 322,
KP_3 = 323,
KP_4 = 324,
KP_5 = 325,
KP_6 = 326,
KP_7 = 327,
KP_8 = 328,
KP_9 = 329,
KP_DECIMAL = 330,
KP_DIVIDE = 331,
KP_MULTIPLY = 332,
KP_SUBTRACT = 333,
KP_ADD = 334,
KP_ENTER = 335,
KP_EQUAL = 336,
LEFT_SHIFT = 340,
LEFT_CONTROL = 341,
LEFT_ALT = 342,
LEFT_SUPER = 343,
RIGHT_SHIFT = 344,
RIGHT_CONTROL = 345,
RIGHT_ALT = 346,
RIGHT_SUPER = 347,
MENU = 348
}
public enum Joystick:int
{
JOYSTICK_1 = 0,
JOYSTICK_2 = 1,
JOYSTICK_3 = 2,
JOYSTICK_4 = 3,
JOYSTICK_5 = 4,
JOYSTICK_6 = 5,
JOYSTICK_7 = 6,
JOYSTICK_8 = 7,
JOYSTICK_9 = 8,
JOYSTICK_10 = 9,
JOYSTICK_11 = 10,
JOYSTICK_12 = 11,
JOYSTICK_13 = 12,
JOYSTICK_14 = 13,
JOYSTICK_15 = 14,
JOYSTICK_16 = 15,
JOYSTICK_LAST = JOYSTICK_16
}
public enum Mouse : int
{
BUTTON_1 = 0,
BUTTON_2 = 1,
BUTTON_3 = 2,
BUTTON_4 = 3,
BUTTON_5 = 4,
BUTTON_6 = 5,
BUTTON_7 = 6,
BUTTON_8 = 7,
BUTTON_LAST = BUTTON_8,
BUTTON_LEFT = BUTTON_1,
BUTTON_RIGHT = BUTTON_2,
BUTTON_MIDDLE = BUTTON_3
}
}
public enum KeyStatus : int
{
RELEASE = 0,
PRESS = 1
}
}
+2 -2
View File
@@ -3,9 +3,9 @@ using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Control
namespace StgSharp.Controlling
{
public static partial class Instruction
public static partial class Control
{
public static unsafe void RecycleMappedVec(Vec4d vec)
{
+1 -1
View File
@@ -1,6 +1,6 @@
using StgSharp.Geometries;
namespace StgSharp.Control
namespace StgSharp.Controlling
{
public static class Remove
{
+1 -3
View File
@@ -3,7 +3,7 @@ using StgSharp.Graphics;
using System;
using System.Diagnostics.CodeAnalysis;
namespace StgSharp.Control
namespace StgSharp.Controlling
{
public static partial class TimeLine
{
@@ -23,10 +23,8 @@ namespace StgSharp.Control
static unsafe TimeLine()
{
allForm = new LinkedList<Form>();
allPool = new LinkedList<Pool>();
internalIO.InternalInitGL();
}
public static TimelineBlock CurrentOperation
+1 -1
View File
@@ -1,4 +1,4 @@
namespace StgSharp.Control
namespace StgSharp.Controlling
{
public abstract class TimelineBlock
{