Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BufferStrategy bs;
- Graphics2D g;
- private void render() {
- bs = window.getCanvas().getBufferStrategy();
- if (bs == null) {
- window.getCanvas().createBufferStrategy(3);
- return;
- }
- g = (Graphics2D) bs.getDrawGraphics();
- bs.show();
- g.dispose();
- }
- // When thread starts
- public void run() {
- while (running) {
- //Game loop stuff here.
- render();
- }
- }
Add Comment
Please, Sign In to add comment