-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.cpp
More file actions
42 lines (33 loc) · 768 Bytes
/
init.cpp
File metadata and controls
42 lines (33 loc) · 768 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
36
37
38
39
40
41
42
#ifndef _INIT_H_
#define _INIT_H_
#include <GL/gl3w.h>
#include <GL/glfw.h>
#include "GL/GL.h"
static const unsigned screenSizeX = 200, screenSizeY = 200;
struct Init {
Init() {
if(!glfwInit()) {
std::cerr << "\nCould not initialize glfw!";
return;
}
glfwOpenWindowHint(GLFW_WINDOW_NO_RESIZE, true);
if(!glfwOpenWindow(screenSizeX, screenSizeY, 8, 8, 8, 8, 8, 8, GLFW_WINDOW)) {
std::cerr << "\nCould not open the window!";
glfwTerminate();
return;
}
glfwSetWindowTitle("Colorful Game of Life");
glfwSetWindowPos(350, 150);
glfwSwapInterval(0);
glfwSetTime(0);
if(gl3wInit() != 0) {
std::cerr << "\nCould not initialize gl3w!";
glfwTerminate();
return;
}
}
~Init() {
glfwTerminate();
}
};
#endif //_INIT_H_