00001 #include "Wall.h" 00002 00003 Wall::Wall(float xpos,float ypos,float width,float height,Color * color):GameObject(xpos,ypos,width,height,color) 00004 { 00005 } 00006 00007 void Wall::drawObject(float x, float y, float w, float h) 00008 { 00009 float newX=x+xpos*w; 00010 float newY=y+ypos*h; 00011 float newWidth= width*w; 00012 float newHight= height*h; 00013 00014 glBindTexture(GL_TEXTURE_2D,objectTexture); 00015 glBegin(GL_QUADS); 00016 00017 glColor4f(color->GetNormalizedRed(),color->GetNormalizedGreen(),color->GetNormalizedBlue(),color->GetNormalizedAlpha()); 00018 glTexCoord2f( 0.0f, 0.0f); glVertex3f( newX, newY, 0.0f); 00019 glTexCoord2f( 0.0f, newHight/10); glVertex3f( newX, newY+newHight, 0.0f); 00020 glTexCoord2f( newWidth/10, newHight/10); glVertex3f( newX+newWidth, newY+newHight, 0.0f); 00021 glTexCoord2f( newWidth/10, 0.0f); glVertex3f( newX+newWidth, newY, 0.0f); 00022 00023 glEnd(); 00024 }