diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-07-02 05:30:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-07-02 05:34:27 +0300 |
commit | a9635c63842d47009cbb9b9de7ca8afa112254bf (patch) | |
tree | 2ed19a6e362515bcfbe323cae39329871dd46e69 /source/blender/gpu | |
parent | 12788538496a6c63f876926f27a99cf8b0ad9c97 (diff) |
Cleanup: rename set_inverted_drawing, move to GPU_state
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_state.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_state.c | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_state.h b/source/blender/gpu/GPU_state.h index 7b970786e5e..efea02eb5a4 100644 --- a/source/blender/gpu/GPU_state.h +++ b/source/blender/gpu/GPU_state.h @@ -59,4 +59,6 @@ void GPU_viewport_size_get_i(int coords[4]); void GPU_flush(void); void GPU_finish(void); +void GPU_logic_op_invert_set(bool enable); + #endif /* __GPU_STATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_state.c b/source/blender/gpu/intern/gpu_state.c index 7a27fea2f0d..caf97a620ab 100644 --- a/source/blender/gpu/intern/gpu_state.c +++ b/source/blender/gpu/intern/gpu_state.c @@ -175,3 +175,17 @@ void GPU_finish(void) { glFinish(); } + +void GPU_logic_op_invert_set(bool enable) +{ + if (enable) { + glLogicOp(GL_INVERT); + glEnable(GL_COLOR_LOGIC_OP); + glDisable(GL_DITHER); + } + else { + glLogicOp(GL_COPY); + glDisable(GL_COLOR_LOGIC_OP); + glEnable(GL_DITHER); + } +} |