-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindowTest.cpp
52 lines (39 loc) · 1.08 KB
/
windowTest.cpp
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
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <SOIL/SOIL.h>
#include <glm/glm.hpp>
#include <iostream>
#include "window.hpp"
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
int main()
{
using namespace sre;
using namespace std;
// Initialize GLEW
glewExperimental = GL_TRUE;
glewInit();
// Initialize GLFW
if (!glfwInit())
return -1;
Monitor mon();
WindowSettings winSet();
FrameBufferSettings frameBufSet();
ContextSettings contSet();
//Window winDefault = Window();
//Window winCustom = Window( 800, 600, "custom window");
//winDefault.setActive();
Window win = Window();
//glfwSetKeyCallback ( window.getGLFWWindow(), key_callback );
while( !win.windowShouldClose() )
{
win.swapBuffers();
glfwPollEvents();
}
// Terminate GLFW
glfwTerminate();
}
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(window, GL_TRUE);
}