home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / lib / CLX / demo / bezier.l next >
Encoding:
Text File  |  1990-05-01  |  1.3 KB  |  40 lines

  1. ;;; -*- Mode:Lisp; Package:XLIB; Syntax:COMMON-LISP; Base:10; Lowercase:T -*-
  2.  
  3. ;;; CLX interface for Bezier Spline Extension.
  4.  
  5. ;;;
  6. ;;;             TEXAS INSTRUMENTS INCORPORATED
  7. ;;;                  P.O. BOX 2909
  8. ;;;                   AUSTIN, TEXAS 78769
  9. ;;;
  10. ;;; Copyright (C) 1987 Texas Instruments Incorporated.
  11. ;;;
  12. ;;; Permission is granted to any individual or institution to use, copy, modify,
  13. ;;; and distribute this software, provided that this complete copyright and
  14. ;;; permission notice is maintained, intact, in all copies and supporting
  15. ;;; documentation.
  16. ;;;
  17. ;;; Texas Instruments Incorporated provides this software "as is" without
  18. ;;; express or implied warranty.
  19. ;;;
  20.  
  21. (in-package :xlib)
  22.  
  23. (export 'draw-curves)
  24.  
  25. (define-extension "bezier")
  26.  
  27. (defun draw-curves (drawable gcontext points)
  28.   ;; Draw Bezier splines on drawable using gcontext.
  29.   ;; Points are a list of (x0 y0 x1 y1 x2 y2 x3 y3)
  30.   (declare (type drawable drawable)
  31.        (type gcontext gcontext)
  32.        (type sequence points))
  33.   (let* ((display (drawable-display drawable))
  34.      (opcode (extension-opcode display "bezier")))
  35.     (with-buffer-request (display opcode :gc-force gcontext)
  36.       ((data card8) 1) ;; X_PolyBezier - The minor_opcode for PolyBezier
  37.       (drawable drawable)
  38.       (gcontext gcontext)
  39.       ((sequence :format int16) points))))
  40.