Permalink
Browse files

finished nehe tut... just displays a opengl window

  • Loading branch information...
1 parent b7f2ae8 commit 10e37e360757e694370400831b3cc71dee107765 @dballard committed Jun 28, 2011
Showing with 15 additions and 3 deletions.
  1. +15 −3 1.lisp → nehe-intro.lisp
View
@@ -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">
+;;; create an instance of our window
+(glut:display-window (make-instance 'my-window))

0 comments on commit 10e37e3

Please sign in to comment.