Suspicious fillRect() Speed
Okay so let me get this straight. Java fills rectangles by iterating through an array and changing the rgb values to a designated color. If all it does is change the color then why is Texturepaint so expensive if all it is doing is changing the integer in the array? Does changing the integer in between take time to register?
Fast fillRect() operation using setPaint(new Color());
setPaint(new Color(0,0,0));
fillRect(0,0,frame.getWidth(),frame.getHeight());
// Around 100+ fps repainting with timer set to zero milliseconds.
Slow fillRect() operation using setPaint(new TexturePaint());
setPaint(new TexturePaint(image, rectangle));
fillRect(0,0,frame.getWidth(),frame.getHeight());
// Around 20+ fps repainting with timer set to zero milliseconds.