SJGL is a library that makes game development in Java easier.
import java.awt.Color;
import sjgl.SJGL;
import sjgl.display.Display;
import sjgl.graphics.Graphics;
public class Main extends SJGL {
public Main() {
Display display = new Display(this);
display.createDisplay(800, 600, false, "Example for SJGL");
}
public static void main(String[] args) {
new Main();
}
@Override
public void onStart() {
}
@Override
public void onClose() {
}
@Override
public void onRender() {
Graphics g = new Graphics(); // NOTE: Be sure that you import the sjgl.graphics.Graphics class instead of java.awt.Graphics
g.clearScreen(Color.BLACK);
g.fillOval(10, 10, 150, 120, Color.CYAN);
}
@Override
public void onUpdate() {
// NOTE: This function will be executed 60 times per second
}
}