-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindow.h
54 lines (33 loc) · 982 Bytes
/
Window.h
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
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include "stdio.h"
#include <GL\glew.h>
#include <GLFW\glfw3.h>
class Window
{
public:
Window();
Window(GLint windowWidth, GLint windowHeight);
int Initialise();
GLint getBufferWidth() { return bufferWidth; }
GLint getBufferHeight() { return bufferHeight; }
bool getShouldClose() { return glfwWindowShouldClose(mainWindow); }
bool* getsKeys() { return keys; }
GLfloat getXChange();
GLfloat getYChange();
void swapBuffers() { glfwSwapBuffers(mainWindow); }
void pause (){ glfwSetInputMode(mainWindow, GLFW_CURSOR, GLFW_CURSOR_DISABLED); }
~Window();
private:
GLFWwindow* mainWindow;
GLint width, height;
GLint bufferWidth, bufferHeight;
bool keys[1024];
GLfloat lastX;
GLfloat lastY;
GLfloat xChange;
GLfloat yChange;
bool mouseFirstMoved;
void createCallbacks();
static void handleKeys(GLFWwindow* window, int key, int code, int action, int mode);
static void handleMouse(GLFWwindow* window, double xPos, double yPos);
};