path:
root/
src/
controller/
clear_selection.sqc (
plain)
blob: 65426e5421ae9e0d135ee0f047d60826fa45c407
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/* I seem to need this for glGenBuffers as per
http://www.gamedev.net/community/forums/topic.asp?topic_id=422358 */
#define GL_GLEXT_PROTOTYPES
#include "clear_selection.h"
#include "../view/exp004state0.h"
#include <GL/glut.h>
EXEC SQL INCLUDE sqlca;
/*
* A simple alias to make the code more readable.
*/
#define S exp004state0
void
clear_selection (void)
{
/*
* WHERE gi IS NOT NULL is added to prevent the PRECOMPILE command
* from throwing a warning about modifying an entire table. Since
* gi is defined as NOT NULL this will clear the entire table.
*/
EXEC SQL DELETE FROM vis_selection WHERE gi IS NOT NULL;
EXEC SQL COMMIT;
for (unsigned int i = 0; i < ROWS; i++)
{
S.selection[i] = false;
S.base_colors_data[i][0] = DEFAULT_COLOR_R;
S.base_colors_data[i][1] = DEFAULT_COLOR_G;
S.base_colors_data[i][2] = DEFAULT_COLOR_B;
S.base_colors_data[i][3] = DEFAULT_COLOR_A;
}
glBindBuffer (GL_ARRAY_BUFFER, S.buffers[BASE_COLORS]);
glColorPointer (4, GL_FLOAT, 0, 0);
glBufferData (GL_ARRAY_BUFFER,
sizeof (S.base_colors_data), S.base_colors_data,
GL_STATIC_DRAW);
glutPostRedisplay ();
return;
}
|