glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_EQUAL, 0x08);
glBindTexture(GL_TEXTURE_2D, texture);//选择之前绑定的图片
// 开始绘制
glBegin(GL_QUADS);
glTexCoord2f(1.0f, 0.0f); glVertex3f(-x, y, 0.0f); // 右上点
glTexCoord2f(0.0f, 0.0f); glVertex3f( x, y, 0.0f); // 右上点
glTexCoord2f(0.0f, 1.0f); glVertex3f( x,-y, 0.0f); // 右下点
glTexCoord2f(1.0f, 1.0f); glVertex3f(-x,-y, 0.0f); // 左下点
glEnd();
glDisable(GL_ALPHA);
glDisable(GL_BLEND);