Well, I was going to wait for a more experienced programmer to come along to answer the camera issue, but since no other solutions have been given...
This is what I have gathered from testing and researching:
Note: HEIGHT & WIDTH correspond to your Display Mode's height and width.
(1)//You put GL_PROJECTION_MATRIX (which won't work); I think you meant GL_PROJECTION
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//1 = zNear (this can not be 0, as there is division in how glFrustum works)
//2 = zFar
//These parameters are supposed to only be positive (glFrustum converts them to negative values)
//Anything between zNear and zFar will be drawn (if zNear and zFar are both 1, nothing will be drawn)
glFrustum(0, WIDTH, HEIGHT, 0, 1,2);
//-1.0f = z
//Any z value between -1.0f and -2.0f will be drawn
glTranslatef(0.0f,0.0f,-1.0f);
//Rest of your drawing code
This works for me and draws, but as for zooming...I tried both these ways:
float zoom = 1.0f; //instance variables
glFrustum(-WIDTH * zoom,WIDTH * zoom,HEIGHT * zoom,-HEIGHT * zoom,1,2);
//and tried this way...
float zoom = 0.0f;
glFrustum(WIDTH - zoom,WIDHT + zoom,HEIGHT + zoom,HEIGHT - zoom,1,2);
They seemed to zoom, but I couldn't figure out how to position the left and bottom correctly. It would never center (except on no zoom).
(2)I read that for 2D games and using glOrtho, just calling glScaled or glScalef before you draw everything should be sufficient. I couldn't get this to work though.
(3)You're supposed to also be able to do this with glOrtho and is sufficient for 2D games. Again, I tried this way (same with glFrustum) using the values in your initialization, and I couldn't get the values of left and bottom to center everything correctly.
Anyway, I hope this helps you out and someone else replies to enlighten us on this issue! In my testing, I was just trying to zoom in and out on a rectangle. If there are no further replies, you can try
http://www.javagaming.org/. If you figure out a solution (that zooms in while keeping the camera centered), please let me know by PM or here!