From f58a6615aa08c53a17ec86e3c94b455321aa7874 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 22 Jun 2013 18:33:56 +0000 Subject: [PATCH] gpu: add full support for alpha test in GL and D3D. --- neercs/video/render.cpp | 6 ++---- neercs/video/text-render.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/neercs/video/render.cpp b/neercs/video/render.cpp index b26b646..dd5dafb 100644 --- a/neercs/video/render.cpp +++ b/neercs/video/render.cpp @@ -862,8 +862,7 @@ void Render::ShaderSimple(Framebuffer *fbo_output, int n) int Render::InitDraw(void) { glDepthMask(GL_TRUE); // do not write z-buffer - glEnable(GL_CULL_FACE); // disable cull face - glCullFace(GL_BACK); // don't draw front face + /* initialise framebuffer objects */ fbo_back = new Framebuffer(screen_size); fbo_screen = new Framebuffer(screen_size); @@ -1452,7 +1451,6 @@ void Render::Draw2D() /* Clear the back buffer */ RenderContext rc; - rc.SetAlphaBlend(true); rc.SetBlendFunc(BlendFunc::SrcColor, BlendFunc::DstAlpha); glEnable(GL_TEXTURE_2D); @@ -1479,7 +1477,7 @@ void Render::Draw3D() return; RenderContext rc; - rc.SetAlphaBlend(false); + rc.SetBlendFunc(BlendFunc::Disabled, BlendFunc::Disabled); rc.SetDepthFunc(DepthFunc::Disabled); glEnableClientState(GL_VERTEX_ARRAY); diff --git a/neercs/video/text-render.cpp b/neercs/video/text-render.cpp index 286f75a..914ee2d 100644 --- a/neercs/video/text-render.cpp +++ b/neercs/video/text-render.cpp @@ -186,7 +186,7 @@ void TextRender::Blit(ivec2 pos, ivec2 size) uint64_t const &x = *(uint64_t const *)&t; RenderContext rc; - rc.SetAlphaBlend(false); + rc.SetBlendFunc(BlendFunc::Disabled, BlendFunc::Disabled); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, (int)x);