This commit is contained in:
2024-07-28 14:22:17 +01:00
commit 319ba58b3e
17 changed files with 5124 additions and 0 deletions

43
ffi/glfw-export.c Normal file
View File

@@ -0,0 +1,43 @@
#include "export.h"
#include <GLFW/glfw3.h>
#include <stdbool.h>
// GLFW constants used below
int CONTEXT_VERSION_MAJOR = GLFW_CONTEXT_VERSION_MAJOR;
int DEPRECATED = GLFW_DECORATED;
int GLFW_FFI_FALSE = GLFW_FALSE;
int SAMPLES = GLFW_SAMPLES;
// GLFW functions used below
void init() {
glfwInit();
}
void windowHint(int hint, int value) {
glfwWindowHint(hint, value);
}
GLFWwindow* createWindow(int width, int height, const char *title) {
return glfwCreateWindow(width, height, title, NULL, NULL);
}
void terminate() {
glfwTerminate();
}
void makeContextCurrent(GLFWwindow* window) {
glfwMakeContextCurrent(window);
}
bool windowShouldClose(GLFWwindow *window) {
glfwWindowShouldClose(window);
}
void pollEvents() {
glfwPollEvents();
}
void swapBuffers(GLFWwindow *window) {
glfwSwapBuffers(window);
}