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/exp004reshape.c b/src/controller/exp004reshape.c
new file mode 100644
index 0000000..7aaff08
--- a/dev/null
+++ b/src/controller/exp004reshape.c
@@ -0,0 +1,55 @@
1#include "exp004reshape.h"
2#include "../view/exp004state0.h"
3#include <GL/glut.h>
4
5void
6exp004reshape (int w, int h)
7{
8 glMatrixMode (GL_PROJECTION);
9 glLoadIdentity ();
10
11 /*
12 * This scaling produces an odd effect when the coordinates are not
13 * centered at 0,0. When 0,0 is the lower left rather than the
14 * center this reshape is a bit unnatural since the image is not
15 * centered in the middle of the window.
16 */
17
18 if (w <= h)
19 {
20 exp004state0.ortho.min_x =
21 exp004state0.ortho_min;
22 exp004state0.ortho.max_x =
23 exp004state0.ortho_max;
24 exp004state0.ortho.min_y =
25 exp004state0.ortho_min * (GLfloat) h / (GLfloat) w;
26 exp004state0.ortho.max_y =
27 exp004state0.ortho_max * (GLfloat) h / (GLfloat) w;
28 }
29 else
30 {
31 exp004state0.ortho.min_x =
32 exp004state0.ortho_min * (GLfloat) w / (GLfloat) h;
33 exp004state0.ortho.max_x =
34 exp004state0.ortho_max * (GLfloat) w / (GLfloat) h;
35 exp004state0.ortho.min_y =
36 exp004state0.ortho_min;
37 exp004state0.ortho.max_y =
38 exp004state0.ortho_max;
39 }
40
41 gluOrtho2D(exp004state0.ortho.min_x,
42 exp004state0.ortho.max_x,
43 exp004state0.ortho.min_y,
44 exp004state0.ortho.max_y);
45
46 glMatrixMode (GL_MODELVIEW);
47
48 // Set the viewport equal to the size of the window.
49 glViewport (0, 0, (GLsizei) w, (GLsizei) h);
50
51 exp004state0.viewport.w = w;
52 exp004state0.viewport.h = h;
53
54 return;
55}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.