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:
authorCampbell Barton <ideasman42@gmail.com>2021-01-21 03:12:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-21 03:12:11 +0300
commit41a945d7469f8135d8181bad9ec80037f0fbd069 (patch)
tree2b747894c2258506e737f92582500676a4eda17f
parent7b45850eac7afadcba028f20c38ea8f0509c5838 (diff)
Docs: add note on convention for setting line-width
-rw-r--r--source/blender/gpu/intern/gpu_state.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc
index 407a8dd6e2b..e7a160d1ea3 100644
--- a/source/blender/gpu/intern/gpu_state.cc
+++ b/source/blender/gpu/intern/gpu_state.cc
@@ -165,6 +165,11 @@ void GPU_depth_range(float near, float far)
copy_v2_fl2(state.depth_range, near, far);
}
+/**
+ * \note By convention, this is set as needed and not reset back to 1.0.
+ * This means code that draws lines must always set the line width beforehand,
+ * but is not expected to restore it's previous value.
+ */
void GPU_line_width(float width)
{
width = max_ff(1.0f, width * PIXELSIZE);