implemented Engine.loadBytes
This commit is contained in:
parent
07ced1f430
commit
fd42674cee
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue