tested multiple windows
This commit is contained in:
parent
4848e5f56a
commit
94245e7689
|
@ -7,12 +7,14 @@ public class Test {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
var engine = new Engine();
|
var engine = new Engine();
|
||||||
var window = engine.openWindow(1280, 720, "Skunkworks");
|
var window = engine.openWindow(1280, 720, "Skunkworks");
|
||||||
|
var window2 = engine.openWindow(1280, 720, "Skunkworks");
|
||||||
var img = engine.loadImage("C:\\Users\\dani\\Videos\\Screenshot 2022-06-25 17-00-59.png");
|
var img = engine.loadImage("C:\\Users\\dani\\Videos\\Screenshot 2022-06-25 17-00-59.png");
|
||||||
//var img = engine.loadImage("C:\\art\\kyoko.png");
|
//var img = engine.loadImage("C:\\art\\kyoko.png");
|
||||||
System.out.println(img.getPixel(new Vec2i(60, 60)));
|
System.out.println(img.getPixel(new Vec2i(60, 60)));
|
||||||
|
|
||||||
while(!window.shouldClose()) {
|
while(!window.shouldClose()) {
|
||||||
window.tick();
|
window.tick();
|
||||||
|
window2.tick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,18 @@ import java.nio.ByteBuffer;
|
||||||
import static com.danitheskunk.skunkworks.GraphicsBackend.*;
|
import static com.danitheskunk.skunkworks.GraphicsBackend.*;
|
||||||
|
|
||||||
public class Engine {
|
public class Engine {
|
||||||
|
GraphicsBackend graphicsBackend;
|
||||||
|
|
||||||
|
//Constructors
|
||||||
|
public Engine() {
|
||||||
|
this(OPENGL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Engine(GraphicsBackend graphicsBackend) {
|
||||||
|
this.graphicsBackend = graphicsBackend;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Methods
|
||||||
public Image loadImage(String path) {
|
public Image loadImage(String path) {
|
||||||
ByteBuffer buf;
|
ByteBuffer buf;
|
||||||
byte[] bytes;
|
byte[] bytes;
|
||||||
|
@ -27,10 +39,6 @@ public class Engine {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IWindow openWindow(int width, int height, String title) {
|
public IWindow openWindow(int width, int height, String title) {
|
||||||
return openWindow(width, height, title, OPENGL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IWindow openWindow(int width, int height, String title, GraphicsBackend graphicsBackend) {
|
|
||||||
return switch(graphicsBackend) {
|
return switch(graphicsBackend) {
|
||||||
case OPENGL -> new GLWindow(width, height, title);
|
case OPENGL -> new GLWindow(width, height, title);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue