开发者

Java : VolatileImage slower than BufferedImage

开发者 https://www.devze.com 2022-12-28 04:21 出处:网络
I\'m making a game in java and in used BufferedImages to render content to the screen. I had performance issues on low end machines where the game is supposed to run, so I switched to Vo开发者_开发技巧

I'm making a game in java and in used BufferedImages to render content to the screen. I had performance issues on low end machines where the game is supposed to run, so I switched to Vo开发者_开发技巧latileImage which are normally faster. Except they actually slow the whole thing down.

The images are created with GraphicsConfiguration.createCompatibleVolatileImage(...) and are drawn to the screen with Graphics.drawImage(...) (follow link to see which one specifically). They are drawn upon a Canvas using double buffering.

Does someone has an idea of what is going wrong here ?


Most likely your code is mixing accelerated and unaccelerated operations.

This document is a must read. Section 3.2 in particular is essential for anyone working with accelerated Java graphics.

0

精彩评论

暂无评论...
验证码 换一张
取 消