summaryrefslogtreecommitdiffstats
path: root/src/view/exp004view.c (plain)
blob: 434c0169f0533607a4f36c5ef33440a3a8c63a03
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/exp004display.h"
#include "../controller/exp004mouse.h"
#include "../controller/exp004reshape.h"
#include "../controller/keyboard.h"
#include "../controller/mousewheel.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 (Controllers)
  glutDisplayFunc (exp004display);
  glutKeyboardFunc (keyboard);
  glutMouseFunc (exp004mouse);
  glutMouseWheelFunc (mousewheel);
  glutReshapeFunc (exp004reshape);

  return;
}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.