add from giga-device, new branch added

This commit is contained in:
Nitload Youmu
2025-08-21 16:51:25 +08:00
commit 43bbc06bbb
1296 changed files with 264186 additions and 0 deletions
@@ -0,0 +1,156 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="glfw_function_table.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
namespace StgSharp.Internal
{
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct GLFWFunctionTable
{
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, int, IntPtr> glfwCreateCursor;
public delegate* unmanaged[Cdecl]<int, IntPtr> glfwCreateStandardCursor;
public delegate* unmanaged[Cdecl]<int, int, byte*, IntPtr, IntPtr, IntPtr> glfwCreateWindow;
public delegate* unmanaged[Cdecl]<void> glfwDefaultWindowHints;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwDestroyCursor;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwDestroyWindow;
public delegate* unmanaged[Cdecl]<byte*, int> glfwExtensionSupported;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwFocusWindow;
public delegate* unmanaged[Cdecl]<IntPtr, byte*> glfwGetClipboardString;
public delegate* unmanaged[Cdecl]<IntPtr> glfwGetCurrentContext;
public delegate* unmanaged[Cdecl]<IntPtr, double*, double*, void> glfwGetCursorPos;
public delegate* unmanaged[Cdecl]<byte**, int> glfwGetError;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetFramebufferSize;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetGamepadName;
public delegate* unmanaged[Cdecl]<int, IntPtr, int> glfwGetGamepadState;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetGammaRamp;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetInputMode;
public delegate* unmanaged[Cdecl]<int, int*, float*> glfwGetJoystickAxes;
public delegate* unmanaged[Cdecl]<int, int*, byte*> glfwGetJoystickButtons;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetJoystickGUID;
public delegate* unmanaged[Cdecl]<int, int*, byte*> glfwGetJoystickHats;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetJoystickName;
public delegate* unmanaged[Cdecl]<int, void*> glfwGetJoystickUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetKey;
public delegate* unmanaged[Cdecl]<int, int, byte*> glfwGetKeyName;
public delegate* unmanaged[Cdecl]<int, int> glfwGetKeyScancode;
public delegate* unmanaged[Cdecl]<IntPtr, float*, float*, void> glfwGetMonitorContentScale;
public delegate* unmanaged[Cdecl]<IntPtr, byte*> glfwGetMonitorName;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetMonitorPhysicalSize;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetMonitorPos;
public delegate* unmanaged[Cdecl]<int*, IntPtr*> glfwGetMonitors;
public delegate* unmanaged[Cdecl]<IntPtr, void*> glfwGetMonitorUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, int*, int*, void> glfwGetMonitorWorkarea;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetMouseButton;
public delegate* unmanaged[Cdecl]<IntPtr> glfwGetPrimaryMonitor;
public delegate* unmanaged[Cdecl]<byte*, IntPtr> glfwGetProcAddress;
public delegate* unmanaged[Cdecl]<uint*, byte**> glfwGetRequiredInstanceExtensions;
public delegate* unmanaged[Cdecl]<double> glfwGetTime;
public delegate* unmanaged[Cdecl]<ulong> glfwGetTimerFrequency;
public delegate* unmanaged[Cdecl]<ulong> glfwGetTimerValue;
public delegate* unmanaged[Cdecl]<byte*> glfwGetVersionString;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetVideoMode;
public delegate* unmanaged[Cdecl]<IntPtr, int*, IntPtr*> glfwGetVideoModes;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetWindowAttrib;
public delegate* unmanaged[Cdecl]<IntPtr, float*, float*, void> glfwGetWindowContentScale;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, int*, int*, void> glfwGetWindowFrameSize;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetWindowMonitor;
public delegate* unmanaged[Cdecl]<IntPtr, float> glfwGetWindowOpacity;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetWindowPos;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetWindowSize;
public delegate* unmanaged[Cdecl]<IntPtr, void*> glfwGetWindowUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwHideWindow;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwIconifyWindow;
public delegate* unmanaged[Cdecl]<int> glfwInit;
public delegate* unmanaged[Cdecl]<int, int, void> glfwInitHint;
public delegate* unmanaged[Cdecl]<int, int> glfwJoystickIsGamepad;
public delegate* unmanaged[Cdecl]<int, int> glfwJoystickPresent;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwMakeContextCurrent;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwMaximizeWindow;
public delegate* unmanaged[Cdecl]<void> glfwPollEvents;
public delegate* unmanaged[Cdecl]<void> glfwPostEmptyEvent;
public delegate* unmanaged[Cdecl]<int> glfwRawMouseMotionSupported;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwRequestWindowAttention;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwRestoreWindow;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, uint, void>, delegate* unmanaged[Cdecl]<IntPtr, uint, void>> glfwSetCharCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, uint, int, void>, delegate* unmanaged[Cdecl]<IntPtr, uint, int, void>> glfwSetCharModsCallback;
public delegate* unmanaged[Cdecl]<IntPtr, byte*, void> glfwSetClipboardString;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> glfwSetCursor;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetCursorEnterCallback;
public delegate* unmanaged[Cdecl]<IntPtr, double, double, void> glfwSetCursorPos;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>> glfwSetCursorPosCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetFramebufferSizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, float, void> glfwSetGamma;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> glfwSetGammaRamp;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetInputMode;
public delegate* unmanaged[Cdecl]<delegate* unmanaged[Cdecl]<int, int, void>, delegate* unmanaged[Cdecl]<int, int, void>> glfwSetJoystickCallback;
public delegate* unmanaged[Cdecl]<int, void*, void> glfwSetJoystickUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void>> glfwSetKeyCallback;
public delegate* unmanaged[Cdecl]<delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetMonitorCallback;
public delegate* unmanaged[Cdecl]<IntPtr, void*, void> glfwSetMonitorUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, void>> glfwSetMouseButtonCallback;
public delegate* unmanaged[Cdecl]<double, void> glfwSetTime;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowAspectRatio;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowAttrib;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, void>, delegate* unmanaged[Cdecl]<IntPtr, void>> glfwSetWindowCloseCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, float, float, void>, delegate* unmanaged[Cdecl]<IntPtr, float, float, void>> glfwSetWindowContentScaleCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowFocusCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, IntPtr, void> glfwSetWindowIcon;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowIconifyCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowMaximizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, int, int, int, int, void> glfwSetWindowMonitor;
public delegate* unmanaged[Cdecl]<IntPtr, float, void> glfwSetWindowOpacity;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowPos;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, void>, delegate* unmanaged[Cdecl]<IntPtr, void>> glfwSetWindowRefreshCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, void> glfwSetWindowShouldClose;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowSize;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void> glfwSetWindowSizeLimits;
public delegate* unmanaged[Cdecl]<IntPtr, byte*, void> glfwSetWindowTitle;
public delegate* unmanaged[Cdecl]<IntPtr, void*, void> glfwSetWindowUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwShowWindow;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwSwapBuffers;
public delegate* unmanaged[Cdecl]<int, void> glfwSwapInterval;
public delegate* unmanaged[Cdecl]<void> glfwTerminate;
public delegate* unmanaged[Cdecl]<byte*, int> glfwUpdateGamepadMappings;
public delegate* unmanaged[Cdecl]<int> glfwVulkanSupported;
public delegate* unmanaged[Cdecl]<void> glfwWaitEvents;
public delegate* unmanaged[Cdecl]<double, void> glfwWaitEventsTimeout;
public delegate* unmanaged[Cdecl]<int, int, void> glfwWindowHint;
public delegate* unmanaged[Cdecl]<int, byte*, void> glfwWindowHintString;
public delegate* unmanaged[Cdecl]<IntPtr, int> glfwWindowShouldClose;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged<Cdecl]<IntPtr,
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged<Cdecl]<IntPtr,
int, int, void>> glfwSetWindowPosCallback;
int, int, void>> glfwSetWindowSizeCallback;
}
}
@@ -0,0 +1,120 @@
#ifndef GLFW_FUNCTION_TABLE_H
#define GLFW_FUNCTION_TABLE_H
#include "glfw3_no_comments.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct GLFWFunctionTable {
void (*glfwDefaultWindowHints)(void);
void (*glfwDestroyCursor)(GLFWcursor* cursor);
void (*glfwDestroyWindow)(GLFWwindow* window);
void (*glfwFocusWindow)(GLFWwindow* window);
const char* (*glfwGetClipboardString)(GLFWwindow* window);
GLFWwindow* (*glfwGetCurrentContext)(void);
void (*glfwGetCursorPos)(GLFWwindow* window, double* xpos, double* ypos);
int (*glfwGetError)(const char** description);
void (*glfwGetFramebufferSize)(GLFWwindow* window, int* width, int* height);
const char* (*glfwGetGamepadName)(int jid);
int (*glfwGetGamepadState)(int jid, GLFWgamepadstate* state);
const GLFWgammaramp* (*glfwGetGammaRamp)(GLFWmonitor* monitor);
int (*glfwGetInputMode)(GLFWwindow* window, int mode);
const float* (*glfwGetJoystickAxes)(int jid, int* count);
const unsigned char* (*glfwGetJoystickButtons)(int jid, int* count);
const char* (*glfwGetJoystickGUID)(int jid);
const unsigned char* (*glfwGetJoystickHats)(int jid, int* count);
const char* (*glfwGetJoystickName)(int jid);
void* (*glfwGetJoystickUserPointer)(int jid);
int (*glfwGetKey)(GLFWwindow* window, int key);
const char* (*glfwGetKeyName)(int key, int scancode);
int (*glfwGetKeyScancode)(int key);
void (*glfwGetMonitorContentScale)(GLFWmonitor* monitor, float* xscale, float* yscale);
const char* (*glfwGetMonitorName)(GLFWmonitor* monitor);
void (*glfwGetMonitorPhysicalSize)(GLFWmonitor* monitor, int* widthMM, int* heightMM);
void (*glfwGetMonitorPos)(GLFWmonitor* monitor, int* xpos, int* ypos);
GLFWmonitor** (*glfwGetMonitors)(int* count);
void* (*glfwGetMonitorUserPointer)(GLFWmonitor* monitor);
void (*glfwGetMonitorWorkarea)(GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
int (*glfwGetMouseButton)(GLFWwindow* window, int button);
GLFWmonitor* (*glfwGetPrimaryMonitor)(void);
double (*glfwGetTime)(void);
uint64_t (*glfwGetTimerFrequency)(void);
uint64_t (*glfwGetTimerValue)(void);
const char* (*glfwGetVersionString)(void);
const GLFWvidmode* (*glfwGetVideoMode)(GLFWmonitor* monitor);
const GLFWvidmode* (*glfwGetVideoModes)(GLFWmonitor* monitor, int* count);
int (*glfwGetWindowAttrib)(GLFWwindow* window, int attrib);
void (*glfwGetWindowContentScale)(GLFWwindow* window, float* xscale, float* yscale);
void (*glfwGetWindowFrameSize)(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
GLFWmonitor* (*glfwGetWindowMonitor)(GLFWwindow* window);
float (*glfwGetWindowOpacity)(GLFWwindow* window);
void (*glfwGetWindowPos)(GLFWwindow* window, int* xpos, int* ypos);
void (*glfwGetWindowSize)(GLFWwindow* window, int* width, int* height);
void* (*glfwGetWindowUserPointer)(GLFWwindow* window);
void (*glfwHideWindow)(GLFWwindow* window);
void (*glfwIconifyWindow)(GLFWwindow* window);
int (*glfwInit)(void);
void (*glfwInitHint)(int hint, int value);
void (*glfwMakeContextCurrent)(GLFWwindow* window);
void (*glfwMaximizeWindow)(GLFWwindow* window);
void (*glfwPollEvents)(void);
void (*glfwPostEmptyEvent)(void);
void (*glfwRequestWindowAttention)(GLFWwindow* window);
int (*glfwRawMouseMotionSupported)(void);
void (*glfwRestoreWindow)(GLFWwindow* window);
void (*glfwSetClipboardString)(GLFWwindow* window, const char* string);
GLFWcharfun (*glfwSetCharCallback)(GLFWwindow* window, GLFWcharfun callback);
GLFWcharmodsfun (*glfwSetCharModsCallback)(GLFWwindow* window, GLFWcharmodsfun callback);
void (*glfwSetCursor)(GLFWwindow* window, GLFWcursor* cursor);
GLFWcursorenterfun (*glfwSetCursorEnterCallback)(GLFWwindow* window, GLFWcursorenterfun callback);
void (*glfwSetCursorPos)(GLFWwindow* window, double xpos, double ypos);
GLFWcursorposfun (*glfwSetCursorPosCallback)(GLFWwindow* window, GLFWcursorposfun callback);
GLFWdropfun (*glfwSetDropCallback)(GLFWwindow* window, GLFWdropfun callback);
void (*glfwSetGammaRamp)(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
GLFWjoystickfun (*glfwSetJoystickCallback)(GLFWjoystickfun callback);
void (*glfwSetJoystickUserPointer)(int jid, void* pointer);
GLFWkeyfun (*glfwSetKeyCallback)(GLFWwindow* window, GLFWkeyfun callback);
void (*glfwSetMonitorUserPointer)(GLFWmonitor* monitor, void* pointer);
GLFWmonitorfun (*glfwSetMonitorCallback)(GLFWmonitorfun callback);
void (*glfwSetTime)(double time);
void (*glfwSetWindowAspectRatio)(GLFWwindow* window, int numer, int denom);
void (*glfwSetWindowAttrib)(GLFWwindow* window, int attrib, int value);
GLFWwindowclosefun (*glfwSetWindowCloseCallback)(GLFWwindow* window, GLFWwindowclosefun callback);
void (*glfwSetWindowIcon)(GLFWwindow* window, int count, const GLFWimage* images);
GLFWwindowiconifyfun (*glfwSetWindowIconifyCallback)(GLFWwindow* window, GLFWwindowiconifyfun callback);
GLFWwindowfocusfun (*glfwSetWindowFocusCallback)(GLFWwindow* window, GLFWwindowfocusfun callback);
GLFWframebuffersizefun (*glfwSetFramebufferSizeCallback)(GLFWwindow* window, GLFWframebuffersizefun callback);
GLFWwindowmaximizefun (*glfwSetWindowMaximizeCallback)(GLFWwindow* window, GLFWwindowmaximizefun callback);
void (*glfwSetWindowMonitor)(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
GLFWmousebuttonfun (*glfwSetMouseButtonCallback)(GLFWwindow* window, GLFWmousebuttonfun callback);
void (*glfwSetWindowOpacity)(GLFWwindow* window, float opacity);
GLFWwindowposfun (*glfwSetWindowPosCallback)(GLFWwindow* window, GLFWwindowposfun callback);
void (*glfwSetWindowPos)(GLFWwindow* window, int xpos, int ypos);
GLFWscrollfun (*glfwSetScrollCallback)(GLFWwindow* window, GLFWscrollfun callback);
void (*glfwSetWindowShouldClose)(GLFWwindow* window, int value);
void (*glfwSetWindowSizeLimits)(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
GLFWwindowsizefun (*glfwSetWindowSizeCallback)(GLFWwindow* window, GLFWwindowsizefun callback);
void (*glfwSetWindowSize)(GLFWwindow* window, int width, int height);
void (*glfwSetWindowTitle)(GLFWwindow* window, const char* title);
void (*glfwSetWindowUserPointer)(GLFWwindow* window, void* pointer);
GLFWwindowrefreshfun (*glfwSetWindowRefreshCallback)(GLFWwindow* window, GLFWwindowrefreshfun callback);
GLFWwindowcontentscalefun (*glfwSetWindowContentScaleCallback)(GLFWwindow* window, GLFWwindowcontentscalefun callback);
void (*glfwSwapBuffers)(GLFWwindow* window);
void (*glfwSwapInterval)(int interval);
void (*glfwTerminate)(void);
int (*glfwUpdateGamepadMappings)(const char* string);
void (*glfwWaitEvents)(void);
void (*glfwWaitEventsTimeout)(double timeout);
int (*glfwVulkanSupported)(void);
int (*glfwWindowShouldClose)(GLFWwindow* window);
} GLFWFunctionTable;
void LoadGLFWFunctions(GLFWFunctionTable* table);
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,123 @@
#ifndef GLFW_FUNCTION_TABLE_H
#define GLFW_FUNCTION_TABLE_H
#include "glfw3_no_comments.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct GLFWFunctionTable {
void (*glfwCreateCursor)(GLFWimage* image, int xhot, int yhot);
GLFWcursor* (*glfwCreateStandardCursor)(int shape);
GLFWwindow* (*glfwCreateWindow)(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
void (*glfwDefaultWindowHints)(void);
void (*glfwDestroyCursor)(GLFWcursor* cursor);
void (*glfwDestroyWindow)(GLFWwindow* window);
void (*glfwFocusWindow)(GLFWwindow* window);
const char* (*glfwGetClipboardString)(GLFWwindow* window);
GLFWwindow* (*glfwGetCurrentContext)(void);
void (*glfwGetCursorPos)(GLFWwindow* window, double* xpos, double* ypos);
int (*glfwGetError)(const char** description);
void (*glfwGetFramebufferSize)(GLFWwindow* window, int* width, int* height);
const char* (*glfwGetGamepadName)(int jid);
int (*glfwGetGamepadState)(int jid, GLFWgamepadstate* state);
const GLFWgammaramp* (*glfwGetGammaRamp)(GLFWmonitor* monitor);
int (*glfwGetInputMode)(GLFWwindow* window, int mode);
const float* (*glfwGetJoystickAxes)(int jid, int* count);
const unsigned char* (*glfwGetJoystickButtons)(int jid, int* count);
const char* (*glfwGetJoystickGUID)(int jid);
const unsigned char* (*glfwGetJoystickHats)(int jid, int* count);
const char* (*glfwGetJoystickName)(int jid);
void* (*glfwGetJoystickUserPointer)(int jid);
int (*glfwGetKey)(GLFWwindow* window, int key);
const char* (*glfwGetKeyName)(int key, int scancode);
int (*glfwGetKeyScancode)(int key);
void (*glfwGetMonitorContentScale)(GLFWmonitor* monitor, float* xscale, float* yscale);
const char* (*glfwGetMonitorName)(GLFWmonitor* monitor);
void (*glfwGetMonitorPhysicalSize)(GLFWmonitor* monitor, int* widthMM, int* heightMM);
void (*glfwGetMonitorPos)(GLFWmonitor* monitor, int* xpos, int* ypos);
GLFWmonitor** (*glfwGetMonitors)(int* count);
void* (*glfwGetMonitorUserPointer)(GLFWmonitor* monitor);
void (*glfwGetMonitorWorkarea)(GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
int (*glfwGetMouseButton)(GLFWwindow* window, int button);
GLFWmonitor* (*glfwGetPrimaryMonitor)(void);
double (*glfwGetTime)(void);
uint64_t (*glfwGetTimerFrequency)(void);
uint64_t (*glfwGetTimerValue)(void);
const char* (*glfwGetVersionString)(void);
const GLFWvidmode* (*glfwGetVideoMode)(GLFWmonitor* monitor);
const GLFWvidmode* (*glfwGetVideoModes)(GLFWmonitor* monitor, int* count);
int (*glfwGetWindowAttrib)(GLFWwindow* window, int attrib);
void (*glfwGetWindowContentScale)(GLFWwindow* window, float* xscale, float* yscale);
void (*glfwGetWindowFrameSize)(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
GLFWmonitor* (*glfwGetWindowMonitor)(GLFWwindow* window);
float (*glfwGetWindowOpacity)(GLFWwindow* window);
void (*glfwGetWindowPos)(GLFWwindow* window, int* xpos, int* ypos);
void (*glfwGetWindowSize)(GLFWwindow* window, int* width, int* height);
void* (*glfwGetWindowUserPointer)(GLFWwindow* window);
void (*glfwHideWindow)(GLFWwindow* window);
void (*glfwIconifyWindow)(GLFWwindow* window);
int (*glfwInit)(void);
void (*glfwInitHint)(int hint, int value);
void (*glfwMakeContextCurrent)(GLFWwindow* window);
void (*glfwMaximizeWindow)(GLFWwindow* window);
void (*glfwPollEvents)(void);
void (*glfwPostEmptyEvent)(void);
void (*glfwRequestWindowAttention)(GLFWwindow* window);
int (*glfwRawMouseMotionSupported)(void);
void (*glfwRestoreWindow)(GLFWwindow* window);
void (*glfwSetClipboardString)(GLFWwindow* window, const char* string);
GLFWcharfun (*glfwSetCharCallback)(GLFWwindow* window, GLFWcharfun callback);
GLFWcharmodsfun (*glfwSetCharModsCallback)(GLFWwindow* window, GLFWcharmodsfun callback);
void (*glfwSetCursor)(GLFWwindow* window, GLFWcursor* cursor);
GLFWcursorenterfun (*glfwSetCursorEnterCallback)(GLFWwindow* window, GLFWcursorenterfun callback);
void (*glfwSetCursorPos)(GLFWwindow* window, double xpos, double ypos);
GLFWcursorposfun (*glfwSetCursorPosCallback)(GLFWwindow* window, GLFWcursorposfun callback);
GLFWdropfun (*glfwSetDropCallback)(GLFWwindow* window, GLFWdropfun callback);
void (*glfwSetGammaRamp)(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
GLFWjoystickfun (*glfwSetJoystickCallback)(GLFWjoystickfun callback);
void (*glfwSetJoystickUserPointer)(int jid, void* pointer);
GLFWkeyfun (*glfwSetKeyCallback)(GLFWwindow* window, GLFWkeyfun callback);
void (*glfwSetMonitorUserPointer)(GLFWmonitor* monitor, void* pointer);
GLFWmonitorfun (*glfwSetMonitorCallback)(GLFWmonitorfun callback);
void (*glfwSetTime)(double time);
void (*glfwSetWindowAspectRatio)(GLFWwindow* window, int numer, int denom);
void (*glfwSetWindowAttrib)(GLFWwindow* window, int attrib, int value);
GLFWwindowclosefun (*glfwSetWindowCloseCallback)(GLFWwindow* window, GLFWwindowclosefun callback);
void (*glfwSetWindowIcon)(GLFWwindow* window, int count, const GLFWimage* images);
GLFWwindowiconifyfun (*glfwSetWindowIconifyCallback)(GLFWwindow* window, GLFWwindowiconifyfun callback);
GLFWwindowfocusfun (*glfwSetWindowFocusCallback)(GLFWwindow* window, GLFWwindowfocusfun callback);
GLFWframebuffersizefun (*glfwSetFramebufferSizeCallback)(GLFWwindow* window, GLFWframebuffersizefun callback);
GLFWwindowmaximizefun (*glfwSetWindowMaximizeCallback)(GLFWwindow* window, GLFWwindowmaximizefun callback);
void (*glfwSetWindowMonitor)(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
GLFWmousebuttonfun (*glfwSetMouseButtonCallback)(GLFWwindow* window, GLFWmousebuttonfun callback);
void (*glfwSetWindowOpacity)(GLFWwindow* window, float opacity);
GLFWwindowposfun (*glfwSetWindowPosCallback)(GLFWwindow* window, GLFWwindowposfun callback);
void (*glfwSetWindowPos)(GLFWwindow* window, int xpos, int ypos);
GLFWscrollfun (*glfwSetScrollCallback)(GLFWwindow* window, GLFWscrollfun callback);
void (*glfwSetWindowShouldClose)(GLFWwindow* window, int value);
void (*glfwSetWindowSizeLimits)(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
GLFWwindowsizefun (*glfwSetWindowSizeCallback)(GLFWwindow* window, GLFWwindowsizefun callback);
void (*glfwSetWindowSize)(GLFWwindow* window, int width, int height);
void (*glfwSetWindowTitle)(GLFWwindow* window, const char* title);
void (*glfwSetWindowUserPointer)(GLFWwindow* window, void* pointer);
GLFWwindowrefreshfun (*glfwSetWindowRefreshCallback)(GLFWwindow* window, GLFWwindowrefreshfun callback);
GLFWwindowcontentscalefun (*glfwSetWindowContentScaleCallback)(GLFWwindow* window, GLFWwindowcontentscalefun callback);
void (*glfwSwapBuffers)(GLFWwindow* window);
void (*glfwSwapInterval)(int interval);
void (*glfwTerminate)(void);
int (*glfwUpdateGamepadMappings)(const char* string);
void (*glfwWaitEvents)(void);
void (*glfwWaitEventsTimeout)(double timeout);
int (*glfwVulkanSupported)(void);
int (*glfwWindowShouldClose)(GLFWwindow* window);
} GLFWFunctionTable;
void LoadGLFWFunctions(GLFWFunctionTable* table);
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,158 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="glfw_function_table.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
namespace StgSharp.Internal
{
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct GLFWFunctionTable
{
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, int, IntPtr> glfwCreateCursor;
public delegate* unmanaged[Cdecl]<int, IntPtr> glfwCreateStandardCursor;
public delegate* unmanaged[Cdecl]<int, int, byte*, IntPtr, IntPtr, IntPtr> glfwCreateWindow;
public delegate* unmanaged[Cdecl]<void> glfwDefaultWindowHints;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwDestroyCursor;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwDestroyWindow;
public delegate* unmanaged[Cdecl]<byte*, int> glfwExtensionSupported;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwFocusWindow;
public delegate* unmanaged[Cdecl]<IntPtr, byte*> glfwGetClipboardString;
public delegate* unmanaged[Cdecl]<IntPtr> glfwGetCurrentContext;
public delegate* unmanaged[Cdecl]<IntPtr, double*, double*, void> glfwGetCursorPos;
public delegate* unmanaged[Cdecl]<byte**, int> glfwGetError;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetFramebufferSize;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetGamepadName;
public delegate* unmanaged[Cdecl]<int, IntPtr, int> glfwGetGamepadState;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetGammaRamp;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetInputMode;
public delegate* unmanaged[Cdecl]<int, int*, float*> glfwGetJoystickAxes;
public delegate* unmanaged[Cdecl]<int, int*, byte*> glfwGetJoystickButtons;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetJoystickGUID;
public delegate* unmanaged[Cdecl]<int, int*, byte*> glfwGetJoystickHats;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetJoystickName;
public delegate* unmanaged[Cdecl]<int, void*> glfwGetJoystickUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetKey;
public delegate* unmanaged[Cdecl]<int, int, byte*> glfwGetKeyName;
public delegate* unmanaged[Cdecl]<int, int> glfwGetKeyScancode;
public delegate* unmanaged[Cdecl]<IntPtr, float*, float*, void> glfwGetMonitorContentScale;
public delegate* unmanaged[Cdecl]<IntPtr, byte*> glfwGetMonitorName;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetMonitorPhysicalSize;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetMonitorPos;
public delegate* unmanaged[Cdecl]<int*, IntPtr*> glfwGetMonitors;
public delegate* unmanaged[Cdecl]<IntPtr, void*> glfwGetMonitorUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, int*, int*, void> glfwGetMonitorWorkarea;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetMouseButton;
public delegate* unmanaged[Cdecl]<IntPtr> glfwGetPrimaryMonitor;
public delegate* unmanaged[Cdecl]<byte*, IntPtr> glfwGetProcAddress;
public delegate* unmanaged[Cdecl]<uint*, byte**> glfwGetRequiredInstanceExtensions;
public delegate* unmanaged[Cdecl]<double> glfwGetTime;
public delegate* unmanaged[Cdecl]<ulong> glfwGetTimerFrequency;
public delegate* unmanaged[Cdecl]<ulong> glfwGetTimerValue;
public delegate* unmanaged[Cdecl]<byte*> glfwGetVersionString;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetVideoMode;
public delegate* unmanaged[Cdecl]<IntPtr, int*, IntPtr*> glfwGetVideoModes;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetWindowAttrib;
public delegate* unmanaged[Cdecl]<IntPtr, float*, float*, void> glfwGetWindowContentScale;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, int*, int*, void> glfwGetWindowFrameSize;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetWindowMonitor;
public delegate* unmanaged[Cdecl]<IntPtr, float> glfwGetWindowOpacity;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetWindowPos;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetWindowSize;
public delegate* unmanaged[Cdecl]<IntPtr, void*> glfwGetWindowUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwHideWindow;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwIconifyWindow;
public delegate* unmanaged[Cdecl]<int> glfwInit;
public delegate* unmanaged[Cdecl]<int, int, void> glfwInitHint;
public delegate* unmanaged[Cdecl]<int, int> glfwJoystickIsGamepad;
public delegate* unmanaged[Cdecl]<int, int> glfwJoystickPresent;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwMakeContextCurrent;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwMaximizeWindow;
public delegate* unmanaged[Cdecl]<void> glfwPollEvents;
public delegate* unmanaged[Cdecl]<void> glfwPostEmptyEvent;
public delegate* unmanaged[Cdecl]<int> glfwRawMouseMotionSupported;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwRequestWindowAttention;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwRestoreWindow;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, uint, void>, delegate* unmanaged[Cdecl]<IntPtr, uint, void>> glfwSetCharCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, uint, int, void>, delegate* unmanaged[Cdecl]<IntPtr, uint, int, void>> glfwSetCharModsCallback;
public delegate* unmanaged[Cdecl]<IntPtr, byte*, void> glfwSetClipboardString;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> glfwSetCursor;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetCursorEnterCallback;
public delegate* unmanaged[Cdecl]<IntPtr, double, double, void> glfwSetCursorPos;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>> glfwSetCursorPosCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetFramebufferSizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, float, void> glfwSetGamma;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> glfwSetGammaRamp;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetInputMode;
public delegate* unmanaged[Cdecl]<delegate* unmanaged[Cdecl]<int, int, void>, delegate* unmanaged[Cdecl]<int, int, void>> glfwSetJoystickCallback;
public delegate* unmanaged[Cdecl]<int, void*, void> glfwSetJoystickUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void>> glfwSetKeyCallback;
public delegate* unmanaged[Cdecl]<delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetMonitorCallback;
public delegate* unmanaged[Cdecl]<IntPtr, void*, void> glfwSetMonitorUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, void>> glfwSetMouseButtonCallback;
public delegate* unmanaged[Cdecl]<double, void> glfwSetTime;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowAspectRatio;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowAttrib;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, void>, delegate* unmanaged[Cdecl]<IntPtr, void>> glfwSetWindowCloseCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, float, float, void>, delegate* unmanaged[Cdecl]<IntPtr, float, float, void>> glfwSetWindowContentScaleCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowFocusCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, IntPtr, void> glfwSetWindowIcon;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowIconifyCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowMaximizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, int, int, int, int, void> glfwSetWindowMonitor;
public delegate* unmanaged[Cdecl]<IntPtr, float, void> glfwSetWindowOpacity;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowPos;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetWindowPosCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, void>, delegate* unmanaged[Cdecl]<IntPtr, void>> glfwSetWindowRefreshCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, void> glfwSetWindowShouldClose;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowSize;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetWindowSizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void> glfwSetWindowSizeLimits;
public delegate* unmanaged[Cdecl]<IntPtr, byte*, void> glfwSetWindowTitle;
public delegate* unmanaged[Cdecl]<IntPtr, void*, void> glfwSetWindowUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwShowWindow;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwSwapBuffers;
public delegate* unmanaged[Cdecl]<int, void> glfwSwapInterval;
public delegate* unmanaged[Cdecl]<void> glfwTerminate;
public delegate* unmanaged[Cdecl]<byte*, int> glfwUpdateGamepadMappings;
public delegate* unmanaged[Cdecl]<int> glfwVulkanSupported;
public delegate* unmanaged[Cdecl]<void> glfwWaitEvents;
public delegate* unmanaged[Cdecl]<double, void> glfwWaitEventsTimeout;
public delegate* unmanaged[Cdecl]<int, int, void> glfwWindowHint;
public delegate* unmanaged[Cdecl]<int, byte*, void> glfwWindowHintString;
public delegate* unmanaged[Cdecl]<IntPtr, int> glfwWindowShouldClose;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>, delegate* unmanaged<Cdecl]<IntPtr,
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, byte**, void>, delegate* unmanaged<Cdecl]<IntPtr,
double, double, void>> glfwSetScrollCallback;
int, byte**, void>> glfwSetDropCallback;
}
}
@@ -0,0 +1,107 @@
#include "glfw_function_table.h"
#include <string.h>
void LoadGLFWFunctions(GLFWFunctionTable* table) {
memset(table, 0, sizeof(GLFWFunctionTable));
table->glfwDefaultWindowHints = glfwDefaultWindowHints;
table->glfwDestroyCursor = glfwDestroyCursor;
table->glfwDestroyWindow = glfwDestroyWindow;
table->glfwFocusWindow = glfwFocusWindow;
table->glfwGetClipboardString = glfwGetClipboardString;
table->glfwGetCurrentContext = glfwGetCurrentContext;
table->glfwGetCursorPos = glfwGetCursorPos;
table->glfwGetError = glfwGetError;
table->glfwGetFramebufferSize = glfwGetFramebufferSize;
table->glfwGetGamepadName = glfwGetGamepadName;
table->glfwGetGamepadState = glfwGetGamepadState;
table->glfwGetGammaRamp = glfwGetGammaRamp;
table->glfwGetInputMode = glfwGetInputMode;
table->glfwGetJoystickAxes = glfwGetJoystickAxes;
table->glfwGetJoystickButtons = glfwGetJoystickButtons;
table->glfwGetJoystickGUID = glfwGetJoystickGUID;
table->glfwGetJoystickHats = glfwGetJoystickHats;
table->glfwGetJoystickName = glfwGetJoystickName;
table->glfwGetJoystickUserPointer = glfwGetJoystickUserPointer;
table->glfwGetKey = glfwGetKey;
table->glfwGetKeyName = glfwGetKeyName;
table->glfwGetKeyScancode = glfwGetKeyScancode;
table->glfwGetMonitorContentScale = glfwGetMonitorContentScale;
table->glfwGetMonitorName = glfwGetMonitorName;
table->glfwGetMonitorPhysicalSize = glfwGetMonitorPhysicalSize;
table->glfwGetMonitorPos = glfwGetMonitorPos;
table->glfwGetMonitors = glfwGetMonitors;
table->glfwGetMonitorUserPointer = glfwGetMonitorUserPointer;
table->glfwGetMonitorWorkarea = glfwGetMonitorWorkarea;
table->glfwGetMouseButton = glfwGetMouseButton;
table->glfwGetPrimaryMonitor = glfwGetPrimaryMonitor;
table->glfwGetTime = glfwGetTime;
table->glfwGetTimerFrequency = glfwGetTimerFrequency;
table->glfwGetTimerValue = glfwGetTimerValue;
table->glfwGetVersionString = glfwGetVersionString;
table->glfwGetVideoMode = glfwGetVideoMode;
table->glfwGetVideoModes = glfwGetVideoModes;
table->glfwGetWindowAttrib = glfwGetWindowAttrib;
table->glfwGetWindowContentScale = glfwGetWindowContentScale;
table->glfwGetWindowFrameSize = glfwGetWindowFrameSize;
table->glfwGetWindowMonitor = glfwGetWindowMonitor;
table->glfwGetWindowOpacity = glfwGetWindowOpacity;
table->glfwGetWindowPos = glfwGetWindowPos;
table->glfwGetWindowSize = glfwGetWindowSize;
table->glfwGetWindowUserPointer = glfwGetWindowUserPointer;
table->glfwHideWindow = glfwHideWindow;
table->glfwIconifyWindow = glfwIconifyWindow;
table->glfwInit = glfwInit;
table->glfwInitHint = glfwInitHint;
table->glfwMakeContextCurrent = glfwMakeContextCurrent;
table->glfwMaximizeWindow = glfwMaximizeWindow;
table->glfwPollEvents = glfwPollEvents;
table->glfwPostEmptyEvent = glfwPostEmptyEvent;
table->glfwRequestWindowAttention = glfwRequestWindowAttention;
table->glfwRawMouseMotionSupported = glfwRawMouseMotionSupported;
table->glfwRestoreWindow = glfwRestoreWindow;
table->glfwSetClipboardString = glfwSetClipboardString;
table->glfwSetCharCallback = glfwSetCharCallback;
table->glfwSetCharModsCallback = glfwSetCharModsCallback;
table->glfwSetCursor = glfwSetCursor;
table->glfwSetCursorEnterCallback = glfwSetCursorEnterCallback;
table->glfwSetCursorPos = glfwSetCursorPos;
table->glfwSetCursorPosCallback = glfwSetCursorPosCallback;
table->glfwSetDropCallback = glfwSetDropCallback;
table->glfwSetGammaRamp = glfwSetGammaRamp;
table->glfwSetJoystickCallback = glfwSetJoystickCallback;
table->glfwSetJoystickUserPointer = glfwSetJoystickUserPointer;
table->glfwSetKeyCallback = glfwSetKeyCallback;
table->glfwSetMonitorUserPointer = glfwSetMonitorUserPointer;
table->glfwSetMonitorCallback = glfwSetMonitorCallback;
table->glfwSetTime = glfwSetTime;
table->glfwSetWindowAspectRatio = glfwSetWindowAspectRatio;
table->glfwSetWindowAttrib = glfwSetWindowAttrib;
table->glfwSetWindowCloseCallback = glfwSetWindowCloseCallback;
table->glfwSetWindowIcon = glfwSetWindowIcon;
table->glfwSetWindowIconifyCallback = glfwSetWindowIconifyCallback;
table->glfwSetWindowFocusCallback = glfwSetWindowFocusCallback;
table->glfwSetFramebufferSizeCallback = glfwSetFramebufferSizeCallback;
table->glfwSetWindowMaximizeCallback = glfwSetWindowMaximizeCallback;
table->glfwSetWindowMonitor = glfwSetWindowMonitor;
table->glfwSetMouseButtonCallback = glfwSetMouseButtonCallback;
table->glfwSetWindowOpacity = glfwSetWindowOpacity;
table->glfwSetWindowPosCallback = glfwSetWindowPosCallback;
table->glfwSetWindowPos = glfwSetWindowPos;
table->glfwSetScrollCallback = glfwSetScrollCallback;
table->glfwSetWindowShouldClose = glfwSetWindowShouldClose;
table->glfwSetWindowSizeLimits = glfwSetWindowSizeLimits;
table->glfwSetWindowSizeCallback = glfwSetWindowSizeCallback;
table->glfwSetWindowSize = glfwSetWindowSize;
table->glfwSetWindowTitle = glfwSetWindowTitle;
table->glfwSetWindowUserPointer = glfwSetWindowUserPointer;
table->glfwSetWindowRefreshCallback = glfwSetWindowRefreshCallback;
table->glfwSetWindowContentScaleCallback = glfwSetWindowContentScaleCallback;
table->glfwSwapBuffers = glfwSwapBuffers;
table->glfwSwapInterval = glfwSwapInterval;
table->glfwTerminate = glfwTerminate;
table->glfwUpdateGamepadMappings = glfwUpdateGamepadMappings;
table->glfwWaitEvents = glfwWaitEvents;
table->glfwWaitEventsTimeout = glfwWaitEventsTimeout;
table->glfwVulkanSupported = glfwVulkanSupported;
table->glfwWindowShouldClose = glfwWindowShouldClose;
}
@@ -0,0 +1,3 @@
#include "StgSharpNative.h"
#include "glfw_function_table.h"
#include <string.h>
@@ -0,0 +1,158 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="glfw_function_table.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
namespace StgSharp.Internal
{
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct GLFWFunctionTable
{
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, int, IntPtr> glfwCreateCursor;
public delegate* unmanaged[Cdecl]<int, IntPtr> glfwCreateStandardCursor;
public delegate* unmanaged[Cdecl]<int, int, byte*, IntPtr, IntPtr, IntPtr> glfwCreateWindow;
public delegate* unmanaged[Cdecl]<void> glfwDefaultWindowHints;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwDestroyCursor;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwDestroyWindow;
public delegate* unmanaged[Cdecl]<byte*, int> glfwExtensionSupported;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwFocusWindow;
public delegate* unmanaged[Cdecl]<IntPtr, byte*> glfwGetClipboardString;
public delegate* unmanaged[Cdecl]<IntPtr> glfwGetCurrentContext;
public delegate* unmanaged[Cdecl]<IntPtr, double*, double*, void> glfwGetCursorPos;
public delegate* unmanaged[Cdecl]<byte**, int> glfwGetError;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetFramebufferSize;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetGamepadName;
public delegate* unmanaged[Cdecl]<int, IntPtr, int> glfwGetGamepadState;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetGammaRamp;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetInputMode;
public delegate* unmanaged[Cdecl]<int, int*, float*> glfwGetJoystickAxes;
public delegate* unmanaged[Cdecl]<int, int*, byte*> glfwGetJoystickButtons;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetJoystickGUID;
public delegate* unmanaged[Cdecl]<int, int*, byte*> glfwGetJoystickHats;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetJoystickName;
public delegate* unmanaged[Cdecl]<int, void*> glfwGetJoystickUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetKey;
public delegate* unmanaged[Cdecl]<int, int, byte*> glfwGetKeyName;
public delegate* unmanaged[Cdecl]<int, int> glfwGetKeyScancode;
public delegate* unmanaged[Cdecl]<IntPtr, float*, float*, void> glfwGetMonitorContentScale;
public delegate* unmanaged[Cdecl]<IntPtr, byte*> glfwGetMonitorName;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetMonitorPhysicalSize;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetMonitorPos;
public delegate* unmanaged[Cdecl]<int*, IntPtr*> glfwGetMonitors;
public delegate* unmanaged[Cdecl]<IntPtr, void*> glfwGetMonitorUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, int*, int*, void> glfwGetMonitorWorkarea;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetMouseButton;
public delegate* unmanaged[Cdecl]<IntPtr> glfwGetPrimaryMonitor;
public delegate* unmanaged[Cdecl]<byte*, IntPtr> glfwGetProcAddress;
public delegate* unmanaged[Cdecl]<uint*, byte**> glfwGetRequiredInstanceExtensions;
public delegate* unmanaged[Cdecl]<double> glfwGetTime;
public delegate* unmanaged[Cdecl]<ulong> glfwGetTimerFrequency;
public delegate* unmanaged[Cdecl]<ulong> glfwGetTimerValue;
public delegate* unmanaged[Cdecl]<byte*> glfwGetVersionString;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetVideoMode;
public delegate* unmanaged[Cdecl]<IntPtr, int*, IntPtr*> glfwGetVideoModes;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetWindowAttrib;
public delegate* unmanaged[Cdecl]<IntPtr, float*, float*, void> glfwGetWindowContentScale;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, int*, int*, void> glfwGetWindowFrameSize;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetWindowMonitor;
public delegate* unmanaged[Cdecl]<IntPtr, float> glfwGetWindowOpacity;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetWindowPos;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetWindowSize;
public delegate* unmanaged[Cdecl]<IntPtr, void*> glfwGetWindowUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwHideWindow;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwIconifyWindow;
public delegate* unmanaged[Cdecl]<int> glfwInit;
public delegate* unmanaged[Cdecl]<int, int, void> glfwInitHint;
public delegate* unmanaged[Cdecl]<int, int> glfwJoystickIsGamepad;
public delegate* unmanaged[Cdecl]<int, int> glfwJoystickPresent;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwMakeContextCurrent;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwMaximizeWindow;
public delegate* unmanaged[Cdecl]<void> glfwPollEvents;
public delegate* unmanaged[Cdecl]<void> glfwPostEmptyEvent;
public delegate* unmanaged[Cdecl]<int> glfwRawMouseMotionSupported;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwRequestWindowAttention;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwRestoreWindow;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, uint, void>, delegate* unmanaged[Cdecl]<IntPtr, uint, void>> glfwSetCharCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, uint, int, void>, delegate* unmanaged[Cdecl]<IntPtr, uint, int, void>> glfwSetCharModsCallback;
public delegate* unmanaged[Cdecl]<IntPtr, byte*, void> glfwSetClipboardString;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> glfwSetCursor;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetCursorEnterCallback;
public delegate* unmanaged[Cdecl]<IntPtr, double, double, void> glfwSetCursorPos;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>> glfwSetCursorPosCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetFramebufferSizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, float, void> glfwSetGamma;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> glfwSetGammaRamp;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetInputMode;
public delegate* unmanaged[Cdecl]<delegate* unmanaged[Cdecl]<int, int, void>, delegate* unmanaged[Cdecl]<int, int, void>> glfwSetJoystickCallback;
public delegate* unmanaged[Cdecl]<int, void*, void> glfwSetJoystickUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void>> glfwSetKeyCallback;
public delegate* unmanaged[Cdecl]<delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetMonitorCallback;
public delegate* unmanaged[Cdecl]<IntPtr, void*, void> glfwSetMonitorUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, void>> glfwSetMouseButtonCallback;
public delegate* unmanaged[Cdecl]<double, void> glfwSetTime;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowAspectRatio;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowAttrib;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, void>, delegate* unmanaged[Cdecl]<IntPtr, void>> glfwSetWindowCloseCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, float, float, void>, delegate* unmanaged[Cdecl]<IntPtr, float, float, void>> glfwSetWindowContentScaleCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowFocusCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, IntPtr, void> glfwSetWindowIcon;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowIconifyCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowMaximizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, int, int, int, int, void> glfwSetWindowMonitor;
public delegate* unmanaged[Cdecl]<IntPtr, float, void> glfwSetWindowOpacity;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowPos;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetWindowPosCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, void>, delegate* unmanaged[Cdecl]<IntPtr, void>> glfwSetWindowRefreshCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, void> glfwSetWindowShouldClose;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowSize;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetWindowSizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void> glfwSetWindowSizeLimits;
public delegate* unmanaged[Cdecl]<IntPtr, byte*, void> glfwSetWindowTitle;
public delegate* unmanaged[Cdecl]<IntPtr, void*, void> glfwSetWindowUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwShowWindow;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwSwapBuffers;
public delegate* unmanaged[Cdecl]<int, void> glfwSwapInterval;
public delegate* unmanaged[Cdecl]<void> glfwTerminate;
public delegate* unmanaged[Cdecl]<byte*, int> glfwUpdateGamepadMappings;
public delegate* unmanaged[Cdecl]<int> glfwVulkanSupported;
public delegate* unmanaged[Cdecl]<void> glfwWaitEvents;
public delegate* unmanaged[Cdecl]<double, void> glfwWaitEventsTimeout;
public delegate* unmanaged[Cdecl]<int, int, void> glfwWindowHint;
public delegate* unmanaged[Cdecl]<int, byte*, void> glfwWindowHintString;
public delegate* unmanaged[Cdecl]<IntPtr, int> glfwWindowShouldClose;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>, delegate* unmanaged<Cdecl]<IntPtr,
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, byte**, void>, delegate* unmanaged<Cdecl]<IntPtr,
double, double, void>> glfwSetScrollCallback;
int, byte**, void>> glfwSetDropCallback;
}
}
@@ -0,0 +1,120 @@
#ifndef GLFW_FUNCTION_TABLE_H
#define GLFW_FUNCTION_TABLE_H
#include "glfw3_no_comments.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct GLFWFunctionTable {
void (*glfwDefaultWindowHints)(void);
void (*glfwDestroyCursor)(GLFWcursor* cursor);
void (*glfwDestroyWindow)(GLFWwindow* window);
void (*glfwFocusWindow)(GLFWwindow* window);
const char* (*glfwGetClipboardString)(GLFWwindow* window);
GLFWwindow* (*glfwGetCurrentContext)(void);
void (*glfwGetCursorPos)(GLFWwindow* window, double* xpos, double* ypos);
int (*glfwGetError)(const char** description);
void (*glfwGetFramebufferSize)(GLFWwindow* window, int* width, int* height);
const char* (*glfwGetGamepadName)(int jid);
int (*glfwGetGamepadState)(int jid, GLFWgamepadstate* state);
const GLFWgammaramp* (*glfwGetGammaRamp)(GLFWmonitor* monitor);
int (*glfwGetInputMode)(GLFWwindow* window, int mode);
const float* (*glfwGetJoystickAxes)(int jid, int* count);
const unsigned char* (*glfwGetJoystickButtons)(int jid, int* count);
const char* (*glfwGetJoystickGUID)(int jid);
const unsigned char* (*glfwGetJoystickHats)(int jid, int* count);
const char* (*glfwGetJoystickName)(int jid);
void* (*glfwGetJoystickUserPointer)(int jid);
int (*glfwGetKey)(GLFWwindow* window, int key);
const char* (*glfwGetKeyName)(int key, int scancode);
int (*glfwGetKeyScancode)(int key);
void (*glfwGetMonitorContentScale)(GLFWmonitor* monitor, float* xscale, float* yscale);
const char* (*glfwGetMonitorName)(GLFWmonitor* monitor);
void (*glfwGetMonitorPhysicalSize)(GLFWmonitor* monitor, int* widthMM, int* heightMM);
void (*glfwGetMonitorPos)(GLFWmonitor* monitor, int* xpos, int* ypos);
GLFWmonitor** (*glfwGetMonitors)(int* count);
void* (*glfwGetMonitorUserPointer)(GLFWmonitor* monitor);
void (*glfwGetMonitorWorkarea)(GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
int (*glfwGetMouseButton)(GLFWwindow* window, int button);
GLFWmonitor* (*glfwGetPrimaryMonitor)(void);
double (*glfwGetTime)(void);
uint64_t (*glfwGetTimerFrequency)(void);
uint64_t (*glfwGetTimerValue)(void);
const char* (*glfwGetVersionString)(void);
const GLFWvidmode* (*glfwGetVideoMode)(GLFWmonitor* monitor);
const GLFWvidmode* (*glfwGetVideoModes)(GLFWmonitor* monitor, int* count);
int (*glfwGetWindowAttrib)(GLFWwindow* window, int attrib);
void (*glfwGetWindowContentScale)(GLFWwindow* window, float* xscale, float* yscale);
void (*glfwGetWindowFrameSize)(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
GLFWmonitor* (*glfwGetWindowMonitor)(GLFWwindow* window);
float (*glfwGetWindowOpacity)(GLFWwindow* window);
void (*glfwGetWindowPos)(GLFWwindow* window, int* xpos, int* ypos);
void (*glfwGetWindowSize)(GLFWwindow* window, int* width, int* height);
void* (*glfwGetWindowUserPointer)(GLFWwindow* window);
void (*glfwHideWindow)(GLFWwindow* window);
void (*glfwIconifyWindow)(GLFWwindow* window);
int (*glfwInit)(void);
void (*glfwInitHint)(int hint, int value);
void (*glfwMakeContextCurrent)(GLFWwindow* window);
void (*glfwMaximizeWindow)(GLFWwindow* window);
void (*glfwPollEvents)(void);
void (*glfwPostEmptyEvent)(void);
void (*glfwRequestWindowAttention)(GLFWwindow* window);
int (*glfwRawMouseMotionSupported)(void);
void (*glfwRestoreWindow)(GLFWwindow* window);
void (*glfwSetClipboardString)(GLFWwindow* window, const char* string);
GLFWcharfun (*glfwSetCharCallback)(GLFWwindow* window, GLFWcharfun callback);
GLFWcharmodsfun (*glfwSetCharModsCallback)(GLFWwindow* window, GLFWcharmodsfun callback);
void (*glfwSetCursor)(GLFWwindow* window, GLFWcursor* cursor);
GLFWcursorenterfun (*glfwSetCursorEnterCallback)(GLFWwindow* window, GLFWcursorenterfun callback);
void (*glfwSetCursorPos)(GLFWwindow* window, double xpos, double ypos);
GLFWcursorposfun (*glfwSetCursorPosCallback)(GLFWwindow* window, GLFWcursorposfun callback);
GLFWdropfun (*glfwSetDropCallback)(GLFWwindow* window, GLFWdropfun callback);
void (*glfwSetGammaRamp)(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
GLFWjoystickfun (*glfwSetJoystickCallback)(GLFWjoystickfun callback);
void (*glfwSetJoystickUserPointer)(int jid, void* pointer);
GLFWkeyfun (*glfwSetKeyCallback)(GLFWwindow* window, GLFWkeyfun callback);
void (*glfwSetMonitorUserPointer)(GLFWmonitor* monitor, void* pointer);
GLFWmonitorfun (*glfwSetMonitorCallback)(GLFWmonitorfun callback);
void (*glfwSetTime)(double time);
void (*glfwSetWindowAspectRatio)(GLFWwindow* window, int numer, int denom);
void (*glfwSetWindowAttrib)(GLFWwindow* window, int attrib, int value);
GLFWwindowclosefun (*glfwSetWindowCloseCallback)(GLFWwindow* window, GLFWwindowclosefun callback);
void (*glfwSetWindowIcon)(GLFWwindow* window, int count, const GLFWimage* images);
GLFWwindowiconifyfun (*glfwSetWindowIconifyCallback)(GLFWwindow* window, GLFWwindowiconifyfun callback);
GLFWwindowfocusfun (*glfwSetWindowFocusCallback)(GLFWwindow* window, GLFWwindowfocusfun callback);
GLFWframebuffersizefun (*glfwSetFramebufferSizeCallback)(GLFWwindow* window, GLFWframebuffersizefun callback);
GLFWwindowmaximizefun (*glfwSetWindowMaximizeCallback)(GLFWwindow* window, GLFWwindowmaximizefun callback);
void (*glfwSetWindowMonitor)(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
GLFWmousebuttonfun (*glfwSetMouseButtonCallback)(GLFWwindow* window, GLFWmousebuttonfun callback);
void (*glfwSetWindowOpacity)(GLFWwindow* window, float opacity);
GLFWwindowposfun (*glfwSetWindowPosCallback)(GLFWwindow* window, GLFWwindowposfun callback);
void (*glfwSetWindowPos)(GLFWwindow* window, int xpos, int ypos);
GLFWscrollfun (*glfwSetScrollCallback)(GLFWwindow* window, GLFWscrollfun callback);
void (*glfwSetWindowShouldClose)(GLFWwindow* window, int value);
void (*glfwSetWindowSizeLimits)(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
GLFWwindowsizefun (*glfwSetWindowSizeCallback)(GLFWwindow* window, GLFWwindowsizefun callback);
void (*glfwSetWindowSize)(GLFWwindow* window, int width, int height);
void (*glfwSetWindowTitle)(GLFWwindow* window, const char* title);
void (*glfwSetWindowUserPointer)(GLFWwindow* window, void* pointer);
GLFWwindowrefreshfun (*glfwSetWindowRefreshCallback)(GLFWwindow* window, GLFWwindowrefreshfun callback);
GLFWwindowcontentscalefun (*glfwSetWindowContentScaleCallback)(GLFWwindow* window, GLFWwindowcontentscalefun callback);
void (*glfwSwapBuffers)(GLFWwindow* window);
void (*glfwSwapInterval)(int interval);
void (*glfwTerminate)(void);
int (*glfwUpdateGamepadMappings)(const char* string);
void (*glfwWaitEvents)(void);
void (*glfwWaitEventsTimeout)(double timeout);
int (*glfwVulkanSupported)(void);
int (*glfwWindowShouldClose)(GLFWwindow* window);
} GLFWFunctionTable;
void LoadGLFWFunctions(GLFWFunctionTable* table);
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,123 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="InternalIO.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Graphics;
using StgSharp.Graphics.OpenGL;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
namespace StgSharp.Internal
{
internal static unsafe partial class InternalIO
{
internal const string SS_errorLog =
"SS_errorlog.log";
internal const string NativeLibName =
"StgSharp.C";
internal static Dictionary<TypeCode, uint> GLtype = [];
internal static readonly GCHandle ssc_logHandle =
GCHandle.Alloc(new byte[512], GCHandleType.Pinned);
internal static IntPtr _nativeLibPtr = IntPtr.Zero;
internal static SemaphoreSlim logSyncSemaphore = new SemaphoreSlim(1, 1);
static InternalIO()
{
GLtype.Add(TypeCode.Single, glConst.FLOAT);
GLtype.Add(TypeCode.Int32, glConst.INT);
GLtype.Add(TypeCode.UInt32, glConst.UNSIGNED_INT);
GLtype.Add(TypeCode.Int16, glConst.SHORT);
GLtype.Add(TypeCode.UInt16, glConst.UNSIGNED_SHORT);
GLtype.Add(TypeCode.SByte, glConst.BYTE);
GLtype.Add(TypeCode.Byte, glConst.UNSIGNED_BYTE);
}
internal static void InternalAppendLog(string log)
{
if (!File.Exists(SS_errorLog))
{
FileStream stream = File.Create(SS_errorLog);
stream.Close();
}
using (StreamWriter logStream = File.AppendText(SS_errorLog)) {
logStream.WriteLine(log);
}
}
internal static void InternalWriteLog(string logLine, LogType logType)
{
logSyncSemaphore.Wait();
if (!File.Exists(SS_errorLog))
{
FileStream stream = File.Create(SS_errorLog);
stream.Close();
}
using (StreamWriter logStream = File.AppendText(SS_errorLog))
{
logStream.WriteLine($"{logType}\t{DateTime.Now.ToString("o")}");
logStream.WriteLine(logLine);
}
_ = logSyncSemaphore.Release();
}
internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType)
{
logSyncSemaphore.Wait();
if (!File.Exists(SS_errorLog))
{
FileStream stream = File.Create(SS_errorLog);
stream.Close();
}
using (StreamWriter logStream = File.AppendText(SS_errorLog))
{
logStream.WriteLine(beforeTime);
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
logStream.WriteLine(logLine);
}
_ = logSyncSemaphore.Release(1);
}
}
}
@@ -0,0 +1,107 @@
#include "glfw_function_table.h"
#include <string.h>
void LoadGLFWFunctions(GLFWFunctionTable* table) {
memset(table, 0, sizeof(GLFWFunctionTable));
table->glfwDefaultWindowHints = glfwDefaultWindowHints;
table->glfwDestroyCursor = glfwDestroyCursor;
table->glfwDestroyWindow = glfwDestroyWindow;
table->glfwFocusWindow = glfwFocusWindow;
table->glfwGetClipboardString = glfwGetClipboardString;
table->glfwGetCurrentContext = glfwGetCurrentContext;
table->glfwGetCursorPos = glfwGetCursorPos;
table->glfwGetError = glfwGetError;
table->glfwGetFramebufferSize = glfwGetFramebufferSize;
table->glfwGetGamepadName = glfwGetGamepadName;
table->glfwGetGamepadState = glfwGetGamepadState;
table->glfwGetGammaRamp = glfwGetGammaRamp;
table->glfwGetInputMode = glfwGetInputMode;
table->glfwGetJoystickAxes = glfwGetJoystickAxes;
table->glfwGetJoystickButtons = glfwGetJoystickButtons;
table->glfwGetJoystickGUID = glfwGetJoystickGUID;
table->glfwGetJoystickHats = glfwGetJoystickHats;
table->glfwGetJoystickName = glfwGetJoystickName;
table->glfwGetJoystickUserPointer = glfwGetJoystickUserPointer;
table->glfwGetKey = glfwGetKey;
table->glfwGetKeyName = glfwGetKeyName;
table->glfwGetKeyScancode = glfwGetKeyScancode;
table->glfwGetMonitorContentScale = glfwGetMonitorContentScale;
table->glfwGetMonitorName = glfwGetMonitorName;
table->glfwGetMonitorPhysicalSize = glfwGetMonitorPhysicalSize;
table->glfwGetMonitorPos = glfwGetMonitorPos;
table->glfwGetMonitors = glfwGetMonitors;
table->glfwGetMonitorUserPointer = glfwGetMonitorUserPointer;
table->glfwGetMonitorWorkarea = glfwGetMonitorWorkarea;
table->glfwGetMouseButton = glfwGetMouseButton;
table->glfwGetPrimaryMonitor = glfwGetPrimaryMonitor;
table->glfwGetTime = glfwGetTime;
table->glfwGetTimerFrequency = glfwGetTimerFrequency;
table->glfwGetTimerValue = glfwGetTimerValue;
table->glfwGetVersionString = glfwGetVersionString;
table->glfwGetVideoMode = glfwGetVideoMode;
table->glfwGetVideoModes = glfwGetVideoModes;
table->glfwGetWindowAttrib = glfwGetWindowAttrib;
table->glfwGetWindowContentScale = glfwGetWindowContentScale;
table->glfwGetWindowFrameSize = glfwGetWindowFrameSize;
table->glfwGetWindowMonitor = glfwGetWindowMonitor;
table->glfwGetWindowOpacity = glfwGetWindowOpacity;
table->glfwGetWindowPos = glfwGetWindowPos;
table->glfwGetWindowSize = glfwGetWindowSize;
table->glfwGetWindowUserPointer = glfwGetWindowUserPointer;
table->glfwHideWindow = glfwHideWindow;
table->glfwIconifyWindow = glfwIconifyWindow;
table->glfwInit = glfwInit;
table->glfwInitHint = glfwInitHint;
table->glfwMakeContextCurrent = glfwMakeContextCurrent;
table->glfwMaximizeWindow = glfwMaximizeWindow;
table->glfwPollEvents = glfwPollEvents;
table->glfwPostEmptyEvent = glfwPostEmptyEvent;
table->glfwRequestWindowAttention = glfwRequestWindowAttention;
table->glfwRawMouseMotionSupported = glfwRawMouseMotionSupported;
table->glfwRestoreWindow = glfwRestoreWindow;
table->glfwSetClipboardString = glfwSetClipboardString;
table->glfwSetCharCallback = glfwSetCharCallback;
table->glfwSetCharModsCallback = glfwSetCharModsCallback;
table->glfwSetCursor = glfwSetCursor;
table->glfwSetCursorEnterCallback = glfwSetCursorEnterCallback;
table->glfwSetCursorPos = glfwSetCursorPos;
table->glfwSetCursorPosCallback = glfwSetCursorPosCallback;
table->glfwSetDropCallback = glfwSetDropCallback;
table->glfwSetGammaRamp = glfwSetGammaRamp;
table->glfwSetJoystickCallback = glfwSetJoystickCallback;
table->glfwSetJoystickUserPointer = glfwSetJoystickUserPointer;
table->glfwSetKeyCallback = glfwSetKeyCallback;
table->glfwSetMonitorUserPointer = glfwSetMonitorUserPointer;
table->glfwSetMonitorCallback = glfwSetMonitorCallback;
table->glfwSetTime = glfwSetTime;
table->glfwSetWindowAspectRatio = glfwSetWindowAspectRatio;
table->glfwSetWindowAttrib = glfwSetWindowAttrib;
table->glfwSetWindowCloseCallback = glfwSetWindowCloseCallback;
table->glfwSetWindowIcon = glfwSetWindowIcon;
table->glfwSetWindowIconifyCallback = glfwSetWindowIconifyCallback;
table->glfwSetWindowFocusCallback = glfwSetWindowFocusCallback;
table->glfwSetFramebufferSizeCallback = glfwSetFramebufferSizeCallback;
table->glfwSetWindowMaximizeCallback = glfwSetWindowMaximizeCallback;
table->glfwSetWindowMonitor = glfwSetWindowMonitor;
table->glfwSetMouseButtonCallback = glfwSetMouseButtonCallback;
table->glfwSetWindowOpacity = glfwSetWindowOpacity;
table->glfwSetWindowPosCallback = glfwSetWindowPosCallback;
table->glfwSetWindowPos = glfwSetWindowPos;
table->glfwSetScrollCallback = glfwSetScrollCallback;
table->glfwSetWindowShouldClose = glfwSetWindowShouldClose;
table->glfwSetWindowSizeLimits = glfwSetWindowSizeLimits;
table->glfwSetWindowSizeCallback = glfwSetWindowSizeCallback;
table->glfwSetWindowSize = glfwSetWindowSize;
table->glfwSetWindowTitle = glfwSetWindowTitle;
table->glfwSetWindowUserPointer = glfwSetWindowUserPointer;
table->glfwSetWindowRefreshCallback = glfwSetWindowRefreshCallback;
table->glfwSetWindowContentScaleCallback = glfwSetWindowContentScaleCallback;
table->glfwSwapBuffers = glfwSwapBuffers;
table->glfwSwapInterval = glfwSwapInterval;
table->glfwTerminate = glfwTerminate;
table->glfwUpdateGamepadMappings = glfwUpdateGamepadMappings;
table->glfwWaitEvents = glfwWaitEvents;
table->glfwWaitEventsTimeout = glfwWaitEventsTimeout;
table->glfwVulkanSupported = glfwVulkanSupported;
table->glfwWindowShouldClose = glfwWindowShouldClose;
}
@@ -0,0 +1,486 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="glfw.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Graphics;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace StgSharp.Internal
{
internal unsafe partial class InternalIO
{
private static GLFWFunction _glfw;
[LibraryImport(NativeLibName, EntryPoint = "load_glfw_functions")]
internal static unsafe partial void glfwLoadLibrary(GLFWFunction* context);
internal static unsafe void LoadGlfw()
{
_glfw = new GLFWFunction();
fixed (GLFWFunction* func = &_glfw) { }
}
#region api call
[LibraryImport(NativeLibName, EntryPoint = "glfwInit")]
internal static unsafe partial int glfwInit();
[LibraryImport(NativeLibName, EntryPoint = "glfwTerminate")]
internal static unsafe partial void glfwTerminate();
[LibraryImport(NativeLibName, EntryPoint = "glfwInitHint")]
internal static unsafe partial void glfwInitHint(int hint, int value);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetVersion")]
internal static unsafe partial void glfwGetVersion(int* major, int* minor, int* rev);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetVersionString")]
internal static unsafe partial byte* glfwGetVersionString();
[LibraryImport(NativeLibName, EntryPoint = "glfwGetError")]
internal static unsafe partial int glfwGetError(byte** description);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetErrorCallback")]
internal static unsafe partial delegate*<int,byte*,void> glfwSetErrorCallback(
delegate*<int,byte*,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetMonitors")]
internal static unsafe partial IntPtr* glfwGetMonitors(int* count);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetPrimaryMonitor")]
internal static unsafe partial IntPtr glfwGetPrimaryMonitor();
[LibraryImport(NativeLibName, EntryPoint = "glfwGetMonitorPos")]
internal static unsafe partial void glfwGetMonitorPos(IntPtr monitor, int* xpos, int* ypos);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetMonitorWorkarea")]
internal static unsafe partial void glfwGetMonitorWorkarea(
IntPtr monitor,
int* xpos,
int* ypos,
int* width,
int* height);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetMonitorPhysicalSize")]
internal static unsafe partial void glfwGetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetMonitorContentScale")]
internal static unsafe partial void glfwGetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetMonitorName")]
internal static unsafe partial byte* glfwGetMonitorName(IntPtr monitor);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetMonitorUserPointer")]
internal static unsafe partial void glfwSetMonitorUserPointer(IntPtr monitor, void* pointer);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetMonitorUserPointer")]
internal static unsafe partial void* glfwGetMonitorUserPointer(IntPtr monitor);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetMonitorCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,void> glfwSetMonitorCallback(
delegate*<glfwWindow*,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetVideoModes")]
internal static unsafe partial glfwVideomode* glfwGetVideoModes(IntPtr monitor, int* count);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetVideoMode")]
internal static unsafe partial glfwVideomode* glfwGetVideoMode(IntPtr monitor);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetGamma")]
internal static unsafe partial void glfwSetGamma(IntPtr monitor, float gamma);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetGammaRamp")]
internal static unsafe partial glfwGammaramp* glfwGetGammaRamp(IntPtr monitor);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetGammaRamp")]
internal static unsafe partial void glfwSetGammaRamp(IntPtr monitor, glfwGammaramp* ramp);
[LibraryImport(NativeLibName, EntryPoint = "glfwDefaultWindowHints")]
internal static unsafe partial void glfwDefaultWindowHints();
[LibraryImport(NativeLibName, EntryPoint = "glfwWindowHint")]
internal static unsafe partial void glfwWindowHint(int hint, int value);
[LibraryImport(NativeLibName, EntryPoint = "glfwWindowHintString")]
internal static unsafe partial void glfwWindowHintString(int hint, byte* value);
[LibraryImport(NativeLibName, EntryPoint = "glfwCreateWindow")]
internal static unsafe partial IntPtr glfwCreateWindow(
int width,
int height,
byte[] title,
IntPtr monitor,
IntPtr share);
[LibraryImport(NativeLibName, EntryPoint = "glfwDestroyWindow")]
internal static unsafe partial void glfwDestroyWindow(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwWindowShouldClose")]
internal static unsafe partial int glfwWindowShouldClose(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowShouldClose")]
internal static unsafe partial void glfwSetWindowShouldClose(IntPtr window, int value);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowTitle")]
internal static unsafe partial void glfwSetWindowTitle(IntPtr window, byte* title);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowIcon")]
internal static unsafe partial void glfwSetWindowIcon(IntPtr window, int count, GLFWimage* images);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetWindowPos")]
internal static unsafe partial void glfwGetWindowPos(IntPtr window, int* xpos, int* ypos);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowPos")]
internal static unsafe partial void glfwSetWindowPos(IntPtr window, int xpos, int ypos);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetWindowSize")]
internal static unsafe partial void glfwGetWindowSize(IntPtr window, int* width, int* height);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowSizeLimits")]
internal static unsafe partial void glfwSetWindowSizeLimits(
IntPtr window,
int minwidth,
int minheight,
int maxwidth,
int maxheight);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowAspectRatio")]
internal static unsafe partial void glfwSetWindowAspectRatio(IntPtr window, int numer, int denom);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowSize")]
internal static unsafe partial void glfwSetWindowSize(IntPtr window, int width, int height);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetFramebufferSize")]
internal static unsafe partial void glfwGetFramebufferSize(IntPtr window, int* width, int* height);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetWindowFrameSize")]
internal static unsafe partial void glfwGetWindowFrameSize(
IntPtr window,
int* left,
int* top,
int* right,
int* bottom);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetWindowContentScale")]
internal static unsafe partial void glfwGetWindowContentScale(IntPtr window, float* xscale, float* yscale);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetWindowOpacity")]
internal static unsafe partial float glfwGetWindowOpacity(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowOpacity")]
internal static unsafe partial void glfwSetWindowOpacity(IntPtr window, float opacity);
[LibraryImport(NativeLibName, EntryPoint = "glfwIconifyWindow")]
internal static unsafe partial void glfwIconifyWindow(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwRestoreWindow")]
internal static unsafe partial void glfwRestoreWindow(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwMaximizeWindow")]
internal static unsafe partial void glfwMaximizeWindow(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwShowWindow")]
internal static unsafe partial void glfwShowWindow(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwHideWindow")]
internal static unsafe partial void glfwHideWindow(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwFocusWindow")]
internal static unsafe partial void glfwFocusWindow(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwRequestWindowAttention")]
internal static unsafe partial void glfwRequestWindowAttention(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetWindowMonitor")]
internal static unsafe partial IntPtr glfwGetWindowMonitor(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowMonitor")]
internal static unsafe partial void glfwSetWindowMonitor(
IntPtr window,
IntPtr monitor,
int xpos,
int ypos,
int width,
int height,
int refreshRate);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetWindowAttrib")]
internal static unsafe partial int glfwGetWindowAttrib(IntPtr window, int attrib);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowAttrib")]
internal static unsafe partial void glfwSetWindowAttrib(IntPtr window, int attrib, int value);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowUserPointer")]
internal static unsafe partial void glfwSetWindowUserPointer(IntPtr window, void* pointer);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetWindowUserPointer")]
internal static unsafe partial void* glfwGetWindowUserPointer(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowPosCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,int,void> glfwSetWindowPosCallback(
IntPtr window,
IntPtr callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowSizeCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,int,void> glfwSetWindowSizeCallback(
IntPtr window,
delegate*<glfwWindow*,int,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowCloseCallback")]
internal static unsafe partial delegate*<glfwWindow*,void> glfwSetWindowCloseCallback(
IntPtr window,
delegate*<glfwWindow*,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowRefreshCallback")]
internal static unsafe partial delegate*<glfwWindow*, void> glfwSetWindowRefreshCallback(
IntPtr window,
delegate*<glfwWindow*, void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowFocusCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,void> glfwSetWindowFocusCallback(
IntPtr window,
delegate*<glfwWindow*,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowIconifyCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,void> glfwSetWindowIconifyCallback(
IntPtr window,
delegate*<glfwWindow*,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowMaximizeCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,void> glfwSetWindowMaximizeCallback(
IntPtr window,
delegate*<glfwWindow*,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetFramebufferSizeCallback")]
internal static unsafe partial FrameBufferSizeHandler glfwSetFramebufferSizeCallback(
IntPtr window,
IntPtr callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetWindowContentScaleCallback")]
internal static unsafe partial delegate*<glfwWindow*, float,float> glfwSetWindowContentScaleCallback(
IntPtr window,
delegate*<glfwWindow*, float,float> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwPollEvents")]
internal static unsafe partial void glfwPollEvents();
[LibraryImport(NativeLibName, EntryPoint = "glfwWaitEvents")]
internal static unsafe partial void glfwWaitEvents();
[LibraryImport(NativeLibName, EntryPoint = "glfwWaitEventsTimeout")]
internal static unsafe partial void glfwWaitEventsTimeout(double timeout);
[LibraryImport(NativeLibName, EntryPoint = "glfwPostEmptyEvent")]
internal static unsafe partial void glfwPostEmptyEvent();
[LibraryImport(NativeLibName, EntryPoint = "glfwGetInputMode")]
internal static unsafe partial int glfwGetInputMode(IntPtr window, int mode);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetInputMode")]
internal static unsafe partial void glfwSetInputMode(IntPtr window, int mode, int value);
[LibraryImport(NativeLibName, EntryPoint = "glfwRawMouseMotionSupported")]
internal static unsafe partial int glfwRawMouseMotionSupported();
[LibraryImport(NativeLibName, EntryPoint = "glfwGetKeyName")]
internal static unsafe partial byte* glfwGetKeyName(int key, int scancode);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetKeyScancode")]
internal static unsafe partial int glfwGetKeyScancode(int key);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetKey")]
internal static unsafe partial KeyStatus glfwGetKey(IntPtr window, int key);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetMouseButton")]
internal static unsafe partial int glfwGetMouseButton(IntPtr window, int button);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetCursorPos")]
internal static unsafe partial void glfwGetCursorPos(IntPtr window, double* xpos, double* ypos);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetCursorPos")]
internal static unsafe partial void glfwSetCursorPos(IntPtr window, double xpos, double ypos);
[LibraryImport(NativeLibName, EntryPoint = "glfwCreateCursor")]
internal static unsafe partial GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot);
[LibraryImport(NativeLibName, EntryPoint = "glfwCreateStandardCursor")]
internal static unsafe partial GLFWcursor* glfwCreateStandardCursor(int shape);
[LibraryImport(NativeLibName, EntryPoint = "glfwDestroyCursor")]
internal static unsafe partial void glfwDestroyCursor(GLFWcursor* cursor);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetCursor")]
internal static unsafe partial void glfwSetCursor(IntPtr window, GLFWcursor* cursor);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetKeyCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,int,int,int,void> glfwSetKeyCallback(
IntPtr window,
delegate*<glfwWindow*,int,int,int,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetCharCallback")]
internal static unsafe partial delegate*<glfwWindow*,uint,void> glfwSetCharCallback(
IntPtr window,
delegate*<glfwWindow*,uint,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetCharModsCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,int,void> glfwSetCharModsCallback(
IntPtr window,
delegate*<glfwWindow*,int,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetMouseButtonCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,int,int,void> glfwSetMouseButtonCallback(
IntPtr window,
delegate*<glfwWindow*,int,int,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetCursorPosCallback")]
internal static unsafe partial delegate*<glfwWindow*,double,double,void> glfwSetCursorPosCallback(
IntPtr window,
delegate*<glfwWindow*,double,double,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetCursorEnterCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,void> glfwSetCursorEnterCallback(
IntPtr window,
delegate*<glfwWindow*,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetScrollCallback")]
internal static unsafe partial delegate*<glfwWindow*,double,double,void> glfwSetScrollCallback(
IntPtr window,
delegate*<glfwWindow*,double,double,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetDropCallback")]
internal static unsafe partial delegate*<glfwWindow*,int,byte**,void> glfwSetDropCallback(
IntPtr window,
delegate*<glfwWindow*,int,byte**,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwJoystickPresent")]
internal static unsafe partial int glfwJoystickPresent(int jid);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetJoystickAxes")]
internal static unsafe partial float* glfwGetJoystickAxes(int jid, int* count);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetJoystickButtons")]
internal static unsafe partial byte* glfwGetJoystickButtons(int jid, int* count);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetJoystickHats")]
internal static unsafe partial byte* glfwGetJoystickHats(int jid, int* count);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetJoystickName")]
internal static unsafe partial byte* glfwGetJoystickName(int jid);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetJoystickGUID")]
internal static unsafe partial byte* glfwGetJoystickGUID(int jid);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetJoystickUserPointer")]
internal static unsafe partial void glfwSetJoystickUserPointer(int jid, void* pointer);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetJoystickUserPointer")]
internal static unsafe partial void* glfwGetJoystickUserPointer(int jid);
[LibraryImport(NativeLibName, EntryPoint = "glfwJoystickIsGamepad")]
internal static unsafe partial int glfwJoystickIsGamepad(int jid);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetJoystickCallback")]
internal static unsafe partial delegate*<int,int,void> glfwSetJoystickCallback(delegate*<int,int,void> callback);
[LibraryImport(NativeLibName, EntryPoint = "glfwUpdateGamepadMappings")]
internal static unsafe partial int glfwUpdateGamepadMappings(byte* str);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetGamepadName")]
internal static unsafe partial byte* glfwGetGamepadName(int jid);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetGamepadState")]
internal static unsafe partial int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
[LibraryImport(NativeLibName, EntryPoint = "glfwSetClipboardString")]
internal static unsafe partial void glfwSetClipboardString(IntPtr window, byte* str);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetClipboardString")]
internal static unsafe partial byte* glfwGetClipboardString(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetTime")]
internal static unsafe partial double glfwGetTime();
[LibraryImport(NativeLibName, EntryPoint = "glfwSetTime")]
internal static unsafe partial void glfwSetTime(double time);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetTimerValue")]
internal static unsafe partial ulong* glfwGetTimerValue();
[LibraryImport(NativeLibName, EntryPoint = "glfwGetTimerFrequency")]
internal static unsafe partial ulong* glfwGetTimerFrequency();
[LibraryImport(NativeLibName, EntryPoint = "glfwMakeContextCurrent")]
internal static unsafe partial void glfwMakeContextCurrent(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetCurrentContext")]
internal static unsafe partial IntPtr glfwGetCurrentContext();
[LibraryImport(NativeLibName, EntryPoint = "glfwSwapBuffers")]
internal static unsafe partial void glfwSwapBuffers(IntPtr window);
[LibraryImport(NativeLibName, EntryPoint = "glfwSwapInterval")]
internal static unsafe partial void glfwSwapInterval(int interval);
[LibraryImport(NativeLibName, EntryPoint = "glfwExtensionSupported")]
internal static unsafe partial int glfwExtensionSupported(byte* extension);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
internal static unsafe partial IntPtr glfwGetProcAddress(string procname);
[LibraryImport(NativeLibName, EntryPoint = "glfwVulkanSupported")]
internal static unsafe partial int glfwVulkanSupported();
[LibraryImport(NativeLibName, EntryPoint = "glfwGetRequiredInstanceExtensions")]
internal static unsafe partial byte** glfwGetRequiredInstanceExtensions(uint* count);
/*
[LibraryImport(NativeLibName, EntryPoint = "glfwGetInstanceProcAddress")] internal static unsafe partial delegate*<void> glfwGetInstanceProcAddress(
VkInstance instance,
byte* procname);
[LibraryImport(NativeLibName, EntryPoint = "glfwGetPhysicalDevicePresentationSupport")] internal static unsafe partial int glfwGetPhysicalDevicePresentationSupport(
VkInstance instance,
VkPhysicalDevice device,
uint* queuefamily);
[LibraryImport(NativeLibName, EntryPoint = "glfwCreateWindowSurface")] internal static unsafe partial VkResult glfwCreateWindowSurface(
VkInstance instance,
glfwWindow* window,
VkAllocationCallbacks* _allocator,
VkSurfaceKHR* surface);
/**/
#endregion api call
}
}
@@ -0,0 +1,110 @@
#include "glfw_function_table.h"
#include <string.h>
void LoadGLFWFunctions(GLFWFunctionTable* table) {
memset(table, 0, sizeof(GLFWFunctionTable));
table->glfwCreateCursor = glfwCreateCursor;
table->glfwCreateStandardCursor = glfwCreateStandardCursor;
table->glfwCreateWindow = glfwCreateWindow;
table->glfwDefaultWindowHints = glfwDefaultWindowHints;
table->glfwDestroyCursor = glfwDestroyCursor;
table->glfwDestroyWindow = glfwDestroyWindow;
table->glfwFocusWindow = glfwFocusWindow;
table->glfwGetClipboardString = glfwGetClipboardString;
table->glfwGetCurrentContext = glfwGetCurrentContext;
table->glfwGetCursorPos = glfwGetCursorPos;
table->glfwGetError = glfwGetError;
table->glfwGetFramebufferSize = glfwGetFramebufferSize;
table->glfwGetGamepadName = glfwGetGamepadName;
table->glfwGetGamepadState = glfwGetGamepadState;
table->glfwGetGammaRamp = glfwGetGammaRamp;
table->glfwGetInputMode = glfwGetInputMode;
table->glfwGetJoystickAxes = glfwGetJoystickAxes;
table->glfwGetJoystickButtons = glfwGetJoystickButtons;
table->glfwGetJoystickGUID = glfwGetJoystickGUID;
table->glfwGetJoystickHats = glfwGetJoystickHats;
table->glfwGetJoystickName = glfwGetJoystickName;
table->glfwGetJoystickUserPointer = glfwGetJoystickUserPointer;
table->glfwGetKey = glfwGetKey;
table->glfwGetKeyName = glfwGetKeyName;
table->glfwGetKeyScancode = glfwGetKeyScancode;
table->glfwGetMonitorContentScale = glfwGetMonitorContentScale;
table->glfwGetMonitorName = glfwGetMonitorName;
table->glfwGetMonitorPhysicalSize = glfwGetMonitorPhysicalSize;
table->glfwGetMonitorPos = glfwGetMonitorPos;
table->glfwGetMonitors = glfwGetMonitors;
table->glfwGetMonitorUserPointer = glfwGetMonitorUserPointer;
table->glfwGetMonitorWorkarea = glfwGetMonitorWorkarea;
table->glfwGetMouseButton = glfwGetMouseButton;
table->glfwGetPrimaryMonitor = glfwGetPrimaryMonitor;
table->glfwGetTime = glfwGetTime;
table->glfwGetTimerFrequency = glfwGetTimerFrequency;
table->glfwGetTimerValue = glfwGetTimerValue;
table->glfwGetVersionString = glfwGetVersionString;
table->glfwGetVideoMode = glfwGetVideoMode;
table->glfwGetVideoModes = glfwGetVideoModes;
table->glfwGetWindowAttrib = glfwGetWindowAttrib;
table->glfwGetWindowContentScale = glfwGetWindowContentScale;
table->glfwGetWindowFrameSize = glfwGetWindowFrameSize;
table->glfwGetWindowMonitor = glfwGetWindowMonitor;
table->glfwGetWindowOpacity = glfwGetWindowOpacity;
table->glfwGetWindowPos = glfwGetWindowPos;
table->glfwGetWindowSize = glfwGetWindowSize;
table->glfwGetWindowUserPointer = glfwGetWindowUserPointer;
table->glfwHideWindow = glfwHideWindow;
table->glfwIconifyWindow = glfwIconifyWindow;
table->glfwInit = glfwInit;
table->glfwInitHint = glfwInitHint;
table->glfwMakeContextCurrent = glfwMakeContextCurrent;
table->glfwMaximizeWindow = glfwMaximizeWindow;
table->glfwPollEvents = glfwPollEvents;
table->glfwPostEmptyEvent = glfwPostEmptyEvent;
table->glfwRequestWindowAttention = glfwRequestWindowAttention;
table->glfwRawMouseMotionSupported = glfwRawMouseMotionSupported;
table->glfwRestoreWindow = glfwRestoreWindow;
table->glfwSetClipboardString = glfwSetClipboardString;
table->glfwSetCharCallback = glfwSetCharCallback;
table->glfwSetCharModsCallback = glfwSetCharModsCallback;
table->glfwSetCursor = glfwSetCursor;
table->glfwSetCursorEnterCallback = glfwSetCursorEnterCallback;
table->glfwSetCursorPos = glfwSetCursorPos;
table->glfwSetCursorPosCallback = glfwSetCursorPosCallback;
table->glfwSetDropCallback = glfwSetDropCallback;
table->glfwSetGammaRamp = glfwSetGammaRamp;
table->glfwSetJoystickCallback = glfwSetJoystickCallback;
table->glfwSetJoystickUserPointer = glfwSetJoystickUserPointer;
table->glfwSetKeyCallback = glfwSetKeyCallback;
table->glfwSetMonitorUserPointer = glfwSetMonitorUserPointer;
table->glfwSetMonitorCallback = glfwSetMonitorCallback;
table->glfwSetTime = glfwSetTime;
table->glfwSetWindowAspectRatio = glfwSetWindowAspectRatio;
table->glfwSetWindowAttrib = glfwSetWindowAttrib;
table->glfwSetWindowCloseCallback = glfwSetWindowCloseCallback;
table->glfwSetWindowIcon = glfwSetWindowIcon;
table->glfwSetWindowIconifyCallback = glfwSetWindowIconifyCallback;
table->glfwSetWindowFocusCallback = glfwSetWindowFocusCallback;
table->glfwSetFramebufferSizeCallback = glfwSetFramebufferSizeCallback;
table->glfwSetWindowMaximizeCallback = glfwSetWindowMaximizeCallback;
table->glfwSetWindowMonitor = glfwSetWindowMonitor;
table->glfwSetMouseButtonCallback = glfwSetMouseButtonCallback;
table->glfwSetWindowOpacity = glfwSetWindowOpacity;
table->glfwSetWindowPosCallback = glfwSetWindowPosCallback;
table->glfwSetWindowPos = glfwSetWindowPos;
table->glfwSetScrollCallback = glfwSetScrollCallback;
table->glfwSetWindowShouldClose = glfwSetWindowShouldClose;
table->glfwSetWindowSizeLimits = glfwSetWindowSizeLimits;
table->glfwSetWindowSizeCallback = glfwSetWindowSizeCallback;
table->glfwSetWindowSize = glfwSetWindowSize;
table->glfwSetWindowTitle = glfwSetWindowTitle;
table->glfwSetWindowUserPointer = glfwSetWindowUserPointer;
table->glfwSetWindowRefreshCallback = glfwSetWindowRefreshCallback;
table->glfwSetWindowContentScaleCallback = glfwSetWindowContentScaleCallback;
table->glfwSwapBuffers = glfwSwapBuffers;
table->glfwSwapInterval = glfwSwapInterval;
table->glfwTerminate = glfwTerminate;
table->glfwUpdateGamepadMappings = glfwUpdateGamepadMappings;
table->glfwWaitEvents = glfwWaitEvents;
table->glfwWaitEventsTimeout = glfwWaitEventsTimeout;
table->glfwVulkanSupported = glfwVulkanSupported;
table->glfwWindowShouldClose = glfwWindowShouldClose;
}
@@ -0,0 +1,156 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="glfw_function_table.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
namespace StgSharp.Internal
{
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct GLFWFunction
{
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, int, IntPtr> glfwCreateCursor;
public delegate* unmanaged[Cdecl]<int, IntPtr> glfwCreateStandardCursor;
public delegate* unmanaged[Cdecl]<int, int, byte*, IntPtr, IntPtr, IntPtr> glfwCreateWindow;
public delegate* unmanaged[Cdecl]<void> glfwDefaultWindowHints;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwDestroyCursor;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwDestroyWindow;
public delegate* unmanaged[Cdecl]<byte*, int> glfwExtensionSupported;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwFocusWindow;
public delegate* unmanaged[Cdecl]<IntPtr, byte*> glfwGetClipboardString;
public delegate* unmanaged[Cdecl]<IntPtr> glfwGetCurrentContext;
public delegate* unmanaged[Cdecl]<IntPtr, double*, double*, void> glfwGetCursorPos;
public delegate* unmanaged[Cdecl]<byte**, int> glfwGetError;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetFramebufferSize;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetGamepadName;
public delegate* unmanaged[Cdecl]<int, IntPtr, int> glfwGetGamepadState;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetGammaRamp;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetInputMode;
public delegate* unmanaged[Cdecl]<int, int*, float*> glfwGetJoystickAxes;
public delegate* unmanaged[Cdecl]<int, int*, byte*> glfwGetJoystickButtons;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetJoystickGUID;
public delegate* unmanaged[Cdecl]<int, int*, byte*> glfwGetJoystickHats;
public delegate* unmanaged[Cdecl]<int, byte*> glfwGetJoystickName;
public delegate* unmanaged[Cdecl]<int, void*> glfwGetJoystickUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetKey;
public delegate* unmanaged[Cdecl]<int, int, byte*> glfwGetKeyName;
public delegate* unmanaged[Cdecl]<int, int> glfwGetKeyScancode;
public delegate* unmanaged[Cdecl]<IntPtr, float*, float*, void> glfwGetMonitorContentScale;
public delegate* unmanaged[Cdecl]<IntPtr, byte*> glfwGetMonitorName;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetMonitorPhysicalSize;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetMonitorPos;
public delegate* unmanaged[Cdecl]<int*, IntPtr*> glfwGetMonitors;
public delegate* unmanaged[Cdecl]<IntPtr, void*> glfwGetMonitorUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, int*, int*, void> glfwGetMonitorWorkarea;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetMouseButton;
public delegate* unmanaged[Cdecl]<IntPtr> glfwGetPrimaryMonitor;
public delegate* unmanaged[Cdecl]<byte*, IntPtr> glfwGetProcAddress;
public delegate* unmanaged[Cdecl]<uint*, byte**> glfwGetRequiredInstanceExtensions;
public delegate* unmanaged[Cdecl]<double> glfwGetTime;
public delegate* unmanaged[Cdecl]<ulong> glfwGetTimerFrequency;
public delegate* unmanaged[Cdecl]<ulong> glfwGetTimerValue;
public delegate* unmanaged[Cdecl]<byte*> glfwGetVersionString;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetVideoMode;
public delegate* unmanaged[Cdecl]<IntPtr, int*, IntPtr*> glfwGetVideoModes;
public delegate* unmanaged[Cdecl]<IntPtr, int, int> glfwGetWindowAttrib;
public delegate* unmanaged[Cdecl]<IntPtr, float*, float*, void> glfwGetWindowContentScale;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, int*, int*, void> glfwGetWindowFrameSize;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr> glfwGetWindowMonitor;
public delegate* unmanaged[Cdecl]<IntPtr, float> glfwGetWindowOpacity;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetWindowPos;
public delegate* unmanaged[Cdecl]<IntPtr, int*, int*, void> glfwGetWindowSize;
public delegate* unmanaged[Cdecl]<IntPtr, void*> glfwGetWindowUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwHideWindow;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwIconifyWindow;
public delegate* unmanaged[Cdecl]<int> glfwInit;
public delegate* unmanaged[Cdecl]<int, int, void> glfwInitHint;
public delegate* unmanaged[Cdecl]<int, int> glfwJoystickIsGamepad;
public delegate* unmanaged[Cdecl]<int, int> glfwJoystickPresent;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwMakeContextCurrent;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwMaximizeWindow;
public delegate* unmanaged[Cdecl]<void> glfwPollEvents;
public delegate* unmanaged[Cdecl]<void> glfwPostEmptyEvent;
public delegate* unmanaged[Cdecl]<int> glfwRawMouseMotionSupported;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwRequestWindowAttention;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwRestoreWindow;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, uint, void>, delegate* unmanaged[Cdecl]<IntPtr, uint, void>> glfwSetCharCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, uint, int, void>, delegate* unmanaged[Cdecl]<IntPtr, uint, int, void>> glfwSetCharModsCallback;
public delegate* unmanaged[Cdecl]<IntPtr, byte*, void> glfwSetClipboardString;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> glfwSetCursor;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetCursorEnterCallback;
public delegate* unmanaged[Cdecl]<IntPtr, double, double, void> glfwSetCursorPos;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>> glfwSetCursorPosCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, byte**, void>, delegate* unmanaged [Cdecl]<IntPtr, int, byte**, void>> glfwSetDropCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetFramebufferSizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, float, void> glfwSetGamma;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> glfwSetGammaRamp;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetInputMode;
public delegate* unmanaged[Cdecl]<delegate* unmanaged[Cdecl]<int, int, void>, delegate* unmanaged[Cdecl]<int, int, void>> glfwSetJoystickCallback;
public delegate* unmanaged[Cdecl]<int, void*, void> glfwSetJoystickUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void>> glfwSetKeyCallback;
public delegate* unmanaged[Cdecl]<delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetMonitorCallback;
public delegate* unmanaged[Cdecl]<IntPtr, void*, void> glfwSetMonitorUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, int, void>> glfwSetMouseButtonCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, double, double, void>, delegate* unmanaged[Cdecl]<IntPtr,double, double, void>> glfwSetScrollCallback;
public delegate* unmanaged[Cdecl]<double, void> glfwSetTime;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowAspectRatio;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowAttrib;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, void>, delegate* unmanaged[Cdecl]<IntPtr, void>> glfwSetWindowCloseCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, float, float, void>, delegate* unmanaged[Cdecl]<IntPtr, float, float, void>> glfwSetWindowContentScaleCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowFocusCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, IntPtr, void> glfwSetWindowIcon;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowIconifyCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, void>> glfwSetWindowMaximizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, int, int, int, int, void> glfwSetWindowMonitor;
public delegate* unmanaged[Cdecl]<IntPtr, float, void> glfwSetWindowOpacity;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowPos;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetWindowPosCallback;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, void>, delegate* unmanaged[Cdecl]<IntPtr, void>> glfwSetWindowRefreshCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, void> glfwSetWindowShouldClose;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, void> glfwSetWindowSize;
public delegate* unmanaged[Cdecl]<IntPtr, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>, delegate* unmanaged[Cdecl]<IntPtr, int, int, void>> glfwSetWindowSizeCallback;
public delegate* unmanaged[Cdecl]<IntPtr, int, int, int, int, void> glfwSetWindowSizeLimits;
public delegate* unmanaged[Cdecl]<IntPtr, byte*, void> glfwSetWindowTitle;
public delegate* unmanaged[Cdecl]<IntPtr, void*, void> glfwSetWindowUserPointer;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwShowWindow;
public delegate* unmanaged[Cdecl]<IntPtr, void> glfwSwapBuffers;
public delegate* unmanaged[Cdecl]<int, void> glfwSwapInterval;
public delegate* unmanaged[Cdecl]<void> glfwTerminate;
public delegate* unmanaged[Cdecl]<byte*, int> glfwUpdateGamepadMappings;
public delegate* unmanaged[Cdecl]<int> glfwVulkanSupported;
public delegate* unmanaged[Cdecl]<void> glfwWaitEvents;
public delegate* unmanaged[Cdecl]<double, void> glfwWaitEventsTimeout;
public delegate* unmanaged[Cdecl]<int, int, void> glfwWindowHint;
public delegate* unmanaged[Cdecl]<int, byte*, void> glfwWindowHintString;
public delegate* unmanaged[Cdecl]<IntPtr, int> glfwWindowShouldClose;
}
}