由于不支持画四边形,只能用2个三角形合并成一个四角形。 材质rect(256,128); glPushMatrix(); GLfloat triangleVertices[] = { -128.0, 64.0, -128.0, -64.0, 128.0, -64.0, }; GLfloat triangleVertices2[] = { 128.0, -64.0, 128.0, 64.0, -128.0, 64.0 }; /*GLfloat coordinates[]={ 0.003906, 0.007813, 0.003906, 0.007813+0.093750, 0.003906 +0.046875, 0.007813+0.093750, 0.003906 +0.046875,0.007813 };*/ GLfloat coordinates[]={ 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, }; GLfloat coordinates2[]={ 1.0, 1.0, 1.0, 0,0, 0.0, 0.0 }; glBindTexture(GL_TEXTURE_2D, ids); glTexCoordPointer(2, GL_FLOAT, 0, coordinates); glVertexPointer(2, GL_FLOAT, 0, triangleVertices); glDrawArrays(GL_TRIANGLES, 0, 3); glTexCoordPointer(2, GL_FLOAT, 0, coordinates2); glVertexPointer(2, GL_FLOAT, 0, &triangleVertices2); glDrawArrays(GL_TRIANGLES, 0, 3); glPopMatrix();