summaryrefslogtreecommitdiff
path: root/main.c3
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-04-25 00:49:46 +0200
committerandromeda <andromeda@lenovo>2026-04-25 00:49:46 +0200
commit168abecfafadb57a0c677777a40083761bf8a922 (patch)
tree2437a104b6c7ba15702fcee10851cfe16b0505cb /main.c3
parent643cf49f77e64f00589bc16147be0afc95fc08cf (diff)
add rsgl, modularize
Diffstat (limited to 'main.c3')
-rw-r--r--main.c354
1 files changed, 13 insertions, 41 deletions
diff --git a/main.c3 b/main.c3
index f9763ef..11e2c5f 100644
--- a/main.c3
+++ b/main.c3
@@ -1,53 +1,25 @@
module c3term;
-import std::io;
-
-alias RGFW_window = void;
-
-constdef RGFW_windowFlags : uint
-{
- RGFW_WINDOW_NO_BORDER = 1 << 0,
- RGFW_WINDOW_NO_RESIZE = 1 << 1,
- RGFW_WINDOW_ALLOW_DND = 1 << 2,
- RGFW_WINDOW_HIDE_MOUSE = 1 << 3,
- RGFW_WINDOW_FULLSCREEN = 1 << 4,
- RGFW_WINDOW_TRANSLUCENT = 1 << 5,
- RGFW_WINDOW_TRANSPARENT = RGFW_WINDOW_TRANSLUCENT,
- RGFW_WINDOW_CENTER = 1 << 6,
- RGFW_WINDOW_RAW_MOUSE = 1 << 7,
- RGFW_WINDOW_SCALE_TO_MONITOR = 1 << 8,
- RGFW_WINDOW_HIDE = 1 << 9,
- RGFW_WINDOW_MAXIMIZE = 1 << 10,
- RGFW_WINDOW_CENTER_CURSOR = 1 << 11,
- RGFW_WINDOW_FLOATING = 1 << 12,
- RGFW_WINDOW_FOCUS_ON_SHOW = 1 << 13,
- RGFW_WINDOW_MINIMIZE = 1 << 14,
- RGFW_WINDOW_FOCUS = 1 << 15,
- RGFW_WINDOW_CAPTURE_MOUSE = 1 << 16,
- RGFW_WINDOW_OPENGL = 1 << 17,
- RGFW_WINDOW_EGL = 1 << 18,
- RGFW_NO_DEINIT_ON_CLOSE = 1 << 19,
- RGFW_WINDOWED_FULLSCREEN = RGFW_WINDOW_NO_BORDER | RGFW_WINDOW_MAXIMIZE,
- RGFW_WINDOW_CAPTURE_RAW_MOUSE = RGFW_WINDOW_CAPTURE_MOUSE | RGFW_WINDOW_RAW_MOUSE,
-}
-
-extern fn RGFW_window* rgfw_createWindow(ZString, int, int, int, int, RGFW_windowFlags) @cname("RGFW_createWindow");
-extern fn bool rgfw_window_shouldClose(RGFW_window*) @cname("RGFW_window_shouldClose");
-extern fn bool rgfw_window_close(RGFW_window*) @cname("RGFW_window_close");
-extern fn void rgfw_pollEvents() @cname("RGFW_pollEvents");
+import rgfw;
+import rsgl;
fn int main(String[] args)
{
- io::printn("init");
+ GlHints* hints = rgfw::getGlobalHints_OpenGL();
+ hints.major = 3;
+ hints.minor = 3;
+ hints.profile = GlProfile.GL_COMPATIBILITY;
+ rgfw::setGlobalHints_OpenGL(hints);
+
+ Window* window = rgfw::createWindow("window title", 0, 0, 800, 400, WindowFlags.WINDOW_CENTER | WindowFlags.WINDOW_NO_RESIZE | WindowFlags.WINDOW_OPENGL);
- RGFW_window* window = rgfw_createWindow("window title", 0, 0, 800, 400, RGFW_WINDOW_CENTER | RGFW_WINDOW_NO_RESIZE);
+ Renderer* renderer = rsgl::renderer_init(rsgl::gl_rendererProc(), &rgfw::getProcAddress_OpenGL);
- while (!rgfw_window_shouldClose(window))
+ while (!rgfw::window_shouldClose(window))
{
- rgfw_pollEvents();
+ rgfw::pollEvents();
}
- rgfw_window_close(window);
+ rgfw::window_close(window);
- io::printn("tschuess");
return(0);
}