path:
root/
src/
controller/
clear_selection.sqc (
plain)
blob: ec98b4c3d77ecc56d9ff537614e4b0b1f94f55f9
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
47
48
49
|
#define GL_GLEXT_PROTOTYPES
#include "clear_selection.h"
#include "../model/map_geometry.h"
#include "../view/exp004state0.h"
#include <GL/glut.h>
#include "sqlca.h"
extern struct sqlca 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.set[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);
/*
* Rebuild the display list for the map.
*/
map_geometry ();
glutPostRedisplay ();
return;
}
|