2020-03-25 16:18:13 +03:00
|
|
|
(load "../core/GLFW.carp")
|
2018-02-27 18:48:31 +03:00
|
|
|
(use GLFW)
|
|
|
|
|
2018-03-06 16:18:25 +03:00
|
|
|
(load "OpenGL.carp")
|
2020-11-23 08:30:43 +03:00
|
|
|
(Project.config "cflag" "-DGL_SILENCE_DEPRECATION")
|
2018-02-27 19:13:46 +03:00
|
|
|
|
|
|
|
(defn t []
|
|
|
|
(Double.to-float (get-time)))
|
|
|
|
|
2018-02-27 18:48:31 +03:00
|
|
|
(defn-do main []
|
|
|
|
(let-do [_ (init)
|
2018-02-27 19:13:46 +03:00
|
|
|
window (create-window 400 300 (cstr "GLFW <3 CARP") NULL NULL)]
|
2018-02-27 18:48:31 +03:00
|
|
|
(make-context-current window)
|
|
|
|
(while (= 0 (window-should-close window))
|
|
|
|
(do
|
2018-03-06 16:18:25 +03:00
|
|
|
(GL.clearColor 1.0f 0.5f 0.2f 1.0f)
|
|
|
|
(GL.clear GL.COLOR_BUFFER_BIT)
|
|
|
|
(GL.color3f 0.0f 0.0f 0.0f)
|
|
|
|
(GL.lineWidth 2.5f)
|
|
|
|
(GL.begin GL.LINES)
|
|
|
|
(GL.vertex3f 0.0f 0.0f 0.0f)
|
|
|
|
(GL.vertex3f (Float.cos (t)) (Float.sin (t)) 0.0f)
|
|
|
|
(GL.end)
|
2018-02-27 18:48:31 +03:00
|
|
|
(swap-buffers window)
|
|
|
|
(poll-events))))
|
|
|
|
0)
|