get drawing of triangles implemented

This commit is contained in:
2024-07-31 22:25:15 +01:00
parent cf38d160d5
commit 16fa1e49af
7 changed files with 121 additions and 16 deletions

View File

@@ -9,13 +9,15 @@ struct
val _ = Glfw.windowHint (Glfw.CONTEXT_VERSION_MAJOR (), 3)
val _ = Glfw.windowHint (Glfw.DEPRECATED (), Glfw.FALSE ())
val _ = Glfw.windowHint (Glfw.SAMPLES (), 4)
val window =
Glfw.createWindow (Constants.windowWidth, Constants.windowHeight, "MLton - dot to dot")
val window =
Glfw.createWindow
(Constants.windowWidth, Constants.windowHeight, "MLton - dot to dot")
val _ = Glfw.makeContextCurrent window
val _ = Gles3.loadGlad ()
val graphDrawObject = AppDraw.initGraphLines ()
val buttonDrawObject = AppDraw.initButton ()
val triangleDrawObject = AppDraw.initTriangles ()
val inputMailbox = Mailbox.mailbox ()
val drawMailbox = Mailbox.mailbox ()
@@ -25,7 +27,14 @@ struct
val _ = CML.spawn (fn () => EventLoop.update (inputMailbox, drawMailbox))
val _ = CML.spawn (fn () =>
EventLoop.draw
(drawMailbox, window, graphDrawObject, buttonDrawObject, 0))
( drawMailbox
, window
, graphDrawObject
, buttonDrawObject
, 0
, triangleDrawObject
, 0
))
in
()
end