Inceptum/src/main/java/io/gitlab/jfronny/glaunch/windows/Window.java

45 lines
900 B
Java
Raw Normal View History

2021-10-28 20:19:09 +02:00
package io.gitlab.jfronny.glaunch.windows;
2021-10-28 21:31:51 +02:00
import imgui.flag.ImGuiWindowFlags;
import imgui.type.ImBoolean;
2021-10-28 20:19:09 +02:00
import io.gitlab.jfronny.glaunch.GLaunch;
2021-10-27 22:00:08 +02:00
public abstract class Window {
private final String name;
private boolean isNew = true;
2021-10-28 21:31:51 +02:00
private ImBoolean openState = new ImBoolean(true);
2021-10-27 22:00:08 +02:00
public Window(String name) {
this.name = name;
}
public void preFirstDraw() {
}
public abstract void draw();
public String getName() {
return name;
}
public void close() {
2021-10-28 21:31:51 +02:00
openState.set(false);
2021-10-27 22:00:08 +02:00
GLaunch.WINDOWS.remove(this);
}
public boolean isNew() {
if (isNew) {
isNew = false;
return true;
}
return false;
}
2021-10-28 21:31:51 +02:00
public int getFlags() {
return ImGuiWindowFlags.AlwaysAutoResize;
}
public ImBoolean getOpenState() {
return openState;
}
2021-10-27 22:00:08 +02:00
}