1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
glEnable( GL_TEXTURE_2D );
// Bind the texture to which subsequent calls refer to
glBindTexture( GL_TEXTURE_2D, ret );
glEnable (GL_BLEND); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBegin( GL_QUADS );
glColor3f(1.0f,1.0f,1.0f);
//Bottom-left vertex (corner)
glTexCoord2d( 0, 0 );
glVertex3f( 100.f, 100.f, 0.0f );
//Bottom-right vertex (corner)
glTexCoord2d( 0.5, 0 );
glVertex3f( 228.f, 100.f, 0.f );
//Top-right vertex (corner)
glTexCoord2d( 0.5, 1 );
glVertex3f( 228.f, 228.f, 0.f );
//Top-left vertex (corner)
glTexCoord2d( 0, 1 );
glVertex3f( 100.f, 228.f, 0.f );
glEnd();
|