summaryrefslogtreecommitdiff
path: root/src/platform.cc
blob: bfb566c2c0671594489a766b9da55967227c7801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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();
}