From 10e37e360757e694370400831b3cc71dee107765 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Tue, 28 Jun 2011 07:48:42 -0700 Subject: [PATCH] finished nehe tut... just displays a opengl window --- 1.lisp => nehe-intro.lisp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) rename 1.lisp => nehe-intro.lisp (63%) diff --git a/1.lisp b/nehe-intro.lisp similarity index 63% rename from 1.lisp rename to nehe-intro.lisp index 23256a6..7d1b2e9 100644 --- a/1.lisp +++ b/nehe-intro.lisp @@ -22,7 +22,7 @@ (gl:clear-color 0 0 0 0) ; background will be black (gl:clear-depth 1) ; clear buffer to minimum depth (gl:enable :depth-test) ; enable depth testing - (gl:depth-function :lequal) ; okay to write pixel if its depth + (gl:depth-func :lequal) ; okay to write pixel if its depth ; is less-than-or-equal to the ; depth xcurrently written (gl:hint :perpective-correction-hint :nicest) ; really nice perspective correction @@ -34,9 +34,21 @@ (gl:clear :color-buffer-bit :depth-buffer-bit) (gl:load-identity)) -(defmethod glut:reshape ((win my-window) wight height) +(defmethod glut:reshape ((win my-window) width height) ;;; prepare viewport (gl:viewport 0 0 width height) ; reset current viewport + ;;; glut reshape -- prepare project + (gl:matrix-mode :projection) ; select the projection matrix + (gl:load-identity) ; reset the matrix + ;; set perspective based on window aspect ratio + (glu:perspective 45 (/ width (max height 1)) 1/10 100) + + ;;; glut reshape -- switch to model view + (gl:matrix-mode :modelview) ;select the model view matrix + (gl:load-identity) ; reset the matrix +) -#<:use "create an instance of our window"> \ No newline at end of file + +;;; create an instance of our window +(glut:display-window (make-instance 'my-window)) \ No newline at end of file