mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
[GL] Add stencil enable to state tracker
This commit is contained in:
parent
03733569e0
commit
b4cc743608
3 changed files with 25 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue