refactor to allow graph lines to be shown at start up
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user