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

45 lines
904 B
Java
Raw Normal View History

2021-10-29 22:50:42 +02:00
package io.gitlab.jfronny.inceptum.windows;
2021-10-28 20:19:09 +02:00
2021-10-28 21:31:51 +02:00
import imgui.flag.ImGuiWindowFlags;
import imgui.type.ImBoolean;
2021-10-29 22:50:42 +02:00
import io.gitlab.jfronny.inceptum.Inceptum;
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-29 22:50:42 +02:00
Inceptum.WINDOWS.remove(this);
2021-10-27 22:00:08 +02:00
}
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
}