Jump to content
  • Advertisement
Sign in to follow this  

[java] Buffered Graphics

This topic is 4048 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'm trying to use buffered graphics, because my images appear to be flickery. However, as opposed to the traditional method of rendering (via an applet), I have to render on a panel. Thus, the following won't work: http://www.realapplets.com/tutorial/DoubleBuffering.html which has this class signature:
Quote:
public class DoubleBuffering extends Applet implements MouseMotionListener {
Any ideas, to as how I can render from a class that has this signature:
Quote:
public class Animate extends Panel{
For the example (above) won't work with my class.

Share this post


Link to post
Share on other sites
Advertisement
You could add a canvas to the Panel, ( I think, maybe you don't have to do this; I always use JPanels, and am not real familiar with AWT Panels ), and then use a BufferStrategy. I'm fairly sure there is information on this at the official Java Tutorials, maybe under the Full-Screen Exclusive Mode section.

Share this post


Link to post
Share on other sites
use CreateImage to create a bitmap the size of your entire drawing
area, and draw everything to it. At the end of your window refresh,
draw the backing image to the real screen in one swell foop. The cost
of drawing the entire bitmap twice (once to draw the backing bitmap,
once to transfer the backing store to foreground) is built in, but
it's acceptable these days.

If possible, keep it that simple.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!