diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-12 20:48:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-12 20:48:52 +0300 |
commit | 2e4569abbc6aa19d166ed083c04e046fdc19fce5 (patch) | |
tree | a924894164afd7337e3d272e0e8ef4cedbf49250 /source/blender/editors | |
parent | fe5efccd8fb6ce2a7e5e858e3f8becf5f98bb087 (diff) |
Fix remaining GL calls/type preventing from building due to recent cleanup
Diffstat (limited to 'source/blender/editors')
4 files changed, 17 insertions, 15 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index c91b4d826a7..d22ddb5f2b7 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -256,7 +256,7 @@ static void def_internal_vicon(int icon_id, VectorDrawFunc drawFunc) /* Utilities */ -static void viconutil_set_point(GLint pt[2], int x, int y) +static void viconutil_set_point(int pt[2], int x, int y) { pt[0] = x; pt[1] = y; @@ -264,7 +264,7 @@ static void viconutil_set_point(GLint pt[2], int x, int y) static void vicon_small_tri_right_draw(int x, int y, int w, int UNUSED(h), float alpha) { - GLint pts[3][2]; + int pts[3][2]; const int cx = x + w / 2 - 4; const int cy = y + w / 2; const int d = w / 5, d2 = w / 7; diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 3d8c718c8a9..55abb269660 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -142,7 +142,7 @@ typedef struct LoadTexData { ViewContext *vc; MTex *mtex; - GLubyte *buffer; + uchar *buffer; bool col; struct ImagePool *pool; @@ -160,7 +160,7 @@ static void load_tex_task_cb_ex(void *__restrict userdata, ViewContext *vc = data->vc; MTex *mtex = data->mtex; - GLubyte *buffer = data->buffer; + uchar *buffer = data->buffer; const bool col = data->col; struct ImagePool *pool = data->pool; @@ -230,7 +230,7 @@ static void load_tex_task_cb_ex(void *__restrict userdata, /* Clamp to avoid precision overflow. */ CLAMP(avg, 0.0f, 1.0f); - buffer[index] = 255 - (GLubyte)(255 * avg); + buffer[index] = 255 - (uchar)(255 * avg); } } else { @@ -254,7 +254,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima MTex *mtex = (primary) ? &br->mtex : &br->mask_mtex; ePaintOverlayControlFlags overlay_flags = BKE_paint_get_overlay_flags(); - GLubyte *buffer = NULL; + uchar *buffer = NULL; int size; bool refresh; @@ -309,10 +309,10 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima target->old_col = col; } if (col) { - buffer = MEM_mallocN(sizeof(GLubyte) * size * size * 4, "load_tex"); + buffer = MEM_mallocN(sizeof(uchar) * size * size * 4, "load_tex"); } else { - buffer = MEM_mallocN(sizeof(GLubyte) * size * size, "load_tex"); + buffer = MEM_mallocN(sizeof(uchar) * size * size, "load_tex"); } pool = BKE_image_pool_new(); @@ -381,7 +381,7 @@ static void load_tex_cursor_task_cb(void *__restrict userdata, LoadTexData *data = userdata; Brush *br = data->br; - GLubyte *buffer = data->buffer; + uchar *buffer = data->buffer; const int size = data->size; @@ -398,7 +398,7 @@ static void load_tex_cursor_task_cb(void *__restrict userdata, /* Falloff curve. */ float avg = BKE_brush_curve_strength_clamped(br, len, 1.0f); - buffer[index] = (GLubyte)(255 * avg); + buffer[index] = (uchar)(255 * avg); } else { buffer[index] = 0; @@ -411,7 +411,7 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom) bool init; ePaintOverlayControlFlags overlay_flags = BKE_paint_get_overlay_flags(); - GLubyte *buffer = NULL; + uchar *buffer = NULL; int size; const bool refresh = !cursor_snap.overlay_texture || @@ -452,7 +452,7 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom) cursor_snap.size = size; } - buffer = MEM_mallocN(sizeof(GLubyte) * size * size, "load_tex"); + buffer = MEM_mallocN(sizeof(uchar) * size * size, "load_tex"); BKE_curvemapping_init(br->curve); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 85d153feb4c..60dd134646d 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -55,6 +55,7 @@ #include "BIF_glutil.h" +#include "GPU_framebuffer.h" #include "GPU_immediate.h" #include "GPU_immediate_util.h" #include "GPU_matrix.h" @@ -570,7 +571,8 @@ static void draw_image_buffer(const bContext *C, float zoomy) { /* Image are still drawn in display space. */ - glDisable(GL_FRAMEBUFFER_SRGB); + GPUFrameBuffer *fb = GPU_framebuffer_active_get(); + GPU_framebuffer_bind_no_srgb(fb); int x, y; int sima_flag = sima->flag & ED_space_image_get_display_channel_mask(ibuf); @@ -660,7 +662,7 @@ static void draw_image_buffer(const bContext *C, } } - glEnable(GL_FRAMEBUFFER_SRGB); + GPU_framebuffer_bind(fb); } static void draw_image_buffer_repeated(const bContext *C, diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index f3300f21628..0b5daece556 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1065,7 +1065,7 @@ static void draw_rotation_guide(const RegionView3D *rv3d) float o[3]; /* center of rotation */ float end[3]; /* endpoints for drawing */ - GLubyte color[4] = {0, 108, 255, 255}; /* bright blue so it matches device LEDs */ + uchar color[4] = {0, 108, 255, 255}; /* bright blue so it matches device LEDs */ negate_v3_v3(o, rv3d->ofs); |