diff --git a/internal/glfw/glfw/error.c b/internal/glfw/glfw/error.c deleted file mode 100644 index 0ef987152..000000000 --- a/internal/glfw/glfw/error.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "_cgo_export.h" - -void glfwSetErrorCallbackCB() { glfwSetErrorCallback((GLFWerrorfun)goErrorCB); } diff --git a/internal/glfw/glfw/error.go b/internal/glfw/glfw/error.go index 897d4b9dd..43093670c 100644 --- a/internal/glfw/glfw/error.go +++ b/internal/glfw/glfw/error.go @@ -2,9 +2,14 @@ package glfw -//#define GLFW_INCLUDE_NONE -//#include "glfw/include/GLFW/glfw3.h" -//void glfwSetErrorCallbackCB(); +// #define GLFW_INCLUDE_NONE +// #include "glfw/include/GLFW/glfw3.h" +// +// void goErrorCB(int code, char* desc); +// +// static void glfwSetErrorCallbackCB() { +// glfwSetErrorCallback((GLFWerrorfun)goErrorCB); +// } import "C" import ( diff --git a/internal/glfw/glfw/input.c b/internal/glfw/glfw/input.c deleted file mode 100644 index eeb63e44f..000000000 --- a/internal/glfw/glfw/input.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "_cgo_export.h" - -void glfwSetKeyCallbackCB(GLFWwindow *window) { - glfwSetKeyCallback(window, (GLFWkeyfun)goKeyCB); -} - -void glfwSetCharCallbackCB(GLFWwindow *window) { - glfwSetCharCallback(window, (GLFWcharfun)goCharCB); -} - -void glfwSetCharModsCallbackCB(GLFWwindow *window) { - glfwSetCharModsCallback(window, (GLFWcharmodsfun)goCharModsCB); -} - -void glfwSetMouseButtonCallbackCB(GLFWwindow *window) { - glfwSetMouseButtonCallback(window, (GLFWmousebuttonfun)goMouseButtonCB); -} - -void glfwSetCursorPosCallbackCB(GLFWwindow *window) { - glfwSetCursorPosCallback(window, (GLFWcursorposfun)goCursorPosCB); -} - -void glfwSetCursorEnterCallbackCB(GLFWwindow *window) { - glfwSetCursorEnterCallback(window, (GLFWcursorenterfun)goCursorEnterCB); -} - -void glfwSetScrollCallbackCB(GLFWwindow *window) { - glfwSetScrollCallback(window, (GLFWscrollfun)goScrollCB); -} - -void glfwSetDropCallbackCB(GLFWwindow *window) { - glfwSetDropCallback(window, (GLFWdropfun)goDropCB); -} diff --git a/internal/glfw/glfw/input.go b/internal/glfw/glfw/input.go index 6ad416048..7d7c9de92 100644 --- a/internal/glfw/glfw/input.go +++ b/internal/glfw/glfw/input.go @@ -2,17 +2,50 @@ package glfw -//#include -//#define GLFW_INCLUDE_NONE -//#include "glfw/include/GLFW/glfw3.h" -//void glfwSetKeyCallbackCB(GLFWwindow *window); -//void glfwSetCharCallbackCB(GLFWwindow *window); -//void glfwSetCharModsCallbackCB(GLFWwindow *window); -//void glfwSetMouseButtonCallbackCB(GLFWwindow *window); -//void glfwSetCursorPosCallbackCB(GLFWwindow *window); -//void glfwSetCursorEnterCallbackCB(GLFWwindow *window); -//void glfwSetScrollCallbackCB(GLFWwindow *window); -//void glfwSetDropCallbackCB(GLFWwindow *window); +// #include +// #define GLFW_INCLUDE_NONE +// #include "glfw/include/GLFW/glfw3.h" +// +// void goKeyCB(void* window, int key, int scancode, int action, int mods); +// void goCharCB(void* window, unsigned int character); +// void goCharModsCB(void* window, unsigned int character, int mods); +// void goMouseButtonCB(void* window, int button, int action, int mods); +// void goCursorPosCB(void* window, double xpos, double ypos); +// void goCursorEnterCB(void* window, int entered); +// void goScrollCB(void* window, double xoff, double yoff); +// void goDropCB(void* window, int count, char** names); +// +// static void glfwSetKeyCallbackCB(GLFWwindow *window) { +// glfwSetKeyCallback(window, (GLFWkeyfun)goKeyCB); +// } +// +// static void glfwSetCharCallbackCB(GLFWwindow *window) { +// glfwSetCharCallback(window, (GLFWcharfun)goCharCB); +// } +// +// static void glfwSetCharModsCallbackCB(GLFWwindow *window) { +// glfwSetCharModsCallback(window, (GLFWcharmodsfun)goCharModsCB); +// } +// +// static void glfwSetMouseButtonCallbackCB(GLFWwindow *window) { +// glfwSetMouseButtonCallback(window, (GLFWmousebuttonfun)goMouseButtonCB); +// } +// +// static void glfwSetCursorPosCallbackCB(GLFWwindow *window) { +// glfwSetCursorPosCallback(window, (GLFWcursorposfun)goCursorPosCB); +// } +// +// static void glfwSetCursorEnterCallbackCB(GLFWwindow *window) { +// glfwSetCursorEnterCallback(window, (GLFWcursorenterfun)goCursorEnterCB); +// } +// +// static void glfwSetScrollCallbackCB(GLFWwindow *window) { +// glfwSetScrollCallback(window, (GLFWscrollfun)goScrollCB); +// } +// +// static void glfwSetDropCallbackCB(GLFWwindow *window) { +// glfwSetDropCallback(window, (GLFWdropfun)goDropCB); +// } import "C" import ( diff --git a/internal/glfw/glfw/monitor.c b/internal/glfw/glfw/monitor.c deleted file mode 100644 index 55107eabf..000000000 --- a/internal/glfw/glfw/monitor.c +++ /dev/null @@ -1,19 +0,0 @@ -#include "_cgo_export.h" - -GLFWmonitor *GetMonitorAtIndex(GLFWmonitor **monitors, int index) { - return monitors[index]; -} - -GLFWvidmode GetVidmodeAtIndex(GLFWvidmode *vidmodes, int index) { - return vidmodes[index]; -} - -void glfwSetMonitorCallbackCB() { - glfwSetMonitorCallback((GLFWmonitorfun)goMonitorCB); -} - -unsigned int GetGammaAtIndex(unsigned short *color, int i) { return color[i]; } - -void SetGammaAtIndex(unsigned short *color, int i, unsigned short value) { - color[i] = value; -} diff --git a/internal/glfw/glfw/monitor.go b/internal/glfw/glfw/monitor.go index 10b3f3dc0..35937f503 100644 --- a/internal/glfw/glfw/monitor.go +++ b/internal/glfw/glfw/monitor.go @@ -2,13 +2,30 @@ package glfw -//#define GLFW_INCLUDE_NONE -//#include "glfw/include/GLFW/glfw3.h" -//GLFWmonitor* GetMonitorAtIndex(GLFWmonitor **monitors, int index); -//GLFWvidmode GetVidmodeAtIndex(GLFWvidmode *vidmodes, int index); -//void glfwSetMonitorCallbackCB(); -//unsigned int GetGammaAtIndex(unsigned short *color, int i); -//void SetGammaAtIndex(unsigned short *color, int i, unsigned short value); +// #define GLFW_INCLUDE_NONE +// #include "glfw/include/GLFW/glfw3.h" +// +// void goMonitorCB(void* monitor, int event); +// +// static GLFWmonitor *GetMonitorAtIndex(GLFWmonitor **monitors, int index) { +// return monitors[index]; +// } +// +// static GLFWvidmode GetVidmodeAtIndex(GLFWvidmode *vidmodes, int index) { +// return vidmodes[index]; +// } +// +// static void glfwSetMonitorCallbackCB() { +// glfwSetMonitorCallback((GLFWmonitorfun)goMonitorCB); +// } +// +// static unsigned int GetGammaAtIndex(unsigned short *color, int i) { +// return color[i]; +// } +// +// static void SetGammaAtIndex(unsigned short *color, int i, unsigned short value) { +// color[i] = value; +// } import "C" import ( diff --git a/internal/glfw/glfw/window.c b/internal/glfw/glfw/window.c deleted file mode 100644 index 17cf713da..000000000 --- a/internal/glfw/glfw/window.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "_cgo_export.h" - -void glfwSetWindowPosCallbackCB(GLFWwindow *window) { - glfwSetWindowPosCallback(window, (GLFWwindowposfun)goWindowPosCB); -} - -void glfwSetWindowSizeCallbackCB(GLFWwindow *window) { - glfwSetWindowSizeCallback(window, (GLFWwindowsizefun)goWindowSizeCB); -} - -void glfwSetWindowCloseCallbackCB(GLFWwindow *window) { - glfwSetWindowCloseCallback(window, (GLFWwindowclosefun)goWindowCloseCB); -} - -void glfwSetWindowRefreshCallbackCB(GLFWwindow *window) { - glfwSetWindowRefreshCallback(window, (GLFWwindowrefreshfun)goWindowRefreshCB); -} - -void glfwSetWindowFocusCallbackCB(GLFWwindow *window) { - glfwSetWindowFocusCallback(window, (GLFWwindowfocusfun)goWindowFocusCB); -} - -void glfwSetWindowIconifyCallbackCB(GLFWwindow *window) { - glfwSetWindowIconifyCallback(window, (GLFWwindowiconifyfun)goWindowIconifyCB); -} - -void glfwSetFramebufferSizeCallbackCB(GLFWwindow *window) { - glfwSetFramebufferSizeCallback(window, - (GLFWframebuffersizefun)goFramebufferSizeCB); -} - -void glfwSetWindowMaximizeCallbackCB(GLFWwindow *window) { - glfwSetWindowMaximizeCallback(window, - (GLFWwindowmaximizefun)goWindowMaximizeCB); -} - -void glfwSetWindowContentScaleCallbackCB(GLFWwindow *window) { - glfwSetWindowContentScaleCallback( - window, (GLFWwindowcontentscalefun)goWindowContentScaleCB); -} diff --git a/internal/glfw/glfw/window.go b/internal/glfw/glfw/window.go index 989e2a104..a1fe6e654 100644 --- a/internal/glfw/glfw/window.go +++ b/internal/glfw/glfw/window.go @@ -2,18 +2,55 @@ package glfw -//#include -//#define GLFW_INCLUDE_NONE -//#include "glfw/include/GLFW/glfw3.h" -//void glfwSetWindowPosCallbackCB(GLFWwindow *window); -//void glfwSetWindowSizeCallbackCB(GLFWwindow *window); -//void glfwSetFramebufferSizeCallbackCB(GLFWwindow *window); -//void glfwSetWindowCloseCallbackCB(GLFWwindow *window); -//void glfwSetWindowRefreshCallbackCB(GLFWwindow *window); -//void glfwSetWindowFocusCallbackCB(GLFWwindow *window); -//void glfwSetWindowIconifyCallbackCB(GLFWwindow *window); -//void glfwSetWindowMaximizeCallbackCB(GLFWwindow *window); -//void glfwSetWindowContentScaleCallbackCB(GLFWwindow *window); +// #include +// #define GLFW_INCLUDE_NONE +// #include "glfw/include/GLFW/glfw3.h" +// +// void goWindowPosCB(void* window, int xpos, int ypos); +// void goWindowSizeCB(void* window, int width, int height); +// void goWindowCloseCB(void* window); +// void goWindowRefreshCB(void* window); +// void goWindowFocusCB(void* window, int focused); +// void goWindowIconifyCB(void* window, int iconified); +// void goFramebufferSizeCB(void* window, int width, int height); +// void goWindowMaximizeCB(void* window, int maximized); +// void goWindowContentScaleCB(void* window, float x, float y); +// +// static void glfwSetWindowPosCallbackCB(GLFWwindow *window) { +// glfwSetWindowPosCallback(window, (GLFWwindowposfun)goWindowPosCB); +// } +// +// static void glfwSetWindowSizeCallbackCB(GLFWwindow *window) { +// glfwSetWindowSizeCallback(window, (GLFWwindowsizefun)goWindowSizeCB); +// } +// +// static void glfwSetWindowCloseCallbackCB(GLFWwindow *window) { +// glfwSetWindowCloseCallback(window, (GLFWwindowclosefun)goWindowCloseCB); +// } +// +// static void glfwSetWindowRefreshCallbackCB(GLFWwindow *window) { +// glfwSetWindowRefreshCallback(window, (GLFWwindowrefreshfun)goWindowRefreshCB); +// } +// +// static void glfwSetWindowFocusCallbackCB(GLFWwindow *window) { +// glfwSetWindowFocusCallback(window, (GLFWwindowfocusfun)goWindowFocusCB); +// } +// +// static void glfwSetWindowIconifyCallbackCB(GLFWwindow *window) { +// glfwSetWindowIconifyCallback(window, (GLFWwindowiconifyfun)goWindowIconifyCB); +// } +// +// static void glfwSetFramebufferSizeCallbackCB(GLFWwindow *window) { +// glfwSetFramebufferSizeCallback(window, (GLFWframebuffersizefun)goFramebufferSizeCB); +// } +// +// static void glfwSetWindowMaximizeCallbackCB(GLFWwindow *window) { +// glfwSetWindowMaximizeCallback(window, (GLFWwindowmaximizefun)goWindowMaximizeCB); +// } +// +// static void glfwSetWindowContentScaleCallbackCB(GLFWwindow *window) { +// glfwSetWindowContentScaleCallback(window, (GLFWwindowcontentscalefun)goWindowContentScaleCB); +// } import "C" import (