mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-08 16:04:39 +00:00
fix: make it all compile
This commit is contained in:
parent
16d8c3c053
commit
07fdc052e0
7 changed files with 83 additions and 107 deletions
|
|
@ -7,7 +7,7 @@
|
|||
package org.lwjgl.test;
|
||||
|
||||
import org.lwjgl.*;
|
||||
import org.lwjgl.opengl.BaseGL;
|
||||
import org.lwjgl.opengl.GL;
|
||||
|
||||
/**
|
||||
* @author Brian
|
||||
|
|
@ -15,35 +15,34 @@ import org.lwjgl.opengl.BaseGL;
|
|||
public class WindowCreationTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
GL gl = null;
|
||||
|
||||
DisplayMode[] modes = Display.getAvailableDisplayModes();
|
||||
System.out.println("Found " + modes.length + " display modes");
|
||||
|
||||
//find 640*480*32*100
|
||||
DisplayMode mode = modes[0];
|
||||
for(int i=0;i<modes.length;i++) {
|
||||
if(modes[i].width == 640 &&
|
||||
modes[i].height == 480 &&
|
||||
modes[i].bpp == 16 &&
|
||||
mode.freq <= modes[i].freq) {
|
||||
mode = modes[i];
|
||||
}
|
||||
}
|
||||
|
||||
if(mode == null) {
|
||||
System.out.println("Unable to find displaymode with following features: 640*480*16*60");
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
System.out.println("mode: " + mode);
|
||||
|
||||
try {
|
||||
Display.create(mode, 0, 0, 0, false, "WindowCreationTest");
|
||||
gl = new GL("WindowCreationTest", 50, 50, 320, 240, 32, 0, 0, 0);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
gl.create();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("Display created");
|
||||
|
||||
while(!gl.isCloseRequested()) {
|
||||
gl.tick();
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
BaseGL.destroy();
|
||||
gl.destroy();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue