mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-11 09:38:41 +12:00
Add UBO/BlendEquation/BlendFunc to GL state manager
This commit is contained in:
parent
219a560cbe
commit
a4ec770587
3 changed files with 67 additions and 7 deletions
|
@ -5,9 +5,20 @@ void GLStateManager::resetBlend() {
|
|||
logicOpEnabled = false;
|
||||
logicOp = GL_COPY;
|
||||
|
||||
blendEquationRGB = GL_FUNC_ADD;
|
||||
blendEquationAlpha = GL_FUNC_ADD;
|
||||
|
||||
blendFuncSourceRGB = GL_SRC_COLOR;
|
||||
blendFuncDestRGB = GL_DST_COLOR;
|
||||
blendFuncSourceAlpha = GL_SRC_ALPHA;
|
||||
blendFuncDestAlpha = GL_DST_ALPHA;
|
||||
|
||||
OpenGL::disableBlend();
|
||||
OpenGL::disableLogicOp();
|
||||
OpenGL::setLogicOp(GL_COPY);
|
||||
|
||||
glBlendEquationSeparate(blendEquationRGB, blendEquationAlpha);
|
||||
glBlendFuncSeparate(blendFuncSourceRGB, blendFuncDestRGB, blendFuncSourceAlpha, blendFuncDestAlpha);
|
||||
}
|
||||
|
||||
void GLStateManager::resetClearing() {
|
||||
|
@ -61,9 +72,12 @@ void GLStateManager::resetVAO() {
|
|||
glBindVertexArray(0);
|
||||
}
|
||||
|
||||
void GLStateManager::resetVBO() {
|
||||
void GLStateManager::resetBuffers() {
|
||||
boundVBO = 0;
|
||||
boundUBO = 0;
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, 0);
|
||||
}
|
||||
|
||||
void GLStateManager::resetProgram() {
|
||||
|
@ -79,7 +93,7 @@ void GLStateManager::reset() {
|
|||
resetDepth();
|
||||
|
||||
resetVAO();
|
||||
resetVBO();
|
||||
resetBuffers();
|
||||
resetProgram();
|
||||
resetScissor();
|
||||
resetStencil();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue