summaryrefslogtreecommitdiff
path: root/terrain.cpp
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-05-11 19:30:31 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-05-11 19:30:31 +0200
commit63e3b825580c8fbf6b84d441c92ed39348e51c17 (patch)
tree1d315af990adf5160554ccf7e2fb615223b44220 /terrain.cpp
parentd42ec5c0e89559abd276334b6c4804e1eaa5e9c7 (diff)
Working win32 port.
Diffstat (limited to 'terrain.cpp')
-rw-r--r--terrain.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/terrain.cpp b/terrain.cpp
index 35aef58..1fd75db 100644
--- a/terrain.cpp
+++ b/terrain.cpp
@@ -73,6 +73,19 @@ void Terrain::Node::fill() {
vertex_array[11] = y;
}
+void Terrain::Node::draw() {
+ glBegin(GL_TRIANGLES);
+ for(int i = 0; i < 2; i++) {
+ glTexCoord2f(0, 0);
+ glVertex3f(vertex_array[0], vertex_array[1], vertex_array[2]);
+ glTexCoord2f(i, 1);
+ glVertex3f(vertex_array[i*3+3], vertex_array[i*3+4], vertex_array[i*3+5]);
+ glTexCoord2f(1, 1-i);
+ glVertex3f(vertex_array[i*3+6], vertex_array[i*3+7], vertex_array[i*3+8]);
+ }
+ glEnd();
+}
+
void Terrain::Node::draw_grid() {
glNormal3f(0, 1, 0);
glBegin(GL_LINE_LOOP);