summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@coffee.donpellegrino.com>2009-08-14 19:19:50 (GMT)
committer Don Pellegrino <don@coffee.donpellegrino.com>2009-08-14 19:19:50 (GMT)
commitdc736fd47fa040ddb5d700bb78b4a0978d1cdb15 (patch) (side-by-side diff)
treee53284d44641dd97bdd082c39c4499637d754ab5
parentedf954cf12cca64868182a0f5a21679b8bf93906 (diff)
downloadexp005-dc736fd47fa040ddb5d700bb78b4a0978d1cdb15.zip
exp005-dc736fd47fa040ddb5d700bb78b4a0978d1cdb15.tar.gz
exp005-dc736fd47fa040ddb5d700bb78b4a0978d1cdb15.tar.bz2
Modified to use dynamic memory allocation for the number of nodes.
-rw-r--r--src/controller/exp004mouse.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/controller/exp004mouse.c b/src/controller/exp004mouse.c
index 2440c3a..0f3e9d3 100644
--- a/src/controller/exp004mouse.c
+++ b/src/controller/exp004mouse.c
@@ -8,6 +8,7 @@
#include "../util/pick_convert.h"
#include <GL/glut.h>
#include <math.h>
+#include <stdlib.h>
/*
* A simple alias to make the code more readable.
@@ -86,8 +87,8 @@ exp004mouse (int button, int state, int x, int y)
* "Specify the array to be used for the returned hit records
* with glSelectBuffer () [Redbook]."
*/
- GLuint select_buf[ROWS];
- glSelectBuffer (ROWS, select_buf);
+ GLuint* select_buf = calloc (S.rows, sizeof (GLuint));
+ glSelectBuffer (S.rows, select_buf);
/*
* "Enter selection mode by specifying GL_SELECT with

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.