-
Notifications
You must be signed in to change notification settings - Fork 13
/
image_gpu_private.h
50 lines (40 loc) · 1.47 KB
/
image_gpu_private.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
/**
* @file image_gpu_private.h
* @brief Private GPU header. GPU functions for image processing.
*/
#ifndef _PICOPTERX_IMAGE_GPU_PRIVATE_H
#define _PICOPTERX_IMAGE_GPU_PRIVATE_H
#include <GLES2/gl2.h>
#include <EGL/egl.h>
namespace picopter {
class GLProgram {
public:
GLProgram(const char *vertex_file, const char *fragment_file);
virtual ~GLProgram();
GLuint GetId();
operator GLuint() { return m_program_id; };
private:
GLuint m_vertex_id, m_fragment_id, m_program_id;
GLuint LoadShader(GLenum shader_type, const char *source_file);
char* ReadFile(const char *file);
};
class GLTexture {
public:
GLTexture(GLsizei width, GLsizei height, GLint type);
virtual ~GLTexture();
GLsizei GetWidth();
GLsizei GetHeight();
void SetData(void *data);
void GetRenderedData(void *buffer);
GLuint GetTextureId();
GLuint GetFramebufferId();
operator GLuint() { return m_texture_id; };
private:
GLsizei m_width, m_height;
GLint m_type;
GLuint m_texture_id, m_framebuffer_id;
};
extern void DoMoreShit(EGLDisplay display, EGLSurface surface, GLuint buffer, picopter::GLProgram &program, picopter::GLTexture &texture);
extern void DisplayShit(int width, int height, void *data);
}
#endif // _PICOPTERX_IMAGE_GPU_PRIVATE_H