-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopenglplayer.h
More file actions
48 lines (42 loc) · 1.17 KB
/
copenglplayer.h
File metadata and controls
48 lines (42 loc) · 1.17 KB
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
#ifndef COPENGLPLAYER_H
#define COPENGLPLAYER_H
// Include GLEW
#include <GL/glew.h>
// Include GLFW
#include <GLFW/glfw3.h>
// Include GLM
#include <glm/glm.hpp>
#include <string>
class COpenglPlayer
{
public:
COpenglPlayer();
virtual void Play();
protected:
virtual void Init();
virtual void InitFrameData() = 0;
virtual void GetRenderData(uint8_t**& pBuffer) = 0;
virtual void UpdateTexture(uint8_t**& pBuffer);
virtual void Run();
private:
int CreateWindow();
bool InitShader(const std::string& shaderFile, GLint shaderID);
void CreateProgram(GLint vShaderID, GLint fShaderID);
void InitTexture();
void InitBufferData();
void InitOpenglEnv();
protected:
GLFWwindow* m_Screen;
GLuint m_uiPosBuffer;
GLuint m_uiFragBuffer;
GLuint m_uiProgram;
GLuint m_uiTextureIDY;
GLuint m_uiTextureIDU;
GLuint m_uiTextureIDV; // Texture id
GLuint m_uiTextureUniformY;
GLuint m_uiTextureUniformU;
GLuint m_uiTextureUniformV;
int m_iPixelW;
int m_iPixelH;
};
#endif // COPENGLPLAYER_H