Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl
In directory sc8-pr-cvs1:/tmp/cvs-serv8620/src/java/org/lwjgl
Modified Files:
Display.java DisplayMode.java
Log Message:
New DisplayMode code
Index: Display.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Display.java 21 Dec 2002 12:37:18 -0000 1.9
+++ Display.java 22 Dec 2002 19:52:15 -0000 1.10
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002 Lightweight Java Game Library Project
+ * Copyright (c) 2002 Light Weight Java Game Library Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -81,18 +81,12 @@
* destroyed.
*
* @param displayMode a display mode to choose
- * @param alpha_bits number of alpha bits required
- * @param depth_bits number of depth bits required
- * @param stencil_bits number of stencil bits required
* @param fullscreen whether to create the display fullscreen
* @throws Exception if the display mode could not be set
* @see #destroy()
*/
public static void create(
DisplayMode displayMode,
- int alpha_bits,
- int depth_bits,
- int stencil_bits,
boolean fullscreen)
throws Exception {
@@ -103,9 +97,9 @@
displayMode.height,
displayMode.bpp,
displayMode.freq,
- alpha_bits,
- depth_bits,
- stencil_bits,
+ displayMode.alpha,
+ displayMode.depth,
+ displayMode.stencil,
fullscreen))
throw new Exception("Failed to set display mode to " + displayMode);
Index: DisplayMode.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/DisplayMode.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/DisplayMode.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- DisplayMode.java 21 Dec 2002 12:37:18 -0000 1.5
+++ DisplayMode.java 22 Dec 2002 19:52:15 -0000 1.6
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002 Lightweight Java Game Library Project
+ * Copyright (c) 2002 Light Weight Java Game Library Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,18 +43,21 @@
public final class DisplayMode {
- public final int width, height, bpp, freq;
+ public final int width, height, bpp, freq, alpha, depth, stencil;
/**
* Construct a display mode.
*
* @see Display
*/
- public DisplayMode(int width, int height, int bpp, int freq) {
+ private DisplayMode(int width, int height, int bpp, int freq, int alpha, int depth, int stencil) {
this.width = width;
this.height = height;
this.bpp = bpp;
this.freq = freq;
+ this.alpha = alpha;
+ this.depth = depth;
+ this.stencil = stencil;
}
@@ -69,14 +72,17 @@
return dm.width == width
&& dm.height == dm.height
&& dm.bpp == bpp
- && dm.freq == freq;
+ && dm.freq == freq
+ && dm.alpha == alpha
+ && dm.depth == depth
+ && dm.stencil == stencil;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
- return width ^ height ^ freq ^ bpp;
+ return width ^ height ^ freq ^ bpp ^ alpha ^ (depth << 8) ^ (stencil << 24);
}
/* (non-Javadoc)
@@ -91,7 +97,13 @@
sb.append(bpp);
sb.append(" @");
sb.append(freq);
- sb.append("Hz");
+ sb.append("Hz ");
+ sb.append(alpha);
+ sb.append("bit alpha, ");
+ sb.append(depth);
+ sb.append("bit depth, ");
+ sb.append(stencil);
+ sb.append("bit stencil");
return sb.toString();
}
|