Advertisement

[java] Java 2D

Started by January 14, 2000 01:04 PM
2 comments, last by Violenza 24 years, 11 months ago
Does the 2D API make any provisions for double buffering? If so, is this API in pure java (no platform dependencies)? If there is no double buffering how are 2D game programmers handling game displays, or is display shearing not really in issue? Mark Mengelt Program Analyst Phoenix, AZ
Mark MengeltProgram AnalystPhoenix, AZ
In short, Java programmers take advantage of the fact that they can store a "rendering context" off-screen. So, following normal double-buffering techniques they write everything to their offscreen context (or Graphics object. Is it Graphics2D for Swing and Java2D now) and then, once finished, switch Graphics objects
Although depending on the platform will boost the speed, you can still wrangle some better performance through double-buffering with Graphics objects.
joeG
Advertisement
Last I checked, there was no explicit provision for double buffering in the 2D API. You have to allocate an image buffer, perform your graphics operations on that, and then blit to the primary Graphics context.

And yes, it is called Graphics2D now. It extends the Graphics class.

Edited by - SiCrane on 1/14/00 1:53:14 PM
Last i checked there was double buffering in swing. Any JComponent can be painted onto an offscreen buffer, then flipped up onto the screen. JComponenet.setDoubleBuffered(true)

This topic is closed to new replies.

Advertisement