implemented Engine.loadBytes

This commit is contained in:
DaniTheSkunk 2022-09-20 23:25:15 +02:00
parent 07ced1f430
commit fd42674cee
1 changed files with 5 additions and 2 deletions

View File

@ -21,7 +21,7 @@ public class Engine {
}
//Methods
public Image loadImage(String path) {
public ByteBuffer loadBytes(String path) {
ByteBuffer buf;
byte[] bytes;
try(FileInputStream fis = new FileInputStream(path)) {
@ -32,7 +32,10 @@ public class Engine {
buf = BufferUtils.createByteBuffer(bytes.length);
buf.put(bytes);
buf.flip();
return new Image(buf);
return buf;
}
public Image loadImage(String path) {
return new Image(loadBytes(path));
}
public IWindow openWindow(Vec2i size, String title) {