glVertex scale runs from -1 to 1

Ok, I’ve got a dumb question which probably means I don’t understand OpenGL that well. When I use the 2D glVertex function I always have to put coordinates in that run from -1 to 1.

For the X-axis -1 is the left most part of the display and 1 is the right most part.

For Y it is what you would expect, -1 for the lowest, and 1 for the highest. How can I change the scaling so that I can use larger values, like 0 to 255 or some other scale?

Thanks!

change the projection matrix:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 255.0, 0.0, 255.0, -1.0, 1.0);

Got it thanks very much!