-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimpleRenderer.h
45 lines (35 loc) · 996 Bytes
/
SimpleRenderer.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
#pragma once
//#include <angle_gl.h>
#include "GLES/gl.h"
#include "GLES/glext.h"
#include "GLES2/gl2.h"
#include "GLES2/gl2ext.h"
#include "GLES3/gl3.h"
#include "GLES3/gl31.h"
#include "GLES3/gl32.h"
// TODO(http://anglebug.com/3730): Autogenerate these enums from gl.xml
// HACK: Defines for queries that are not in GLES
#define GL_CONTEXT_PROFILE_MASK 0x9126
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
class SimpleRenderer
{
public:
SimpleRenderer();
~SimpleRenderer();
void Draw();
void UpdateWindowSize(GLsizei width, GLsizei height);
private:
GLuint mProgram;
GLsizei mWindowWidth;
GLsizei mWindowHeight;
GLint mPositionAttribLocation;
GLint mColorAttribLocation;
GLint mModelUniformLocation;
GLint mViewUniformLocation;
GLint mProjUniformLocation;
GLuint mVertexPositionBuffer;
GLuint mVertexColorBuffer;
GLuint mIndexBuffer;
int mDrawCount;
};