skunkworks/Test.java

67 lines
2.1 KiB
Java
Raw Normal View History

2022-09-14 19:08:16 +02:00
import com.danitheskunk.skunkworks.*;
2022-09-27 04:41:21 +02:00
import com.danitheskunk.skunkworks.windows.*;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinDef;
import com.sun.jna.platform.win32.WinUser;
import java.util.ArrayList;
2022-09-14 00:59:35 +02:00
public class Test {
2022-09-14 01:09:28 +02:00
public static void main(String[] args) {
2022-10-05 02:36:19 +02:00
/*
2022-09-27 04:41:21 +02:00
var windows = Window.getAllVisible();
System.out.printf("%d Open Windows:\n", windows.size());
for(var window: windows) {
System.out.printf("%s -- %s -- %s\n", window.getTitle(), window.getClassName(), window.getExecutableName());
}
windows.get(0).setBorder(true);
windows.get(0).setBorderRounded(false);
2022-09-28 02:17:33 +02:00
windows.get(0).move(new Recti(1280, 720, 2560, 1440));
windows.get(0).debugPrintStyles();
windows.get(0).debugPrintStylesEx();
2022-09-28 02:17:33 +02:00
Window.onKey();
Window.onNewWindow();
Window.messageLoop();
2022-10-05 02:36:19 +02:00
*/
2022-09-14 05:47:24 +02:00
var engine = new Engine();
var window = engine.openWindow(new Vec2i(1280, 720), "Skunkworks");
2022-10-05 02:36:19 +02:00
//var img = engine.loadImage("C:\\Users\\dani\\Videos\\Screenshot 2022-06-25 17-00-59.png");
//var tex2 = window.loadTexture("C:\\art\\pixel stuff.png");
//var tileset = window.loadTextureArray("C:\\stream\\coding\\rlc\\tilemap.png", new Vec2i(16, 16));
//var font = window.loadFontTileset("EGA8x14.png");
//var font2 = window.loadFontTTF("fonts\\LiberationSans-Regular.ttf", 16*8.f);
//var tex = window.loadTexture(img);
var slice = window.loadNineSlice("demoassets\\9slice-1.png");
//window.setDebug(true);
2022-09-14 05:47:24 +02:00
while(!window.shouldClose()) {
window.tick();
2022-09-14 19:08:16 +02:00
var renderContext = window.renderStart();
2022-10-05 02:36:19 +02:00
/*renderContext.drawTextureRectangle(
2022-09-16 03:18:12 +02:00
new Recti(0, 0, 1280, 720),
tex
2022-09-14 19:08:16 +02:00
);
2022-09-16 03:18:12 +02:00
renderContext.drawTextureRectangle(
new Recti(new Vec2i(200, 100), tex2.getSize()),
tex2
);
renderContext.drawTextureRectangle(
new Recti(new Vec2i(400, 400), new Vec2i(16, 16)),
tileset.get(0x30)
);
renderContext.drawString(new Vec2i(100, 100), "hello world mew", font);
2022-09-21 03:10:12 +02:00
renderContext.drawString(new Vec2i(710, 140), "hello world mew", font2);
2022-10-05 02:36:19 +02:00
*/
renderContext.drawNineSlice(slice, new Recti(100, 100, 1080, 520));
2022-09-14 19:08:16 +02:00
window.renderFinish(renderContext);
2022-09-14 05:47:24 +02:00
}
2022-10-05 02:36:19 +02:00
2022-09-14 01:09:28 +02:00
}
2022-09-14 00:59:35 +02:00
}