Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

biovenger

[java] Performance in Java applications with Java2D

This topic is 5225 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I just had a fast question. How good is the performance in Java when one is using the Java2D classes (Graphics2D, etc...) to render. I will not be using any fancy software blenders, but mainly will just display images (.PNG with 1 layer of transparency) and animations. How large can the performance be? Is it fast enough to do a nice little action game (was thinking isometric)? Or would I have to use the OpenGL extensions (I''d really rather NOT do this).

Share this post


Link to post
Share on other sites
Advertisement
Faster than you think. I think you''ll find it works quite well. Make sure you use double buffering. I made a side scrolling shooter with Java2D in college and was suprised at the performance. I thought it would be slow.

Share this post


Link to post
Share on other sites
It can be fast enough for simple stuff, provided you a) expect it to run at 30fps or less in general (although it is possible to target 60fps+ it''s generally not always going to work out) b) don''t deploy on the Mac which has some performance issues still c) know all the magic riddles and runes to get accelerated blitting working and d) you don''t do any alpha blending or rotation or scaling

Cas

Share this post


Link to post
Share on other sites
Oh please teach me the arcane magicks of accelerated blitting! Or at least show me a tutorial!

Also: I am of course talking about a Java Application, not an applet.

[edited by - biovenger on June 1, 2004 7:28:39 AM]

Share this post


Link to post
Share on other sites
Java2D uses directx for hardware accelerated blitting on windows. So its comparable in speed to doing 2d in SDL or Allegro on windows. Its easy to get 100+ fps.

Share this post


Link to post
Share on other sites
I was also wondering about basically the same thing. Thanks for the link.

How do using .gif''s compare to using .png? Any speed advantage,color advantage or something like that?

Share this post


Link to post
Share on other sites
Anything other than 1-bit (on/off) transparency will pretty much suck in terms of performance, but how you create that image is up to you. Sticking with gifs is a good idea though, as if you use pngs you can accidentally get a proper transparent image and be left wondering where all your performance has gone. :S The 256 colour limit for gifs isn't usually a problem unless you want big background images or something.

[edited by - OrangyTang on June 1, 2004 2:23:15 PM]

Share this post


Link to post
Share on other sites
Rule-of-Thumb when working with PNG files: Always save them in 8-bit mode (256 colors, that way you only get 1-bit transparecy channel)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!