diff options
author | chai <chaifix@163.com> | 2021-10-30 22:59:42 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-30 22:59:42 +0800 |
commit | 26f05c6e3dcac9995345fb5a2b031be7e3ea79e9 (patch) | |
tree | fc32c3e9d235817df0be331a6100b7f8263facab /Runtime/Graphics/GfxDevice.cpp | |
parent | c3e259f4d29e9bdcb73617ad8e4d71f117b4d289 (diff) |
*TextGenerator
Diffstat (limited to 'Runtime/Graphics/GfxDevice.cpp')
-rw-r--r-- | Runtime/Graphics/GfxDevice.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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); |