dungeon_crawler
diff prototype/src/mesh.cc @ 11:e5567ddbf2ef
- Texture set (texture manager)
- materials
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 19 Aug 2012 03:11:36 +0300 |
parents | 22562582c82d |
children | 0588f8a1a351 |
line diff
1.1 --- a/prototype/src/mesh.cc Sat Aug 18 03:47:13 2012 +0300 1.2 +++ b/prototype/src/mesh.cc Sun Aug 19 03:11:36 2012 +0300 1.3 @@ -105,6 +105,16 @@ 1.4 return xform; 1.5 } 1.6 1.7 +void Mesh::set_material(const Material &mat) 1.8 +{ 1.9 + this->mat = mat; 1.10 +} 1.11 + 1.12 +const Material &Mesh::get_material() const 1.13 +{ 1.14 + return mat; 1.15 +} 1.16 + 1.17 void Mesh::set_attrib_location(int attr, int loc) 1.18 { 1.19 if(attr == MESH_ATTR_TANGENT) { 1.20 @@ -119,6 +129,8 @@ 1.21 1.22 void Mesh::draw() const 1.23 { 1.24 + mat.setup(); 1.25 + 1.26 glMatrixMode(GL_MODELVIEW); 1.27 glPushMatrix(); 1.28 mult_matrix(xform);