daily update on 20231104 by nitload youmu

This commit is contained in:
Nitload
2023-11-04 07:28:34 +08:00
parent 588a61d514
commit 9933ced8f4
368 changed files with 171636 additions and 109434 deletions
@@ -2566,29 +2566,29 @@ namespace StgSharp.Graphics
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate IntPtr glfwCreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwDefaultWindowHints();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwDestroyCursor(GLFWcursor* cursor);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwDestroyWindow(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwExtensionSupported(char* extension);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwFocusWindow(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate char* glfwGetClipboardString(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwDestroyWindow(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwExtensionSupported(byte* extension);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwFocusWindow(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte* glfwGetClipboardString(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate IntPtr glfwGetCurrentContext();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetCursorPos(IntPtr window, double* xpos, double* ypos);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetError(char** description);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetFramebufferSize(IntPtr* window, int* width, int* height);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate char* glfwGetGamepadName(int jid);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetError(byte** description);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetFramebufferSize(IntPtr window, int* width, int* height);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte* glfwGetGamepadName(int jid);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWgammaramp* glfwGetGammaRamp(IntPtr monitor);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetInputMode(IntPtr* window, int mode);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetInputMode(IntPtr window, int mode);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate float* glfwGetJoystickAxes(int jid, int* count);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte[] glfwGetJoystickButtons(int jid, int* count);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate char* glfwGetJoystickGUID(int jid);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte[] glfwGetJoystickHats(int jid, int* count);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate char* glfwGetJoystickName(int jid);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte* glfwGetJoystickButtons(int jid, int* count);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte* glfwGetJoystickGUID(int jid);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte* glfwGetJoystickHats(int jid, int* count);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte* glfwGetJoystickName(int jid);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void* glfwGetJoystickUserPointer(int jid);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate KeyStatus glfwGetKey(IntPtr window, int key);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate char* glfwGetKeyName(int key, int scancode);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte* glfwGetKeyName(int key, int scancode);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetKeyScancode(int key);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate char* glfwGetMonitorName(IntPtr monitor);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte* glfwGetMonitorName(IntPtr monitor);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetMonitorPos(IntPtr monitor, int* xpos, int* ypos);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate IntPtr* glfwGetMonitors(int* count);
@@ -2597,48 +2597,48 @@ namespace StgSharp.Graphics
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetMouseButton(IntPtr window, int button);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate IntPtr glfwGetPrimaryMonitor();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate IntPtr glfwGetProcAddress(string procname);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate char** glfwGetRequiredInstanceExtensions(uint* count);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte** glfwGetRequiredInstanceExtensions(uint* count);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate double glfwGetTime();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate ulong* glfwGetTimerFrequency();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate ulong* glfwGetTimerValue();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetVersion(int* major, int* minor, int* rev);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate char* glfwGetVersionString();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate byte* glfwGetVersionString();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWvidmode* glfwGetVideoMode(IntPtr monitor);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWvidmode* glfwGetVideoModes(IntPtr monitor, int* count);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetWindowAttrib(IntPtr* window, int attrib);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetWindowContentScale(IntPtr* window, float* xscale, float* yscale);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetWindowFrameSize(IntPtr* window, int* left, int* top, int* right, int* bottom);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate IntPtr glfwGetWindowMonitor(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate float glfwGetWindowOpacity(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetWindowPos(IntPtr* window, int* xpos, int* ypos);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetWindowSize(IntPtr* window, int* width, int* height);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void* glfwGetWindowUserPointer(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwHideWindow(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwIconifyWindow(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetWindowAttrib(IntPtr window, int attrib);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetWindowContentScale(IntPtr window, float* xscale, float* yscale);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate IntPtr glfwGetWindowMonitor(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate float glfwGetWindowOpacity(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetWindowPos(IntPtr window, int* xpos, int* ypos);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwGetWindowSize(IntPtr window, int* width, int* height);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void* glfwGetWindowUserPointer(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwHideWindow(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwIconifyWindow(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwInit();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwInitHint(int hint, int value);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwJoystickIsGamepad(int jid);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwJoystickPresent(int jid);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwMakeContextCurrent(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwMaximizeWindow(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwMaximizeWindow(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwPollEvents();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwPostEmptyEvent();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwRawMouseMotionSupported();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwRequestWindowAttention(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwRestoreWindow(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwRequestWindowAttention(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwRestoreWindow(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWcharfun glfwSetCharCallback(IntPtr window, GLFWcharfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWcharmodsfun glfwSetCharModsCallback(IntPtr window, GLFWcharmodsfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetClipboardString(IntPtr window, byte[] str);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetClipboardString(IntPtr window, byte* str);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetCursor(IntPtr window, GLFWcursor* cursor);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWcursorenterfun glfwSetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetCursorPos(IntPtr window, double xpos, double ypos);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWcursorposfun glfwSetCursorPosCallback(IntPtr window, GLFWcursorposfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWdropfun glfwSetDropCallback(IntPtr window, GLFWdropfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWframebuffersizefun glfwSetFramebufferSizeCallback(IntPtr window, FrameBufferSizeHadler callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate FramebuffersizeHandler glfwSetFramebufferSizeCallback(IntPtr window, FrameBufferSizeHandler callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetGamma(IntPtr monitor, float gamma);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetInputMode(IntPtr* window, int mode, int value);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetInputMode(IntPtr window, int mode, int value);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetJoystickUserPointer(int jid, void* pointer);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWkeyfun glfwSetKeyCallback(IntPtr window, GLFWkeyfun callback);
@@ -2647,37 +2647,37 @@ namespace StgSharp.Graphics
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWmousebuttonfun glfwSetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWscrollfun glfwSetScrollCallback(IntPtr window, GLFWscrollfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetTime(double time);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowAspectRatio(IntPtr* window, int numer, int denom);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowAttrib(IntPtr* window, int attrib, int value);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowclosefun glfwSetWindowCloseCallback(IntPtr* window, GLFWwindowclosefun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(IntPtr* window, GLFWwindowcontentscalefun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowfocusfun glfwSetWindowFocusCallback(IntPtr* window, GLFWwindowfocusfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowIcon(IntPtr* window, int count, GLFWimage* images);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowiconifyfun glfwSetWindowIconifyCallback(IntPtr* window, GLFWwindowiconifyfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(IntPtr* window, GLFWwindowmaximizefun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowMonitor(IntPtr* window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowOpacity(IntPtr* window, float opacity);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowPos(IntPtr* window, int xpos, int ypos);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowposfun glfwSetWindowPosCallback(IntPtr* window, GLFWwindowposfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowrefreshfun glfwSetWindowRefreshCallback(IntPtr* window, GLFWwindowrefreshfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowAspectRatio(IntPtr window, int numer, int denom);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowAttrib(IntPtr window, int attrib, int value);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowclosefun glfwSetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowfocusfun glfwSetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowIcon(IntPtr window, int count, GLFWimage* images);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowiconifyfun glfwSetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowOpacity(IntPtr window, float opacity);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowPos(IntPtr window, int xpos, int ypos);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowposfun glfwSetWindowPosCallback(IntPtr window, GLFWwindowposfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowrefreshfun glfwSetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowShouldClose(IntPtr window, int value);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowSize(IntPtr window, int width, int height);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowsizefun glfwSetWindowSizeCallback(IntPtr* window, GLFWwindowsizefun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWwindowsizefun glfwSetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowTitle(IntPtr* window, char* title);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowUserPointer(IntPtr* window, void* pointer);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwShowWindow(IntPtr* window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowTitle(IntPtr window, byte* title);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSetWindowUserPointer(IntPtr window, void* pointer);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwShowWindow(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSwapBuffers(IntPtr window);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwSwapInterval(int interval);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwTerminate();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwUpdateGamepadMappings(byte[] str);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwUpdateGamepadMappings(byte* str);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwVulkanSupported();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwWaitEvents();
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwWaitEventsTimeout(double timeout);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwWindowHint(int hint, int value);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwWindowHintString(int hint, char* value);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate void glfwWindowHintString(int hint, byte* value);
[UnmanagedFunctionPointer(callingConvention: CallingConvention.StdCall, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwWindowShouldClose(IntPtr window);
//[UnmanagedFunctionPointer(callingConvention: CallingConvention.Cdecl, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, char* procname);
//[UnmanagedFunctionPointer(callingConvention: CallingConvention.Cdecl, CharSet = CharSet.Ansi)] internal unsafe delegate GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, byte* procname);
//[UnmanagedFunctionPointer(callingConvention: CallingConvention.Cdecl, CharSet = CharSet.Ansi)] internal unsafe delegate int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily);
//[UnmanagedFunctionPointer(callingConvention: CallingConvention.Cdecl, CharSet = CharSet.Ansi)] internal unsafe delegate VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
@@ -2686,7 +2686,7 @@ namespace StgSharp.Graphics
#region StgSharpDele
public unsafe delegate void FrameBufferSizeHadler(IntPtr window, int width, int height);
public unsafe delegate void FrameBufferSizeHandler(IntPtr window, int width, int height);
#endregion
+1 -1
View File
@@ -37,7 +37,7 @@ namespace StgSharp.Graphics
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 GLFWframebuffersizefun(IntPtr window, int width, int height); //window is the pointer to a GLFWwindow instance
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);
+7 -7
View File
@@ -101,12 +101,12 @@ namespace StgSharp.Graphics
byte[] tittleBytes = Encoding.UTF8.GetBytes(name);
if (sharedForm == null)
{
windowPtr = InternalIO.glfw_CreateWindow(
windowPtr = InternalIO.glfw.CreateWindow(
width, height, tittleBytes, monitor, IntPtr.Zero);
}
else
{
windowPtr = InternalIO.glfw_CreateWindow(
windowPtr = InternalIO.glfw.CreateWindow(
width, height, tittleBytes, monitor, sharedForm.windowID);
}
@@ -123,7 +123,7 @@ namespace StgSharp.Graphics
bindedContext = (GLcontext*)ptr;
}
InternalIO.glfw_MakeContextCurrent(windowID);
InternalIO.glfw.MakeContextCurrent(windowID);
InternalIO.InternalSetCurrentContext(bindedContext);
GL.context = bindedContext;
}
@@ -136,7 +136,7 @@ namespace StgSharp.Graphics
{
this.Width = width;
this.Height = height;
InternalIO.glfw_SetWindowSize(this.windowID, width, height);
InternalIO.glfw.SetWindowSize(this.windowID, width, height);
}
/// <summary>
@@ -148,7 +148,7 @@ namespace StgSharp.Graphics
public void SetSize(Vec2d size)
{
this.Size = size;
InternalIO.glfw_SetWindowSize(this.windowID, (int)size.X, (int)size.Y);
InternalIO.glfw.SetWindowSize(this.windowID, (int)size.X, (int)size.Y);
}
@@ -161,7 +161,7 @@ namespace StgSharp.Graphics
/// <param name="maxHeight">Maximum height of current form</param>
public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight)
{
InternalIO.glfw_SetWindowSizeLimits(
InternalIO.glfw.SetWindowSizeLimits(
this.windowID,
minWidth, minHeight, maxWidth, maxHeight);
}
@@ -177,7 +177,7 @@ namespace StgSharp.Graphics
/// </param>
public void SetSizeLimit(Vec2d minSize, Vec2d maxSize)
{
InternalIO.glfw_SetWindowSizeLimits(
InternalIO.glfw.SetWindowSizeLimits(
this.windowID,
(int)minSize.X, (int)minSize.Y, (int)maxSize.X, (int)maxSize.Y);
}
+9 -258
View File
@@ -13,7 +13,7 @@ namespace StgSharp.Graphics
public static unsafe IntPtr LoadGLfunc(string name)
{
IntPtr ret = InternalIO.glfw_GetProcAddress(name);
IntPtr ret = InternalIO.glfw.GetProcAddress(name);
if (ret == default)
{
InternalIO.InternalWriteLog(
@@ -30,9 +30,9 @@ namespace StgSharp.Graphics
/// <param name="form">The Form instance to be controlled</param>
/// <param name="handler">Method hadler </param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void SetFrameBufferSizeCallback(Form form, FrameBufferSizeHadler handler)
public static unsafe void SetFrameBufferSizeCallback(Form form, FrameBufferSizeHandler handler)
{
InternalIO.glfw_SetFramebufferSizeCallback(form.windowID, handler);
InternalIO.glfw.SetFramebufferSizeCallback(form.windowID, handler);
}
@@ -120,12 +120,12 @@ namespace StgSharp.Graphics
IntPtr windowPtr;
if (share == null)
{
windowPtr = InternalIO.glfw_CreateWindow(
windowPtr = InternalIO.glfw.CreateWindow(
width, height, tittleBytes, monitor, IntPtr.Zero);
}
else
{
windowPtr = InternalIO.glfw_CreateWindow(
windowPtr = InternalIO.glfw.CreateWindow(
width, height, tittleBytes, monitor, share.windowID);
}
@@ -177,14 +177,14 @@ namespace StgSharp.Graphics
public static unsafe IntPtr GetProcAddress(string name)
{
IntPtr ret = InternalIO.glfw_GetProcAddress(name);
IntPtr ret = InternalIO.glfw.GetProcAddress(name);
return ret;
}
public static unsafe bool GetWindowShouldClose(Form form)
{
return InternalIO.glfw_WindowShouldClose(form.windowID) == 0;
return InternalIO.glfw.WindowShouldClose(form.windowID) == 0;
}
@@ -194,7 +194,7 @@ namespace StgSharp.Graphics
{
return;
}
InternalIO.glfw_SwapBuffers(form.windowID);
InternalIO.glfw.SwapBuffers(form.windowID);
}
@@ -204,7 +204,7 @@ namespace StgSharp.Graphics
{
return;
}
InternalIO.glfw_MakeContextCurrent(form.windowID);
InternalIO.glfw.MakeContextCurrent(form.windowID);
}
@@ -3458,253 +3458,4 @@ namespace StgSharp.Graphics
}
[StructLayout(LayoutKind.Sequential)]
internal struct GLFWapi
{
internal IntPtr Init;
internal IntPtr Terminate;
internal IntPtr InitHint;
internal IntPtr GetVersion;
internal IntPtr GetVersionString;
internal IntPtr GetError;
internal IntPtr SetErrorCallback;
internal IntPtr GetMonitors;
internal IntPtr GetPrimaryMonitor;
internal IntPtr GetMonitorPos;
internal IntPtr GetMonitorWorkarea;
internal IntPtr GetMonitorPhysicalSize;
internal IntPtr GetMonitorContentScale;
internal IntPtr GetMonitorName;
internal IntPtr SetMonitorUserPointer;
internal IntPtr GetMonitorUserPointer;
internal IntPtr SetMonitorCallback;
internal IntPtr GetVideoModes;
internal IntPtr GetVideoMode;
internal IntPtr SetGamma;
internal IntPtr GetGammaRamp;
internal IntPtr SetGammaRamp;
internal IntPtr DefaultWindowHints;
internal IntPtr WindowHint;
internal IntPtr WindowHintString;
internal IntPtr CreateWindow;
internal IntPtr DestroyWindow;
internal IntPtr WindowShouldClose;
internal IntPtr SetWindowShouldClose;
internal IntPtr SetWindowTitle;
internal IntPtr SetWindowIcon;
internal IntPtr GetWindowPos;
internal IntPtr SetWindowPos;
internal IntPtr GetWindowSize;
internal IntPtr SetWindowSizeLimits;
internal IntPtr SetWindowAspectRatio;
internal IntPtr SetWindowSize;
internal IntPtr GetFramebufferSize;
internal IntPtr GetWindowFrameSize;
internal IntPtr GetWindowContentScale;
internal IntPtr GetWindowOpacity;
internal IntPtr SetWindowOpacity;
internal IntPtr IconifyWindow;
internal IntPtr RestoreWindow;
internal IntPtr MaximizeWindow;
internal IntPtr ShowWindow;
internal IntPtr HideWindow;
internal IntPtr FocusWindow;
internal IntPtr RequestWindowAttention;
internal IntPtr GetWindowMonitor;
internal IntPtr SetWindowMonitor;
internal IntPtr GetWindowAttrib;
internal IntPtr SetWindowAttrib;
internal IntPtr SetWindowUserPointer;
internal IntPtr GetWindowUserPointer;
internal IntPtr SetWindowPosCallback;
internal IntPtr SetWindowSizeCallback;
internal IntPtr SetWindowCloseCallback;
internal IntPtr SetWindowRefreshCallback;
internal IntPtr SetWindowFocusCallback;
internal IntPtr SetWindowIconifyCallback;
internal IntPtr SetWindowMaximizeCallback;
internal IntPtr SetFramebufferSizeCallback;
internal IntPtr SetWindowContentScaleCallback;
internal IntPtr PollEvents;
internal IntPtr WaitEvents;
internal IntPtr WaitEventsTimeout;
internal IntPtr PostEmptyEvent;
internal IntPtr GetInputMode;
internal IntPtr SetInputMode;
internal IntPtr RawMouseMotionSupported;
internal IntPtr GetKeyName;
internal IntPtr GetKeyScancode;
internal IntPtr GetKey;
internal IntPtr GetMouseButton;
internal IntPtr GetCursorPos;
internal IntPtr SetCursorPos;
internal IntPtr CreateCursor;
internal IntPtr CreateStandardCursor;
internal IntPtr DestroyCursor;
internal IntPtr SetCursor;
internal IntPtr SetKeyCallback;
internal IntPtr SetCharCallback;
internal IntPtr SetCharModsCallback;
internal IntPtr SetMouseButtonCallback;
internal IntPtr SetCursorPosCallback;
internal IntPtr SetCursorEnterCallback;
internal IntPtr SetScrollCallback;
internal IntPtr SetDropCallback;
internal IntPtr JoystickPresent;
internal IntPtr GetJoystickAxes;
internal IntPtr GetJoystickButtons;
internal IntPtr GetJoystickHats;
internal IntPtr GetJoystickName;
internal IntPtr GetJoystickGUID;
internal IntPtr SetJoystickUserPointer;
internal IntPtr GetJoystickUserPointer;
internal IntPtr JoystickIsGamepad;
internal IntPtr SetJoystickCallback;
internal IntPtr UpdateGamepadMappings;
internal IntPtr GetGamepadName;
internal IntPtr GetGamepadState;
internal IntPtr SetClipboardString;
internal IntPtr GetClipboardString;
internal IntPtr GetTime;
internal IntPtr SetTime;
internal IntPtr GetTimerValue;
internal IntPtr GetTimerFrequency;
internal IntPtr MakeContextCurrent;
internal IntPtr GetCurrentContext;
internal IntPtr SwapBuffers;
internal IntPtr SwapInterval;
internal IntPtr ExtensionSupported;
internal IntPtr GetProcAddress;
internal IntPtr VulkanSupported;
internal IntPtr GetRequiredInstanceExtensions;
//internal IntPtr GetInstanceProcAddress;
//internal IntPtr GetPhysicalDevicePresentationSupport;
//internal IntPtr CreateWindowSurface;
}
[StructLayout(LayoutKind.Sequential)]
internal struct glfwpack
{
internal glfwInit glfw_Init;
internal glfwTerminate glfw_Terminate;
internal glfwInitHint glfw_InitHint;
internal glfwGetVersion glfw_GetVersion;
internal glfwGetVersionString glfw_GetVersionString;
internal glfwGetError glfw_GetError;
internal glfwSetErrorCallback glfw_SetErrorCallback;
internal glfwGetMonitors glfw_GetMonitors;
internal glfwGetPrimaryMonitor glfw_GetPrimaryMonitor;
internal glfwGetMonitorPos glfw_GetMonitorPos;
internal glfwGetMonitorWorkarea glfw_GetMonitorWorkarea;
internal glfwGetMonitorPhysicalSize glfw_GetMonitorPhysicalSize;
internal glfwGetMonitorContentScale glfw_GetMonitorContentScale;
internal glfwGetMonitorName glfw_GetMonitorName;
internal glfwSetMonitorUserPointer glfw_SetMonitorUserPointer;
internal glfwGetMonitorUserPointer glfw_GetMonitorUserPointer;
internal glfwSetMonitorCallback glfw_SetMonitorCallback;
internal glfwGetVideoModes glfw_GetVideoModes;
internal glfwGetVideoMode glfw_GetVideoMode;
internal glfwSetGamma glfw_SetGamma;
internal glfwGetGammaRamp glfw_GetGammaRamp;
internal glfwSetGammaRamp glfw_SetGammaRamp;
internal glfwDefaultWindowHints glfw_DefaultWindowHints;
internal glfwWindowHint glfw_WindowHint;
internal glfwWindowHintString glfw_WindowHintString;
internal glfwCreateWindow glfw_CreateWindow;
internal glfwDestroyWindow glfw_DestroyWindow;
internal glfwWindowShouldClose glfw_WindowShouldClose;
internal glfwSetWindowShouldClose glfw_SetWindowShouldClose;
internal glfwSetWindowTitle glfw_SetWindowTitle;
internal glfwSetWindowIcon glfw_SetWindowIcon;
internal glfwGetWindowPos glfw_GetWindowPos;
internal glfwSetWindowPos glfw_SetWindowPos;
internal glfwGetWindowSize glfw_GetWindowSize;
internal glfwSetWindowSizeLimits glfw_SetWindowSizeLimits;
internal glfwSetWindowAspectRatio glfw_SetWindowAspectRatio;
internal glfwSetWindowSize glfw_SetWindowSize;
internal glfwGetFramebufferSize glfw_GetFramebufferSize;
internal glfwGetWindowFrameSize glfw_GetWindowFrameSize;
internal glfwGetWindowContentScale glfw_GetWindowContentScale;
internal glfwGetWindowOpacity glfw_GetWindowOpacity;
internal glfwSetWindowOpacity glfw_SetWindowOpacity;
internal glfwIconifyWindow glfw_IconifyWindow;
internal glfwRestoreWindow glfw_RestoreWindow;
internal glfwMaximizeWindow glfw_MaximizeWindow;
internal glfwShowWindow glfw_ShowWindow;
internal glfwHideWindow glfw_HideWindow;
internal glfwFocusWindow glfw_FocusWindow;
internal glfwRequestWindowAttention glfw_RequestWindowAttention;
internal glfwGetWindowMonitor glfw_GetWindowMonitor;
internal glfwSetWindowMonitor glfw_SetWindowMonitor;
internal glfwGetWindowAttrib glfw_GetWindowAttrib;
internal glfwSetWindowAttrib glfw_SetWindowAttrib;
internal glfwSetWindowUserPointer glfw_SetWindowUserPointer;
internal glfwGetWindowUserPointer glfw_GetWindowUserPointer;
internal glfwSetWindowPosCallback glfw_SetWindowPosCallback;
internal glfwSetWindowSizeCallback glfw_SetWindowSizeCallback;
internal glfwSetWindowCloseCallback glfw_SetWindowCloseCallback;
internal glfwSetWindowRefreshCallback glfw_SetWindowRefreshCallback;
internal glfwSetWindowFocusCallback glfw_SetWindowFocusCallback;
internal glfwSetWindowIconifyCallback glfw_SetWindowIconifyCallback;
internal glfwSetWindowMaximizeCallback glfw_SetWindowMaximizeCallback;
internal glfwSetFramebufferSizeCallback glfw_SetFramebufferSizeCallback;
internal glfwSetWindowContentScaleCallback glfw_SetWindowContentScaleCallback;
internal glfwPollEvents glfw_PollEvents;
internal glfwWaitEvents glfw_WaitEvents;
internal glfwWaitEventsTimeout glfw_WaitEventsTimeout;
internal glfwPostEmptyEvent glfw_PostEmptyEvent;
internal glfwGetInputMode glfw_GetInputMode;
internal glfwSetInputMode glfw_SetInputMode;
internal glfwRawMouseMotionSupported glfw_RawMouseMotionSupported;
internal glfwGetKeyName glfw_GetKeyName;
internal glfwGetKeyScancode glfw_GetKeyScancode;
internal glfwGetKey glfw_GetKey;
internal glfwGetMouseButton glfw_GetMouseButton;
internal glfwGetCursorPos glfw_GetCursorPos;
internal glfwSetCursorPos glfw_SetCursorPos;
internal glfwCreateCursor glfw_CreateCursor;
internal glfwCreateStandardCursor glfw_CreateStandardCursor;
internal glfwDestroyCursor glfw_DestroyCursor;
internal glfwSetCursor glfw_SetCursor;
internal glfwSetKeyCallback glfw_SetKeyCallback;
internal glfwSetCharCallback glfw_SetCharCallback;
internal glfwSetCharModsCallback glfw_SetCharModsCallback;
internal glfwSetMouseButtonCallback glfw_SetMouseButtonCallback;
internal glfwSetCursorPosCallback glfw_SetCursorPosCallback;
internal glfwSetCursorEnterCallback glfw_SetCursorEnterCallback;
internal glfwSetScrollCallback glfw_SetScrollCallback;
internal glfwSetDropCallback glfw_SetDropCallback;
internal glfwJoystickPresent glfw_JoystickPresent;
internal glfwGetJoystickAxes glfw_GetJoystickAxes;
internal glfwGetJoystickButtons glfw_GetJoystickButtons;
internal glfwGetJoystickHats glfw_GetJoystickHats;
internal glfwGetJoystickName glfw_GetJoystickName;
internal glfwGetJoystickGUID glfw_GetJoystickGUID;
internal glfwSetJoystickUserPointer glfw_SetJoystickUserPointer;
internal glfwGetJoystickUserPointer glfw_GetJoystickUserPointer;
internal glfwJoystickIsGamepad glfw_JoystickIsGamepad;
internal glfwSetJoystickCallback glfw_SetJoystickCallback;
internal glfwUpdateGamepadMappings glfw_UpdateGamepadMappings;
internal glfwGetGamepadName glfw_GetGamepadName;
internal glfwGetGamepadState glfw_GetGamepadState;
internal glfwSetClipboardString glfw_SetClipboardString;
internal glfwGetClipboardString glfw_GetClipboardString;
internal glfwGetTime glfw_GetTime;
internal glfwSetTime glfw_SetTime;
internal glfwGetTimerValue glfw_GetTimerValue;
internal glfwGetTimerFrequency glfw_GetTimerFrequency;
internal glfwMakeContextCurrent glfw_MakeContextCurrent;
internal glfwGetCurrentContext glfw_GetCurrentContext;
internal glfwSwapBuffers glfw_SwapBuffers;
internal glfwSwapInterval glfw_SwapInterval;
internal glfwExtensionSupported glfw_ExtensionSupported;
internal glfwGetProcAddress glfw_GetProcAddress;
internal glfwVulkanSupported glfw_VulkanSupported;
internal glfwGetRequiredInstanceExtensions glfw_GetRequiredInstanceExtensions;
//internal glfwGetInstanceProcAddress glfw_GetInstanceProcAddress;
//internal glfwGetPhysicalDevicePresentationSupport glfw_GetPhysicalDevicePresentationSupport;
//internal glfwCreateWindowSurface glfw_CreateWindowSurface;
}
}
+636
View File
@@ -0,0 +1,636 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using static StgSharp.Graphics.GLFWlibrary;
using static System.Net.Mime.MediaTypeNames;
using System.Threading;
namespace StgSharp.Graphics
{
internal interface IglFramework
{
internal int Init();
internal unsafe void Terminate();
internal unsafe void InitHint(int hint, int value);
internal unsafe void GetVersion(int* major, int* minor, int* rev);
internal unsafe byte* GetVersionString();
internal unsafe int GetError(byte** description);
internal unsafe GLFWerrorfun SetErrorCallback(GLFWerrorfun callback);
internal unsafe IntPtr* GetMonitors(int* count);
internal unsafe IntPtr GetPrimaryMonitor();
internal unsafe void GetMonitorPos(IntPtr monitor, int* xpos, int* ypos);
internal unsafe void GetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height);
internal unsafe void GetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM);
internal unsafe void GetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale);
internal unsafe byte* GetMonitorName(IntPtr monitor);
internal unsafe void SetMonitorUserPointer(IntPtr monitor, void* pointer);
internal unsafe void* GetMonitorUserPointer(IntPtr monitor);
internal unsafe GLFWmonitorfun SetMonitorCallback(GLFWmonitorfun callback);
internal unsafe GLFWvidmode* GetVideoModes(IntPtr monitor, int* count);
internal unsafe GLFWvidmode* GetVideoMode(IntPtr monitor);
internal unsafe void SetGamma(IntPtr monitor, float gamma);
internal unsafe GLFWgammaramp* GetGammaRamp(IntPtr monitor);
internal unsafe void SetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp);
internal unsafe void DefaultWindowHints();
internal unsafe void WindowHint(int hint, int value);
internal unsafe void WindowHintString(int hint, byte* value);
internal unsafe IntPtr CreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share);
internal unsafe void DestroyWindow(IntPtr window);
internal unsafe int WindowShouldClose(IntPtr window);
internal unsafe void SetWindowShouldClose(IntPtr window, int value);
internal unsafe void SetWindowTitle(IntPtr window, byte* title);
internal unsafe void SetWindowIcon(IntPtr window, int count, GLFWimage* images);
internal unsafe void GetWindowPos(IntPtr window, int* xpos, int* ypos);
internal unsafe void SetWindowPos(IntPtr window, int xpos, int ypos);
internal unsafe void GetWindowSize(IntPtr window, int* width, int* height);
internal unsafe void SetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight);
internal unsafe void SetWindowAspectRatio(IntPtr window, int numer, int denom);
internal unsafe void SetWindowSize(IntPtr window, int width, int height);
internal unsafe void GetFramebufferSize(IntPtr window, int* width, int* height);
internal unsafe void GetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom);
internal unsafe void GetWindowContentScale(IntPtr window, float* xscale, float* yscale);
internal unsafe float GetWindowOpacity(IntPtr window);
internal unsafe void SetWindowOpacity(IntPtr window, float opacity);
internal unsafe void IconifyWindow(IntPtr window);
internal unsafe void RestoreWindow(IntPtr window);
internal unsafe void MaximizeWindow(IntPtr window);
internal unsafe void ShowWindow(IntPtr window);
internal unsafe void HideWindow(IntPtr window);
internal unsafe void FocusWindow(IntPtr window);
internal unsafe void RequestWindowAttention(IntPtr window);
internal unsafe IntPtr GetWindowMonitor(IntPtr window);
internal unsafe void SetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate);
internal unsafe int GetWindowAttrib(IntPtr window, int attrib);
internal unsafe void SetWindowAttrib(IntPtr window, int attrib, int value);
internal unsafe void SetWindowUserPointer(IntPtr window, void* pointer);
internal unsafe void* GetWindowUserPointer(IntPtr window);
internal unsafe GLFWwindowposfun SetWindowPosCallback(IntPtr window, GLFWwindowposfun callback);
internal unsafe GLFWwindowsizefun SetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback);
internal unsafe GLFWwindowclosefun SetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback);
internal unsafe GLFWwindowrefreshfun SetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback);
internal unsafe GLFWwindowfocusfun SetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback);
internal unsafe GLFWwindowiconifyfun SetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback);
internal unsafe GLFWwindowmaximizefun SetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback);
internal unsafe FramebuffersizeHandler SetFramebufferSizeCallback(IntPtr window, FrameBufferSizeHandler callback);
internal unsafe GLFWwindowcontentscalefun SetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback);
internal unsafe void PollEvents();
internal unsafe void WaitEvents();
internal unsafe void WaitEventsTimeout(double timeout);
internal unsafe void PostEmptyEvent();
internal unsafe int GetInputMode(IntPtr window, int mode);
internal unsafe void SetInputMode(IntPtr window, int mode, int value);
internal unsafe int RawMouseMotionSupported();
internal unsafe byte* GetKeyName(int key, int scancode);
internal unsafe int GetKeyScancode(int key);
internal unsafe KeyStatus GetKey(IntPtr window, int key);
internal unsafe int GetMouseButton(IntPtr window, int button);
internal unsafe void GetCursorPos(IntPtr window, double* xpos, double* ypos);
internal unsafe void SetCursorPos(IntPtr window, double xpos, double ypos);
internal unsafe GLFWcursor* CreateCursor(GLFWimage* image, int xhot, int yhot);
internal unsafe GLFWcursor* CreateStandardCursor(int shape);
internal unsafe void DestroyCursor(GLFWcursor* cursor);
internal unsafe void SetCursor(IntPtr window, GLFWcursor* cursor);
internal unsafe GLFWkeyfun SetKeyCallback(IntPtr window, GLFWkeyfun callback);
internal unsafe GLFWcharfun SetCharCallback(IntPtr window, GLFWcharfun callback);
internal unsafe GLFWcharmodsfun SetCharModsCallback(IntPtr window, GLFWcharmodsfun callback);
internal unsafe GLFWmousebuttonfun SetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback);
internal unsafe GLFWcursorposfun SetCursorPosCallback(IntPtr window, GLFWcursorposfun callback);
internal unsafe GLFWcursorenterfun SetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback);
internal unsafe GLFWscrollfun SetScrollCallback(IntPtr window, GLFWscrollfun callback);
internal unsafe GLFWdropfun SetDropCallback(IntPtr window, GLFWdropfun callback);
internal unsafe int JoystickPresent(int jid);
internal unsafe float* GetJoystickAxes(int jid, int* count);
internal unsafe byte* GetJoystickButtons(int jid, int* count);
internal unsafe byte* GetJoystickHats(int jid, int* count);
internal unsafe byte* GetJoystickName(int jid);
internal unsafe byte* GetJoystickGUID(int jid);
internal unsafe void SetJoystickUserPointer(int jid, void* pointer);
internal unsafe void* GetJoystickUserPointer(int jid);
internal unsafe int JoystickIsGamepad(int jid);
internal unsafe GLFWjoystickfun SetJoystickCallback(GLFWjoystickfun callback);
internal unsafe int UpdateGamepadMappings(byte* str);
internal unsafe byte* GetGamepadName(int jid);
internal unsafe int GetGamepadState(int jid, GLFWgamepadstate* state);
internal unsafe void SetClipboardString(IntPtr window, byte* str);
internal unsafe byte* GetClipboardString(IntPtr window);
internal unsafe double GetTime();
internal unsafe void SetTime(double time);
internal unsafe ulong* GetTimerValue();
internal unsafe ulong* GetTimerFrequency();
internal unsafe void MakeContextCurrent(IntPtr window);
internal unsafe IntPtr GetCurrentContext();
internal unsafe void SwapBuffers(IntPtr window);
internal unsafe void SwapInterval(int interval);
internal unsafe int ExtensionSupported(byte* extension);
internal unsafe IntPtr GetProcAddress(string procname);
internal unsafe int VulkanSupported();
internal unsafe byte** GetRequiredInstanceExtensions(uint* count);
//internal unsafe GLFWvkproc GetInstanceProcAddress(VkInstance instance, byte* procname);
//internal unsafe int GetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily);
//internal unsafe VkResult CreateWindowSurface(VkInstance instance, IntPtr window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
}
internal class glFramework_PInvoke : IglFramework
{
#region api call
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwInit")] internal extern unsafe static int glfwInit();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwTerminate")] internal extern unsafe static void glfwTerminate();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwInitHint")] internal extern unsafe static void glfwInitHint(int hint, int value);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetVersion")] internal extern unsafe static void glfwGetVersion(int* major, int* minor, int* rev);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetVersionString")] internal extern unsafe static byte* glfwGetVersionString();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetError")] internal extern unsafe static int glfwGetError(byte** description);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetErrorCallback")] internal extern unsafe static GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitors")] internal extern unsafe static IntPtr* glfwGetMonitors(int* count);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetPrimaryMonitor")] internal extern unsafe static IntPtr glfwGetPrimaryMonitor();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorPos")] internal extern unsafe static void glfwGetMonitorPos(IntPtr monitor, int* xpos, int* ypos);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorWorkarea")] internal extern unsafe static void glfwGetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorPhysicalSize")] internal extern unsafe static void glfwGetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorContentScale")] internal extern unsafe static void glfwGetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorName")] internal extern unsafe static byte* glfwGetMonitorName(IntPtr monitor);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetMonitorUserPointer")] internal extern unsafe static void glfwSetMonitorUserPointer(IntPtr monitor, void* pointer);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorUserPointer")] internal extern unsafe static void* glfwGetMonitorUserPointer(IntPtr monitor);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetMonitorCallback")] internal extern unsafe static GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetVideoModes")] internal extern unsafe static GLFWvidmode* glfwGetVideoModes(IntPtr monitor, int* count);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetVideoMode")] internal extern unsafe static GLFWvidmode* glfwGetVideoMode(IntPtr monitor);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetGamma")] internal extern unsafe static void glfwSetGamma(IntPtr monitor, float gamma);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetGammaRamp")] internal extern unsafe static GLFWgammaramp* glfwGetGammaRamp(IntPtr monitor);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetGammaRamp")] internal extern unsafe static void glfwSetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwDefaultWindowHints")] internal extern unsafe static void glfwDefaultWindowHints();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWindowHint")] internal extern unsafe static void glfwWindowHint(int hint, int value);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWindowHintString")] internal extern unsafe static void glfwWindowHintString(int hint, byte* value);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateWindow")] internal extern unsafe static IntPtr glfwCreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwDestroyWindow")] internal extern unsafe static void glfwDestroyWindow(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWindowShouldClose")] internal extern unsafe static int glfwWindowShouldClose(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowShouldClose")] internal extern unsafe static void glfwSetWindowShouldClose(IntPtr window, int value);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowTitle")] internal extern unsafe static void glfwSetWindowTitle(IntPtr window, byte* title);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowIcon")] internal extern unsafe static void glfwSetWindowIcon(IntPtr window, int count, GLFWimage* images);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowPos")] internal extern unsafe static void glfwGetWindowPos(IntPtr window, int* xpos, int* ypos);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowPos")] internal extern unsafe static void glfwSetWindowPos(IntPtr window, int xpos, int ypos);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowSize")] internal extern unsafe static void glfwGetWindowSize(IntPtr window, int* width, int* height);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowSizeLimits")] internal extern unsafe static void glfwSetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowAspectRatio")] internal extern unsafe static void glfwSetWindowAspectRatio(IntPtr window, int numer, int denom);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowSize")] internal extern unsafe static void glfwSetWindowSize(IntPtr window, int width, int height);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetFramebufferSize")] internal extern unsafe static void glfwGetFramebufferSize(IntPtr window, int* width, int* height);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowFrameSize")] internal extern unsafe static void glfwGetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowContentScale")] internal extern unsafe static void glfwGetWindowContentScale(IntPtr window, float* xscale, float* yscale);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowOpacity")] internal extern unsafe static float glfwGetWindowOpacity(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowOpacity")] internal extern unsafe static void glfwSetWindowOpacity(IntPtr window, float opacity);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwIconifyWindow")] internal extern unsafe static void glfwIconifyWindow(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwRestoreWindow")] internal extern unsafe static void glfwRestoreWindow(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwMaximizeWindow")] internal extern unsafe static void glfwMaximizeWindow(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwShowWindow")] internal extern unsafe static void glfwShowWindow(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwHideWindow")] internal extern unsafe static void glfwHideWindow(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwFocusWindow")] internal extern unsafe static void glfwFocusWindow(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwRequestWindowAttention")] internal extern unsafe static void glfwRequestWindowAttention(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowMonitor")] internal extern unsafe static IntPtr glfwGetWindowMonitor(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowMonitor")] internal extern unsafe static void glfwSetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowAttrib")] internal extern unsafe static int glfwGetWindowAttrib(IntPtr window, int attrib);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowAttrib")] internal extern unsafe static void glfwSetWindowAttrib(IntPtr window, int attrib, int value);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowUserPointer")] internal extern unsafe static void glfwSetWindowUserPointer(IntPtr window, void* pointer);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowUserPointer")] internal extern unsafe static void* glfwGetWindowUserPointer(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowPosCallback")] internal extern unsafe static GLFWwindowposfun glfwSetWindowPosCallback(IntPtr window, GLFWwindowposfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowSizeCallback")] internal extern unsafe static GLFWwindowsizefun glfwSetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowCloseCallback")] internal extern unsafe static GLFWwindowclosefun glfwSetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowRefreshCallback")] internal extern unsafe static GLFWwindowrefreshfun glfwSetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowFocusCallback")] internal extern unsafe static GLFWwindowfocusfun glfwSetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowIconifyCallback")] internal extern unsafe static GLFWwindowiconifyfun glfwSetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowMaximizeCallback")] internal extern unsafe static GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetFramebufferSizeCallback")] internal extern unsafe static FramebuffersizeHandler glfwSetFramebufferSizeCallback(IntPtr window, FrameBufferSizeHandler callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowContentScaleCallback")] internal extern unsafe static GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwPollEvents")] internal extern unsafe static void glfwPollEvents();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWaitEvents")] internal extern unsafe static void glfwWaitEvents();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWaitEventsTimeout")] internal extern unsafe static void glfwWaitEventsTimeout(double timeout);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwPostEmptyEvent")] internal extern unsafe static void glfwPostEmptyEvent();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetInputMode")] internal extern unsafe static int glfwGetInputMode(IntPtr window, int mode);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetInputMode")] internal extern unsafe static void glfwSetInputMode(IntPtr window, int mode, int value);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwRawMouseMotionSupported")] internal extern unsafe static int glfwRawMouseMotionSupported();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetKeyName")] internal extern unsafe static byte* glfwGetKeyName(int key, int scancode);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetKeyScancode")] internal extern unsafe static int glfwGetKeyScancode(int key);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetKey")] internal extern unsafe static KeyStatus glfwGetKey(IntPtr window, int key);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMouseButton")] internal extern unsafe static int glfwGetMouseButton(IntPtr window, int button);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetCursorPos")] internal extern unsafe static void glfwGetCursorPos(IntPtr window, double* xpos, double* ypos);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCursorPos")] internal extern unsafe static void glfwSetCursorPos(IntPtr window, double xpos, double ypos);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateCursor")] internal extern unsafe static GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateStandardCursor")] internal extern unsafe static GLFWcursor* glfwCreateStandardCursor(int shape);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwDestroyCursor")] internal extern unsafe static void glfwDestroyCursor(GLFWcursor* cursor);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCursor")] internal extern unsafe static void glfwSetCursor(IntPtr window, GLFWcursor* cursor);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetKeyCallback")] internal extern unsafe static GLFWkeyfun glfwSetKeyCallback(IntPtr window, GLFWkeyfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCharCallback")] internal extern unsafe static GLFWcharfun glfwSetCharCallback(IntPtr window, GLFWcharfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCharModsCallback")] internal extern unsafe static GLFWcharmodsfun glfwSetCharModsCallback(IntPtr window, GLFWcharmodsfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetMouseButtonCallback")] internal extern unsafe static GLFWmousebuttonfun glfwSetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCursorPosCallback")] internal extern unsafe static GLFWcursorposfun glfwSetCursorPosCallback(IntPtr window, GLFWcursorposfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCursorEnterCallback")] internal extern unsafe static GLFWcursorenterfun glfwSetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetScrollCallback")] internal extern unsafe static GLFWscrollfun glfwSetScrollCallback(IntPtr window, GLFWscrollfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetDropCallback")] internal extern unsafe static GLFWdropfun glfwSetDropCallback(IntPtr window, GLFWdropfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwJoystickPresent")] internal extern unsafe static int glfwJoystickPresent(int jid);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickAxes")] internal extern unsafe static float* glfwGetJoystickAxes(int jid, int* count);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickButtons")] internal extern unsafe static byte* glfwGetJoystickButtons(int jid, int* count);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickHats")] internal extern unsafe static byte* glfwGetJoystickHats(int jid, int* count);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickName")] internal extern unsafe static byte* glfwGetJoystickName(int jid);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickGUID")] internal extern unsafe static byte* glfwGetJoystickGUID(int jid);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetJoystickUserPointer")] internal extern unsafe static void glfwSetJoystickUserPointer(int jid, void* pointer);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickUserPointer")] internal extern unsafe static void* glfwGetJoystickUserPointer(int jid);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwJoystickIsGamepad")] internal extern unsafe static int glfwJoystickIsGamepad(int jid);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetJoystickCallback")] internal extern unsafe static GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwUpdateGamepadMappings")] internal extern unsafe static int glfwUpdateGamepadMappings(byte* str);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetGamepadName")] internal extern unsafe static byte* glfwGetGamepadName(int jid);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetGamepadState")] internal extern unsafe static int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetClipboardString")] internal extern unsafe static void glfwSetClipboardString(IntPtr window, byte* str);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetClipboardString")] internal extern unsafe static byte* glfwGetClipboardString(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetTime")] internal extern unsafe static double glfwGetTime();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetTime")] internal extern unsafe static void glfwSetTime(double time);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetTimerValue")] internal extern unsafe static ulong* glfwGetTimerValue();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetTimerFrequency")] internal extern unsafe static ulong* glfwGetTimerFrequency();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwMakeContextCurrent")] internal extern unsafe static void glfwMakeContextCurrent(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetCurrentContext")] internal extern unsafe static IntPtr glfwGetCurrentContext();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSwapBuffers")] internal extern unsafe static void glfwSwapBuffers(IntPtr window);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSwapInterval")] internal extern unsafe static void glfwSwapInterval(int interval);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwExtensionSupported")] internal extern unsafe static int glfwExtensionSupported(byte* extension);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetProcAddress", CharSet = CharSet.Ansi)] internal extern unsafe static IntPtr glfwGetProcAddress(string procname);
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwVulkanSupported")] internal extern unsafe static int glfwVulkanSupported();
[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetRequiredInstanceExtensions")] internal extern unsafe static byte** glfwGetRequiredInstanceExtensions(uint* count);
//[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetInstanceProcAddress")] internal extern unsafe static GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, byte* procname);
//[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetPhysicalDevicePresentationSupport")] internal extern unsafe static int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily);
//[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateWindowSurface")] internal extern unsafe static VkResult glfwCreateWindowSurface(VkInstance instance, IntPtr window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
#endregion
#region api
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int Init() => glfwInit();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void Terminate() => glfwTerminate();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void InitHint(int hint, int value) => glfwInitHint(hint, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetVersion(int* major, int* minor, int* rev) => glfwGetVersion(major, minor, rev);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetVersionString() => glfwGetVersionString();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetError(byte** description) => glfwGetError(description);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWerrorfun SetErrorCallback(GLFWerrorfun callback) => glfwSetErrorCallback(callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr* GetMonitors(int* count) => glfwGetMonitors(count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetPrimaryMonitor() => glfwGetPrimaryMonitor();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorPos(IntPtr monitor, int* xpos, int* ypos) => glfwGetMonitorPos(monitor, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height) => glfwGetMonitorWorkarea(monitor, xpos, ypos, width, height);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM) => glfwGetMonitorPhysicalSize(monitor, widthMM, heightMM);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale) => glfwGetMonitorContentScale(monitor, xscale, yscale);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetMonitorName(IntPtr monitor) => glfwGetMonitorName(monitor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetMonitorUserPointer(IntPtr monitor, void* pointer) => glfwSetMonitorUserPointer(monitor, pointer);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetMonitorUserPointer(IntPtr monitor) => glfwGetMonitorUserPointer(monitor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWmonitorfun SetMonitorCallback(GLFWmonitorfun callback) => glfwSetMonitorCallback(callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvidmode* GetVideoModes(IntPtr monitor, int* count) => glfwGetVideoModes(monitor, count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvidmode* GetVideoMode(IntPtr monitor) => glfwGetVideoMode(monitor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetGamma(IntPtr monitor, float gamma) => glfwSetGamma(monitor, gamma);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWgammaramp* GetGammaRamp(IntPtr monitor) => glfwGetGammaRamp(monitor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp) => glfwSetGammaRamp(monitor, ramp);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DefaultWindowHints() => glfwDefaultWindowHints();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WindowHint(int hint, int value) => glfwWindowHint(hint, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WindowHintString(int hint, byte* value) => glfwWindowHintString(hint, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr CreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share) => glfwCreateWindow(width, height, title, monitor, share);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DestroyWindow(IntPtr window) => glfwDestroyWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int WindowShouldClose(IntPtr window) => glfwWindowShouldClose(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowShouldClose(IntPtr window, int value) => glfwSetWindowShouldClose(window, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowTitle(IntPtr window, byte* title) => glfwSetWindowTitle(window, title);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowIcon(IntPtr window, int count, GLFWimage* images) => glfwSetWindowIcon(window, count, images);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowPos(IntPtr window, int* xpos, int* ypos) => glfwGetWindowPos(window, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowPos(IntPtr window, int xpos, int ypos) => glfwSetWindowPos(window, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowSize(IntPtr window, int* width, int* height) => glfwGetWindowSize(window, width, height);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight) => glfwSetWindowSizeLimits(window, minwidth, minheight, maxwidth, maxheight);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowAspectRatio(IntPtr window, int numer, int denom) => glfwSetWindowAspectRatio(window, numer, denom);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowSize(IntPtr window, int width, int height) => glfwSetWindowSize(window, width, height);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetFramebufferSize(IntPtr window, int* width, int* height) => glfwGetFramebufferSize(window, width, height);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom) => glfwGetWindowFrameSize(window, left, top, right, bottom);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowContentScale(IntPtr window, float* xscale, float* yscale) => glfwGetWindowContentScale(window, xscale, yscale);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe float GetWindowOpacity(IntPtr window) => glfwGetWindowOpacity(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowOpacity(IntPtr window, float opacity) => glfwSetWindowOpacity(window, opacity);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void IconifyWindow(IntPtr window) => glfwIconifyWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void RestoreWindow(IntPtr window) => glfwRestoreWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void MaximizeWindow(IntPtr window) => glfwMaximizeWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void ShowWindow(IntPtr window) => glfwShowWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void HideWindow(IntPtr window) => glfwHideWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void FocusWindow(IntPtr window) => glfwFocusWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void RequestWindowAttention(IntPtr window) => glfwRequestWindowAttention(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetWindowMonitor(IntPtr window) => glfwGetWindowMonitor(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate) => glfwSetWindowMonitor(window, monitor, xpos, ypos, width, height, refreshRate);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetWindowAttrib(IntPtr window, int attrib) => glfwGetWindowAttrib(window, attrib);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowAttrib(IntPtr window, int attrib, int value) => glfwSetWindowAttrib(window, attrib, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowUserPointer(IntPtr window, void* pointer) => glfwSetWindowUserPointer(window, pointer);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetWindowUserPointer(IntPtr window) => glfwGetWindowUserPointer(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowposfun SetWindowPosCallback(IntPtr window, GLFWwindowposfun callback) => glfwSetWindowPosCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowsizefun SetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback) => glfwSetWindowSizeCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowclosefun SetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback) => glfwSetWindowCloseCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowrefreshfun SetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback) => glfwSetWindowRefreshCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowfocusfun SetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback) => glfwSetWindowFocusCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowiconifyfun SetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback) => glfwSetWindowIconifyCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowmaximizefun SetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback) => glfwSetWindowMaximizeCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe FramebuffersizeHandler SetFramebufferSizeCallback(IntPtr window, FrameBufferSizeHandler callback) => glfwSetFramebufferSizeCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowcontentscalefun SetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback) => glfwSetWindowContentScaleCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void PollEvents() => glfwPollEvents();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WaitEvents() => glfwWaitEvents();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WaitEventsTimeout(double timeout) => glfwWaitEventsTimeout(timeout);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void PostEmptyEvent() => glfwPostEmptyEvent();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetInputMode(IntPtr window, int mode) => glfwGetInputMode(window, mode);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetInputMode(IntPtr window, int mode, int value) => glfwSetInputMode(window, mode, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int RawMouseMotionSupported() => glfwRawMouseMotionSupported();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetKeyName(int key, int scancode) => glfwGetKeyName(key, scancode);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetKeyScancode(int key) => glfwGetKeyScancode(key);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe KeyStatus GetKey(IntPtr window, int key) => glfwGetKey(window, key);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetMouseButton(IntPtr window, int button) => glfwGetMouseButton(window, button);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetCursorPos(IntPtr window, double* xpos, double* ypos) => glfwGetCursorPos(window, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetCursorPos(IntPtr window, double xpos, double ypos) => glfwSetCursorPos(window, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursor* CreateCursor(GLFWimage* image, int xhot, int yhot) => glfwCreateCursor(image, xhot, yhot);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursor* CreateStandardCursor(int shape) => glfwCreateStandardCursor(shape);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DestroyCursor(GLFWcursor* cursor) => glfwDestroyCursor(cursor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetCursor(IntPtr window, GLFWcursor* cursor) => glfwSetCursor(window, cursor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWkeyfun SetKeyCallback(IntPtr window, GLFWkeyfun callback) => glfwSetKeyCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcharfun SetCharCallback(IntPtr window, GLFWcharfun callback) => glfwSetCharCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcharmodsfun SetCharModsCallback(IntPtr window, GLFWcharmodsfun callback) => glfwSetCharModsCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWmousebuttonfun SetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback) => glfwSetMouseButtonCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursorposfun SetCursorPosCallback(IntPtr window, GLFWcursorposfun callback) => glfwSetCursorPosCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursorenterfun SetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback) => glfwSetCursorEnterCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWscrollfun SetScrollCallback(IntPtr window, GLFWscrollfun callback) => glfwSetScrollCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWdropfun SetDropCallback(IntPtr window, GLFWdropfun callback) => glfwSetDropCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int JoystickPresent(int jid) => glfwJoystickPresent(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe float* GetJoystickAxes(int jid, int* count) => glfwGetJoystickAxes(jid, count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickButtons(int jid, int* count) => glfwGetJoystickButtons(jid, count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickHats(int jid, int* count) => glfwGetJoystickHats(jid, count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickName(int jid) => glfwGetJoystickName(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickGUID(int jid) => glfwGetJoystickGUID(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetJoystickUserPointer(int jid, void* pointer) => glfwSetJoystickUserPointer(jid, pointer);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetJoystickUserPointer(int jid) => glfwGetJoystickUserPointer(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int JoystickIsGamepad(int jid) => glfwJoystickIsGamepad(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWjoystickfun SetJoystickCallback(GLFWjoystickfun callback) => glfwSetJoystickCallback(callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int UpdateGamepadMappings(byte* str) => glfwUpdateGamepadMappings(str);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetGamepadName(int jid) => glfwGetGamepadName(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetGamepadState(int jid, GLFWgamepadstate* state) => glfwGetGamepadState(jid, state);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetClipboardString(IntPtr window, byte* str) => glfwSetClipboardString(window, str);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetClipboardString(IntPtr window) => glfwGetClipboardString(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe double GetTime() => glfwGetTime();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetTime(double time) => glfwSetTime(time);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe ulong* GetTimerValue() => glfwGetTimerValue();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe ulong* GetTimerFrequency() => glfwGetTimerFrequency();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void MakeContextCurrent(IntPtr window) => glfwMakeContextCurrent(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetCurrentContext() => glfwGetCurrentContext();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SwapBuffers(IntPtr window) => glfwSwapBuffers(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SwapInterval(int interval) => glfwSwapInterval(interval);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int ExtensionSupported(byte* extension) => glfwExtensionSupported(extension);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetProcAddress(string procname) => glfwGetProcAddress(procname);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int VulkanSupported() => glfwVulkanSupported();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte** GetRequiredInstanceExtensions(uint* count) => glfwGetRequiredInstanceExtensions(count);
//[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvkproc GetInstanceProcAddress(VkInstance instance, byte* procname)=>glfwGetInstanceProcAddress(instance, procname)
//[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily) => glfwGetPhysicalDevicePresentationSupport(instance, device, queuefamily);
//[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe VkResult CreateWindowSurface(VkInstance instance, IntPtr window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface)=>glfwCreateWindowSurface(instance, window, allocator, surface)
#endregion
}
internal class glFramework_Delegate : IglFramework
{
#region glfw api define
internal static glfwCreateCursor glfw_CreateCursor;
internal static glfwCreateStandardCursor glfw_CreateStandardCursor;
internal static glfwCreateWindow glfw_CreateWindow;
internal static glfwDefaultWindowHints glfw_DefaultWindowHints;
internal static glfwDestroyCursor glfw_DestroyCursor;
internal static glfwDestroyWindow glfw_DestroyWindow;
internal static glfwExtensionSupported glfw_ExtensionSupported;
internal static glfwFocusWindow glfw_FocusWindow;
internal static glfwGetClipboardString glfw_GetClipboardString;
internal static glfwGetCurrentContext glfw_GetCurrentContext;
internal static glfwGetCursorPos glfw_GetCursorPos;
internal static glfwGetError glfw_GetError;
internal static glfwGetFramebufferSize glfw_GetFramebufferSize;
internal static glfwGetGamepadName glfw_GetGamepadName;
internal static glfwGetGamepadState glfw_GetGamepadState;
internal static glfwGetGammaRamp glfw_GetGammaRamp;
internal static glfwGetInputMode glfw_GetInputMode;
internal static glfwGetJoystickAxes glfw_GetJoystickAxes;
internal static glfwGetJoystickButtons glfw_GetJoystickButtons;
internal static glfwGetJoystickGUID glfw_GetJoystickGUID;
internal static glfwGetJoystickHats glfw_GetJoystickHats;
internal static glfwGetJoystickName glfw_GetJoystickName;
internal static glfwGetJoystickUserPointer glfw_GetJoystickUserPointer;
internal static glfwGetKey glfw_GetKey;
internal static glfwGetKeyName glfw_GetKeyName;
internal static glfwGetKeyScancode glfw_GetKeyScancode;
internal static glfwGetMonitorContentScale glfw_GetMonitorContentScale;
internal static glfwGetMonitorName glfw_GetMonitorName;
internal static glfwGetMonitorPhysicalSize glfw_GetMonitorPhysicalSize;
internal static glfwGetMonitorPos glfw_GetMonitorPos;
internal static glfwGetMonitors glfw_GetMonitors;
internal static glfwGetMonitorUserPointer glfw_GetMonitorUserPointer;
internal static glfwGetMonitorWorkarea glfw_GetMonitorWorkarea;
internal static glfwGetMouseButton glfw_GetMouseButton;
internal static glfwGetPrimaryMonitor glfw_GetPrimaryMonitor;
internal static glfwGetProcAddress glfw_GetProcAddress;
internal static glfwGetRequiredInstanceExtensions glfw_GetRequiredInstanceExtensions;
internal static glfwGetTime glfw_GetTime;
internal static glfwGetTimerFrequency glfw_GetTimerFrequency;
internal static glfwGetTimerValue glfw_GetTimerValue;
internal static glfwGetVersion glfw_GetVersion;
internal static glfwGetVersionString glfw_GetVersionString;
internal static glfwGetVideoMode glfw_GetVideoMode;
internal static glfwGetVideoModes glfw_GetVideoModes;
internal static glfwGetWindowAttrib glfw_GetWindowAttrib;
internal static glfwGetWindowContentScale glfw_GetWindowContentScale;
internal static glfwGetWindowFrameSize glfw_GetWindowFrameSize;
internal static glfwGetWindowMonitor glfw_GetWindowMonitor;
internal static glfwGetWindowOpacity glfw_GetWindowOpacity;
internal static glfwGetWindowPos glfw_GetWindowPos;
internal static glfwGetWindowSize glfw_GetWindowSize;
internal static glfwGetWindowUserPointer glfw_GetWindowUserPointer;
internal static glfwHideWindow glfw_HideWindow;
internal static glfwIconifyWindow glfw_IconifyWindow;
internal static glfwInit glfw_Init;
internal static glfwInitHint glfw_InitHint;
internal static glfwJoystickIsGamepad glfw_JoystickIsGamepad;
internal static glfwJoystickPresent glfw_JoystickPresent;
internal static glfwMakeContextCurrent glfw_MakeContextCurrent;
internal static glfwMaximizeWindow glfw_MaximizeWindow;
internal static glfwPollEvents glfw_PollEvents;
internal static glfwPostEmptyEvent glfw_PostEmptyEvent;
internal static glfwRawMouseMotionSupported glfw_RawMouseMotionSupported;
internal static glfwRequestWindowAttention glfw_RequestWindowAttention;
internal static glfwRestoreWindow glfw_RestoreWindow;
internal static glfwSetCharCallback glfw_SetCharCallback;
internal static glfwSetCharModsCallback glfw_SetCharModsCallback;
internal static glfwSetClipboardString glfw_SetClipboardString;
internal static glfwSetCursor glfw_SetCursor;
internal static glfwSetCursorEnterCallback glfw_SetCursorEnterCallback;
internal static glfwSetCursorPos glfw_SetCursorPos;
internal static glfwSetCursorPosCallback glfw_SetCursorPosCallback;
internal static glfwSetDropCallback glfw_SetDropCallback;
internal static glfwSetErrorCallback glfw_SetErrorCallback;
internal static glfwSetFramebufferSizeCallback glfw_SetFramebufferSizeCallback;
internal static glfwSetGamma glfw_SetGamma;
internal static glfwSetGammaRamp glfw_SetGammaRamp;
internal static glfwSetInputMode glfw_SetInputMode;
internal static glfwSetJoystickCallback glfw_SetJoystickCallback;
internal static glfwSetJoystickUserPointer glfw_SetJoystickUserPointer;
internal static glfwSetKeyCallback glfw_SetKeyCallback;
internal static glfwSetMonitorCallback glfw_SetMonitorCallback;
internal static glfwSetMonitorUserPointer glfw_SetMonitorUserPointer;
internal static glfwSetMouseButtonCallback glfw_SetMouseButtonCallback;
internal static glfwSetScrollCallback glfw_SetScrollCallback;
internal static glfwSetTime glfw_SetTime;
internal static glfwSetWindowAspectRatio glfw_SetWindowAspectRatio;
internal static glfwSetWindowAttrib glfw_SetWindowAttrib;
internal static glfwSetWindowCloseCallback glfw_SetWindowCloseCallback;
internal static glfwSetWindowContentScaleCallback glfw_SetWindowContentScaleCallback;
internal static glfwSetWindowFocusCallback glfw_SetWindowFocusCallback;
internal static glfwSetWindowIcon glfw_SetWindowIcon;
internal static glfwSetWindowIconifyCallback glfw_SetWindowIconifyCallback;
internal static glfwSetWindowMaximizeCallback glfw_SetWindowMaximizeCallback;
internal static glfwSetWindowMonitor glfw_SetWindowMonitor;
internal static glfwSetWindowOpacity glfw_SetWindowOpacity;
internal static glfwSetWindowPos glfw_SetWindowPos;
internal static glfwSetWindowPosCallback glfw_SetWindowPosCallback;
internal static glfwSetWindowRefreshCallback glfw_SetWindowRefreshCallback;
internal static glfwSetWindowShouldClose glfw_SetWindowShouldClose;
internal static glfwSetWindowSize glfw_SetWindowSize;
internal static glfwSetWindowSizeCallback glfw_SetWindowSizeCallback;
internal static glfwSetWindowSizeLimits glfw_SetWindowSizeLimits;
internal static glfwSetWindowTitle glfw_SetWindowTitle;
internal static glfwSetWindowUserPointer glfw_SetWindowUserPointer;
internal static glfwShowWindow glfw_ShowWindow;
internal static glfwSwapBuffers glfw_SwapBuffers;
internal static glfwSwapInterval glfw_SwapInterval;
internal static glfwTerminate glfw_Terminate;
internal static glfwUpdateGamepadMappings glfw_UpdateGamepadMappings;
internal static glfwVulkanSupported glfw_VulkanSupported;
internal static glfwWaitEvents glfw_WaitEvents;
internal static glfwWaitEventsTimeout glfw_WaitEventsTimeout;
internal static glfwWindowHint glfw_WindowHint;
internal static glfwWindowHintString glfw_WindowHintString;
internal static glfwWindowShouldClose glfw_WindowShouldClose;
//internal [NotNull] static glfwGetInstanceProcAddress glfw_GetInstanceProcAddress;
//internal [NotNull] static glfwGetPhysicalDevicePresentationSupport glfw_GetPhysicalDevicePresentationSupport;
//internal [NotNull] static glfwCreateWindowSurface glfw_CreateWindowSurface;
#endregion
#region api
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int Init() => glfw_Init();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void Terminate() => glfw_Terminate();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void InitHint(int hint, int value) => glfw_InitHint(hint, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetVersion(int* major, int* minor, int* rev) => glfw_GetVersion(major, minor, rev);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetVersionString() => glfw_GetVersionString();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetError(byte** description) => glfw_GetError(description);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWerrorfun SetErrorCallback(GLFWerrorfun callback) => glfw_SetErrorCallback(callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr* GetMonitors(int* count) => glfw_GetMonitors(count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetPrimaryMonitor() => glfw_GetPrimaryMonitor();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorPos(IntPtr monitor, int* xpos, int* ypos) => glfw_GetMonitorPos(monitor, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height) => glfw_GetMonitorWorkarea(monitor, xpos, ypos, width, height);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM) => glfw_GetMonitorPhysicalSize(monitor, widthMM, heightMM);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale) => glfw_GetMonitorContentScale(monitor, xscale, yscale);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetMonitorName(IntPtr monitor) => glfw_GetMonitorName(monitor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetMonitorUserPointer(IntPtr monitor, void* pointer) => glfw_SetMonitorUserPointer(monitor, pointer);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetMonitorUserPointer(IntPtr monitor) => glfw_GetMonitorUserPointer(monitor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWmonitorfun SetMonitorCallback(GLFWmonitorfun callback) => glfw_SetMonitorCallback(callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvidmode* GetVideoModes(IntPtr monitor, int* count) => glfw_GetVideoModes(monitor, count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvidmode* GetVideoMode(IntPtr monitor) => glfw_GetVideoMode(monitor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetGamma(IntPtr monitor, float gamma) => glfw_SetGamma(monitor, gamma);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWgammaramp* GetGammaRamp(IntPtr monitor) => glfw_GetGammaRamp(monitor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp) => glfw_SetGammaRamp(monitor, ramp);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DefaultWindowHints() => glfw_DefaultWindowHints();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WindowHint(int hint, int value) => glfw_WindowHint(hint, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WindowHintString(int hint, byte* value) => glfw_WindowHintString(hint, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr CreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share) => glfw_CreateWindow(width, height, title, monitor, share);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DestroyWindow(IntPtr window) => glfw_DestroyWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int WindowShouldClose(IntPtr window) => glfw_WindowShouldClose(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowShouldClose(IntPtr window, int value) => glfw_SetWindowShouldClose(window, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowTitle(IntPtr window, byte* title) => glfw_SetWindowTitle(window, title);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowIcon(IntPtr window, int count, GLFWimage* images) => glfw_SetWindowIcon(window, count, images);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowPos(IntPtr window, int* xpos, int* ypos) => glfw_GetWindowPos(window, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowPos(IntPtr window, int xpos, int ypos) => glfw_SetWindowPos(window, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowSize(IntPtr window, int* width, int* height) => glfw_GetWindowSize(window, width, height);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight) => glfw_SetWindowSizeLimits(window, minwidth, minheight, maxwidth, maxheight);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowAspectRatio(IntPtr window, int numer, int denom) => glfw_SetWindowAspectRatio(window, numer, denom);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowSize(IntPtr window, int width, int height) => glfw_SetWindowSize(window, width, height);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetFramebufferSize(IntPtr window, int* width, int* height) => glfw_GetFramebufferSize(window, width, height);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom) => glfw_GetWindowFrameSize(window, left, top, right, bottom);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowContentScale(IntPtr window, float* xscale, float* yscale) => glfw_GetWindowContentScale(window, xscale, yscale);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe float GetWindowOpacity(IntPtr window) => glfw_GetWindowOpacity(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowOpacity(IntPtr window, float opacity) => glfw_SetWindowOpacity(window, opacity);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void IconifyWindow(IntPtr window) => glfw_IconifyWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void RestoreWindow(IntPtr window) => glfw_RestoreWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void MaximizeWindow(IntPtr window) => glfw_MaximizeWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void ShowWindow(IntPtr window) => glfw_ShowWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void HideWindow(IntPtr window) => glfw_HideWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void FocusWindow(IntPtr window) => glfw_FocusWindow(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void RequestWindowAttention(IntPtr window) => glfw_RequestWindowAttention(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetWindowMonitor(IntPtr window) => glfw_GetWindowMonitor(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate) => glfw_SetWindowMonitor(window, monitor, xpos, ypos, width, height, refreshRate);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetWindowAttrib(IntPtr window, int attrib) => glfw_GetWindowAttrib(window, attrib);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowAttrib(IntPtr window, int attrib, int value) => glfw_SetWindowAttrib(window, attrib, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowUserPointer(IntPtr window, void* pointer) => glfw_SetWindowUserPointer(window, pointer);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetWindowUserPointer(IntPtr window) => glfw_GetWindowUserPointer(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowposfun SetWindowPosCallback(IntPtr window, GLFWwindowposfun callback) => glfw_SetWindowPosCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowsizefun SetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback) => glfw_SetWindowSizeCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowclosefun SetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback) => glfw_SetWindowCloseCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowrefreshfun SetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback) => glfw_SetWindowRefreshCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowfocusfun SetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback) => glfw_SetWindowFocusCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowiconifyfun SetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback) => glfw_SetWindowIconifyCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowmaximizefun SetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback) => glfw_SetWindowMaximizeCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe FramebuffersizeHandler SetFramebufferSizeCallback(IntPtr window, FrameBufferSizeHandler callback) => glfw_SetFramebufferSizeCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowcontentscalefun SetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback) => glfw_SetWindowContentScaleCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void PollEvents() => glfw_PollEvents();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WaitEvents() => glfw_WaitEvents();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WaitEventsTimeout(double timeout) => glfw_WaitEventsTimeout(timeout);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void PostEmptyEvent() => glfw_PostEmptyEvent();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetInputMode(IntPtr window, int mode) => glfw_GetInputMode(window, mode);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetInputMode(IntPtr window, int mode, int value) => glfw_SetInputMode(window, mode, value);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int RawMouseMotionSupported() => glfw_RawMouseMotionSupported();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetKeyName(int key, int scancode) => glfw_GetKeyName(key, scancode);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetKeyScancode(int key) => glfw_GetKeyScancode(key);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe KeyStatus GetKey(IntPtr window, int key) => glfw_GetKey(window, key);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetMouseButton(IntPtr window, int button) => glfw_GetMouseButton(window, button);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetCursorPos(IntPtr window, double* xpos, double* ypos) => glfw_GetCursorPos(window, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetCursorPos(IntPtr window, double xpos, double ypos) => glfw_SetCursorPos(window, xpos, ypos);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursor* CreateCursor(GLFWimage* image, int xhot, int yhot) => glfw_CreateCursor(image, xhot, yhot);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursor* CreateStandardCursor(int shape) => glfw_CreateStandardCursor(shape);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DestroyCursor(GLFWcursor* cursor) => glfw_DestroyCursor(cursor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetCursor(IntPtr window, GLFWcursor* cursor) => glfw_SetCursor(window, cursor);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWkeyfun SetKeyCallback(IntPtr window, GLFWkeyfun callback) => glfw_SetKeyCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcharfun SetCharCallback(IntPtr window, GLFWcharfun callback) => glfw_SetCharCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcharmodsfun SetCharModsCallback(IntPtr window, GLFWcharmodsfun callback) => glfw_SetCharModsCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWmousebuttonfun SetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback) => glfw_SetMouseButtonCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursorposfun SetCursorPosCallback(IntPtr window, GLFWcursorposfun callback) => glfw_SetCursorPosCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursorenterfun SetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback) => glfw_SetCursorEnterCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWscrollfun SetScrollCallback(IntPtr window, GLFWscrollfun callback) => glfw_SetScrollCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWdropfun SetDropCallback(IntPtr window, GLFWdropfun callback) => glfw_SetDropCallback(window, callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int JoystickPresent(int jid) => glfw_JoystickPresent(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe float* GetJoystickAxes(int jid, int* count) => glfw_GetJoystickAxes(jid, count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickButtons(int jid, int* count) => glfw_GetJoystickButtons(jid, count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickHats(int jid, int* count) => glfw_GetJoystickHats(jid, count);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickName(int jid) => glfw_GetJoystickName(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickGUID(int jid) => glfw_GetJoystickGUID(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetJoystickUserPointer(int jid, void* pointer) => glfw_SetJoystickUserPointer(jid, pointer);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetJoystickUserPointer(int jid) => glfw_GetJoystickUserPointer(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int JoystickIsGamepad(int jid) => glfw_JoystickIsGamepad(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWjoystickfun SetJoystickCallback(GLFWjoystickfun callback) => glfw_SetJoystickCallback(callback);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int UpdateGamepadMappings(byte* str) => glfw_UpdateGamepadMappings(str);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetGamepadName(int jid) => glfw_GetGamepadName(jid);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetGamepadState(int jid, GLFWgamepadstate* state) => glfw_GetGamepadState(jid, state);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetClipboardString(IntPtr window, byte* str) => glfw_SetClipboardString(window, str);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetClipboardString(IntPtr window) => glfw_GetClipboardString(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe double GetTime() => glfw_GetTime();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetTime(double time) => glfw_SetTime(time);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe ulong* GetTimerValue() => glfw_GetTimerValue();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe ulong* GetTimerFrequency() => glfw_GetTimerFrequency();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void MakeContextCurrent(IntPtr window) => glfw_MakeContextCurrent(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetCurrentContext() => glfw_GetCurrentContext();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SwapBuffers(IntPtr window) => glfw_SwapBuffers(window);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SwapInterval(int interval) => glfw_SwapInterval(interval);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int ExtensionSupported(byte* extension) => glfw_ExtensionSupported(extension);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetProcAddress(string procname) => glfw_GetProcAddress(procname);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int VulkanSupported() => glfw_VulkanSupported();
[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte** GetRequiredInstanceExtensions(uint* count) => glfw_GetRequiredInstanceExtensions(count);
//[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvkproc GetInstanceProcAddress(VkInstance instance, byte* procname)=>glfwGetInstanceProcAddress(instance, procname)
//[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily) => glfw_GetPhysicalDevicePresentationSupport(instance, device, queuefamily);
//[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe VkResult CreateWindowSurface(VkInstance instance, IntPtr window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface)=>glfwCreateWindowSurface(instance, window, allocator, surface)
#endregion
}
}
+72 -152
View File
@@ -1,5 +1,8 @@
using StgSharp.Controlling;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
namespace StgSharp.Graphics
@@ -7,33 +10,40 @@ namespace StgSharp.Graphics
public static unsafe partial class Graphic
{
internal static void ConvertAPI<TDele>(IntPtr funcPtr, TDele dele)
internal static TDele ConvertAPI<TDele>(IntPtr funcPtr)
{
if (funcPtr == IntPtr.Zero)
{
InternalIO.InternalWriteLog(
$"Failed to convert {nameof(funcPtr)} to {nameof(dele)}, the function pointer is zero.",
LogType.Error);
return;
}
if (dele != null)
{
InternalIO.InternalWriteLog(
$"Failed to convert {nameof(funcPtr)} to {nameof(dele)}, the delegate is not null.",
LogType.Error);
return;
throw new Exception("Failed to convert api, the function pointer is zero.");
}
try
{
dele = Marshal.GetDelegateForFunctionPointer<TDele>(funcPtr);
InternalIO.InternalWriteLog($"Successfully lod glfw api {typeof(TDele)}", LogType.Info);
return Marshal.GetDelegateForFunctionPointer<TDele>(funcPtr);
}
catch (Exception ex)
{
InternalIO.InternalWriteLog(
$"Failed to convert {nameof(funcPtr)} to {nameof(dele)}, the runtime throws an exception:\n" +
$"{ex.Message}",
LogType.Error);
throw;
}
}
internal static Delegate ConvertAPI(IntPtr funcPtr, Type T)
{
if (funcPtr == IntPtr.Zero)
{
throw new Exception("Failed to convert api, the function pointer is zero.");
}
try
{
return Marshal.GetDelegateForFunctionPointer(funcPtr, T);
}
catch (Exception ex)
{
throw;
}
}
@@ -44,147 +54,57 @@ namespace StgSharp.Graphics
/// </summary>
public static void InitGL(int majorVersion, int minorVersion)
{
if (InternalIO.glfw_Init == null)
if (InternalIO.glfw == null)
{
IntPtr ptr1 = Marshal.AllocHGlobal(sizeof(GLFWapi));
GLFWapi* glfw = (GLFWapi*)ptr1;
//GLFWapi* ptr = (GLFWapi*)InternalIO.InternalInitGL(majorVersion, minorVersion, glfw);
IntPtr packptr = InternalIO.InternalInitGL(majorVersion, minorVersion, glfw);
glfwpack pack = Marshal.PtrToStructure<glfwpack>(packptr);
#if DEBUG
#endif
InternalIO.glfw_CreateWindow = pack.glfw_CreateWindow;
/*
try
{
ConvertAPI(pack.Init, InternalIO.glfw_Init);
ConvertAPI(pack.Terminate, InternalIO.glfw_Terminate);
ConvertAPI(pack.InitHint, InternalIO.glfw_InitHint);
ConvertAPI(pack.GetVersion, InternalIO.glfw_GetVersion);
ConvertAPI(pack.GetVersionString, InternalIO.glfw_GetVersionString);
ConvertAPI(pack.GetError, InternalIO.glfw_GetError);
ConvertAPI(pack.SetErrorCallback, InternalIO.glfw_SetErrorCallback);
ConvertAPI(pack.GetMonitors, InternalIO.glfw_GetMonitors);
ConvertAPI(pack.GetPrimaryMonitor, InternalIO.glfw_GetPrimaryMonitor);
ConvertAPI(pack.GetMonitorPos, InternalIO.glfw_GetMonitorPos);
ConvertAPI(pack.GetMonitorWorkarea, InternalIO.glfw_GetMonitorWorkarea);
ConvertAPI(pack.GetMonitorPhysicalSize, InternalIO.glfw_GetMonitorPhysicalSize);
ConvertAPI(pack.GetMonitorContentScale, InternalIO.glfw_GetMonitorContentScale);
ConvertAPI(pack.GetMonitorName, InternalIO.glfw_GetMonitorName);
ConvertAPI(pack.SetMonitorUserPointer, InternalIO.glfw_SetMonitorUserPointer);
ConvertAPI(pack.GetMonitorUserPointer, InternalIO.glfw_GetMonitorUserPointer);
ConvertAPI(pack.SetMonitorCallback, InternalIO.glfw_SetMonitorCallback);
ConvertAPI(pack.GetVideoModes, InternalIO.glfw_GetVideoModes);
ConvertAPI(pack.GetVideoMode, InternalIO.glfw_GetVideoMode);
ConvertAPI(pack.SetGamma, InternalIO.glfw_SetGamma);
ConvertAPI(pack.GetGammaRamp, InternalIO.glfw_GetGammaRamp);
ConvertAPI(pack.SetGammaRamp, InternalIO.glfw_SetGammaRamp);
ConvertAPI(pack.DefaultWindowHints, InternalIO.glfw_DefaultWindowHints);
ConvertAPI(pack.WindowHint, InternalIO.glfw_WindowHint);
ConvertAPI(pack.WindowHintString, InternalIO.glfw_WindowHintString);
ConvertAPI(pack.CreateWindow, InternalIO.glfw_CreateWindow);
ConvertAPI(pack.DestroyWindow, InternalIO.glfw_DestroyWindow);
ConvertAPI(pack.WindowShouldClose, InternalIO.glfw_WindowShouldClose);
ConvertAPI(pack.SetWindowShouldClose, InternalIO.glfw_SetWindowShouldClose);
ConvertAPI(pack.SetWindowTitle, InternalIO.glfw_SetWindowTitle);
ConvertAPI(pack.SetWindowIcon, InternalIO.glfw_SetWindowIcon);
ConvertAPI(pack.GetWindowPos, InternalIO.glfw_GetWindowPos);
ConvertAPI(pack.SetWindowPos, InternalIO.glfw_SetWindowPos);
ConvertAPI(pack.GetWindowSize, InternalIO.glfw_GetWindowSize);
ConvertAPI(pack.SetWindowSizeLimits, InternalIO.glfw_SetWindowSizeLimits);
ConvertAPI(pack.SetWindowAspectRatio, InternalIO.glfw_SetWindowAspectRatio);
ConvertAPI(pack.SetWindowSize, InternalIO.glfw_SetWindowSize);
ConvertAPI(pack.GetFramebufferSize, InternalIO.glfw_GetFramebufferSize);
ConvertAPI(pack.GetWindowFrameSize, InternalIO.glfw_GetWindowFrameSize);
ConvertAPI(pack.GetWindowContentScale, InternalIO.glfw_GetWindowContentScale);
ConvertAPI(pack.GetWindowOpacity, InternalIO.glfw_GetWindowOpacity);
ConvertAPI(pack.SetWindowOpacity, InternalIO.glfw_SetWindowOpacity);
ConvertAPI(pack.IconifyWindow, InternalIO.glfw_IconifyWindow);
ConvertAPI(pack.RestoreWindow, InternalIO.glfw_RestoreWindow);
ConvertAPI(pack.MaximizeWindow, InternalIO.glfw_MaximizeWindow);
ConvertAPI(pack.ShowWindow, InternalIO.glfw_ShowWindow);
ConvertAPI(pack.HideWindow, InternalIO.glfw_HideWindow);
ConvertAPI(pack.FocusWindow, InternalIO.glfw_FocusWindow);
ConvertAPI(pack.RequestWindowAttention, InternalIO.glfw_RequestWindowAttention);
ConvertAPI(pack.GetWindowMonitor, InternalIO.glfw_GetWindowMonitor);
ConvertAPI(pack.SetWindowMonitor, InternalIO.glfw_SetWindowMonitor);
ConvertAPI(pack.GetWindowAttrib, InternalIO.glfw_GetWindowAttrib);
ConvertAPI(pack.SetWindowAttrib, InternalIO.glfw_SetWindowAttrib);
ConvertAPI(pack.SetWindowUserPointer, InternalIO.glfw_SetWindowUserPointer);
ConvertAPI(pack.GetWindowUserPointer, InternalIO.glfw_GetWindowUserPointer);
ConvertAPI(pack.SetWindowPosCallback, InternalIO.glfw_SetWindowPosCallback);
ConvertAPI(pack.SetWindowSizeCallback, InternalIO.glfw_SetWindowSizeCallback);
ConvertAPI(pack.SetWindowCloseCallback, InternalIO.glfw_SetWindowCloseCallback);
ConvertAPI(pack.SetWindowRefreshCallback, InternalIO.glfw_SetWindowRefreshCallback);
ConvertAPI(pack.SetWindowFocusCallback, InternalIO.glfw_SetWindowFocusCallback);
ConvertAPI(pack.SetWindowIconifyCallback, InternalIO.glfw_SetWindowIconifyCallback);
ConvertAPI(pack.SetWindowMaximizeCallback, InternalIO.glfw_SetWindowMaximizeCallback);
ConvertAPI(pack.SetFramebufferSizeCallback, InternalIO.glfw_SetFramebufferSizeCallback);
ConvertAPI(pack.SetWindowContentScaleCallback, InternalIO.glfw_SetWindowContentScaleCallback);
ConvertAPI(pack.PollEvents, InternalIO.glfw_PollEvents);
ConvertAPI(pack.WaitEvents, InternalIO.glfw_WaitEvents);
ConvertAPI(pack.WaitEventsTimeout, InternalIO.glfw_WaitEventsTimeout);
ConvertAPI(pack.PostEmptyEvent, InternalIO.glfw_PostEmptyEvent);
ConvertAPI(pack.GetInputMode, InternalIO.glfw_GetInputMode);
ConvertAPI(pack.SetInputMode, InternalIO.glfw_SetInputMode);
ConvertAPI(pack.RawMouseMotionSupported, InternalIO.glfw_RawMouseMotionSupported);
ConvertAPI(pack.GetKeyName, InternalIO.glfw_GetKeyName);
ConvertAPI(pack.GetKeyScancode, InternalIO.glfw_GetKeyScancode);
ConvertAPI(pack.GetKey, InternalIO.glfw_GetKey);
ConvertAPI(pack.GetMouseButton, InternalIO.glfw_GetMouseButton);
ConvertAPI(pack.GetCursorPos, InternalIO.glfw_GetCursorPos);
ConvertAPI(pack.SetCursorPos, InternalIO.glfw_SetCursorPos);
ConvertAPI(pack.CreateCursor, InternalIO.glfw_CreateCursor);
ConvertAPI(pack.CreateStandardCursor, InternalIO.glfw_CreateStandardCursor);
ConvertAPI(pack.DestroyCursor, InternalIO.glfw_DestroyCursor);
ConvertAPI(pack.SetCursor, InternalIO.glfw_SetCursor);
ConvertAPI(pack.SetKeyCallback, InternalIO.glfw_SetKeyCallback);
ConvertAPI(pack.SetCharCallback, InternalIO.glfw_SetCharCallback);
ConvertAPI(pack.SetCharModsCallback, InternalIO.glfw_SetCharModsCallback);
ConvertAPI(pack.SetMouseButtonCallback, InternalIO.glfw_SetMouseButtonCallback);
ConvertAPI(pack.SetCursorPosCallback, InternalIO.glfw_SetCursorPosCallback);
ConvertAPI(pack.SetCursorEnterCallback, InternalIO.glfw_SetCursorEnterCallback);
ConvertAPI(pack.SetScrollCallback, InternalIO.glfw_SetScrollCallback);
ConvertAPI(pack.SetDropCallback, InternalIO.glfw_SetDropCallback);
ConvertAPI(pack.JoystickPresent, InternalIO.glfw_JoystickPresent);
ConvertAPI(pack.GetJoystickAxes, InternalIO.glfw_GetJoystickAxes);
ConvertAPI(pack.GetJoystickButtons, InternalIO.glfw_GetJoystickButtons);
ConvertAPI(pack.GetJoystickHats, InternalIO.glfw_GetJoystickHats);
ConvertAPI(pack.GetJoystickName, InternalIO.glfw_GetJoystickName);
ConvertAPI(pack.GetJoystickGUID, InternalIO.glfw_GetJoystickGUID);
ConvertAPI(pack.SetJoystickUserPointer, InternalIO.glfw_SetJoystickUserPointer);
ConvertAPI(pack.GetJoystickUserPointer, InternalIO.glfw_GetJoystickUserPointer);
ConvertAPI(pack.JoystickIsGamepad, InternalIO.glfw_JoystickIsGamepad);
ConvertAPI(pack.SetJoystickCallback, InternalIO.glfw_SetJoystickCallback);
ConvertAPI(pack.UpdateGamepadMappings, InternalIO.glfw_UpdateGamepadMappings);
ConvertAPI(pack.GetGamepadName, InternalIO.glfw_GetGamepadName);
ConvertAPI(pack.GetGamepadState, InternalIO.glfw_GetGamepadState);
ConvertAPI(pack.SetClipboardString, InternalIO.glfw_SetClipboardString);
ConvertAPI(pack.GetClipboardString, InternalIO.glfw_GetClipboardString);
ConvertAPI(pack.GetTime, InternalIO.glfw_GetTime);
ConvertAPI(pack.SetTime, InternalIO.glfw_SetTime);
ConvertAPI(pack.GetTimerValue, InternalIO.glfw_GetTimerValue);
ConvertAPI(pack.GetTimerFrequency, InternalIO.glfw_GetTimerFrequency);
ConvertAPI(pack.MakeContextCurrent, InternalIO.glfw_MakeContextCurrent);
ConvertAPI(pack.GetCurrentContext, InternalIO.glfw_GetCurrentContext);
ConvertAPI(pack.SwapBuffers, InternalIO.glfw_SwapBuffers);
ConvertAPI(pack.SwapInterval, InternalIO.glfw_SwapInterval);
ConvertAPI(pack.ExtensionSupported, InternalIO.glfw_ExtensionSupported);
ConvertAPI(pack.GetProcAddress, InternalIO.glfw_GetProcAddress);
ConvertAPI(pack.VulkanSupported, InternalIO.glfw_VulkanSupported);
ConvertAPI(pack.GetRequiredInstanceExtensions, InternalIO.glfw_GetRequiredInstanceExtensions);
//ConvertAPI(pack.GetInstanceProcAddress, InternalIO.glfw_GetInstanceProcAddress);
//ConvertAPI(pack.GetPhysicalDevicePresentationSupport, InternalIO.glfw_GetPhysicalDevicePresentationSupport);
//ConvertAPI(pack.CreateWindowSurface, InternalIO.glfw_CreateWindowSurface);
InternalIO.glfw = new glFramework_PInvoke();
InternalIO.glfw.Init();
//InternalIO.InternalWriteLog("Successfully load GLFW APIs. StgSharp is now working on p/invoke mode", LogType.Info);
}
catch (Exception sig)
{
string log = $"Failed to load GLFW APIs by P/Invoke," +
$"StgSharp will switch to delegate mode. The detailed info is:\n" +
$"{sig.Message}\n";
if (InternalIO.SSClibPtr == default)
{
InternalIO.SSClibPtr =
InternalIO.InternalLoadWINlib(InternalIO.SSC_libname + ".dll");
}
InternalIO.glfw = new glFramework_Delegate();
InternalIO.SSClibPtr = InternalIO.InternalLoadWINlib(InternalIO.SSC_libname);
FieldInfo[] glfwApis = typeof(glFramework_Delegate).GetFields();
foreach (FieldInfo item in glfwApis)
{
if (item.FieldType.BaseType == typeof(Delegate))
{
try
{
IntPtr funcptr = InternalIO.InternalGetWINproc(
InternalIO.SSClibPtr, item.Name);
item.SetValue(null, ConvertAPI(funcptr, item.FieldType));
log += $"Successfully load GLFW API called {item.Name}";
}
catch (Exception ex)
{
log += $"Failed to load GLFW API called {item.Name}, the detailed info is\n" +
$"{ex.Message}";
continue;
}
}
}
InternalIO.InternalWriteLog(log, LogType.Warning);
}
*/
}
else
{
throw new Exception("Do not init GL twice");
InternalIO.InternalWriteLog("Attempt to load GLFW APIs twice", LogType.Warning);
}
InternalIO.InternalInitGL(majorVersion, minorVersion);
}