summaryrefslogtreecommitdiff
path: root/procyon/source/gfx/initgfx.c
blob: d60e3935af4cbac31d65410f2910cbb0bddf1791 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <acm/gfx.h>

#include <GLFW/glfw3.h>

void acm_initgfx(void) {
	acm_log("Initialising graphics\n");
	if (!glfwInit()) {
		fprintf(stderr,"Unable to initialise GLFW\n");
		acm_exit(acm_stat_err);
	}
	GLFWwindow * win = glfwCreateWindow(0x300,0x200,"Procyon",nullptr,nullptr);
	if (win == nullptr) {
		fprintf(stderr,"Unable to open window\n");
		goto abrt;
	}
	glfwMakeContextCurrent(win);
	acm_dat.win = win;
	return;
abrt:;
	glfwTerminate();
	acm_exit(acm_stat_err);
}