progress adding function to draw text

This commit is contained in:
2024-10-04 23:23:25 +01:00
parent ff8d911010
commit de70d31ee1
5 changed files with 138 additions and 20 deletions

View File

@@ -83,9 +83,28 @@ struct
()
fun draw (drawObject: t) =
let
val _ = drawText drawObject
in
()
let val _ = drawText drawObject
in ()
end
fun helpLoop (shellState as {window, ...}: t) =
case Glfw.windowShouldClose window of
false =>
let
val _ = Gles3.clearColor (0.1, 0.1, 0.1, 0.1)
val _ = Gles3.clear ()
val _ = draw shellState
val _ = Glfw.swapBuffers window
val _ = Glfw.waitEvents ()
in
helpLoop shellState
end
| true => Glfw.terminate ()
fun loop window =
let val shellState = create window
in helpLoop shellState
end
end

View File

@@ -2,20 +2,6 @@ structure Shell =
struct
open CML
fun loop window =
case Glfw.windowShouldClose window of
false =>
let
val _ = Gles3.clearColor (0.1, 0.1, 0.1, 0.1)
val _ = Gles3.clear ()
val _ = Glfw.swapBuffers window
val _ = Glfw.waitEvents ()
in
loop window
end
| true => Glfw.terminate ()
fun main () =
let
(* Set up GLFW. *)
@@ -26,8 +12,10 @@ struct
val window = Glfw.createWindow (1600, 900, "shf")
val _ = Glfw.makeContextCurrent window
val _ = Gles3.loadGlad ()
val _ = GlDraw.loop window
in
loop window
()
end
end