To draw a background image, I'm currently using Image.subImage. It works fine, but on a blank slate game with just the background drawing and a simple sprite, it's "only" 2200 FPS on my screen. I wish I could profile and find out what's eating things up, but my computer can't run NB or its profiler at the moment. :/
Is the following usage of subImage reasonable to call every update?
Code:
public void render(Graphics g)
{
Viewport viewport = getViewport();
float x = viewport.getX();
float y = viewport.getY();
float clipx = viewport.getClip().x;
float clipy = viewport.getClip().y;
float width = viewport.getClip().width;
float height = viewport.getClip().height;
Image sub = image.getSubImage((int) x, (int) y, (int) width, (int) height);
sub.draw(clipx, clipy);
}