Add a flag to ImTextureID that disables alpha test

This commit is contained in:
Dr. Chat
2016-02-16 16:43:12 -06:00
parent 65d1ea0250
commit a8dfd6a21a
5 changed files with 26 additions and 1 deletions

View File

@@ -270,6 +270,16 @@ 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

View File

@@ -37,6 +37,8 @@ class GLImmediateDrawer : public ImmediateDrawer {
void EndDrawBatch() override;
void End() override;
void EnableAlphaTest(bool enable);
private:
void InitializeShaders();