Guest User

Untitled

a guest
Apr 24th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. BufferStrategy bs;
  2. Graphics2D g;
  3.  
  4. private void render() {
  5. bs = window.getCanvas().getBufferStrategy();
  6.  
  7. if (bs == null) {
  8. window.getCanvas().createBufferStrategy(3);
  9. return;
  10. }
  11.  
  12. g = (Graphics2D) bs.getDrawGraphics();
  13.  
  14. bs.show();
  15. g.dispose();
  16. }
  17.  
  18. // When thread starts
  19. public void run() {
  20. while (running) {
  21. //Game loop stuff here.
  22. render();
  23. }
  24. }
Add Comment
Please, Sign In to add comment