diff options
Diffstat (limited to 'src/platform.cpp')
| -rw-r--r-- | src/platform.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/platform.cpp b/src/platform.cpp new file mode 100644 index 0000000..adb41d2 --- /dev/null +++ b/src/platform.cpp @@ -0,0 +1,26 @@ +#include "platform.h" +#include <GLFW/glfw3.h> + +static GLFWwindow* window = nullptr; + +void platform_init() { + glfwInit(); + window = glfwCreateWindow(1280, 720, "demo64k", nullptr, nullptr); +} + +void platform_shutdown() { + glfwDestroyWindow(window); + glfwTerminate(); +} + +void platform_poll() { + glfwPollEvents(); +} + +bool platform_should_close() { + return glfwWindowShouldClose(window); +} + +GLFWwindow* platform_get_window() { + return window; +} |
