Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glow-samples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
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
Zain Selman
glow-samples
Commits
8e5df672
Commit
8e5df672
authored
5 years ago
by
Philip Trettner
Browse files
Options
Downloads
Patches
Plain Diff
more 2D samples
parent
ae6ed8ad
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
extern/glow
+1
-1
1 addition, 1 deletion
extern/glow
extern/glow-extras
+1
-1
1 addition, 1 deletion
extern/glow-extras
extern/polymesh
+1
-1
1 addition, 1 deletion
extern/polymesh
samples/wip/vector-2D/Vector2DSample.cc
+48
-3
48 additions, 3 deletions
samples/wip/vector-2D/Vector2DSample.cc
with
51 additions
and
6 deletions
glow
@
a0f72756
Subproject commit a
af5f23b57cfd260efdaa2c1e7787415e9960c86
Subproject commit a
0f727567041516347439d73795636d1aee12df2
This diff is collapsed.
Click to expand it.
glow-extras
@
4a664b55
Subproject commit
22266479a99ff82946ee7eb698166a548fcf77c9
Subproject commit
4a664b557fb3e417b85d5b6eb4ca1e5f72df78d6
This diff is collapsed.
Click to expand it.
polymesh
@
6c22fa03
Subproject commit
8780b1de6fe379af2f0162d68f26de2fb55ea52c
Subproject commit
6c22fa0315f450b7dbd48b5555fbbff2a80c6bcd
This diff is collapsed.
Click to expand it.
samples/wip/vector-2D/Vector2DSample.cc
+
48
−
3
View file @
8e5df672
...
...
@@ -45,11 +45,56 @@ void Vector2DSample::render(float elapsedSeconds)
glow
::
vector
::
image2D
img
;
auto
g
=
graphics
(
img
);
g
.
draw
(
tg
::
pos2
(
100
,
100
),
{
tg
::
color3
::
blue
,
5.0
f
});
// ways to specify a brush
g
.
draw
(
tg
::
pos2
(
100
,
100
),
tg
::
color3
::
blue
);
g
.
draw
(
tg
::
pos2
(
110
,
100
),
tg
::
color4
::
blue
);
g
.
draw
(
tg
::
pos2
(
120
,
100
),
{
1
,
0
,
0
});
g
.
draw
(
tg
::
pos2
(
130
,
100
),
{
1
,
0
,
0
,
1
});
g
.
draw
(
tg
::
pos2
(
140
,
100
),
{
tg
::
color3
::
blue
,
5.0
f
});
g
.
draw
(
tg
::
pos2
(
150
,
100
),
{
tg
::
color4
::
blue
,
5.0
f
});
g
.
draw
(
tg
::
pos2
(
160
,
100
),
{{
1
,
0
,
0
},
5.0
f
});
g
.
draw
(
tg
::
pos2
(
170
,
100
),
{{
1
,
0
,
0
,
1
},
5.0
f
});
// ways to speficy a fill
g
.
fill
(
tg
::
aabb2
({
100
,
120
},
{
150
,
125
}),
tg
::
color3
::
green
);
g
.
fill
(
tg
::
aabb2
({
100
,
130
},
{
150
,
135
}),
tg
::
color4
::
green
);
g
.
fill
(
tg
::
aabb2
({
100
,
140
},
{
150
,
145
}),
{
1
,
0
,
0
});
g
.
fill
(
tg
::
aabb2
({
100
,
150
},
{
150
,
155
}),
{
1
,
0
,
0
,
1
});
// line drawings
g
.
draw
(
tg
::
segment2
({
110
,
100
},
{
80
,
80
}),
tg
::
color3
::
red
);
g
.
fill
(
tg
::
aabb2
({
70
,
10
},
{
100
,
20
}),
tg
::
color3
::
green
);
g
.
draw
(
tg
::
aabb2
({
70
,
10
},
{
100
,
20
}),
{{
0
,
0
,
0
},
3
});
// fillings
// other objects
{
float
x
=
250
;
float
y
=
100
;
auto
next
=
[
&
]
{
x
+=
100
;
if
(
x
>
1000
)
{
x
=
250
;
y
+=
100
;
}
};
g
.
draw
(
tg
::
aabb2
({
x
-
20
,
y
-
10
},
{
x
+
20
,
y
+
10
}),
{{
0
,
0
,
0
},
3
});
g
.
fill
(
tg
::
aabb2
({
x
-
20
,
y
-
10
},
{
x
+
20
,
y
+
10
}),
tg
::
color3
::
green
);
next
();
g
.
draw
(
tg
::
triangle2
({
x
-
20
,
y
-
10
},
{
x
+
10
,
y
-
20
},
{
x
,
y
+
20
}),
{{
0
,
0
,
0
},
2
});
g
.
fill
(
tg
::
triangle2
({
x
-
20
,
y
-
10
},
{
x
+
10
,
y
-
20
},
{
x
,
y
+
20
}),
{
0
,
0
,
1
});
next
();
g
.
draw
(
tg
::
sphere2
({
x
,
y
},
15.
f
),
{{
0
,
0
,
0
},
2
});
g
.
fill
(
tg
::
sphere2
({
x
,
y
},
15.
f
),
{
0
,
0
,
1
});
next
();
g
.
draw
(
tg
::
circle2
({
x
,
y
},
15.
f
),
{{
0
,
0
,
0
},
2
});
g
.
fill
(
tg
::
circle2
({
x
,
y
},
15.
f
),
{
0
,
0
,
1
});
next
();
}
// TODO: more
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment