diff options
author | Alexander Romanov <a.romanov@blend4web.com> | 2016-05-16 11:13:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-09 22:38:17 +0300 |
commit | 6798809c7ec8388509f541a64359b3d107e6fd3f (patch) | |
tree | cab8d4b80cfca2974814af7598248edd6368b6e5 /source/blender/editors/interface/interface_widgets.c | |
parent | d733826708f9b562687b78424e5c0835cba8c3c9 (diff) |
Flat shading for basic shader
The purpose of the patch is to replace deprecated glShadeModel.
To decrease glShadeModel calls I've set GL_SMOOTH by default
Reviewers: merwin, brecht
Reviewed By: brecht
Subscribers: blueprintrandom, Evgeny_Rodygin, AlexKowel, yurikovelenov
Differential Revision: https://developer.blender.org/D1958
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 19e0b55374e..5098e701638 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -712,8 +712,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) unsigned char *col_pt = col_array; shadecolors4(col1, col2, wcol->inner, wcol->shadetop, wcol->shadedown); - - glShadeModel(GL_SMOOTH); + for (a = 0; a < wtb->totvert; a++, col_pt += 4) { round_box_shade_col4_r(col_pt, col1, col2, wtb->inner_uv[a][wtb->draw_shadedir ? 1 : 0]); } @@ -725,8 +724,6 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) glDrawArrays(GL_POLYGON, 0, wtb->totvert); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_COLOR_ARRAY); - - glShadeModel(GL_FLAT); } } @@ -2311,8 +2308,6 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti * ui_color_picker_to_rgb(0.0f, 0.0f, hsv[2], colcent, colcent + 1, colcent + 2); - glShadeModel(GL_SMOOTH); - glBegin(GL_TRIANGLE_FAN); glColor3fv(colcent); glVertex2f(centx, centy); @@ -2330,8 +2325,6 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti * } glEnd(); - glShadeModel(GL_FLAT); - /* fully rounded outline */ glPushMatrix(); glTranslatef(centx, centy, 0.0f); @@ -2363,7 +2356,6 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons float col1[4][3]; /* right half, rect bottom to top */ /* draw series of gouraud rects */ - glShadeModel(GL_SMOOTH); switch (type) { case UI_GRAD_SV: @@ -2486,8 +2478,6 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons } glEnd(); } - - glShadeModel(GL_FLAT); } bool ui_but_is_colorpicker_display_space(uiBut *but) |