フルスクリーンアプリケーションを開発しようとしていますが、ダブルバッファに問題があります。
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);
}
ひらめきがひどく見えます。テキストは他のすべてのバッファにのみ描画され、残りのバッファには白い背景が含まれているようです。何が問題なのですか?