Fixed
This commit is contained in:
parent
c2714fe763
commit
24160ac606
|
@ -53,9 +53,8 @@ public class CoreGL extends BaseGL implements CoreGLConstants {
|
|||
* @param alpha
|
||||
* @param depth
|
||||
* @param stencil
|
||||
* @throws Exception
|
||||
*/
|
||||
public CoreGL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) throws Exception {
|
||||
public CoreGL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) {
|
||||
super(title, x, y, width, height, bpp, alpha, depth, stencil);
|
||||
}
|
||||
|
||||
|
@ -65,9 +64,8 @@ public class CoreGL extends BaseGL implements CoreGLConstants {
|
|||
* @param alpha
|
||||
* @param depth
|
||||
* @param stencil
|
||||
* @throws Exception
|
||||
*/
|
||||
public CoreGL(String title, int bpp, int alpha, int depth, int stencil) throws Exception {
|
||||
public CoreGL(String title, int bpp, int alpha, int depth, int stencil) {
|
||||
super(title, bpp, alpha, depth, stencil);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,9 +58,8 @@ public class GL extends CoreGL implements GLConstants {
|
|||
* @param alpha
|
||||
* @param depth
|
||||
* @param stencil
|
||||
* @throws Exception
|
||||
*/
|
||||
public GL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) throws Exception {
|
||||
public GL(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) {
|
||||
super(title, x, y, width, height, bpp, alpha, depth, stencil);
|
||||
}
|
||||
|
||||
|
@ -70,9 +69,8 @@ public class GL extends CoreGL implements GLConstants {
|
|||
* @param alpha
|
||||
* @param depth
|
||||
* @param stencil
|
||||
* @throws Exception
|
||||
*/
|
||||
public GL(String title, int bpp, int alpha, int depth, int stencil) throws Exception {
|
||||
public GL(String title, int bpp, int alpha, int depth, int stencil) {
|
||||
super(title, bpp, alpha, depth, stencil);
|
||||
}
|
||||
|
||||
|
|
|
@ -61,17 +61,18 @@ public final class Game {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//select above found displaymode
|
||||
Display.create(modes[mode], 0, 16, 0, false, "LWJGL Game Example");
|
||||
System.out.println("Created display.");
|
||||
if (mode != -1) {
|
||||
//select above found displaymode
|
||||
System.out.println("Setting display mode to "+modes[mode]);
|
||||
Display.setDisplayMode(modes[mode]);
|
||||
System.out.println("Created display.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("Failed to create display due to " + e);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static final GL gl = new GL();
|
||||
public static final GL gl = new GL("LWJGL Game Example", 16, 0, 0,0);
|
||||
public static final GLU glu = new GLU(gl);
|
||||
static {
|
||||
try {
|
||||
|
@ -99,10 +100,18 @@ public final class Game {
|
|||
try {
|
||||
init();
|
||||
while (!finished) {
|
||||
// Keyboard.poll();
|
||||
gl.tick();
|
||||
|
||||
if (gl.isMinimized())
|
||||
Thread.sleep(200);
|
||||
else if (gl.isCloseRequested())
|
||||
System.exit(0);
|
||||
|
||||
Keyboard.poll();
|
||||
Keyboard.read();
|
||||
mainLoop();
|
||||
render();
|
||||
gl.swapBuffers();
|
||||
gl.paint();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
|
@ -188,6 +197,10 @@ public final class Game {
|
|||
Keyboard.destroy();
|
||||
Mouse.destroy();
|
||||
gl.destroy();
|
||||
BaseGL.destroy();
|
||||
try {
|
||||
Display.resetDisplayMode();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue