diff options
author | Ray Molenkamp <github@lazydodo.com> | 2018-06-27 00:17:31 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2018-06-27 00:17:31 +0300 |
commit | 6f2c9ea3e13248d146816910369983c5265bc968 (patch) | |
tree | 32b779874f8116663534ab8a6602f8f139bd6360 /source/blender/gpu/intern/gpu_texture.c | |
parent | a61480c27103fbf449fd14ea8061b65c29f19eae (diff) |
bf_gpu: Add GPU_state module.
This has wrappers for the most common gl* functions in the codebase, and is in preparation for D3502
Reviewers: brecht, fclem
Differential Revision: https://developer.blender.org/D3501
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index 21a3aee5f57..ae037ca442e 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -1260,43 +1260,3 @@ int GPU_texture_detach_framebuffer(GPUTexture *tex, GPUFrameBuffer *fb) BLI_assert(!"Error: Texture: Framebuffer is not attached"); return 0; } - -void GPU_blend(bool enable) -{ - if (enable) { - glEnable(GL_BLEND); - } - else { - glDisable(GL_BLEND); - } -} - -static GLenum gpu_get_gl_blendfunction(GPUBlendFunction blend) -{ - switch (blend) { - case GPU_ONE: - return GL_ONE; - case GPU_SRC_ALPHA: - return GL_SRC_ALPHA; - case GPU_ONE_MINUS_SRC_ALPHA: - return GL_ONE_MINUS_SRC_ALPHA; - default: - BLI_assert(!"Unhandled blend mode"); - return GL_ZERO; - } -} - -void GPU_blend_set_func_separate( - GPUBlendFunction src_rgb, GPUBlendFunction dst_rgb, - GPUBlendFunction src_alpha, GPUBlendFunction dst_alpha) -{ - glBlendFuncSeparate(gpu_get_gl_blendfunction(src_rgb), - gpu_get_gl_blendfunction(dst_rgb), - gpu_get_gl_blendfunction(src_alpha), - gpu_get_gl_blendfunction(dst_alpha)); -} - -void GPU_blend_set_func(GPUBlendFunction sfactor, GPUBlendFunction dfactor) -{ - glBlendFunc(gpu_get_gl_blendfunction(sfactor), gpu_get_gl_blendfunction(dfactor)); -} |