Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Floor
- glEnable( GL_TEXTURE_2D );
- glBindTexture( GL_TEXTURE_2D, m_iFloorTextureID );
- glBegin( GL_QUADS );
- glNormal3f( 0.0f, 1.0f, 0.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
- glTexCoord2f( 1.0f, 0.0f );
- glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
- glTexCoord2f( 1.0f, 1.0f );
- glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
- glTexCoord2f( 0.0f, 1.0f );
- glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
- glEnd();
- glDisable( GL_TEXTURE_2D );
- // Ceiling
- glEnable( GL_TEXTURE_2D );
- glBindTexture( GL_TEXTURE_2D, m_iCeilingTextureID );
- glBegin( GL_QUADS );
- glNormal3f( 0.0f, -1.0f, 0.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
- glTexCoord2f( 1.0f, 0.0f );
- glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
- glTexCoord2f( 1.0f, 1.0f );
- glVertex3f( MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
- glTexCoord2f( 0.0f, 1.0f );
- glVertex3f( MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
- glDisable( GL_TEXTURE_2D );
- glEnd();
- glDisable( GL_TEXTURE_2D );
- // Front wall
- glEnable( GL_TEXTURE_2D );
- glBindTexture( GL_TEXTURE_2D, m_iWallTextureID );
- glBegin( GL_QUADS );
- glNormal3f( 0.0f, 0.0f, 1.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
- glTexCoord2f( 1.0f, 0.0f );
- glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
- glTexCoord2f( 1.0f, 1.0f );
- glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
- glTexCoord2f( 0.0f, 1.0f );
- glVertex3f( MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
- // Back wall
- glNormal3f( 0.0f, 0.0f, -1.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
- glTexCoord2f( 1.0f, 0.0f );
- glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
- glTexCoord2f( 1.0f, 1.0f );
- glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
- glTexCoord2f( 0.0f, 1.0f );
- glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
- // Left wall
- glNormal3f( 1.0f, 0.0f, 0.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
- glTexCoord2f( 1.0f, 0.0f );
- glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
- glTexCoord2f( 1.0f, 1.0f );
- glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
- glTexCoord2f( 0.0f, 1.0f );
- glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
- // Right wall
- glNormal3f( -1.0f, 0.0f, 0.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
- glTexCoord2f( 1.0f, 0.0f );
- glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
- glTexCoord2f( 1.0f, 1.0f );
- glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
- glTexCoord2f( 0.0f, 1.0f );
- glVertex3f( MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
- glDisable( GL_TEXTURE_2D );
- glEnd();
- glDisable( GL_TEXTURE_2D );
Add Comment
Please, Sign In to add comment