summaryrefslogtreecommitdiff
path: root/src/platform.cpp
blob: adb41d28331dc624aa6ec2e2ba858aa3b811d67f (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
#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;
}