mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-05 14:35:58 +00:00
Reverted display mode selection
This commit is contained in:
parent
df1d611624
commit
0d620e9125
11 changed files with 100 additions and 126 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue