optimization - How can I speed up my Java game's FPS? -
i making java game, , game lags lot when paint out graphics. way painting out graphics make bufferedimage
, graphics2d
it, whole bunch of:
g2d.drawimage(loadedimages.getimage(),x,y,null);
after print of images bufferedimage
, paint bufferedimage
screen.
there lot of images paint bufferedimage
. there better way speed painting time? not know graphics , graphic cards. should use graphics card? should paint directly screen? should use entirely different drawimage()
?
the performance should if you're drawing reasonable amount of images.
make sure you're not creating new bufferedimage
s every time draw screen. example, might have resources
singleton in manage of images load , unload each image once.
if want more performance, you'll want use opengl. see lwjgl, libgdx, or jogl. may want consider 2d graphics libraries slick.
Comments
Post a Comment