1
フルスクリーンアプリケーションを開発しようとしていますが、ダブルバッファに問題があります。Javaダブルバッファリング - 他のすべてのフレームだけが描画される
public void create()
{
window = new JWindow();
window.setIgnoreRepaint (true);
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow (window);
window.setVisible (true);
window.createBufferStrategy (2);
}
public void renderCycle()
{
BufferStrategy strategy = window.getBufferStrategy();
while (true)
{
render ((Graphics2D) strategy.getDrawGraphics());
strategy.show();
}
}
public void render (Graphics2D g)
{
g.setColor (Color.WHITE);
g.drawString ("Veikia", 100, 100);
}
私は重いちらつきを参照してください - テキストのみが他のすべてのバッファに描画され、残りのバッファが白色の背景が含まれているかのように思えます。何が問題なの?