Fixed full screen mode and back

This commit is contained in:
Willem Cazander 2022-03-02 02:13:37 +01:00
parent f5f7a0a48b
commit 87ce108bd1
7 changed files with 27 additions and 31 deletions

View file

@ -129,10 +129,10 @@ public class GDXAppVrGem4Activator implements BundleActivator {
Gdx.app.postRunnable(new Runnable() { Gdx.app.postRunnable(new Runnable() {
@Override @Override
public void run() { public void run() {
terminal.registrateScreen(new ScreenDesktop1()); terminal.registrateScreen(new ScreenDesktop1(bootArgs));
terminal.registrateScreen(new ScreenDesktop2()); terminal.registrateScreen(new ScreenDesktop2(bootArgs));
terminal.registrateScreen(new ScreenDesktop3()); terminal.registrateScreen(new ScreenDesktop3(bootArgs));
terminal.registrateScreen(new ScreenDesktop4()); terminal.registrateScreen(new ScreenDesktop4(bootArgs));
terminal.registrateScreen(new ScreenCredits()); terminal.registrateScreen(new ScreenCredits());
terminal.registrateScreen(new ScreenHelp()); terminal.registrateScreen(new ScreenHelp());
terminal.registrateScreen(new ScreenIntroMission()); terminal.registrateScreen(new ScreenIntroMission());

View file

@ -8,6 +8,7 @@ import com.badlogic.gdx.Gdx;
import imgui.ImGui; import imgui.ImGui;
import imgui.type.ImBoolean; import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
import love.distributedrebirth.gdxapp4d.vrgem4.FontAwesomeIcons; import love.distributedrebirth.gdxapp4d.vrgem4.FontAwesomeIcons;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppLauncher; import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppLauncher;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4; import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4;
@ -28,12 +29,14 @@ import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenHelp;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class DeskTopScreenMenu { public class DeskTopScreenMenu {
private SystemWarpBootArgs bootArgs;
private List<GDXAppLauncher> apps; private List<GDXAppLauncher> apps;
private ImBoolean fileMinimizeSelected = new ImBoolean(false); private ImBoolean fileMinimizeSelected = new ImBoolean(false);
private ImBoolean fileCloseSelected = new ImBoolean(false); private ImBoolean fileCloseSelected = new ImBoolean(false);
private ImBoolean tosSelfSelected = new ImBoolean(false); private ImBoolean tosSelfSelected = new ImBoolean(false);
public DeskTopScreenMenu() { public DeskTopScreenMenu(SystemWarpBootArgs bootArgs) {
this.bootArgs = bootArgs;
apps = new ArrayList<>(); apps = new ArrayList<>();
apps.add(new GDXAppLauncher("Basic Console", () -> new BasicConsoleApp())); apps.add(new GDXAppLauncher("Basic Console", () -> new BasicConsoleApp()));
apps.add(new GDXAppLauncher("Sys Glyph Set", () -> new SystemBaseGlyphApp())); apps.add(new GDXAppLauncher("Sys Glyph Set", () -> new SystemBaseGlyphApp()));
@ -222,11 +225,11 @@ public class DeskTopScreenMenu {
ImGui.separator(); ImGui.separator();
if (Gdx.graphics.isFullscreen()) { if (Gdx.graphics.isFullscreen()) {
if (ImGui.menuItem(FontAwesomeIcons.Wheelchair + " Window Mode")) { if (ImGui.menuItem(FontAwesomeIcons.Wheelchair + " Window Mode")) {
// Gdx.graphics.setWindowedMode(GDXAppVrGem4.INSTANCE.viewWidth, GDXAppVrGem4.INSTANCE.viewHeight); Gdx.graphics.setWindowedMode(bootArgs.getBootWindowWidth(), bootArgs.getBootWindowHeight());
} }
} else { } else {
if (ImGui.menuItem(FontAwesomeIcons.FighterJet + " Full Screen")) { if (ImGui.menuItem(FontAwesomeIcons.FighterJet + " Full Screen")) {
// Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
} }
} }

View file

@ -17,6 +17,7 @@ import imgui.ImGui;
import imgui.flag.ImGuiCond; import imgui.flag.ImGuiCond;
import imgui.flag.ImGuiWindowFlags; import imgui.flag.ImGuiWindowFlags;
import imgui.type.ImBoolean; import imgui.type.ImBoolean;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
import love.distributedrebirth.gdxapp4d.vrgem4.ImGuiSetup; import love.distributedrebirth.gdxapp4d.vrgem4.ImGuiSetup;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskApp; import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskApp;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection; import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppContourSection;
@ -41,8 +42,8 @@ public abstract class AbstractScreenDesktop extends ScreenAdapter implements Des
private ModelBatch modelBatch; private ModelBatch modelBatch;
private Array<ModelInstance> modelInstances = new Array<ModelInstance>(); private Array<ModelInstance> modelInstances = new Array<ModelInstance>();
public AbstractScreenDesktop(String name) { public AbstractScreenDesktop(String name, SystemWarpBootArgs bootArgs) {
this.create(); this.create(bootArgs);
deskAppScreen = new DeskAppScreen(name); deskAppScreen = new DeskAppScreen(name);
deskAppScreen.addDeskAppListener(new DeskAppScreenListener() { deskAppScreen.addDeskAppListener(new DeskAppScreenListener() {
@ -61,7 +62,7 @@ public abstract class AbstractScreenDesktop extends ScreenAdapter implements Des
} }
private void create() { private void create(SystemWarpBootArgs bootArgs) {
batch = new SpriteBatch(); batch = new SpriteBatch();
font = new BitmapFont(); font = new BitmapFont();
camera = new OrthographicCamera(); camera = new OrthographicCamera();
@ -70,7 +71,7 @@ public abstract class AbstractScreenDesktop extends ScreenAdapter implements Des
camera.update(); camera.update();
batch.setProjectionMatrix(camera.combined); batch.setProjectionMatrix(camera.combined);
screenMenu = new DeskTopScreenMenu(); screenMenu = new DeskTopScreenMenu(bootArgs);
modelBatch = new ModelBatch(); modelBatch = new ModelBatch();

View file

@ -1,8 +1,5 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen; package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.Model;
@ -12,16 +9,14 @@ import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4; import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppScreen;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskTopScreen;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop1 extends AbstractScreenDesktop { public class ScreenDesktop1 extends AbstractScreenDesktop {
private Model grid; private Model grid;
public ScreenDesktop1() { public ScreenDesktop1(SystemWarpBootArgs bootArgs) {
super("Desktop1"); super("Desktop1", bootArgs);
//backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-front.png")); //backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-front.png"));
} }

View file

@ -1,8 +1,5 @@
package love.distributedrebirth.gdxapp4d.vrgem4.screen; package love.distributedrebirth.gdxapp4d.vrgem4.screen;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.Model;
@ -12,16 +9,14 @@ import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.vrgem4.GDXAppVrGem4; import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskAppScreen;
import love.distributedrebirth.gdxapp4d.vrgem4.desktop.DeskTopScreen;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop2 extends AbstractScreenDesktop { public class ScreenDesktop2 extends AbstractScreenDesktop {
private Model grid; private Model grid;
public ScreenDesktop2() { public ScreenDesktop2(SystemWarpBootArgs bootArgs) {
super("Desktop2"); super("Desktop2", bootArgs);
//backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-nose.png")); //backgroundImage = new Texture(Gdx.files.internal("background/terrydavis-nose.png"));
} }

View file

@ -9,13 +9,14 @@ import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Array;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop3 extends AbstractScreenDesktop { public class ScreenDesktop3 extends AbstractScreenDesktop {
private Model grid; private Model grid;
public ScreenDesktop3() { public ScreenDesktop3(SystemWarpBootArgs bootArgs) {
super("Desktop3"); super("Desktop3", bootArgs);
} }
protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) { protected void createModel(ModelBuilder modelBuilder, Array<ModelInstance> modelInstances) {

View file

@ -20,6 +20,7 @@ import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.viewport.ScreenViewport; import com.badlogic.gdx.utils.viewport.ScreenViewport;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBootArgs;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class ScreenDesktop4 extends AbstractScreenDesktop { public class ScreenDesktop4 extends AbstractScreenDesktop {
@ -35,8 +36,8 @@ public class ScreenDesktop4 extends AbstractScreenDesktop {
private float colorFade = 0f; private float colorFade = 0f;
private boolean colorPositive = true; private boolean colorPositive = true;
public ScreenDesktop4() { public ScreenDesktop4(SystemWarpBootArgs bootArgs) {
super("Desktop4"); super("Desktop4", bootArgs);
shader = new UserColorShader(); shader = new UserColorShader();
shader.init(); shader.init();
font = new BitmapFont(); font = new BitmapFont();