summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--AUTHORS1
-rw-r--r--Makefile.am2
-rw-r--r--README24
-rw-r--r--ax/acx_pthread.m4242
-rw-r--r--ax/ax_check_gl.m495
-rw-r--r--ax/ax_check_glu.m471
-rw-r--r--ax/ax_check_glut.m478
-rw-r--r--ax/ax_lang_compiler_ms.m423
-rw-r--r--configure.ac24
-rw-r--r--src/Makefile.am28
-rw-r--r--src/controller/exp004display.c16
-rw-r--r--src/controller/exp004display.h6
-rw-r--r--src/controller/exp004mouse.c90
-rw-r--r--src/controller/exp004mouse.h6
-rw-r--r--src/controller/exp004processhits.c54
-rw-r--r--src/controller/exp004processhits.h8
-rw-r--r--src/controller/exp004reshape.c55
-rw-r--r--src/controller/exp004reshape.h6
-rw-r--r--src/exp004viz.c15
-rw-r--r--src/model/exp004base.c107
-rw-r--r--src/model/exp004base.h9
-rw-r--r--src/model/exp004state.h101
-rw-r--r--src/util/check_error.c17
-rw-r--r--src/util/check_error.h9
-rw-r--r--src/view/exp004geometry.c32
-rw-r--r--src/view/exp004geometry.h8
-rw-r--r--src/view/exp004state0.h8
-rw-r--r--src/view/exp004view.c44
-rw-r--r--src/view/exp004view.h6
29 files changed, 1185 insertions, 0 deletions
diff --git a/src/controller/exp004processhits.c b/src/controller/exp004processhits.c
new file mode 100644
index 0000000..29fbbbc
--- a/dev/null
+++ b/src/controller/exp004processhits.c
@@ -0,0 +1,54 @@
1/* I seem to need this for glGenBuffers as per
2 http://www.gamedev.net/community/forums/topic.asp?topic_id=422358 */
3#define GL_GLEXT_PROTOTYPES
4
5#include "exp004processhits.h"
6#include "../view/exp004state0.h"
7#include <stdio.h>
8
9/*
10 * The implementation of this function is based on
11 * [Angel,2008,pp80-81].
12 */
13void
14exp004processhits (GLint hits, GLuint buffer[])
15{
16 /*
17 * A simple alias to make the code more readable.
18 */
19 EXP004STATE* S = &exp004state0;
20
21 printf ("Hits: %d\n", hits);
22
23 GLuint *hitlist = buffer;
24
25 for (int i = 0; i < hits; i++)
26 {
27 hitlist += 3;
28
29 /*
30 * Report the hit to the terminal.
31 */
32 printf ("Hit %i: %s\n", i + 1, exp004state0.gi_data[*hitlist]);
33
34 /*
35 * Add the hits to the selection.
36 */
37 exp004state0.selection[*hitlist] = true;
38 exp004state0.base_colors_data[*hitlist][0] = SELECT_COLOR_R;
39 exp004state0.base_colors_data[*hitlist][1] = SELECT_COLOR_G;
40 exp004state0.base_colors_data[*hitlist][2] = SELECT_COLOR_B;
41
42 hitlist++;
43 }
44
45 glBindBuffer (GL_ARRAY_BUFFER, S->buffers[BASE_COLORS]);
46 glColorPointer (3, GL_FLOAT, 0, 0);
47 glBufferData (GL_ARRAY_BUFFER,
48 sizeof (S->base_colors_data), S->base_colors_data,
49 GL_STATIC_DRAW);
50
51 printf ("\n");
52
53 return;
54}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.