-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacro.h
26 lines (26 loc) · 1.61 KB
/
macro.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
#pragma once
#ifdef DEBUG
#define glCall(x) \
x; \
{ \
unsigned int err = 0; \
while ((err = glGetError()) != GL_NO_ERROR) \
{ \
std::cout << "ERROR: 0x" << std::hex << err << " in file" << __FILE__ << ": " \
<< std::dec << __LINE__ << '\n'; \
} \
}
#define glCallr(x, y) \
y = x; \
{ \
unsigned int err = 0; \
while ((err = glGetError()) != GL_NO_ERROR) \
{ \
std::cout << "ERROR: 0x" << std::hex << err << " in file" << __FILE__ << ": " \
<< std::dec << __LINE__ << '\n'; \
} \
}
#else
#define glCall(x) x;
#define glCallr(x, y) y = x;
#endif