Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2016-01-16 06:59:42 +0300
committerMike Erwin <significant.bit@gmail.com>2016-01-16 07:51:29 +0300
commit2d71d13ea2cb7a7640e5139dc24341bd58416d57 (patch)
tree48061a6f98f4212de685e3dc8279270a5427e898 /source/blender/editors/gpencil
parent31375a1b21a98f5ce6abdd46a41a1e287d3d5050 (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/gpencil')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index f207c71474c..d5c7c523ca8 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -105,9 +105,9 @@ static void gp_draw_stroke_buffer(tGPspoint *points, int totpoints, short thickn
if (dflag & (GP_DRAWDATA_ONLY3D | GP_DRAWDATA_ONLYV2D))
return;
- /* if drawing a single point, draw it larger */
if (totpoints == 1) {
- /* draw point */
+ /* if drawing a single point, draw it larger */
+ glPointSize((float)(thickness + 2) * points->pressure);
glBegin(GL_POINTS);
glVertex2iv(&points->x);
glEnd();
@@ -1123,7 +1123,6 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
/* restore initial gl conditions */
glLineWidth(1.0);
- glPointSize(1.0);
glColor4f(0, 0, 0, 1);
}