mirror of
https://github.com/bjornbytes/lovr.git
synced 2024-07-05 22:03:36 +00:00
Simplify lovrGraphicsClear;
This commit is contained in:
parent
48733f87c4
commit
146d037cae
|
@ -147,19 +147,8 @@ void lovrGraphicsReset() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void lovrGraphicsClear(int color, int depth) {
|
void lovrGraphicsClear(int color, int depth) {
|
||||||
int bits = 0;
|
if (!color && !depth) return;
|
||||||
|
glClear((color ? GL_COLOR_BUFFER_BIT : 0) | (depth ? GL_DEPTH_BUFFER_BIT : 0));
|
||||||
if (color) {
|
|
||||||
bits |= GL_COLOR_BUFFER_BIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (depth) {
|
|
||||||
bits |= GL_DEPTH_BUFFER_BIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bits != 0) {
|
|
||||||
glClear(bits);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void lovrGraphicsPresent() {
|
void lovrGraphicsPresent() {
|
||||||
|
|
Loading…
Reference in a new issue