-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.h
More file actions
43 lines (31 loc) · 1.05 KB
/
Copy pathWindow.h
File metadata and controls
43 lines (31 loc) · 1.05 KB
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
36
37
38
39
40
41
42
43
#ifndef _TINY_PIYO_WINDOW_H
#define _TINY_PIYO_WINDOW_H
#include "GL/glew.h"
#include <GLFW/glfw3.h>
#include <string>
class InputManager;
enum WindowFlag
{
HIDDEN = 0x1,
FULLSCREEN = 0x2,
RESIZABLE = 0x4
};
class Window
{
public:
void Init(const std::string& name, int width, int height, unsigned int flags = 0);
void Destroy();
bool ShouldClose() { return glfwWindowShouldClose(this->_window); };
unsigned int GetKey(unsigned int key) { return glfwGetKey(this->_window, key); };
void SwapBuffers() { glfwSwapBuffers(this->_window); };
int GetScreenWidth() { return this->_width; };
int GetScreenHeight() { return this->_height; };
void SetScreenTitle(const std::string& name) { glfwSetWindowTitle(this->_window, name.c_str()); };
GLFWwindow* GetWindow() { return this->_window; }
InputManager* GetInputManager() { return this->_inputManager; };
private:
GLFWwindow* _window;
InputManager* _inputManager;
int _width, _height;
};
#endif