From 26f05c6e3dcac9995345fb5a2b031be7e3ea79e9 Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 30 Oct 2021 22:59:42 +0800 Subject: *TextGenerator --- Runtime/Graphics/GfxDevice.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Runtime/Graphics/GfxDevice.cpp') diff --git a/Runtime/Graphics/GfxDevice.cpp b/Runtime/Graphics/GfxDevice.cpp index d30a60a..f318487 100644 --- a/Runtime/Graphics/GfxDevice.cpp +++ b/Runtime/Graphics/GfxDevice.cpp @@ -80,6 +80,9 @@ void GfxDevice::UseShader(LuaBind::State& state, Shader* shader, int idx) m_Shader.shader = shader; m_Shader.ref.SetRef(state, idx); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } void GfxDevice::UnuseShader() @@ -135,7 +138,8 @@ void GfxDevice::SetUniformTexture(const char* name, Texture* texture) int texUnit = s_TextureUnitBucket.back(); s_TextureUnitBucket.pop_back(); glActiveTexture(GL_TEXTURE0 + texUnit); - glBindTexture(GL_TEXTURE_2D, texture->GetGpuID()); + //glBindTexture(GL_TEXTURE_2D, texture->GetGpuID()); + glBindTexture(GL_TEXTURE_2D, 2); GLint loc = glGetUniformLocation(m_Shader.GetID(), name); glUniform1i(loc, texUnit); -- cgit v1.1-26-g67d0