Argentum integrated with SDL2/SKIA (backed by OpenGL renderer) this allows to create portable GUI frameworks.
Code example:
using sys { Blob, log }
using guiPlatform { Canvas, Paint, Rect, Font, Image }
class MyApp {
+guiPlatform_App {
onStart() {
font.fromName("Arial Bold");
img.fromBlob(Blob.{ _.loadFile("sd.png") : log("Img sd.png not loaded") });
}
onPaint(c Canvas) {
phase += 1s;
c.clear(0xff_ffffffs);
p = Paint;
c.drawRect(Rect.setXYWH(50f, 50f, 100f, 100f), p.color(0xff_ff0000s));
forRangeFStep(0f, 700f, 4f)`i
c.drawLine(i, 0f, 0f, 700f - i, p.color(0xff_008800s | (short(i) + phase)));
c.drawSimpleText(48f, 16f, "Hello", font, 16f, p.color(0xff_004400s));
c.drawImage(108f, 100f, img);
}
onKey(pressed bool, key short, shifts short) {
pressed && key == keyEsc ? setMainObject(?MyApp)
}
}
phase = 0s;
font = Font;
img = Image;
}
MyApp.run("Hello AG", 120) // Start GUI app with windows title and given FPS
Result:
More details: https://aglang.org/gui-platform/
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.