1
다음과 같이 내가 시도
는 (Google 검색을 통해 얻었다) -iPhone OS에서 OpenGL ES를 사용하여 일련의 줄을 그릴 수 있습니까?
static const GLfloat vertices[] =
{
0.0, 0.0,
250.0, 280.0,
250.0, 280.0,
250.0, 500.0,
250.0, 500.0,
350.0, 500.0,
350.0, 500.0,
250.0, 280.0
};
static const GLubyte squareColors[] = {
255, 255, 255, 255,
255, 255, 255, 255
};
glDisable(GL_TEXTURE_2D);
BOOL colorArrayEnabled = glIsEnabled(GL_COLOR_ARRAY);
if (!colorArrayEnabled) {
glEnableClientState(GL_COLOR_ARRAY);
}
BOOL vertexArrayEnabled = glIsEnabled(GL_VERTEX_ARRAY);
if (!vertexArrayEnabled) {
glEnableClientState(GL_VERTEX_ARRAY);
}
glLineWidth(16.0f);
glColorPointer(4, GL_UNSIGNED_BYTE, 0, squareColors);
glVertexPointer(2, GL_FLOAT, sizeof(GLfloat)*2, vertices);
glDrawArrays(GL_LINES, 0, 2);
if (!vertexArrayEnabled) {
glDisableClientState(GL_VERTEX_ARRAY);
}
if (!colorArrayEnabled) {
glDisableClientState(GL_COLOR_ARRAY);
}
glEnable(GL_TEXTURE_2D);
을 참고 : 나는 아이폰 프로그래밍에서 선발입니다.
어떻게 투영 매트릭스를 설정 했습니까? – ognian