glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
- glVertexPointer(2, GL_INT, 0, vertices);
- glColorPointer(3, GL_FLOAT, 0, colors);
+ glVertexPointer(2, GL_INT, 2 * sizeof(GLint), vertices);
+ glColorPointer(3, GL_FLOAT, 3 * sizeof(GLfloat), colors);
}
static void setupInterleave(void)
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- gluOrtho2D(0.0, (GLdouble) w, 0.0, (GLdouble) h);
+ glOrtho(0.0, (GLdouble) w, 0.0, (GLdouble) h, -1.0, 1.0);
}
int main(int argc, char** argv)