Commits

Roi Atalla committed 3ddfd6e

Changed GLProgram to have many execution points depending on the OpenGL version needed.

  • Participants
  • Parent commits 810bfb1

Comments (0)

Files changed (1)

src/main/java/com/ra4king/opengl/GLProgram.java

 	}
 	
 	public final void run() {
-		run(false);
+		try {
+			Display.create();
+		}
+		catch(Exception exc) {
+			exc.printStackTrace();
+			System.exit(1);
+		}
+		
+		gameLoop();
 	}
 	
 	public final void run(boolean core) {
 			System.exit(1);
 		}
 		
+		gameLoop();
+	}
+	
+	public final void run(int major, int minor) {
+		try {
+			Display.create(new PixelFormat(),new ContextAttribs(major,minor));
+		}
+		catch(Exception exc) {
+			exc.printStackTrace();
+			System.exit(1);
+		}
+		
+		gameLoop();
+	}
+	
+	private void gameLoop() {
 		init();
 		
 		resized();