shadows, textures, resource managers... shaders...
[antikythera] / src / machine.cc
index 313540d..3d4dd73 100644 (file)
@@ -3,6 +3,7 @@
 #include <math.h>
 #include <float.h>
 #include <assert.h>
+#include "opengl.h"
 #include "machine.h"
 
 static float delta_angle(float a, float b);
@@ -212,6 +213,19 @@ void Machine::draw() const
        for(size_t i=0; i<gears.size(); i++) {
                gears[i]->draw();
        }
+
+       float dcol[] = {0.4, 0.4, 0.4, 1.0};
+       float scol[] = {0, 0, 0, 0};
+       glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, dcol);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, scol);
+
+       glBegin(GL_QUADS);
+       glNormal3f(0, 1, 0);
+       glVertex3f(-300, -100, 300);
+       glVertex3f(300, -100, 300);
+       glVertex3f(300, -100, -300);
+       glVertex3f(-300, -100, -300);
+       glEnd();
 }
 
 Gear *Machine::intersect_gear(const Ray &ray, HitPoint *hitp) const