Move EnableDepthTest functionality into a bool alpha_blend var on ImmediateDraw.
This commit is contained in:
@@ -228,6 +228,14 @@ void GLImmediateDrawer::Draw(const ImmediateDraw& draw) {
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
if (draw.alpha_blend) {
|
||||
glEnablei(GL_BLEND, 0);
|
||||
glBlendEquationi(0, GL_FUNC_ADD);
|
||||
glBlendFunci(0, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
} else {
|
||||
glDisablei(GL_BLEND, 0);
|
||||
}
|
||||
|
||||
if (draw.texture_handle) {
|
||||
glBindTextureUnit(0, static_cast<GLuint>(draw.texture_handle));
|
||||
} else {
|
||||
@@ -270,16 +278,6 @@ void GLImmediateDrawer::End() {
|
||||
}
|
||||
}
|
||||
|
||||
void GLImmediateDrawer::EnableAlphaTest(bool enable) {
|
||||
if (enable) {
|
||||
glEnablei(GL_BLEND, 0);
|
||||
glBlendEquationi(0, GL_FUNC_ADD);
|
||||
glBlendFunci(0, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
} else {
|
||||
glDisablei(GL_BLEND, 0);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace gl
|
||||
} // namespace ui
|
||||
} // namespace xe
|
||||
|
||||
@@ -37,8 +37,6 @@ class GLImmediateDrawer : public ImmediateDrawer {
|
||||
void EndDrawBatch() override;
|
||||
void End() override;
|
||||
|
||||
void EnableAlphaTest(bool enable);
|
||||
|
||||
private:
|
||||
void InitializeShaders();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user