Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glow-extras
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glow
glow-extras
Merge requests
!115
Add colors(...) to tri_ref and line_ref
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add colors(...) to tri_ref and line_ref
jn/develop
into
develop
Overview
0
Commits
3
Pipelines
0
Changes
1
Merged
Julius Nehring-Wirxel
requested to merge
jn/develop
into
develop
3 years ago
Overview
0
Commits
3
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
develop
version 1
63aa8821
3 years ago
develop (base)
and
latest version
latest version
d45d42e5
3 commits,
3 years ago
version 1
63aa8821
2 commits,
3 years ago
1 file
+
23
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
viewer/glow-extras/viewer/canvas.hh
+
23
−
0
Options
@@ -382,6 +382,17 @@ protected:
line_ref
&
color
(
float
r
,
float
g
,
float
b
,
float
a
=
1
)
{
return
color
(
tg
::
color4
(
r
,
g
,
b
,
a
));
}
line_ref
&
color
(
std
::
string_view
color_str
);
/// sets the two vertex colors (for all lines, probably only useful for add_line(line))
line_ref
&
colors
(
tg
::
color4
const
&
c0
,
tg
::
color4
const
&
c1
)
{
for
(
auto
&
l
:
_lines
)
{
l
.
p0
.
color
=
c0
;
l
.
p1
.
color
=
c1
;
}
return
*
this
;
}
/// sets the size of all added lines
/// NOTE: world size or px size is determined by canvas state and cannot be changed!
line_ref
&
size
(
float
s
)
@@ -498,6 +509,18 @@ protected:
triangle_ref
&
color
(
float
r
,
float
g
,
float
b
,
float
a
=
1
)
{
return
color
(
tg
::
color4
(
r
,
g
,
b
,
a
));
}
triangle_ref
&
color
(
std
::
string_view
color_str
);
/// sets the three vertex colors (for all triangles, probably only useful for add_face(tri))
triangle_ref
&
colors
(
tg
::
color4
const
&
c0
,
tg
::
color4
const
&
c1
,
tg
::
color4
const
&
c2
)
{
for
(
auto
&
t
:
_triangles
)
{
t
.
color
[
0
]
=
c0
;
t
.
color
[
1
]
=
c1
;
t
.
color
[
2
]
=
c2
;
}
return
*
this
;
}
/// sets the triangle normal of all triangles
triangle_ref
&
normal
(
tg
::
vec3
const
&
n
)
{
Loading