new simplified timer. and little other ops

This commit is contained in:
Youmu Liu
2025-11-18 20:39:03 +08:00
parent 81a60d1cfe
commit ece12f2ea7
28 changed files with 2254 additions and 853 deletions
+8 -7
View File
@@ -20,7 +20,7 @@ typedef struct GLFWFunctionTable {
GLFWwindow *(*glfwGetCurrentContext)(void);
void (*glfwGetCursorPos)(GLFWwindow *window, double *xpos, double *ypos);
int (*glfwGetError)(const char **description);
void (*glfwGetFramebufferSize)(GLFWwindow *window, int *width, int *height);
void (*glfwGetFrameBufferSize)(GLFWwindow *window, int *width, int *height);
const char *(*glfwGetGamepadName)(int jid);
int (*glfwGetGamepadState)(int jid, GLFWgamepadstate *state);
const GLFWgammaramp *(*glfwGetGammaRamp)(GLFWmonitor *monitor);
@@ -38,10 +38,10 @@ typedef struct GLFWFunctionTable {
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);
GLFWmonitor **(*glfwGetMonitors)(int *count);
int (*glfwGetMouseButton)(GLFWwindow *window, int button);
GLFWmonitor *(*glfwGetPrimaryMonitor)(void);
GLFWglproc (*glfwGetProcAddress)(const char *procname);
@@ -66,7 +66,7 @@ typedef struct GLFWFunctionTable {
void (*glfwIconifyWindow)(GLFWwindow *window);
int (*glfwInit)(void);
void (*glfwInitHint)(int hint, int value);
int (*glfwJoystickIsGamepad)(int jid);
int (*glfwJoystickIsGamePad)(int jid);
int (*glfwJoystickPresent)(int jid);
void (*glfwMakeContextCurrent)(GLFWwindow *window);
void (*glfwMaximizeWindow)(GLFWwindow *window);
@@ -75,13 +75,13 @@ typedef struct GLFWFunctionTable {
int (*glfwRawMouseMotionSupported)(void);
void (*glfwRequestWindowAttention)(GLFWwindow *window);
void (*glfwRestoreWindow)(GLFWwindow *window);
void (*glfwSetClipboardString)(GLFWwindow *window, const char *str);
void (*glfwSetCursor)(GLFWwindow *window, GLFWcursor *cursor);
void (*glfwSetCursorPos)(GLFWwindow *window, double xpos, double ypos);
GLFWcharfun (*glfwSetCharCallback)(GLFWwindow *window, GLFWcharfun callback);
GLFWcharmodsfun (*glfwSetCharModsCallback)(GLFWwindow *window, GLFWcharmodsfun callback);
void (*glfwSetClipboardString)(GLFWwindow *window, const char *str);
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);
GLFWerrorfun (*glfwSetErrorCallback)(GLFWerrorfun callback);
@@ -91,6 +91,7 @@ typedef struct GLFWFunctionTable {
void (*glfwSetGammaRamp)(GLFWmonitor *monitor, const GLFWgammaramp *ramp);
void (*glfwSetInputMode)(GLFWwindow *window, int mode, int value);
GLFWjoystickfun (*glfwSetJoystickCallback)(GLFWjoystickfun callback);
void (*glfwSetJoystickUserPointer)(int jid, void *pointer);
GLFWkeyfun (*glfwSetKeyCallback)(GLFWwindow *window, GLFWkeyfun callback);
GLFWmonitorfun (*glfwSetMonitorCallback)(GLFWmonitorfun callback);
void (*glfwSetMonitorUserPointer)(GLFWmonitor *monitor, void *pointer);
@@ -130,7 +131,7 @@ typedef struct GLFWFunctionTable {
void (*glfwSwapBuffers)(GLFWwindow *window);
void (*glfwSwapInterval)(int interval);
void (*glfwTerminate)(void);
int (*glfwUpdateGamepadMappings)(const char *str);
int (*glfwUpdateGamePadMappings)(const char *str);
int (*glfwVulkanSupported)(void);
void (*glfwWaitEvents)(void);
void (*glfwWaitEventsTimeout)(double timeout);
+101 -100
View File
@@ -4,119 +4,120 @@
SN_API void SN_DECL load_glfw_functions(GLFWFunctionTable *table)
{
table->glfwInit = glfwInit;
table->glfwTerminate = glfwTerminate;
table->glfwInitHint = glfwInitHint;
table->glfwGetVersion = glfwGetVersion;
table->glfwGetVersionString = glfwGetVersionString;
table->glfwGetError = glfwGetError;
table->glfwSetErrorCallback = glfwSetErrorCallback;
table->glfwGetMonitors = glfwGetMonitors;
table->glfwGetPrimaryMonitor = glfwGetPrimaryMonitor;
table->glfwGetMonitorPos = glfwGetMonitorPos;
table->glfwGetMonitorWorkarea = glfwGetMonitorWorkarea;
table->glfwGetMonitorPhysicalSize = glfwGetMonitorPhysicalSize;
table->glfwGetMonitorContentScale = glfwGetMonitorContentScale;
table->glfwGetMonitorName = glfwGetMonitorName;
table->glfwSetMonitorUserPointer = glfwSetMonitorUserPointer;
table->glfwGetMonitorUserPointer = glfwGetMonitorUserPointer;
table->glfwSetMonitorCallback = glfwSetMonitorCallback;
table->glfwGetVideoModes = glfwGetVideoModes;
table->glfwGetVideoMode = glfwGetVideoMode;
table->glfwSetGamma = glfwSetGamma;
table->glfwGetGammaRamp = glfwGetGammaRamp;
table->glfwSetGammaRamp = glfwSetGammaRamp;
table->glfwDefaultWindowHints = glfwDefaultWindowHints;
table->glfwWindowHint = glfwWindowHint;
table->glfwWindowHintString = glfwWindowHintString;
table->glfwCreateWindow = glfwCreateWindow;
table->glfwDestroyWindow = glfwDestroyWindow;
table->glfwWindowShouldClose = glfwWindowShouldClose;
table->glfwSetWindowShouldClose = glfwSetWindowShouldClose;
table->glfwSetWindowTitle = glfwSetWindowTitle;
table->glfwSetWindowIcon = glfwSetWindowIcon;
table->glfwGetWindowPos = glfwGetWindowPos;
table->glfwSetWindowPos = glfwSetWindowPos;
table->glfwGetWindowSize = glfwGetWindowSize;
table->glfwSetWindowSizeLimits = glfwSetWindowSizeLimits;
table->glfwSetWindowAspectRatio = glfwSetWindowAspectRatio;
table->glfwSetWindowSize = glfwSetWindowSize;
table->glfwGetFramebufferSize = glfwGetFramebufferSize;
table->glfwGetWindowFrameSize = glfwGetWindowFrameSize;
table->glfwGetWindowContentScale = glfwGetWindowContentScale;
table->glfwGetWindowOpacity = glfwGetWindowOpacity;
table->glfwSetWindowOpacity = glfwSetWindowOpacity;
table->glfwIconifyWindow = glfwIconifyWindow;
table->glfwRestoreWindow = glfwRestoreWindow;
table->glfwMaximizeWindow = glfwMaximizeWindow;
table->glfwShowWindow = glfwShowWindow;
table->glfwHideWindow = glfwHideWindow;
table->glfwFocusWindow = glfwFocusWindow;
table->glfwRequestWindowAttention = glfwRequestWindowAttention;
table->glfwGetWindowMonitor = glfwGetWindowMonitor;
table->glfwSetWindowMonitor = glfwSetWindowMonitor;
table->glfwGetWindowAttrib = glfwGetWindowAttrib;
table->glfwSetWindowAttrib = glfwSetWindowAttrib;
table->glfwSetWindowUserPointer = glfwSetWindowUserPointer;
table->glfwGetWindowUserPointer = glfwGetWindowUserPointer;
table->glfwSetWindowPosCallback = glfwSetWindowPosCallback;
table->glfwSetWindowSizeCallback = glfwSetWindowSizeCallback;
table->glfwSetWindowCloseCallback = glfwSetWindowCloseCallback;
table->glfwSetWindowRefreshCallback = glfwSetWindowRefreshCallback;
table->glfwSetWindowFocusCallback = glfwSetWindowFocusCallback;
table->glfwSetWindowIconifyCallback = glfwSetWindowIconifyCallback;
table->glfwSetWindowMaximizeCallback = glfwSetWindowMaximizeCallback;
table->glfwSetFramebufferSizeCallback = glfwSetFramebufferSizeCallback;
table->glfwSetWindowContentScaleCallback = glfwSetWindowContentScaleCallback;
table->glfwPollEvents = glfwPollEvents;
table->glfwWaitEvents = glfwWaitEvents;
table->glfwWaitEventsTimeout = glfwWaitEventsTimeout;
table->glfwPostEmptyEvent = glfwPostEmptyEvent;
table->glfwGetInputMode = glfwGetInputMode;
table->glfwSetInputMode = glfwSetInputMode;
table->glfwRawMouseMotionSupported = glfwRawMouseMotionSupported;
table->glfwGetKeyName = glfwGetKeyName;
table->glfwGetKeyScancode = glfwGetKeyScancode;
table->glfwGetKey = glfwGetKey;
table->glfwGetMouseButton = glfwGetMouseButton;
table->glfwGetCursorPos = glfwGetCursorPos;
table->glfwSetCursorPos = glfwSetCursorPos;
table->glfwCreateCursor = glfwCreateCursor;
table->glfwCreateStandardCursor = glfwCreateStandardCursor;
table->glfwCreateWindow = glfwCreateWindow;
table->glfwDefaultWindowHints = glfwDefaultWindowHints;
table->glfwDestroyCursor = glfwDestroyCursor;
table->glfwSetCursor = glfwSetCursor;
table->glfwSetKeyCallback = glfwSetKeyCallback;
table->glfwSetCharCallback = glfwSetCharCallback;
table->glfwSetCharModsCallback = glfwSetCharModsCallback;
table->glfwSetMouseButtonCallback = glfwSetMouseButtonCallback;
table->glfwSetCursorPosCallback = glfwSetCursorPosCallback;
table->glfwSetCursorEnterCallback = glfwSetCursorEnterCallback;
table->glfwSetScrollCallback = glfwSetScrollCallback;
table->glfwSetDropCallback = glfwSetDropCallback;
table->glfwJoystickPresent = glfwJoystickPresent;
table->glfwDestroyWindow = glfwDestroyWindow;
table->glfwExtensionSupported = glfwExtensionSupported;
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->glfwJoystickIsGamepad = glfwJoystickIsGamepad;
table->glfwSetJoystickCallback = glfwSetJoystickCallback;
table->glfwUpdateGamepadMappings = glfwUpdateGamepadMappings;
table->glfwGetGamepadName = glfwGetGamepadName;
table->glfwGetGamepadState = glfwGetGamepadState;
table->glfwSetClipboardString = glfwSetClipboardString;
table->glfwGetClipboardString = glfwGetClipboardString;
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->glfwGetProcAddress = glfwGetProcAddress;
table->glfwGetRequiredInstanceExtensions = glfwGetRequiredInstanceExtensions;
table->glfwGetTime = glfwGetTime;
table->glfwSetTime = glfwSetTime;
table->glfwGetTimerValue = glfwGetTimerValue;
table->glfwGetTimerFrequency = glfwGetTimerFrequency;
table->glfwGetTimerValue = glfwGetTimerValue;
table->glfwGetVersion = glfwGetVersion;
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->glfwJoystickIsGamePad = glfwJoystickIsGamepad;
table->glfwJoystickPresent = glfwJoystickPresent;
table->glfwMakeContextCurrent = glfwMakeContextCurrent;
table->glfwGetCurrentContext = glfwGetCurrentContext;
table->glfwMaximizeWindow = glfwMaximizeWindow;
table->glfwPollEvents = glfwPollEvents;
table->glfwPostEmptyEvent = glfwPostEmptyEvent;
table->glfwRawMouseMotionSupported = glfwRawMouseMotionSupported;
table->glfwRequestWindowAttention = glfwRequestWindowAttention;
table->glfwRestoreWindow = glfwRestoreWindow;
table->glfwSetCharCallback = glfwSetCharCallback;
table->glfwSetCharModsCallback = glfwSetCharModsCallback;
table->glfwSetClipboardString = glfwSetClipboardString;
table->glfwSetCursor = glfwSetCursor;
table->glfwSetCursorEnterCallback = glfwSetCursorEnterCallback;
table->glfwSetCursorPos = glfwSetCursorPos;
table->glfwSetCursorPosCallback = glfwSetCursorPosCallback;
table->glfwSetDropCallback = glfwSetDropCallback;
table->glfwSetErrorCallback = glfwSetErrorCallback;
table->glfwSetFramebufferSizeCallback = glfwSetFramebufferSizeCallback;
table->glfwSetGamma = glfwSetGamma;
table->glfwSetGammaRamp = glfwSetGammaRamp;
table->glfwSetInputMode = glfwSetInputMode;
table->glfwSetJoystickCallback = glfwSetJoystickCallback;
table->glfwSetJoystickUserPointer = glfwSetJoystickUserPointer;
table->glfwSetKeyCallback = glfwSetKeyCallback;
table->glfwSetMonitorCallback = glfwSetMonitorCallback;
table->glfwSetMonitorUserPointer = glfwSetMonitorUserPointer;
table->glfwSetMouseButtonCallback = glfwSetMouseButtonCallback;
table->glfwSetScrollCallback = glfwSetScrollCallback;
table->glfwSetTime = glfwSetTime;
table->glfwSetWindowAspectRatio = glfwSetWindowAspectRatio;
table->glfwSetWindowAttrib = glfwSetWindowAttrib;
table->glfwSetWindowCloseCallback = glfwSetWindowCloseCallback;
table->glfwSetWindowContentScaleCallback = glfwSetWindowContentScaleCallback;
table->glfwSetWindowFocusCallback = glfwSetWindowFocusCallback;
table->glfwSetWindowIcon = glfwSetWindowIcon;
table->glfwSetWindowIconifyCallback = glfwSetWindowIconifyCallback;
table->glfwSetWindowMaximizeCallback = glfwSetWindowMaximizeCallback;
table->glfwSetWindowMonitor = glfwSetWindowMonitor;
table->glfwSetWindowOpacity = glfwSetWindowOpacity;
table->glfwSetWindowPos = glfwSetWindowPos;
table->glfwSetWindowPosCallback = glfwSetWindowPosCallback;
table->glfwSetWindowRefreshCallback = glfwSetWindowRefreshCallback;
table->glfwSetWindowShouldClose = glfwSetWindowShouldClose;
table->glfwSetWindowSize = glfwSetWindowSize;
table->glfwSetWindowSizeCallback = glfwSetWindowSizeCallback;
table->glfwSetWindowSizeLimits = glfwSetWindowSizeLimits;
table->glfwSetWindowTitle = glfwSetWindowTitle;
table->glfwSetWindowUserPointer = glfwSetWindowUserPointer;
table->glfwShowWindow = glfwShowWindow;
table->glfwSwapBuffers = glfwSwapBuffers;
table->glfwSwapInterval = glfwSwapInterval;
table->glfwExtensionSupported = glfwExtensionSupported;
table->glfwGetProcAddress = glfwGetProcAddress;
table->glfwTerminate = glfwTerminate;
table->glfwUpdateGamePadMappings = glfwUpdateGamepadMappings;
table->glfwVulkanSupported = glfwVulkanSupported;
table->glfwGetRequiredInstanceExtensions = glfwGetRequiredInstanceExtensions;
table->glfwWaitEvents = glfwWaitEvents;
table->glfwWaitEventsTimeout = glfwWaitEventsTimeout;
table->glfwWindowHint = glfwWindowHint;
table->glfwWindowHintString = glfwWindowHintString;
table->glfwWindowShouldClose = glfwWindowShouldClose;
}