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-16 03:06:25 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-07-16 19:01:44 +0300
commitab19abe22315f2e2dcce989beef6dcabee528299 (patch)
tree751d0dba4738ed2e6281b94bb12cb68b5f904952 /source/blender/windowmanager/intern
parentbc8508115645f6426431217d1fc78cfe32ce6b23 (diff)
Cleanup: Port glClear calls to GPU module functions
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c8
-rw-r--r--source/blender/windowmanager/intern/wm_playanim.c9
-rw-r--r--source/blender/windowmanager/intern/wm_window.c4
3 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 2b679dfefde..c686bf3f3e1 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -736,8 +736,8 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo)
wm_draw_region_buffer_create(region, false, false);
wm_draw_region_bind(region, 0);
- glClearColor(0, 0, 0, 0);
- glClear(GL_COLOR_BUFFER_BIT);
+ GPU_clear_color(0, 0, 0, 0);
+ GPU_clear(GPU_COLOR_BIT);
ED_region_do_draw(C, region);
wm_draw_region_unbind(region);
@@ -759,8 +759,8 @@ static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view)
* Actually this is only a problem when resizing the window.
* If it becomes a problem we should clear only when window size changes. */
#if 0
- glClearColor(0, 0, 0, 0);
- glClear(GL_COLOR_BUFFER_BIT);
+ GPU_clear_color(0, 0, 0, 0);
+ GPU_clear(GPU_COLOR_BIT);
#endif
/* Blit non-overlapping area regions. */
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c
index 37c7e802554..50d2b4dd49e 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -58,6 +58,7 @@
#include "BIF_glutil.h"
#include "GPU_context.h"
+#include "GPU_framebuffer.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_init_exit.h"
@@ -309,8 +310,8 @@ static void playanim_toscreen(
CLAMP(offs_x, 0.0f, 1.0f);
CLAMP(offs_y, 0.0f, 1.0f);
- glClearColor(0.1, 0.1, 0.1, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
+ GPU_clear_color(0.1, 0.1, 0.1, 0.0);
+ GPU_clear(GPU_COLOR_BIT);
/* checkerboard for case alpha */
if (ibuf->planes == 32) {
@@ -1315,8 +1316,8 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
maxwiny = ibuf->y * (1 + (maxwiny / ibuf->y));
}
- glClearColor(0.1, 0.1, 0.1, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
+ GPU_clear_color(0.1, 0.1, 0.1, 0.0);
+ GPU_clear(GPU_COLOR_BIT);
int win_x, win_y;
playanim_window_get_size(&win_x, &win_y);
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index e1b2285313c..aaf8e46b301 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -648,10 +648,10 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm,
}
#endif
/* until screens get drawn, make it nice gray */
- glClearColor(0.55, 0.55, 0.55, 0.0);
+ GPU_clear_color(0.55, 0.55, 0.55, 0.0);
/* Crash on OSS ATI: bugs.launchpad.net/ubuntu/+source/mesa/+bug/656100 */
if (!GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE)) {
- glClear(GL_COLOR_BUFFER_BIT);
+ GPU_clear(GPU_COLOR_BIT);
}
/* needed here, because it's used before it reads userdef */