forked from christopher-besch/opengl_reference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderer.h
39 lines (31 loc) · 777 Bytes
/
Renderer.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
#pragma once
#include <GL/glew.h>
#include "VertexArray.h"
#include "IndexBuffer.h"
#include "Shader.h"
// <- compiler dependent
#define ASSERT(x) if (!(x)) __debugbreak();
#ifdef DEBUG
// #x turns x into a string
#define GLCALL(x) gl_clear_errors();\
x;\
ASSERT(gl_log_call(#x, __FILE__, __LINE__))
#else
#define GLCALL(x) x
#endif
void gl_clear_errors();
bool gl_log_call(const char* function, const char* file, int line);
void GLAPIENTRY error_occurred_gl(GLenum source,
GLenum type,
GLuint id,
GLenum severity,
GLsizei length,
const GLchar * message,
const void* userParam);
class Renderer
{
private:
public:
void clear() const;
void draw(const VertexArray& va, const IndexBuffer& ib, Shader& shader) const;
};