summaryrefslogtreecommitdiffstats
Side-by-side diff
-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 @@
+#include "exp004reshape.h"
+#include "../view/exp004state0.h"
+#include <GL/glut.h>
+
+void
+exp004reshape (int w, int h)
+{
+ glMatrixMode (GL_PROJECTION);
+ glLoadIdentity ();
+
+ /*
+ * This scaling produces an odd effect when the coordinates are not
+ * centered at 0,0. When 0,0 is the lower left rather than the
+ * center this reshape is a bit unnatural since the image is not
+ * centered in the middle of the window.
+ */
+
+ if (w <= h)
+ {
+ exp004state0.ortho.min_x =
+ exp004state0.ortho_min;
+ exp004state0.ortho.max_x =
+ exp004state0.ortho_max;
+ exp004state0.ortho.min_y =
+ exp004state0.ortho_min * (GLfloat) h / (GLfloat) w;
+ exp004state0.ortho.max_y =
+ exp004state0.ortho_max * (GLfloat) h / (GLfloat) w;
+ }
+ else
+ {
+ exp004state0.ortho.min_x =
+ exp004state0.ortho_min * (GLfloat) w / (GLfloat) h;
+ exp004state0.ortho.max_x =
+ exp004state0.ortho_max * (GLfloat) w / (GLfloat) h;
+ exp004state0.ortho.min_y =
+ exp004state0.ortho_min;
+ exp004state0.ortho.max_y =
+ exp004state0.ortho_max;
+ }
+
+ gluOrtho2D(exp004state0.ortho.min_x,
+ exp004state0.ortho.max_x,
+ exp004state0.ortho.min_y,
+ exp004state0.ortho.max_y);
+
+ glMatrixMode (GL_MODELVIEW);
+
+ // Set the viewport equal to the size of the window.
+ glViewport (0, 0, (GLsizei) w, (GLsizei) h);
+
+ exp004state0.viewport.w = w;
+ exp004state0.viewport.h = h;
+
+ return;
+}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.