/**
* Render offscreen graphics into the frame.
*/
private void render() {
final BufferStrategy bufferStrategy = frame.getBufferStrategy();
do {
do {
final Graphics2D graphics = (Graphics2D) bufferStrategy.getDrawGraphics();
// canvas is not opaque, so fill with background color
graphics.setPaint(background);
graphics.fillRect(0, 0, 400, 400);
// then let canvas render into graphics
canvas.render(graphics);
graphics.dispose();
} while (bufferStrategy.contentsRestored());
bufferStrategy.show();
} while (bufferStrategy.contentsLost());
}
OffscreenCanvasExample.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:piccolo2d.java
作者:
评论列表
文章目录