mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
Add clear colour to GL state manager
This commit is contained in:
parent
4107a84c0d
commit
0f5c41cd69
4 changed files with 138 additions and 128 deletions
|
@ -34,6 +34,8 @@ struct GLStateManager {
|
|||
bool redMask, greenMask, blueMask, alphaMask;
|
||||
bool depthMask;
|
||||
|
||||
float clearRed, clearBlue, clearGreen, clearAlpha;
|
||||
|
||||
GLuint stencilMask;
|
||||
GLuint boundVAO;
|
||||
GLuint boundVBO;
|
||||
|
@ -44,6 +46,7 @@ struct GLStateManager {
|
|||
|
||||
void reset();
|
||||
void resetBlend();
|
||||
void resetClearing();
|
||||
void resetClipping();
|
||||
void resetColourMask();
|
||||
void resetDepth();
|
||||
|
@ -209,8 +212,19 @@ struct GLStateManager {
|
|||
}
|
||||
}
|
||||
|
||||
void setClearColour(float r, float g, float b, float a) {
|
||||
if (clearRed != r || clearGreen != g || clearBlue != b || clearAlpha != a) {
|
||||
clearRed = r;
|
||||
clearGreen = g;
|
||||
clearBlue = b;
|
||||
clearAlpha = a;
|
||||
|
||||
OpenGL::setClearColor(r, g, b, a);
|
||||
}
|
||||
}
|
||||
|
||||
void setDepthFunc(OpenGL::DepthFunc func) { setDepthFunc(static_cast<GLenum>(func)); }
|
||||
};
|
||||
|
||||
static_assert(std::is_trivially_constructible<GLStateManager>(), "OpenGL State Manager class is not trivially constructible!");
|
||||
static_assert(std::is_trivially_destructible<GLStateManager>(), "OpenGL State Manager class is not trivially destructible!");
|
||||
static_assert(std::is_trivially_destructible<GLStateManager>(), "OpenGL State Manager class is not trivially destructible!");
|
Loading…
Add table
Add a link
Reference in a new issue