Reverted display mode selection

This commit is contained in:
Elias Naur 2003-03-19 12:41:28 +00:00
parent df1d611624
commit 0d620e9125
11 changed files with 100 additions and 126 deletions

View file

@ -110,13 +110,19 @@ public final class Display {
* destroyed.
*
* @param displayMode A display mode to choose
* @param alpha Minimun number of alpha bits on the display
* @param depth Minimun number of depth bits on the display
* @param stencil Minimun number of stencil bits on the display
* @param fullscreen Whether to create the display fullscreen
* @param title The title for the application
* @throws Exception if the display mode could not be set
* @see #destroy()
*/
public static void create(
DisplayMode displayMode,
DisplayMode displayMode,
int alpha,
int depth,
int stencil,
boolean fullscreen,
String title)
throws Exception {
@ -129,9 +135,9 @@ public final class Display {
displayMode.height,
displayMode.bpp,
displayMode.freq,
displayMode.alpha,
displayMode.depth,
displayMode.stencil,
alpha,
depth,
stencil,
fullscreen,
title)) {
throw new Exception("Failed to set display mode to " + displayMode);
@ -274,4 +280,4 @@ public final class Display {
public static boolean isCloseRequested() {
return closeRequested;
}
}
}

View file

@ -46,21 +46,18 @@ package org.lwjgl;
public final class DisplayMode {
/** properties of the display mode */
public final int width, height, bpp, freq, alpha, depth, stencil;
public final int width, height, bpp, freq;
/**
* Construct a display mode.
*
* @see Display
*/
private DisplayMode(int width, int height, int bpp, int freq, int alpha, int depth, int stencil) {
private DisplayMode(int width, int height, int bpp, int freq) {
this.width = width;
this.height = height;
this.bpp = bpp;
this.freq = freq;
this.alpha = alpha;
this.depth = depth;
this.stencil = stencil;
}
/**
@ -77,10 +74,7 @@ public final class DisplayMode {
return dm.width == width
&& dm.height == dm.height
&& dm.bpp == bpp
&& dm.freq == freq
&& dm.alpha == alpha
&& dm.depth == depth
&& dm.stencil == stencil;
&& dm.freq == freq;
}
/**
@ -89,7 +83,7 @@ public final class DisplayMode {
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return width ^ height ^ freq ^ bpp ^ alpha ^ (depth << 8) ^ (stencil << 24);
return width ^ height ^ freq ^ bpp;
}
/**
@ -106,13 +100,7 @@ public final class DisplayMode {
sb.append(bpp);
sb.append(" @");
sb.append(freq);
sb.append("Hz ");
sb.append(alpha);
sb.append("bit alpha, ");
sb.append(depth);
sb.append("bit depth, ");
sb.append(stencil);
sb.append("bit stencil");
sb.append("Hz");
return sb.toString();
}
}
}

View file

@ -83,7 +83,7 @@ public class ControllerCreationTest {
private void setupDisplay(boolean fullscreen) {
try {
Display.create(displayMode, fullscreen, "MouseTest");
Display.create(displayMode, 0, 0, 0, fullscreen, "MouseTest");
gl = new GL();
gl.create();
@ -223,4 +223,4 @@ public class ControllerCreationTest {
ControllerCreationTest cct = new ControllerCreationTest();
cct.executeTest();
}
}
}

View file

@ -83,7 +83,7 @@ public class MouseCreationTest {
private void setupDisplay(boolean fullscreen) {
try {
Display.create(displayMode, fullscreen, "MouseTest");
Display.create(displayMode, 0, 0, 0, fullscreen, "MouseTest");
gl = new GL();
gl.create();
@ -226,4 +226,4 @@ public class MouseCreationTest {
MouseCreationTest mt = new MouseCreationTest();
mt.executeTest();
}
}
}

View file

@ -90,7 +90,7 @@ public class MouseTest {
private void setupDisplay(boolean fullscreen) {
try {
Display.create(displayMode, fullscreen, "MouseTest");
Display.create(displayMode, 0, 0, 0, fullscreen, "MouseTest");
gl = new GL();
gl.create();
@ -193,4 +193,4 @@ public class MouseTest {
MouseTest mt = new MouseTest();
mt.executeTest();
}
}
}

View file

@ -92,7 +92,7 @@ public class MovingSoundTest extends BasicTest {
break;
}
}
Display.create(modes[mode], false, "MovingSoundTest");
Display.create(modes[mode], 0, 0, 0, false, "MovingSoundTest");
} catch (Exception e) {
e.printStackTrace();
exit(-1);
@ -256,4 +256,4 @@ public class MovingSoundTest extends BasicTest {
MovingSoundTest movingSoundTest = new MovingSoundTest();
movingSoundTest.execute(args);
}
}
}

View file

@ -63,7 +63,7 @@ public final class Game {
}
//select above found displaymode
Display.create(modes[mode], false, "LWJGL Game Example");
Display.create(modes[mode], 0, 16, 0, false, "LWJGL Game Example");
System.out.println("Created display.");
} catch (Exception e) {
System.err.println("Failed to create display due to " + e);

View file

@ -81,7 +81,7 @@ public class Grass {
}
// For now let's just pick a mode we're certain to have
Display.create(modes[mode], false, "Grass");
Display.create(modes[mode], 0, 16, 0, false, "Grass");
System.out.println("Created display.");
} catch (Exception e) {
e.printStackTrace();