#ifndef OUR_DICK_RENDER_HPP #define OUR_DICK_RENDER_HPP #include #include #define OPENFL_VERSION 400 #define GLSL_VERSION 400 class GLFWwindow; class render_manager { private: void (*m_windowCloseCallback)(void); void (*m_inputHandler)(GLFWwindow* window, int key, int scancode, int action, int mods); GLFWwindow* m_mainWindow; public: enum GLFW_ERROR { GLFW_OK, GLFW_CONTEXT_ERROR, GLFW_WINDOW_ERROR, GLFW_INIT_ERROR, }; render_manager (render_manager&) = delete; render_manager (render_manager&&) = delete; render_manager(); GLFW_ERROR init(int width, int height, const char* title); // Sets up the OpenGL environment void update(); // Update the GL context and draw new frame void request_exit(); template void handle_window_close_event(T handle){ m_windowCloseCallback = handle; } template void handle_keypress_event(T handle){ m_inputHandler = handle; glfwSetKeyCallback(m_mainWindow, m_inputHandler); } }; #endif