aboutsummaryrefslogtreecommitdiff
path: root/samples/OpenGL/frustum/frustum.c
diff options
context:
space:
mode:
authorWolfgang Draxinger <code@datenwolf.net>2020-12-14 18:34:13 +0100
committerWolfgang Draxinger <code@datenwolf.net>2020-12-14 18:34:13 +0100
commit4d2861343709bc0191a62e3b91aaa1c3f842cd6b (patch)
tree50e498656fd941a40d689e31962cd7cfe7bb6511 /samples/OpenGL/frustum/frustum.c
parentfe85753859d3994c3d74860258be122a1bb86aa3 (diff)
parent5f280e26b131fd5f2b569ce0ff48a2b9cfa9b128 (diff)
downloadcodesamples-4d2861343709bc0191a62e3b91aaa1c3f842cd6b.tar.gz
codesamples-4d2861343709bc0191a62e3b91aaa1c3f842cd6b.tar.bz2
Merge branch 'master' of git://github.com/datenwolf/codesamples
Diffstat (limited to 'samples/OpenGL/frustum/frustum.c')
-rw-r--r--samples/OpenGL/frustum/frustum.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/samples/OpenGL/frustum/frustum.c b/samples/OpenGL/frustum/frustum.c
index 2728cee..5e70382 100644
--- a/samples/OpenGL/frustum/frustum.c
+++ b/samples/OpenGL/frustum/frustum.c
@@ -168,10 +168,12 @@ void draw_arrow(
by + (-0.866*d[1] - 0.5*b[1])*bh,
bz + (-0.866*d[2] - 0.5*b[2])*bh }
};
- GLushort const idx[][2] = {
+ GLushort const idx_line[][2] = {
{0, 1},
- {0, 2}, {0, 3},
- {1, 4}, {1, 5}
+ };
+ GLushort const idx_heads[][3] = {
+ {0, 2, 3},
+ {1, 4, 5}
};
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
@@ -180,7 +182,8 @@ void draw_arrow(
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, pos);
- glDrawElements(GL_LINES, 2*5, GL_UNSIGNED_SHORT, idx);
+ glDrawElements(GL_LINES, 2, GL_UNSIGNED_SHORT, idx_line);
+ glDrawElements(GL_TRIANGLES, 2*3, GL_UNSIGNED_SHORT, idx_heads);
glDisableClientState(GL_VERTEX_ARRAY);
if(annotation) {