Skip to content

Instantly share code, notes, and snippets.

@kasperlanger
Created June 22, 2010 06:35
Show Gist options
  • Save kasperlanger/448088 to your computer and use it in GitHub Desktop.
Save kasperlanger/448088 to your computer and use it in GitHub Desktop.
(ns test
(:use [penumbra.opengl])
(:require [penumbra.app :as app]
[penumbra.text :as text]))
(defn reshape [[x y width height] state]
(frustum-view 60.0 (/ (double width) height) 1.0 100.0)
(load-identity)
state)
(defn display [[delta time] state]
(text/write-to-screen (str (int (/ 1 delta)) " fps") 0 0)
(translate 0 -0.5 -2)
(rotate (* 200 time) 0 0 1)
(draw-triangles
(color 1 0 0) (vertex 1 -0.5)
(color 0 1 0) (vertex -1 -0.5)
(color 0 0 1) (vertex 0 1))
(app/repaint!))
(defn init [state]
(app/fullscreen! false)
(app/vsync! true)
(app/title! "Hello world")
state)
(defn disp [[delta time] state] (display [delta time] state))
(app/start
{:display disp, :reshape reshape, :init init}
{})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment