File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does every image need to be a 'VolatileImage' in a 2d game?

 
C Wang
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a little confused about how VolatileImage s are supposed to be used.
Are they just for the 'main' image (the one you draw other images on) or should the other images (like sprite images) be VolatileImage as well?

for example i have 2 images 'screenimage' and 'enemyimage', and I draw enemyimage on to screenimage
if I want to use hardware acceleration on them should I just make screenimage a VolatileImage or should enemyimage be a VolatileImage too?
 
Marlon Drescher
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have exactly the same question.
 
Stephan van Hulst
Bartender
Pie
Posts: 4830
34
Chrome Netbeans IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marlon, welcome to CodeRanch.

You only need VolatileImage if you want hardware acceleration for your image. This is usually the case for offscreen rendering of a scene. Swing already takes care of most of this.

Just use BufferedImage, and only if performance is low, should you consider using a VolatileImage for rendering scenes. Static graphics objects should never use VolatileImage.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic