Right now, this is how i have initialized opengl:
updateScreen();
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glClearColor(0.f, 0.f, 0.f, 1.f);
public void updateScreen() {
final int rw = (int) (Display.getWidth() / scale());
final int rh = (int) (Display.getHeight() / scale());
final float x = vx;
final float y = vy;
final float w = x + rw;
final float h = y + rh;
glViewport(0, 0, Display.getWidth(), Display.getHeight());
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(x, w, y, h, 1.f, -1.f);
glMatrixMode(GL_MODELVIEW);
}
updateScreen is also use for whenever i move the camera. Now:
1)Is this code "good enough" ?
2)I wanted to move the camera using glulookat, but suddenly nothing appears on the screen. I read it is a common mistake, but i can't figure out how to fix it.