20 lines
419 B
C++
20 lines
419 B
C++
|
|
#include <GLFW/glfw3.h>
|
|
#include <cassert>
|
|
#include "init.hpp"
|
|
|
|
static bool is_initialized = false;
|
|
|
|
void Graphics::init() {
|
|
if(is_initialized) {
|
|
return;
|
|
}
|
|
assert(glfwInit());
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
|
|
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
|
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, true);
|
|
is_initialized = true;
|
|
}
|
|
|