diff options
Diffstat (limited to 'src/platform.cc')
| -rw-r--r-- | src/platform.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/platform.cc b/src/platform.cc new file mode 100644 index 0000000..bfb566c --- /dev/null +++ b/src/platform.cc @@ -0,0 +1,30 @@ +#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; +} + +double platform_get_time() { + return glfwGetTime(); +} |
