diff --git a/Makefile b/Makefile index 540869f..a062620 100644 --- a/Makefile +++ b/Makefile @@ -4,5 +4,8 @@ run_debug: run: ./build-unix.sh && ./shf +rgfw: + ./build-unix-rgfw-debug-.sh && ./shf-rgfw + tests: mlton -const "Exn.keepHistory true" shf-tests.mlb && ./shf-tests diff --git a/ffi/rgfw-export.c b/ffi/rgfw-export.c index 75aab91..69c728d 100644 --- a/ffi/rgfw-export.c +++ b/ffi/rgfw-export.c @@ -17,7 +17,11 @@ void closeWindow(RGFW_window* window) { } bool shouldCloseWindow(RGFW_window* window) { - return RGFW_window_shouldClose(window) != 0; + if (RGFW_window_shouldClose(window)) { + return true; + } else { + return false; + } } void swapBuffers(RGFW_window* window) { diff --git a/shell/rgfw-loop.sml b/shell/rgfw-loop.sml index 434ba1d..7686308 100644 --- a/shell/rgfw-loop.sml +++ b/shell/rgfw-loop.sml @@ -1,20 +1,20 @@ structure RgfwLoop = struct - fun loop (counter, window) = + fun loop window = if Rgfw.shouldCloseWindow window then Rgfw.closeWindow window else - let val () = print ("counter = " ^ Int.toString counter ^ "\n") - in loop (counter + 1, window) + let + val () = Rgfw.swapBuffers window + in + loop window end fun main () = let - val () = print "15\n" val window = Rgfw.createWindow ("shf", 0, 0, 1920, 1080) - val () = print "17\n" in - loop (0, window) + loop window end end diff --git a/shf-rgfw b/shf-rgfw index 2edbdc8..7565d3a 100755 Binary files a/shf-rgfw and b/shf-rgfw differ