fix(VideoOptions): initialize videoMode based on OS in constructor
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
package de.extio.game_engine.renderer.model.options;
|
package de.extio.game_engine.renderer.model.options;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public final class VideoOptions {
|
public final class VideoOptions {
|
||||||
|
|
||||||
private VideoOptionsVideoMode videoMode = VideoOptionsVideoMode.WINDOW;
|
private VideoOptionsVideoMode videoMode;
|
||||||
|
|
||||||
private int fullScreenNumber = -1;
|
private int fullScreenNumber = -1;
|
||||||
|
|
||||||
@@ -10,6 +12,15 @@ public final class VideoOptions {
|
|||||||
|
|
||||||
private int frameRateTarget = 60;
|
private int frameRateTarget = 60;
|
||||||
|
|
||||||
|
public VideoOptions() {
|
||||||
|
if (Objects.requireNonNullElse(System.getProperty("os.name"), "").toLowerCase().contains("windows")) {
|
||||||
|
videoMode = VideoOptionsVideoMode.BORDERLESS;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
videoMode = VideoOptionsVideoMode.FULLSCREEN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void apply(final VideoOptions other) {
|
public void apply(final VideoOptions other) {
|
||||||
this.setVideoMode(other.getVideoMode());
|
this.setVideoMode(other.getVideoMode());
|
||||||
this.setFullScreenNumber(other.getFullScreenNumber());
|
this.setFullScreenNumber(other.getFullScreenNumber());
|
||||||
|
|||||||
Reference in New Issue
Block a user