diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-03-24 01:43:26 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-03-24 01:43:26 +0300 |
commit | ed9af18c762cf55947f51f3dae939a76fdb19d9a (patch) | |
tree | 8526bb9a0b4a9e1d413a2fb884f264c27f46ce94 /source/blender/editors/interface/interface_draw.c | |
parent | ee5e7a006e7134bad6534abe331c6f9310380337 (diff) |
GPU: Replace glEnable/glDisable but GPU_state calls
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index eeea4959729..da85ed2840d 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1291,7 +1291,12 @@ static void ui_draw_colorband_handle_tri_hlight(uint pos, float x1, float y1, fl static void ui_draw_colorband_handle_tri(uint pos, float x1, float y1, float halfwidth, float height, bool fill) { - glEnable(fill ? GL_POLYGON_SMOOTH : GL_LINE_SMOOTH); + if (fill) { + GPU_polygon_smooth(true); + } + else { + GPU_line_smooth(true); + } immBegin(fill ? GPU_PRIM_TRIS : GPU_PRIM_LINE_LOOP, 3); immVertex2f(pos, x1 + halfwidth, y1); @@ -1299,7 +1304,12 @@ static void ui_draw_colorband_handle_tri(uint pos, float x1, float y1, float hal immVertex2f(pos, x1 - halfwidth, y1); immEnd(); - glDisable(fill ? GL_POLYGON_SMOOTH : GL_LINE_SMOOTH); + if (fill) { + GPU_polygon_smooth(false); + } + else { + GPU_line_smooth(false); + } } static void ui_draw_colorband_handle_box(uint pos, float x1, float y1, float x2, float y2, bool fill) |