RunicVTT Open Source Virtual Tabletop for TTRPG using P2P
Loading...
Searching...
No Matches
Renderer.h File Reference
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "VertexArray.h"
#include "IndexBuffer.h"
#include "Shader.h"
Include dependency graph for Renderer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Renderer
 

Macros

#define ASSERT(x)
 
#define GLCall(x)
 

Functions

void GLClearError ()
 
bool GLLogCall (const char *function, const char *file, int line)
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT ( x)
Value:
if (!(x)) \
__debugbreak();

Definition at line 9 of file Renderer.h.

9#define ASSERT(x) \
10 if (!(x)) \
11 __debugbreak();

◆ GLCall

#define GLCall ( x)
Value:
x; \
ASSERT(GLLogCall(#x, __FILE__, __LINE__));
bool GLLogCall(const char *function, const char *file, int line)
Definition Renderer.cpp:10
void GLClearError()
Definition Renderer.cpp:4

Definition at line 12 of file Renderer.h.

12#define GLCall(x) \
13 GLClearError(); \
14 x; \
15 ASSERT(GLLogCall(#x, __FILE__, __LINE__));

Function Documentation

◆ GLClearError()

void GLClearError ( )

Definition at line 4 of file Renderer.cpp.

5{
6 while (glGetError() != GL_NO_ERROR)
7 ;
8}

◆ GLLogCall()

bool GLLogCall ( const char * function,
const char * file,
int line )

Definition at line 10 of file Renderer.cpp.

11{
12 while (GLenum error = glGetError())
13 {
14 std::cout << "[OpenGl Error] (" << error << "): " << function << " " << file << ":" << line << std::endl;
15 return false;
16 }
17 return true;
18}