This commit is contained in:
wheremyfoodat 2023-07-28 02:24:26 +03:00
parent adb78bf838
commit 73321856c8
4 changed files with 53 additions and 29 deletions
include/renderer_gl

View file

@ -34,11 +34,13 @@ struct GLStateManager {
bool redMask, greenMask, blueMask, alphaMask;
bool depthMask;
GLuint stencilMask;
GLuint boundVAO;
GLuint boundVBO;
GLuint currentProgram;
GLenum depthFunc;
GLenum logicOp;
void reset();
void resetBlend();
@ -121,6 +123,13 @@ struct GLStateManager {
}
}
void setLogicOp(GLenum op) {
if (logicOp != op) {
logicOp = op;
OpenGL::setLogicOp(op);
}
}
void enableClipPlane(GLuint index) {
if (index >= clipPlaneCount) [[unlikely]] {
Helpers::panic("Enabled invalid clipping plane %d\n", index);
@ -143,6 +152,13 @@ struct GLStateManager {
}
}
void setStencilMask(GLuint mask) {
if (stencilMask != mask) {
stencilMask = mask;
OpenGL::setStencilMask(mask);
}
}
void bindVAO(GLuint handle) {
if (boundVAO != handle) {
boundVAO = handle;