Added cl-opengl example proof-of-concept.
[cl-glfw.git] / examples / test-cl-opengl.lisp
blob6dcc900411a1c500bac043f8bdd46348b84996c9
1 (require '#:asdf)
2 (asdf:oos 'asdf:load-op '#:cl-glfw)
3 (asdf:oos 'asdf:load-op '#:cl-opengl)
4 (asdf:oos 'asdf:load-op '#:cl-glu)
6 (glfw:do-window ("A Simple cl-opengl Example")
7 ((gl:matrix-mode :projection)
8 (gl:load-identity)
9 (unwind-protect (glu:perspective 45 4/3 0.1 50)
10 (gl:matrix-mode :modelview)))
11 (gl:clear :color-buffer-bit)
12 (gl:load-identity)
13 (gl:translate 0 0 -5)
14 (gl:rotate (* 10 (float (glfw:get-time) 0.0)) 1 1 0)
15 (gl:rotate (* 90 (float (glfw:get-time) 0.0)) 0 0 1)
16 (gl:begin :triangles)
17 (gl:color 1 0 0) (gl:vertex 1 0 0)
18 (gl:color 0 1 0) (gl:vertex -1 1 0)
19 (gl:color 0 0 1) (gl:vertex -1 -1 0)
20 (gl:end))