restore imperative shell

This commit is contained in:
2024-08-08 05:56:20 +01:00
parent 1264e20dc8
commit a53c5e1ce3
6 changed files with 47 additions and 23 deletions

View File

@@ -15,12 +15,18 @@ struct
val _ = Glfw.makeContextCurrent window
val _ = Gles3.loadGlad ()
val initialModel = AppType.getInitial (Constants.windowWidth, Constants.windowHeight)
val initialModel =
AppInit.fromWindowWidthAndHeight
(Constants.windowWidth, Constants.windowHeight)
val graphLines = #graphLines initialModel
val graphLines =
let
open AppType
in
#graphLines initialModel
end
val graphDrawObject = AppDraw.initGraphLines ()
val _ =
AppDraw.uploadGraphLines (graphDrawObject, graphLines)
val _ = AppDraw.uploadGraphLines (graphDrawObject, graphLines)
val buttonDrawObject = AppDraw.initButton ()
val triangleDrawObject = AppDraw.initTriangles ()
@@ -30,8 +36,8 @@ struct
val _ = CML.spawn (fn () =>
InputCallbacks.registerCallbacks (window, inputMailbox))
val _ = CML.spawn
(fn () => EventLoop.update (inputMailbox, drawMailbox, initialModel))
val _ = CML.spawn (fn () =>
EventLoop.update (inputMailbox, drawMailbox, initialModel))
val _ = CML.spawn (fn () =>
EventLoop.draw
( drawMailbox