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:13:11 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-07-18 04:43:52 +0300
commit264b1e1e15ff3a6971166c8b93b3f0a06a60cc83 (patch)
treed60488bb6aaecf5759d1688b33c6e1dcf5525ea6 /source/blender/gpu
parent5993c53a6d36f4dc12910281be83021e45f76ac4 (diff)
Cleanup: GPU: Encapsulate glFrontFace
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_state.h1
-rw-r--r--source/blender/gpu/intern/gpu_state.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_state.h b/source/blender/gpu/GPU_state.h
index 0a97016e06d..c9f745a680d 100644
--- a/source/blender/gpu/GPU_state.h
+++ b/source/blender/gpu/GPU_state.h
@@ -59,6 +59,7 @@ void GPU_blend_set_func_separate(eGPUBlendFunction src_rgb,
eGPUBlendFunction src_alpha,
eGPUBlendFunction dst_alpha);
void GPU_face_culling(eGPUFaceCull culling);
+void GPU_front_facing(bool invert);
void GPU_depth_range(float near, float far);
void GPU_depth_test(bool enable);
bool GPU_depth_test_enabled(void);
diff --git a/source/blender/gpu/intern/gpu_state.c b/source/blender/gpu/intern/gpu_state.c
index 6d707161e97..c8f51b14343 100644
--- a/source/blender/gpu/intern/gpu_state.c
+++ b/source/blender/gpu/intern/gpu_state.c
@@ -89,6 +89,11 @@ void GPU_face_culling(eGPUFaceCull culling)
}
}
+void GPU_front_facing(bool invert)
+{
+ glFrontFace((invert) ? GL_CW : GL_CCW);
+}
+
void GPU_depth_range(float near, float far)
{
/* glDepthRangef is only for OpenGL 4.1 or higher */