fix: rewritten windowed/fullscreen selection

This commit is contained in:
Brian Matzon 2003-03-28 23:47:20 +00:00
parent d3c77abc4b
commit f5c253726a
1 changed files with 9 additions and 4 deletions

View File

@ -65,7 +65,7 @@ public class MouseCreationTest {
public MouseCreationTest() { public MouseCreationTest() {
} }
private void initialize() { private void initialize(boolean fullscreen) {
// find first display mode that allows us 640*480*16 // find first display mode that allows us 640*480*16
DisplayMode[] modes = Display.getAvailableDisplayModes(); DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) { for (int i = 0; i < modes.length; i++) {
@ -78,7 +78,12 @@ public class MouseCreationTest {
} }
try { try {
gl = new GL("MouseCreationTest", 50, 50, 640, 480, 32, 0, 0, 0); if(fullscreen) {
Display.setDisplayMode(displayMode);
gl = new GL("MouseCreationTest", 16, 0, 0, 0);
} else {
gl = new GL("MouseCreationTest", 50, 50, 640, 480, 16, 0, 0, 0);
}
gl.create(); gl.create();
glu = new GLU(gl); glu = new GLU(gl);
@ -96,7 +101,7 @@ public class MouseCreationTest {
} }
public void executeTest() { public void executeTest() {
initialize(); initialize(false);
System.out.println("Test ready:\n"); System.out.println("Test ready:\n");
@ -118,7 +123,7 @@ public class MouseCreationTest {
System.out.print("Entering fullscreen mode..."); System.out.print("Entering fullscreen mode...");
try { try {
gl.destroy(); gl.destroy();
initialize(); initialize(true);
Display.setDisplayMode(displayMode); Display.setDisplayMode(displayMode);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();