[pal-cvs] CVS pal

tneste tneste at common-lisp.net
Wed Oct 24 18:07:03 UTC 2007


Update of /project/pal/cvsroot/pal
In directory clnet:/tmp/cvs-serv4391

Modified Files:
	ffi.lisp package.lisp pal.lisp 
Log Message:
Smoothp option now works with filled polygons.

--- /project/pal/cvsroot/pal/ffi.lisp	2007/10/11 19:26:23	1.21
+++ /project/pal/cvsroot/pal/ffi.lisp	2007/10/24 18:07:03	1.22
@@ -706,6 +706,7 @@
 (defconstant +gl-dst-alpha+ #x304)
 (defconstant +gl-one+ 1)
 (defconstant +gl-flat+ #x1d00)
+(defconstant +gl-polygon-smooth+ #xb41)
 (defconstant +gl-zero+ 0)
 (defconstant +gl-points+ 0)
 (defconstant +gl-ONE-MINUS-DST-ALPHA+ #x305)
--- /project/pal/cvsroot/pal/package.lisp	2007/10/24 17:51:47	1.19
+++ /project/pal/cvsroot/pal/package.lisp	2007/10/24 18:07:03	1.20
@@ -4,6 +4,7 @@
   (:use :common-lisp)
   (:export #:+NO-EVENT+
            #:+gl-line-smooth+
+           #:+gl-polygon-smooth+
            #:fade-out-music
            #:fade-in-music
            #:make-font
--- /project/pal/cvsroot/pal/pal.lisp	2007/10/24 17:51:47	1.35
+++ /project/pal/cvsroot/pal/pal.lisp	2007/10/24 18:07:03	1.36
@@ -633,6 +633,7 @@
                          (v+ pos (v 0 height)))
                    r g b a
                    :fill fill
+                   :smoothp smoothp
                    :absolutep absolutep))
     ((eq nil fill)
      (with-line-settings smoothp size r g b a
@@ -655,6 +656,8 @@
     ((image-p fill)
      (close-quads)
      (pal-ffi:gl-push-attrib (logior pal-ffi:+gl-current-bit+))
+     (when smoothp
+       (pal-ffi:gl-enable pal-ffi:+gl-polygon-smooth+))
      (set-image fill)
      (pal-ffi:gl-color4ub r g b a)
      (with-gl pal-ffi:+gl-polygon+
@@ -684,18 +687,22 @@
      (pal-ffi:gl-push-attrib (logior pal-ffi:+gl-current-bit+ pal-ffi:+gl-enable-bit+))
      (pal-ffi:gl-color4ub r g b a)
      (pal-ffi:gl-disable pal-ffi:+gl-texture-2d+)
+     (when smoothp
+       (pal-ffi:gl-enable pal-ffi:+gl-polygon-smooth+))
      (with-gl pal-ffi:+gl-polygon+
        (dolist (p points)
          (pal-ffi:gl-vertex2f (vx p) (vy p))))
      (pal-ffi:gl-pop-attrib))))
 
-(defunct draw-polygon* (points &key image tex-coords colors)
-    (list points list tex-coords list colors (or boolean image) image)
+(defunct draw-polygon* (points &key image tex-coords colors smoothp)
+    (list points list tex-coords list colors (or boolean image) image boolean smoothp)
   (close-quads)
   (pal-ffi:gl-push-attrib (logior pal-ffi:+gl-current-bit+ pal-ffi:+gl-enable-bit+))
   (cond
     ((and image tex-coords)
      (set-image image)
+     (when smoothp
+       (pal-ffi:gl-enable pal-ffi:+gl-polygon-smooth+))
      (cond
        (colors
         (pal-ffi:gl-shade-model pal-ffi:+gl-smooth+)
@@ -719,6 +726,8 @@
     (t
      (pal-ffi:gl-shade-model pal-ffi:+gl-smooth+)
      (pal-ffi:gl-disable pal-ffi:+gl-texture-2d+)
+     (when smoothp
+       (pal-ffi:gl-enable pal-ffi:+gl-polygon-smooth+))
      (with-gl pal-ffi:+gl-polygon+
        (loop
           for p in points




More information about the Pal-cvs mailing list