TGA and RGB image loading
This commit is contained in:
parent
ff59df8e28
commit
e83cdba55b
7 changed files with 169 additions and 3 deletions
|
@ -60,17 +60,39 @@ void display_rotating_pyramid(float x, float y, float z, float c, float h, float
|
|||
glPopMatrix();
|
||||
}
|
||||
|
||||
void display_tree(float x, float y, float z, float h, float w)
|
||||
void display_tree(float x, float y, float z, float h, float w, const Texture& tree_texture)
|
||||
{
|
||||
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
|
||||
glBindTexture(GL_TEXTURE_2D,tree_texture.opengl_id[0]);
|
||||
|
||||
glColor4f(1.0f, 1.0f, 1.0f,1.00);
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
// First rectangle
|
||||
glTexCoord2f(1,0);
|
||||
glVertex3f(x+w/2,y,z);
|
||||
|
||||
glTexCoord2f(0,0);
|
||||
glVertex3f(x-w/2,y,z);
|
||||
|
||||
glTexCoord2f(0,1);
|
||||
glVertex3f(x-w/2,y+h,z);
|
||||
|
||||
glTexCoord2f(1,1);
|
||||
glVertex3f(x+w/2,y+h,z);
|
||||
|
||||
// Second rectangle
|
||||
glTexCoord2f(1,0);
|
||||
glVertex3f(x,y,z+w/2);
|
||||
|
||||
glTexCoord2f(0,0);
|
||||
glVertex3f(x,y,z-w/2);
|
||||
|
||||
glTexCoord2f(0,1);
|
||||
glVertex3f(x,y+h,z-w/2);
|
||||
|
||||
glTexCoord2f(1,1);
|
||||
glVertex3f(x,y+h,z+w/2);
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue