Hey,
I’m using openGL through LWJGL and have my window which does not seem to be clearing its contents before rendering so moving a quad causes it to redraw over the top of what was there before.
This is my opengl init code:
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, WIDTH, HEIGHT, 0, 1, -1);
glMatrixMode(GL_MODELVIEW);
This is my mainLoop:
public void mainLoop() {
while (!Display.isCloseRequested()) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
update();
render();
Display.sync(fps);
Display.update();
}
Display.destroy();
}