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) (unidiff)
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 @@
8#include "../util/pick_convert.h"8#include "../util/pick_convert.h"
9#include <GL/glut.h>9#include <GL/glut.h>
10#include <math.h>10#include <math.h>
11#include <stdlib.h>
1112
12/*13/*
13 * A simple alias to make the code more readable.14 * A simple alias to make the code more readable.
@@ -86,8 +87,8 @@ exp004mouse (int button, int state, int x, int y)
86 * "Specify the array to be used for the returned hit records87 * "Specify the array to be used for the returned hit records
87 * with glSelectBuffer () [Redbook]."88 * with glSelectBuffer () [Redbook]."
88 */89 */
89 GLuint select_buf[ROWS];90 GLuint* select_buf = calloc (S.rows, sizeof (GLuint));
90 glSelectBuffer (ROWS, select_buf);91 glSelectBuffer (S.rows, select_buf);
9192
92 /*93 /*
93 * "Enter selection mode by specifying GL_SELECT with94 * "Enter selection mode by specifying GL_SELECT with

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.