Carp/examples/glfw.carp
Erik Svedäng a873099640
chore: Move some examples to test/produces-output (#989)
* chore: Moved examples that work more as tests to folder 'test/produces-output'

* fix: Corrections to the release script

* fix: Correct filename on Windows

* fix: Move more files around

* fix: Remove check-malloc example

* fix: Apparently unicode example does not work

* chore: Move nested_lambdas.carp back to examples

* chore: Remove .DS_Store files

* fix: Bring back unicode test

* test: Make sure benchmark compile (had to remove mandelbrot and n-bodies)

* fix: Replacement implementation of clock_gettime on Windows

* chore: Trigger CI

* fix: Define CLOCK_REALTIME

Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
2020-11-23 06:30:43 +01:00

27 lines
707 B
Plaintext

(load "../core/GLFW.carp")
(use GLFW)
(load "OpenGL.carp")
(Project.config "cflag" "-DGL_SILENCE_DEPRECATION")
(defn t []
(Double.to-float (get-time)))
(defn-do main []
(let-do [_ (init)
window (create-window 400 300 (cstr "GLFW <3 CARP") NULL NULL)]
(make-context-current window)
(while (= 0 (window-should-close window))
(do
(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)
(swap-buffers window)
(poll-events))))
0)