Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-07-17 21:04:37 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-07-18 04:43:52 +0300
commit5993c53a6d36f4dc12910281be83021e45f76ac4 (patch)
treec342317e6f3b1a812ca52e67a1ecf161f2d110e0 /source/blender/gpu/intern
parentc14e6cdd5660be471e559206cd5eacee85fa0981 (diff)
Cleanup: GPU: Encapsulate Backface culling
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_state.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_state.c b/source/blender/gpu/intern/gpu_state.c
index a339cfb8b5a..6d707161e97 100644
--- a/source/blender/gpu/intern/gpu_state.c
+++ b/source/blender/gpu/intern/gpu_state.c
@@ -78,6 +78,17 @@ void GPU_blend_set_func_separate(eGPUBlendFunction src_rgb,
gpu_get_gl_blendfunction(dst_alpha));
}
+void GPU_face_culling(eGPUFaceCull culling)
+{
+ if (culling == GPU_CULL_NONE) {
+ glDisable(GL_CULL_FACE);
+ }
+ else {
+ glEnable(GL_CULL_FACE);
+ glCullFace((culling == GPU_CULL_FRONT) ? GL_FRONT : GL_BACK);
+ }
+}
+
void GPU_depth_range(float near, float far)
{
/* glDepthRangef is only for OpenGL 4.1 or higher */