implemented Engine.loadBytes
This commit is contained in:
parent
07ced1f430
commit
fd42674cee
|
@ -21,7 +21,7 @@ public class Engine {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Methods
|
//Methods
|
||||||
public Image loadImage(String path) {
|
public ByteBuffer loadBytes(String path) {
|
||||||
ByteBuffer buf;
|
ByteBuffer buf;
|
||||||
byte[] bytes;
|
byte[] bytes;
|
||||||
try(FileInputStream fis = new FileInputStream(path)) {
|
try(FileInputStream fis = new FileInputStream(path)) {
|
||||||
|
@ -32,7 +32,10 @@ public class Engine {
|
||||||
buf = BufferUtils.createByteBuffer(bytes.length);
|
buf = BufferUtils.createByteBuffer(bytes.length);
|
||||||
buf.put(bytes);
|
buf.put(bytes);
|
||||||
buf.flip();
|
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) {
|
public IWindow openWindow(Vec2i size, String title) {
|
||||||
|
|
Loading…
Reference in New Issue