From ab19abe22315f2e2dcce989beef6dcabee528299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 16 Jul 2020 02:06:25 +0200 Subject: Cleanup: Port glClear calls to GPU module functions --- source/blender/windowmanager/intern/wm_draw.c | 8 ++++---- source/blender/windowmanager/intern/wm_playanim.c | 9 +++++---- source/blender/windowmanager/intern/wm_window.c | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'source/blender/windowmanager/intern') 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 */ -- cgit v1.2.3