2018-09-02 13:36:49 +02:00
|
|
|
package it.cavallium.warppi.gui.graphicengine;
|
2017-01-22 13:46:38 +01:00
|
|
|
|
2019-11-01 15:23:34 +01:00
|
|
|
import it.cavallium.warppi.util.EventSubscriber;
|
|
|
|
|
2017-01-31 22:29:49 +01:00
|
|
|
import java.io.IOException;
|
2017-09-23 23:23:26 +02:00
|
|
|
import java.util.List;
|
2019-11-01 15:23:34 +01:00
|
|
|
import java.util.function.Consumer;
|
2018-08-29 00:07:45 +02:00
|
|
|
|
2017-02-02 10:30:45 +01:00
|
|
|
public interface GraphicEngine {
|
2017-01-22 13:46:38 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
int[] getSize();
|
2017-01-31 22:29:49 +01:00
|
|
|
|
2019-02-27 23:29:03 +01:00
|
|
|
boolean isSupported();
|
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
boolean isInitialized();
|
2017-01-22 13:46:38 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
void setTitle(String title);
|
2017-01-22 13:46:38 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
void setResizable(boolean r);
|
2017-01-31 22:29:49 +01:00
|
|
|
|
2019-02-27 23:29:03 +01:00
|
|
|
void setDisplayMode(int ww, int wh);
|
2017-01-31 22:29:49 +01:00
|
|
|
|
2019-02-27 23:29:03 +01:00
|
|
|
void create(Runnable object);
|
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
default void create() {
|
2017-12-13 18:09:57 +01:00
|
|
|
create(null);
|
|
|
|
};
|
2017-09-24 18:47:30 +02:00
|
|
|
|
2019-11-01 15:23:34 +01:00
|
|
|
EventSubscriber<Integer[]> onResize();
|
2017-01-22 13:46:38 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
int getWidth();
|
2017-01-22 13:46:38 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
int getHeight();
|
2017-01-22 13:46:38 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
void destroy();
|
2017-01-22 13:46:38 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
void start(RenderingLoop d);
|
2017-01-22 13:46:38 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
void repaint();
|
2017-01-31 22:29:49 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
Renderer getRenderer();
|
2017-01-31 22:29:49 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
BinaryFont loadFont(String fontName) throws IOException;
|
2018-05-12 21:18:29 +02:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
BinaryFont loadFont(String path, String fontName) throws IOException;
|
2017-01-31 22:29:49 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
Skin loadSkin(String file) throws IOException;
|
2017-01-31 22:29:49 +01:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
boolean doesRefreshPauses();
|
2017-09-15 23:24:12 +02:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
default boolean supportsFontRegistering() {
|
2017-09-23 23:23:26 +02:00
|
|
|
return false;
|
|
|
|
}
|
2017-09-24 18:47:30 +02:00
|
|
|
|
2018-09-22 11:17:30 +02:00
|
|
|
default List<BinaryFont> getRegisteredFonts() {
|
2017-09-23 23:23:26 +02:00
|
|
|
return null;
|
|
|
|
}
|
2017-01-22 13:46:38 +01:00
|
|
|
}
|