Created
June 22, 2010 06:35
-
-
Save kasperlanger/448088 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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