-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEngine.h
61 lines (51 loc) · 1.44 KB
/
Engine.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
55
56
57
58
59
60
61
#ifndef GAME_ENGINE
#define GAME_ENGINE
/*--------------------------------------*/
#define MB_LEFT GLFW_MOUSE_BUTTON_1
#define MB_RIGHT GLFW_MOUSE_BUTTON_2
#define MB_MIDDLE GLFW_MOUSE_BUTTON_3
/*--------------------------------------*/
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include <vector>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "Input.h"
#include "gmath.h"
#include "ngetype.h"
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include <glm/gtc/type_ptr.hpp>
#pragma once
class Engine{
public:
bool init(const char* window_title, int _view_xport, int _view_yport);
void StepEvent();
void BeginDraw();
void EndDraw();
GLFWwindow* get_window();
static unsigned int CreateShader(const char*, const char*);
static std::string LoadShaderFromFile(const char*);
static const float* getOthroMatrix();
Engine();
void setBackgroundColor(glm::vec3);
glm::vec2 getWindowSize();
int getViewWidth();
int getViewHeight();
int getViewX();
int getViewY();
private:
int window_width, window_height,
view_xport, view_yport,
view_xview, view_yview,
view_wport, view_hport,
view_width, view_height;
GLFWwindow* window;
static unsigned int CompileShader(unsigned int type, const char*source);
float right, left, bottom, top, near, far;
static glm::mat4 ortho_mat;
glm::vec3 background_color;
};
#endif