19,468
社区成员
发帖
与我相关
我的任务
分享glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
static GLfloat corners[] = {0, 0, 0,
100, 0, 0,
100, 100, 0,
0, 100, 0,
0, 0, 100,
100, 0, 100,
100, 100, 100,
0, 100, 100};
static GLubyte indexes[] = {0, 1, 2, 3,
2, 3, 7, 6,
1, 0, 4, 5,
2, 6, 5, 1,
3, 7, 4, 0,
4, 5, 6, 7};
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, corners);
glDrawElements(GL_QUADS, 24, GL_UNSIGNED_BYTE, indexes);
glDisableClientState(GL_VERTEX_ARRAY);