diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-01-16 06:59:42 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-01-16 07:51:29 +0300 |
commit | 2d71d13ea2cb7a7640e5139dc24341bd58416d57 (patch) | |
tree | 48061a6f98f4212de685e3dc8279270a5427e898 /source/blender/editors/uvedit/uvedit_smart_stitch.c | |
parent | 31375a1b21a98f5ce6abdd46a41a1e287d3d5050 (diff) |
OpenGL: fixes related to GL_POINTS
I put all usage of GL_POINTS under the microscope. Fixed problems &
optimized a couple of spots.
- reduce calls to glPointSize by about 50%
- draw selected & unselected vertices together for UV editor & EditMesh
- draw initial gpencil stroke point the proper size
- a few other smaller fixes
New policy: each GL_POINTS draw call needs to set its desired point
size. This eliminates half our calls to glPointSize (setting it back to
its 1.0 default after every draw).
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_smart_stitch.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_smart_stitch.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 828537fd585..c9f4d274b8e 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1506,15 +1506,12 @@ static void stitch_calculate_edge_normal(BMEditMesh *em, UvEdge *edge, float *no static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *arg) { int i, index = 0; - float pointsize = UI_GetThemeValuef(TH_VERTEX_SIZE); StitchState *state = (StitchState *)arg; StitchPreviewer *stitch_preview = state->stitch_preview; glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); glEnableClientState(GL_VERTEX_ARRAY); - glPointSize(pointsize * 2.0f); - glEnable(GL_BLEND); UI_ThemeColor4(TH_STITCH_PREVIEW_ACTIVE); @@ -1542,6 +1539,8 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar /* draw vert preview */ if (state->mode == STITCH_VERT) { + glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) * 2.0f); + UI_ThemeColor4(TH_STITCH_PREVIEW_STITCHABLE); glVertexPointer(2, GL_FLOAT, 0, stitch_preview->preview_stitchable); glDrawArrays(GL_POINTS, 0, stitch_preview->num_stitchable); @@ -1562,8 +1561,6 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar glPopClientAttrib(); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - glPointSize(1.0); } static UvEdge *uv_edge_get(BMLoop *l, StitchState *state) |