ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/entity.C
(Generate patch)

Comparing libgender/entity.C (file contents):
Revision 1.4 by root, Sun Oct 3 02:38:33 2004 UTC vs.
Revision 1.5 by root, Sun Oct 3 03:17:09 2004 UTC

135template<GLenum type> 135template<GLenum type>
136void entity_opengl2d<type>::draw (const draw_context &ctx) 136void entity_opengl2d<type>::draw (const draw_context &ctx)
137{ 137{
138 glBegin (type); 138 glBegin (type);
139 139
140 if (ctx.mode == draw_context::LIGHTED)
141 {
142 glMaterialfv (GL_FRONT, GL_DIFFUSE, (GLfloat *)&m.diffuse);
143 glMaterialfv (GL_FRONT, GL_SPECULAR, (GLfloat *)&m.specular);
144 glMaterialfv (GL_FRONT, GL_EMISSION, (GLfloat *)&m.emission);
145 glMaterialf (GL_FRONT, GL_SHININESS, m.shininess);
146 }
147
140 for (iterator i = begin (); i < end (); ++i) 148 for (iterator i = begin (); i < end (); ++i)
141 { 149 {
142 if (ctx.mode == draw_context::LIGHTED) 150 if (ctx.mode == draw_context::LIGHTED)
143 { 151 {
144 glColor3fv ((GLfloat *)&i->c);
145 glTexCoord2fv ((GLfloat *)&i->t); 152 glTexCoord2fv ((GLfloat *)&i->t);
146 glNormal3fv ((GLfloat *)&i->n); 153 glNormal3fv ((GLfloat *)&i->n);
147 } 154 }
148 155
149 glVertex3fv ((GLfloat *)&i->p); 156 glVertex3fv ((GLfloat *)&i->p);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines