Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Graphics g = bs.getDrawGraphics(); g.setColor(Color.BLACK); g.fillRect(0, 0, getWidth(), getHeight()); g.dispose(); bs.show();
调用是否bs.show()实际显示缓冲的帧?如果是这样,怎么做?它只是说它使下一个可用缓冲区可见,但是当前缓冲区呢?什么时候显示?
bs.show()
根据文档:
通过复制内存(blitting)或更改显示指针(翻转)使下一个可用缓冲区可见。
简单地说,这意味着BufferStrategy成为 JFrame 的当前缓冲区。
BufferStrategy