-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.hpp
More file actions
35 lines (25 loc) · 800 Bytes
/
application.hpp
File metadata and controls
35 lines (25 loc) · 800 Bytes
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
31
32
33
34
35
#ifndef APPLICATION_HPP
#define APPLICATION_HPP
#include "inputmanager.hpp"
#include "GL/glew.h"
#include "GLFW/glfw3.h"
#include <string>
#include <memory>
#include <functional>
namespace cg
{
class Application
{
// Unique pointer that destroys the window and terminates GLFW using RAII.
using WindowPointer = std::unique_ptr<GLFWwindow, std::function<void(GLFWwindow*)>>;
public:
explicit Application(std::string title, int window_width = 640, int window_height = 480);
GLFWwindow* get_window() const;
void set_input(InputManager* input);
private:
[[noreturn]] static void error_callback(int errorcode, const char* description);
static void framebuffer_callback(GLFWwindow* window, int width, int height);
WindowPointer window;
};
}
#endif // APPLICATION_HPP