path:
root/
src/
view/
exp004view.c (
plain)
blob: b16597d194145818474eb7055cbb5d44bee41867
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
50
51
52
53
54
55
|
#include "../controller/callbacks/display.h"
#include "../controller/callbacks/keyboard.h"
#include "../controller/callbacks/mouse.h"
#include "../controller/callbacks/mouse_wheel.h"
#include "../controller/callbacks/reshape.h"
#include "../db/dbconnect.h"
#include "exp004init.h"
#include "exp004state0.h"
#include "exp004view.h"
#include <GL/freeglut.h>
#include <GL/freeglut_ext.h>
#include <GL/glut.h>
void
exp004view (void)
{
// Connect to the database.
dbconnect ();
// GLUT Initialization
glutInitWindowSize (500, 500);
glutInitWindowPosition (100, 100);
glutCreateWindow ("Exp004");
// GL Initialization
glClearColor (CLEAR_COLOR);
glColor3f (DRAW_COLOR);
glEnable (GL_AUTO_NORMAL);
glDisable (GL_DEPTH_TEST);
glEnable (GL_MAP1_VERTEX_3);
glShadeModel (GL_SMOOTH);
/* Buffer objects to use. */
glEnableClientState (GL_COLOR_ARRAY);
glEnableClientState (GL_VERTEX_ARRAY);
/* Enable Antialiasing as described in "Antialiasing"
[Shreiner,247]. */
glEnable (GL_LINE_SMOOTH);
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);
// Initialize the model.
exp004init ();
// Callbacks
glutDisplayFunc (display);
glutKeyboardFunc (keyboard);
glutMouseFunc (mouse);
glutMouseWheelFunc (mouse_wheel);
glutReshapeFunc (reshape);
return;
}
|