summaryrefslogtreecommitdiffstats
path: root/src/model/geometry/map_geometry.c (plain)
blob: c4c8db044782ce12486f4d6d46c75f25e88caa05
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
#include "map_geometry.h"
#include "../../view/state0.h"
#include <GL/glut.h>

#define S state0

void
map_geometry (void)
{
  glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE);
  glPolygonMode (GL_FRONT, GL_FILL);

  for (int i = 0; i < S.rows; i++)
    {
      glLoadName (i);

      // Draw the protein geometry.
      float *v = S.base_vertices_data + (i * 2);
      glPushMatrix ();
      glTranslatef (*v, *(v + 1), 0.0);
      glColor4fv (S.base_colors_data + (i * 4));
      glCallList (S.list_offset + PROTEIN_GEOMETRY);
      glPopMatrix ();

      // If the object is selected, draw the selection geometry.
      if (S.selection.set[i])
	{
	  glPushMatrix ();
	  glTranslatef (*v, *(v + 1), 0.0);
	  glColor4f (0.5, 0.5, 0.5, 1.0);
	  glCallList (S.list_offset + PROTEIN_SELECTED_GEOMETRY);
	  glPopMatrix ();
	}
    }

  glEndList ();

  return;
}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.