package com.betato.gamedisplay;

import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.image.BufferStrategy;

public abstract class GameWindow extends Canvas implements Game {
	
	private static final long serialVersionUID = 1L;
	private GameLoop gameLoop;
	
	public int fps, ups = 0;
	
	public GameWindow(GameLoop gameLoop) {
		this.gameLoop = gameLoop;
		gameLoop.run(this);
	}
	
	@Override
	public void init() {
		
	}
	
	@Override
	public void update() {
		
	}
	
	@Override
	public void render() {
		BufferStrategy bs = this.getBufferStrategy();
		if (bs == null) {
			this.createBufferStrategy(2);
			return;
		}
		Graphics g = bs.getDrawGraphics();
		// Render stuff here
		g.dispose();
		bs.show();
	}
	
	@Override
	public void updateFps(int fps, int ups) {
		this.fps = fps;
		this.ups = ups;
	}
}

@@ -378,32 +378,100 @@
 run(this);%0A%09%7D%0A%09%0A
+%09public void close() %7B%0A%09%09gameLoop.running = false;%0A%09%09onExit();%0A%09%7D%0A%09%0A
 %09@Override%0A%09publ
@@ -457,32 +457,32 @@
 %09%7D%0A%09%0A%09@Override%0A
-
 %09public void ini
@@ -485,24 +485,33 @@
  init() %7B%0A%09%09
+onInit();
 %0A%09%7D%0A%09%0A%09@Over
@@ -541,16 +541,27 @@
 e() %7B%0A%09%09
+onUpdate();
 %0A%09%7D%0A%09%0A%09@
@@ -752,28 +752,20 @@
 ;%0A%09%09
-// 
+on
 Render
- stuff here
+(g);
 %0A%09%09g
@@ -884,13 +884,296 @@
  = ups;%0A
-
 %09%7D%0A
+%09%0A%09// Called on initialization%0A%09abstract public void onInit();%0A%0A%09// Called on update%0A%09abstract public void onUpdate(/* Add mouse and keyboard inputs */);%0A%0A%09// Called on render%0A%09abstract public void onRender(Graphics g);%0A%0A%09// Called on GameWindow exit%0A%09abstract public void onExit();%0A
 %7D%0A

Add GameWindow abstract methods