[GL] Add stencil enable to state tracker
This commit is contained in:
@@ -21,6 +21,7 @@ struct GLStateManager {
|
||||
bool blendEnabled;
|
||||
bool depthEnabled;
|
||||
bool scissorEnabled;
|
||||
bool stencilEnabled;
|
||||
|
||||
// Colour/depth masks
|
||||
bool redMask, greenMask, blueMask, alphaMask;
|
||||
@@ -40,6 +41,7 @@ struct GLStateManager {
|
||||
void resetVBO();
|
||||
void resetProgram();
|
||||
void resetScissor();
|
||||
void resetStencil();
|
||||
|
||||
void enableDepth() {
|
||||
if (!depthEnabled) {
|
||||
@@ -83,6 +85,20 @@ struct GLStateManager {
|
||||
}
|
||||
}
|
||||
|
||||
void enableStencil() {
|
||||
if (!stencilEnabled) {
|
||||
stencilEnabled = true;
|
||||
OpenGL::enableStencil();
|
||||
}
|
||||
}
|
||||
|
||||
void disableStencil() {
|
||||
if (stencilEnabled) {
|
||||
stencilEnabled = false;
|
||||
OpenGL::disableStencil();
|
||||
}
|
||||
}
|
||||
|
||||
void bindVAO(GLuint handle) {
|
||||
if (boundVAO != handle) {
|
||||
boundVAO = handle;
|
||||
|
||||
Reference in New Issue
Block a user