Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/OpenGL/Clojure/opengl.clj
Normal file
22
Task/OpenGL/Clojure/opengl.clj
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(use 'penumbra.opengl)
|
||||
(require '[penumbra.app :as app])
|
||||
|
||||
(defn init [state]
|
||||
(app/title! "Triangle")
|
||||
(clear-color 0.3 0.3 0.3 0)
|
||||
(shade-model :smooth)
|
||||
state)
|
||||
|
||||
(defn reshape [[x y w h] state]
|
||||
(ortho-view -30 30 -30 30 -30 30)
|
||||
(load-identity)
|
||||
(translate -15 -15)
|
||||
state)
|
||||
|
||||
(defn display [[dt time] state]
|
||||
(draw-triangles
|
||||
(color 1 0 0) (vertex 0 0)
|
||||
(color 0 1 0) (vertex 30 0)
|
||||
(color 0 0 1) (vertex 0 30)))
|
||||
|
||||
(app/start {:display display, :reshape reshape, :init init} {})
|
||||
Loading…
Add table
Add a link
Reference in a new issue