-
Notifications
You must be signed in to change notification settings - Fork 0
/
GLHandler.h
47 lines (32 loc) · 845 Bytes
/
GLHandler.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
#pragma once
#include <GL/glew.h>
#include <GL/glu.h>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include "Camera.h"
#include "ErrorStateBase.h"
#include "StarField.h"
class GLHandler : public ErrorStateBase
{
GLuint program;
GLuint vertexBuffer;
GLuint vertexArray;
std::map<std::string, std::vector<GLfloat> > uniformMap;
std::vector<Star> starField;
Camera const & camera;
void prepareObjects();
void prepareProgram();
void updateShaderCamera();
// forbidding copy and assignation
GLHandler(GLHandler const &);
GLHandler & operator=(GLHandler const &);
public:
GLHandler(Camera const &);
~GLHandler();
ErrorCode initGL();
void resizeWindow(int width, int height);
void drawGLScene();
void setStarField(std::vector<Star> const &);
};