Jump to content
  • Advertisement


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


[java] I'm just wondering how to increase speed in double buffering.

This topic is 5455 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

I was programming an engine for my mmorpg game:"Sekiya Online", and I was just wondering if there is a way to increase speed in a sprite animation, using double buffering. Does anyone know?

Share this post

Link to post
Share on other sites
I''m not quite sure what you mean. Double buffering is used to prevent flickering when you draw to the screen, although I suppose that this does improve execution speed.

Put simply, you draw all of your sprites to an image in memory, then draw that image to the display. This means that the display only has to be updated once, rather than each time you draw a sprite.

Look at this thread

And this thread

Share this post

Link to post
Share on other sites
According to Sun''s Java Tutorials (paraphrased):
"If you compare a program that blts directly to the screen with programs that use page flipping and double buffering, the program that blts directly to the screen will run faster. Double buffering does not improve the performance of your program, only its ''perceived performance''."

You see, double buffering and page flipping still cost a little bit more memory and have a little more overhead than blting directly to the screen but these two methods can prevent things like "tearing" and "flickering" in your graphics. So you won''t "increase speed" in a sprite animation by using double buffering. This doesn''t mean that you shouldn''t use double buffering because, as fractionMan says, it will prevent weird things from happening to your display like flickering. That''s the improvement in "perceived" performance that Sun''s tutorials talk about: an improvement in performance according to the eye of the user.

Look at Sun''s Java Tutorials on Full Screen Exclusive mode in Java 1.4 and at the threads that fractionMan linked to.

Over the centuries, mankind has tried many ways of combating the forces of evil...prayer,
fasting, good works and so on. Up until Doom, no one seemed to have thought about the
double-barrel shotgun. Eat leaden death, demon...
-- Terry Pratchett

Share this post

Link to post
Share on other sites
Using BufferedImage would probably be a good idea.... but besides that I''m unsure....

garazdawi - ''I put the laughter back in slaughter''

Share this post

Link to post
Share on other sites
No, what I meant was. Can I make it so, that the frames
display slower? Becuase, when I use double buffering,
the sprite I use doesn't move as fast or as slow as I want
it to, during the animation in run-time. How can I make it
go faster?, if there is a way to. By faster I mean, his legs
are moving faster than him.

Java Network Programmer.

[edited by - redarcher on November 11, 2003 1:57:29 PM]

Share this post

Link to post
Share on other sites
Do all your frame updates and animation based in time instead of frames.

Here are a couple of articles:


Read Chris Hargrove's(of Gas Powered Games) comments in this thread


First make it work,
then make it fast.

--Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte

[edited by - CaptainJester on November 12, 2003 9:32:28 AM]

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!