I’m making a scroller learning from thebennybox tutorials. In his way of scrolling he does this each loop.
public void render()
{
// glPushMatrix();
{
// draw to center (exact in this case) of screen first instead
// of bottom left
glTranslatef(
Display.getWidth() / 2 - Player.SIZE / 2,
Display.getHeight() / 2 - Player.SIZE / 2,
0);
sprite.render();
// negative to scroll in opposite direction
glTranslatef(-x, -y, 0);
}
// glPopMatrix();
}
He also calls
glLoadeIdentity();
each frame. I plan on rotating sprites later on but pushing and poping this doesn’t let it move. How can I fix this?