mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-18 19:12:44 +03:00
feat(gx): implement GLSDLDevice::SetScissor
This commit is contained in:
parent
1620994f02
commit
56439993ba
@ -2468,8 +2468,26 @@ void GLSDLDevice::SetModelView(GLEnum transform) {
|
||||
}
|
||||
}
|
||||
|
||||
void GLSDLDevice::SetScissor(bool a2, const GLRect& a3) {
|
||||
// TODO
|
||||
void GLSDLDevice::SetScissor(bool enable, const GLRect& rect) {
|
||||
if (enable) {
|
||||
if (this->m_States.rasterizer.scissorEnable) {
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
if (rect.left == this->m_States.rasterizer.scissor.left &&
|
||||
rect.top == this->m_States.rasterizer.scissor.top &&
|
||||
rect.width == this->m_States.rasterizer.scissor.width &&
|
||||
rect.height == this->m_States.rasterizer.scissor.height) {
|
||||
return;
|
||||
}
|
||||
|
||||
glScissor(rect.left, rect.top, rect.width, rect.height);
|
||||
|
||||
this->m_States.rasterizer.scissor = rect;
|
||||
} else if (this->m_States.rasterizer.scissorEnable) {
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
this->m_States.rasterizer.scissorEnable = false;
|
||||
}
|
||||
}
|
||||
|
||||
void GLSDLDevice::SetShader(GLShader::ShaderType shaderType, GLShader* shader) {
|
||||
|
@ -171,7 +171,7 @@ class GLSDLDevice {
|
||||
void SetIndexBuffer(GLBuffer* buffer);
|
||||
void SetLightingEnable(bool enable);
|
||||
void SetModelView(GLEnum transform);
|
||||
void SetScissor(bool a2, const GLRect& a3);
|
||||
void SetScissor(bool enable, const GLRect& rect);
|
||||
void SetShader(GLShader::ShaderType shaderType, GLShader* shader);
|
||||
void SetShaderConstants(GLShader::ShaderType shaderType, uint32_t index, const float* constants, uint32_t count);
|
||||
void SetShaderConstantsInternal(GLShader::ShaderType shaderType, uint32_t index, const float* constants, uint32_t count);
|
||||
|
Loading…
Reference in New Issue
Block a user