refactor to allow graph lines to be shown at start up

This commit is contained in:
2024-08-03 06:05:26 +01:00
parent ee2274ffbc
commit 0d1ea9444b
6 changed files with 27 additions and 14 deletions

View File

@@ -15,7 +15,13 @@ struct
val _ = Glfw.makeContextCurrent window
val _ = Gles3.loadGlad ()
val initialModel = AppType.getInitial (Constants.windowWidth, Constants.windowHeight)
val graphLines = #graphLines initialModel
val graphDrawObject = AppDraw.initGraphLines ()
val _ =
AppDraw.uploadGraphLines (graphDrawObject, graphLines)
val buttonDrawObject = AppDraw.initButton ()
val triangleDrawObject = AppDraw.initTriangles ()
@@ -24,13 +30,14 @@ struct
val _ = CML.spawn (fn () =>
InputCallbacks.registerCallbacks (window, inputMailbox))
val _ = CML.spawn (fn () => EventLoop.update (inputMailbox, drawMailbox))
val _ = CML.spawn
(fn () => EventLoop.update (inputMailbox, drawMailbox, initialModel))
val _ = CML.spawn (fn () =>
EventLoop.draw
( drawMailbox
, window
, graphDrawObject
, Vector.length Constants.graphLines div 2
, Vector.length graphLines div 2
, buttonDrawObject
, 0
, triangleDrawObject