How can I improve the performance of my rendering? Currently, I'm rendering with java.awt.Graphics, but it seems to be starting to slow down since I'm adding new stuff to render.
My rendering setup:
Loading a spritesheet:
Spritesheet sheet = new Spritesheet(ImageLoader.loadImage("/textures/spritesheet.png"));
BufferedImage player = sheet.crop(5, 0, Spritesheet.DEF_WIDTH, Spritesheet.DEF_HEIGHT);
And then rendering it with java.awt.Graphics in my gameloop:
g.drawImage(player, x, y, Entity.DEF_WIDTH, Entity.DEF_HEIGHT);
Spritesheet.DEF_HEIGHT refer to 32px for quick access since most of my sprites are 32x32px.
Entity.DEF_HEIGHT refer to 64px to render the entity on the screen.
One way I know that could solve my problem is that I could use smaller sprites but scale them up while rendering, but let's see if it's possible without that first.