add rule to Makefile to run RGFW build more quickly
This commit is contained in:
3
Makefile
3
Makefile
@@ -4,5 +4,8 @@ run_debug:
|
|||||||
run:
|
run:
|
||||||
./build-unix.sh && ./shf
|
./build-unix.sh && ./shf
|
||||||
|
|
||||||
|
rgfw:
|
||||||
|
./build-unix-rgfw-debug-.sh && ./shf-rgfw
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
mlton -const "Exn.keepHistory true" shf-tests.mlb && ./shf-tests
|
mlton -const "Exn.keepHistory true" shf-tests.mlb && ./shf-tests
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ void closeWindow(RGFW_window* window) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool shouldCloseWindow(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) {
|
void swapBuffers(RGFW_window* window) {
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
structure RgfwLoop =
|
structure RgfwLoop =
|
||||||
struct
|
struct
|
||||||
fun loop (counter, window) =
|
fun loop window =
|
||||||
if Rgfw.shouldCloseWindow window then
|
if Rgfw.shouldCloseWindow window then
|
||||||
Rgfw.closeWindow window
|
Rgfw.closeWindow window
|
||||||
else
|
else
|
||||||
let val () = print ("counter = " ^ Int.toString counter ^ "\n")
|
let
|
||||||
in loop (counter + 1, window)
|
val () = Rgfw.swapBuffers window
|
||||||
|
in
|
||||||
|
loop window
|
||||||
end
|
end
|
||||||
|
|
||||||
fun main () =
|
fun main () =
|
||||||
let
|
let
|
||||||
val () = print "15\n"
|
|
||||||
val window = Rgfw.createWindow ("shf", 0, 0, 1920, 1080)
|
val window = Rgfw.createWindow ("shf", 0, 0, 1920, 1080)
|
||||||
val () = print "17\n"
|
|
||||||
in
|
in
|
||||||
loop (0, window)
|
loop window
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user