mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-12 22:17:26 +01:00
internal/glfw/glfw: refactoring: reduce files
This commit is contained in:
parent
0db860b5dd
commit
eba8713c64
@ -1,3 +0,0 @@
|
|||||||
#include "_cgo_export.h"
|
|
||||||
|
|
||||||
void glfwSetErrorCallbackCB() { glfwSetErrorCallback((GLFWerrorfun)goErrorCB); }
|
|
@ -2,9 +2,14 @@
|
|||||||
|
|
||||||
package glfw
|
package glfw
|
||||||
|
|
||||||
//#define GLFW_INCLUDE_NONE
|
// #define GLFW_INCLUDE_NONE
|
||||||
//#include "glfw/include/GLFW/glfw3.h"
|
// #include "glfw/include/GLFW/glfw3.h"
|
||||||
//void glfwSetErrorCallbackCB();
|
//
|
||||||
|
// void goErrorCB(int code, char* desc);
|
||||||
|
//
|
||||||
|
// static void glfwSetErrorCallbackCB() {
|
||||||
|
// glfwSetErrorCallback((GLFWerrorfun)goErrorCB);
|
||||||
|
// }
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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);
|
|
||||||
}
|
|
@ -2,17 +2,50 @@
|
|||||||
|
|
||||||
package glfw
|
package glfw
|
||||||
|
|
||||||
//#include <stdlib.h>
|
// #include <stdlib.h>
|
||||||
//#define GLFW_INCLUDE_NONE
|
// #define GLFW_INCLUDE_NONE
|
||||||
//#include "glfw/include/GLFW/glfw3.h"
|
// #include "glfw/include/GLFW/glfw3.h"
|
||||||
//void glfwSetKeyCallbackCB(GLFWwindow *window);
|
//
|
||||||
//void glfwSetCharCallbackCB(GLFWwindow *window);
|
// void goKeyCB(void* window, int key, int scancode, int action, int mods);
|
||||||
//void glfwSetCharModsCallbackCB(GLFWwindow *window);
|
// void goCharCB(void* window, unsigned int character);
|
||||||
//void glfwSetMouseButtonCallbackCB(GLFWwindow *window);
|
// void goCharModsCB(void* window, unsigned int character, int mods);
|
||||||
//void glfwSetCursorPosCallbackCB(GLFWwindow *window);
|
// void goMouseButtonCB(void* window, int button, int action, int mods);
|
||||||
//void glfwSetCursorEnterCallbackCB(GLFWwindow *window);
|
// void goCursorPosCB(void* window, double xpos, double ypos);
|
||||||
//void glfwSetScrollCallbackCB(GLFWwindow *window);
|
// void goCursorEnterCB(void* window, int entered);
|
||||||
//void glfwSetDropCallbackCB(GLFWwindow *window);
|
// 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 "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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;
|
|
||||||
}
|
|
@ -2,13 +2,30 @@
|
|||||||
|
|
||||||
package glfw
|
package glfw
|
||||||
|
|
||||||
//#define GLFW_INCLUDE_NONE
|
// #define GLFW_INCLUDE_NONE
|
||||||
//#include "glfw/include/GLFW/glfw3.h"
|
// #include "glfw/include/GLFW/glfw3.h"
|
||||||
//GLFWmonitor* GetMonitorAtIndex(GLFWmonitor **monitors, int index);
|
//
|
||||||
//GLFWvidmode GetVidmodeAtIndex(GLFWvidmode *vidmodes, int index);
|
// void goMonitorCB(void* monitor, int event);
|
||||||
//void glfwSetMonitorCallbackCB();
|
//
|
||||||
//unsigned int GetGammaAtIndex(unsigned short *color, int i);
|
// static GLFWmonitor *GetMonitorAtIndex(GLFWmonitor **monitors, int index) {
|
||||||
//void SetGammaAtIndex(unsigned short *color, int i, unsigned short value);
|
// 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 "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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);
|
|
||||||
}
|
|
@ -2,18 +2,55 @@
|
|||||||
|
|
||||||
package glfw
|
package glfw
|
||||||
|
|
||||||
//#include <stdlib.h>
|
// #include <stdlib.h>
|
||||||
//#define GLFW_INCLUDE_NONE
|
// #define GLFW_INCLUDE_NONE
|
||||||
//#include "glfw/include/GLFW/glfw3.h"
|
// #include "glfw/include/GLFW/glfw3.h"
|
||||||
//void glfwSetWindowPosCallbackCB(GLFWwindow *window);
|
//
|
||||||
//void glfwSetWindowSizeCallbackCB(GLFWwindow *window);
|
// void goWindowPosCB(void* window, int xpos, int ypos);
|
||||||
//void glfwSetFramebufferSizeCallbackCB(GLFWwindow *window);
|
// void goWindowSizeCB(void* window, int width, int height);
|
||||||
//void glfwSetWindowCloseCallbackCB(GLFWwindow *window);
|
// void goWindowCloseCB(void* window);
|
||||||
//void glfwSetWindowRefreshCallbackCB(GLFWwindow *window);
|
// void goWindowRefreshCB(void* window);
|
||||||
//void glfwSetWindowFocusCallbackCB(GLFWwindow *window);
|
// void goWindowFocusCB(void* window, int focused);
|
||||||
//void glfwSetWindowIconifyCallbackCB(GLFWwindow *window);
|
// void goWindowIconifyCB(void* window, int iconified);
|
||||||
//void glfwSetWindowMaximizeCallbackCB(GLFWwindow *window);
|
// void goFramebufferSizeCB(void* window, int width, int height);
|
||||||
//void glfwSetWindowContentScaleCallbackCB(GLFWwindow *window);
|
// 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 "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Loading…
Reference in New Issue
Block a user