diff options
Diffstat (limited to 'src/render/face.cc')
-rw-r--r-- | src/render/face.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/render/face.cc b/src/render/face.cc index cd69b4e..764c452 100644 --- a/src/render/face.cc +++ b/src/render/face.cc @@ -9,10 +9,15 @@ namespace render { -Face::Face(math::Vector3f const & normal) : +Face::Face(math::Vector3f const & normal, math::Color const *color) : face_normal(normal) { face_normal.normalize(); + + if (color) + face_color = new math::Color(*color); + else + face_color = 0; } Face::~Face() @@ -22,6 +27,9 @@ Face::~Face() } face_vertex.clear(); + + if (face_color) + delete face_color; } void Face::add_vertex(math::Vector3f const & vertex) @@ -33,7 +41,8 @@ void Face::add_vertex(math::Vector3f const & vertex) void Face::draw() { - gl::begin(gl::LineLoop); + //gl::begin(gl::LineLoop); + gl::begin(gl::Polygon); for (std::vector<math::Vector3f *>::iterator it = face_vertex.begin(); it != face_vertex.end(); it++) { gl::vertex(*(*it)); } |