Skip to content

Commit

Permalink
Change :color-buffer-bit to :color-buffer, etc, in the examples
Browse files Browse the repository at this point in the history
darcs-hash:20070306043408-28748-4243e098230d7857d926534fc46a5327dca60064.gz
  • Loading branch information
luismbo committed Mar 6, 2007
1 parent d20d8c0 commit 6ea7fac
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 44 deletions.
8 changes: 4 additions & 4 deletions examples/mesademos/gears-raw.lisp
Expand Up @@ -25,7 +25,7 @@
(gl:shade-model :flat)
(gl:normal 0 0 1)
;; Draw front face.
(gl:with-primitives :quad-strip
(gl:with-primitives :quad-strip
(dotimes (i (1+ n-teeth))
(let ((angle (/ (* i 2.0 +pif+) n-teeth)))
(gl:vertex (* r0 (cos angle)) (* r0 (sin angle)) (* width 0.5))
Expand Down Expand Up @@ -57,7 +57,7 @@
(gl:vertex (* r1 (cos (+ angle (* 3 da))))
(* r1 (sin (+ angle (* 3 da))))
(* width -0.5))
(gl:vertex (* r0 (cos angle)) (* r0 (sin angle)) (* width -0.5)))))
(gl:vertex (* r0 (cos angle)) (* r0 (sin angle)) (* width -0.5)))))
;; Draw back sides of teeth.
(gl:with-primitives :quads
(dotimes (i n-teeth)
Expand Down Expand Up @@ -131,7 +131,7 @@
(defvar *t0* 0)

(cffi:defcallback draw :void ()
(gl:clear :color-buffer-bit :depth-buffer-bit)
(gl:clear :color-buffer :depth-buffer)
(gl:push-matrix)
(gl:rotate *view-rotx* 1 0 0)
(gl:rotate *view-roty* 0 1 0)
Expand Down Expand Up @@ -192,7 +192,7 @@
(:key-right (decf *view-roty* 5.0)))
(glut:post-redisplay))

(cffi:defcallback reshape :void ((width :int) (height :int))
(cffi:defcallback reshape :void ((width :int) (height :int))
(gl:viewport 0 0 width height)
(gl:matrix-mode :projection)
(gl:load-identity)
Expand Down
2 changes: 1 addition & 1 deletion examples/mesademos/gears.lisp
Expand Up @@ -163,7 +163,7 @@
(defmethod glut:display ((window gears-window))
(with-slots (view-rotx view-roty view-rotz angle gear1 gear2 gear3)
window
(gl:clear :color-buffer-bit :depth-buffer-bit)
(gl:clear :color-buffer :depth-buffer)
(gl:with-pushed-matrix
(gl:rotate view-rotx 1 0 0)
(gl:rotate view-roty 0 1 0)
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/glut-teapot.lisp
Expand Up @@ -24,7 +24,7 @@
(gl:rotate 30 1 1 0)
(gl:light :light0 :position '(0 1 1 0))
(gl:light :light0 :diffuse '(0.2 0.4 0.6 0))
(gl:clear :color-buffer-bit :depth-buffer-bit)
(gl:clear :color-buffer :depth-buffer)
(gl:color 1 1 1)
(gl:front-face :cw)
(glut:solid-teapot 1.3)
Expand Down
8 changes: 4 additions & 4 deletions examples/misc/render-to-texture.lisp
Expand Up @@ -108,7 +108,7 @@

(defun draw-teapot ()
(gl:clear-color 0 0.3 0.5 1.0)
(gl:clear :color-buffer-bit :depth-buffer-bit)
(gl:clear :color-buffer :depth-buffer)

(gl:disable :blend :texture-2d)
(gl:enable :lighting :light0 :depth-test)
Expand All @@ -123,7 +123,7 @@
(gl:rotate *teapot-rotation-x* 1 0 0)
(gl:rotate *teapot-rotation-y* 0 1 0)
(gl:rotate *teapot-rotation-z* 0 0 1)

(gl:color 1 1 1)
(glut:solid-teapot 1.3)

Expand All @@ -136,7 +136,7 @@

(defun draw-spinning-quad (texture)
(gl:clear-color 0 0 0 0)
(gl:clear :color-buffer-bit :depth-buffer-bit)
(gl:clear :color-buffer :depth-buffer)

(gl:disable :lighting)
(gl:enable :blend :texture-2d :depth-test)
Expand Down Expand Up @@ -175,5 +175,5 @@
(gl:color 1 1 1 0)
(gl:vertex 1 -1)
(gl:tex-coord 0 0.5)
(gl:vertex -1 -1))
(gl:vertex -1 -1))
(incf *quad-rotation* 0.1))
2 changes: 1 addition & 1 deletion examples/redbook/clip.lisp
Expand Up @@ -19,7 +19,7 @@
(gl:shade-model :flat))

(defmethod glut:display ((w clip-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:color 1 1 1)
(gl:with-pushed-matrix
(gl:translate 0 0 -5)
Expand Down
2 changes: 1 addition & 1 deletion examples/redbook/cube.lisp
Expand Up @@ -21,7 +21,7 @@
(gl:shade-model :flat))

(defmethod glut:display ((w cube-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:color 1 1 1)
(gl:load-identity) ; clear the matrix
;; viewing transformation
Expand Down
2 changes: 1 addition & 1 deletion examples/redbook/double.lisp
Expand Up @@ -21,7 +21,7 @@
(gl:shade-model :flat))

(defmethod glut:display ((w double-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:with-pushed-matrix
(gl:rotate (slot-value w 'spin) 0 0 1)
(gl:color 1 1 1)
Expand Down
2 changes: 1 addition & 1 deletion examples/redbook/hello.lisp
Expand Up @@ -28,7 +28,7 @@
(gl:ortho 0 1 0 1 -1 1))

(defmethod glut:display ((w hello-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
;; Draw white polygon (rectangle) with corners at
;; (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0).
(gl:color 1 1 1)
Expand Down
2 changes: 1 addition & 1 deletion examples/redbook/lines.lisp
Expand Up @@ -26,7 +26,7 @@
(gl:shade-model :flat))

(defmethod glut:display ((w lines-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
;; Select white for all lines.
(gl:color 1 1 1)
;; In 1st row, 3 lines, each with a different stipple.
Expand Down
8 changes: 3 additions & 5 deletions examples/redbook/list.lisp
Expand Up @@ -5,15 +5,13 @@
;;; Copyright (c) 1993-1997, Silicon Graphics, Inc.
;;; ALL RIGHTS RESERVED

;;; This program demonstrates how to make and execute a
;;; display list. Note that attributes, such as current
;;; This program demonstrates how to make and execute a
;;; display list. Note that attributes, such as current
;;; color and matrix, are changed.

(in-package #:cl-glut-examples)

(defclass list-window (glut:window)
;; TODO: use some more interesting interface for (de)allocating
;; display lists...
((list-name :accessor list-name :initform (gl:gen-lists 1)))
(:default-initargs
:width 600 :height 50 :title "list.lisp" :mode '(:single :rgb)))
Expand All @@ -29,7 +27,7 @@
(gl:shade-model :flat))

(defmethod glut:display ((w list-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:color 0 1 0) ; current color green
(loop repeat 10 do (gl:call-list (list-name w)))
(gl:with-primitives :lines ; is this line green? NO!
Expand Down
2 changes: 1 addition & 1 deletion examples/redbook/model.lisp
Expand Up @@ -24,7 +24,7 @@
(gl:vertex 0 25)
(gl:vertex 25 -25)
(gl:vertex -25 -25))))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:color 1 1 1)
;; triangle with solid-lines
(gl:load-identity)
Expand Down
2 changes: 1 addition & 1 deletion examples/redbook/movelight.lisp
Expand Up @@ -37,7 +37,7 @@
;;; light at a new position in world coordinates. The cube
;;; represents the position of the light.
(defmethod glut:display ((w movelight-window))
(gl:clear :color-buffer-bit :depth-buffer-bit)
(gl:clear :color-buffer :depth-buffer)
(gl:with-pushed-matrix
(glu:look-at 0 0 5 0 0 0 0 1 0)
(gl:with-pushed-matrix
Expand Down
2 changes: 1 addition & 1 deletion examples/redbook/planet.lisp
Expand Up @@ -24,7 +24,7 @@
(gl:shade-model :flat))

(defmethod glut:display ((w planet-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:color 1 1 1)
(gl:with-pushed-matrix
;; draw sun
Expand Down
22 changes: 11 additions & 11 deletions examples/redbook/polys.lisp
Expand Up @@ -37,25 +37,25 @@
#x10 #x18 #x18 #x08 #x10 #x00 #x00 #x08))

(defparameter *halftone*
#(#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#(#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55
#xAA #xAA #xAA #xAA #x55 #x55 #x55 #x55))

(defmethod glut:display ((w polys-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:color 1 1 1)
;; Draw one solid, unstippled rectangles then two
;; stippled rectangles.
Expand Down
2 changes: 1 addition & 1 deletion examples/redbook/robot.lisp
Expand Up @@ -24,7 +24,7 @@
(gl:shade-model :flat))

(defmethod glut:display ((w robot-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:with-pushed-matrix
;; first cube
(gl:translate -1 0 0)
Expand Down
2 changes: 1 addition & 1 deletion examples/redbook/smooth.lisp
Expand Up @@ -20,7 +20,7 @@
(gl:shade-model :smooth))

(defmethod glut:display ((w smooth-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:with-primitives :triangles
(gl:color 1 0 0)
(gl:vertex 5 5)
Expand Down
6 changes: 3 additions & 3 deletions examples/redbook/stroke.lisp
Expand Up @@ -5,9 +5,9 @@
;;; Copyright (c) 1993-1997, Silicon Graphics, Inc.
;;; ALL RIGHTS RESERVED

;;; This program demonstrates some characters of a
;;; This program demonstrates some characters of a
;;; stroke (vector) font. The characters are represented
;;; by display lists, which are given numbers which
;;; by display lists, which are given numbers which
;;; correspond to the ASCII values of the characters.
;;; Use of GL:CALL-LISTS is demonstrated.

Expand Down Expand Up @@ -57,7 +57,7 @@
(defmethod glut:display ((w stroke-window))
(flet ((print-stroked-string (string)
(gl:call-lists (map 'vector #'char-code string))))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(gl:color 1 1 1)
(gl:with-pushed-matrix
(gl:scale 2 2 2)
Expand Down
6 changes: 1 addition & 5 deletions examples/redbook/varray.lisp
Expand Up @@ -28,13 +28,10 @@
0.75 0.75 0.75
0.35 0.35 0.35
0.5 0.5 0.5)))

(gl:enable-client-state :vertex-array)
(gl:enable-client-state :color-array)

(gl:vertex-pointer 2 :int 0 vertices)
(gl:color-pointer 3 :float 0 colors)))


(defun setup-interleave ()
(let ((intertwined '(1.0 0.2 1.0 100.0 100.0 0.0
Expand All @@ -43,7 +40,6 @@
0.2 1.0 0.2 200.0 300.0 0.0
0.2 1.0 1.0 300.0 200.0 0.0
0.2 0.2 1.0 200.0 100.0 0.0)))

(gl:interleaved-arrays :c3f-v3f 0 intertwined)))

(defmethod glut:display-window :before ((w varray-window))
Expand All @@ -52,7 +48,7 @@
(setup-pointers))

(defmethod glut:display ((w varray-window))
(gl:clear :color-buffer-bit)
(gl:clear :color-buffer)
(ecase (deref-method w)
(draw-array
(gl:draw-arrays :triangles 0 6))
Expand Down

0 comments on commit 6ea7fac

Please sign in to comment.