50 for(
size_t i = 0; i < n; i++)
78 for (
size_t i = 0; i <
mesh->getTextures().size(); i++)
109 map<int, MaterialGroup* > texMatMap;
110 map<VecUChar, MaterialGroup*, Util::ColorVecCompare> colorMatMap;
116 map<int, MaterialGroup*>::iterator texIt;
117 map<VecUChar, MaterialGroup*, Util::ColorVecCompare>::iterator colIt;
128 texIt = texMatMap.find(m.
m_texture->idx());
129 if(texIt == texMatMap.end())
146 if(colIt == colorMatMap.end())
156 colIt->second->faceBuffer.push_back(i);
166 glEnableClientState(GL_VERTEX_ARRAY);
167 glEnableClientState(GL_NORMAL_ARRAY);
168 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
178 glVertexPointer( 3, GL_FLOAT, 0,
m_vertices.get() );
179 glNormalPointer( GL_FLOAT, 0,
m_normals.get() );
180 glTexCoordPointer(3, GL_FLOAT, 0,
m_texcoords.get());
188 unsigned int* buf =
new unsigned int [3 * g->
faceBuffer.size()];
191 glColor3f(1.0, 1.0, 1.0);
193 glDrawElements(GL_TRIANGLES, 3 * g->
faceBuffer.size(), GL_UNSIGNED_INT, buf);
199 glDisable(GL_TEXTURE_2D);
200 glBegin(GL_TRIANGLES);
205 for(
size_t i = 0; i < g->
faceBuffer.size(); i++)
225 glEnable(GL_TEXTURE_2D);