<div>Good Morning,</div><div><br></div><div><br></div>I am trying to write x/fillpolygon macro (see below) to call XFillPolygon as defined below:<br><div><br></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; "><pre>
XFillPolygon(<b>display</b>, <b>d</b>, <b>gc</b>, <b>points</b>, <b>npoints</b>, <b>shape</b>, <b>mode</b>)
<a href="http://tronche.com/gui/x/xlib/display/opening.html#Display">Display</a> *<b>display</b>;
Drawable <b>d</b>;
<a href="http://tronche.com/gui/x/xlib/GC/manipulating.html">GC</a> <b>gc</b>;
<a href="http://tronche.com/gui/x/xlib/graphics/drawing/#XPoint">XPoint</a> *<b>points</b>;
int <b>npoints</b>;
int <b>shape</b>;
int <b>mode</b>;
</pre><div><span class="Apple-style-span" style="white-space: pre;"><br></span></div></span></div><div><br></div><div><div>(defmacro x/fillpolygon (points &key (shape #$Complex) (mode #$CoordModeOrigin))</div><div>"points is a list of pairs, shape is one of Complex, Convex, or Nonconvex, and</div>
<div>mode is one of CoordModeOrigin or CoordModePrevious."</div><div> `(rlet ((xpoints (:array :<XP>oint ,(length points))))</div><div> (let ((i 0))</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (dolist (p ,points)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> (rlet ((xpoint :<XP>oint))</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (setf (pref xpoint :<XP>oint.x) (car p))</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> (setf (pref xpoint :<XP>oint.y) (cdr p))</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (setf (paref xpoints (:array :<XP>oint ,(length points)) i) xpoint)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> (incf i)))</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (#_XFillPolygon *display* </div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (window *context*)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> (graphics-context *context*)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> xpoints</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> ,(length points)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> ,shape</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> ,mode</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> ))))</div>
<div><br></div><div><br></div><div>I am not sure if I am correctly defining xpoints, what is the correct code to call #_XFillPolygon?</div><div><br></div><div>example of usage:</div><div><br></div><div>> (x/fillpolygon '((100 40) (140 50) (130 60)))</div>
<div><br></div><div><br></div><div>Kind regards</div><div>Taoufik</div><div><br></div><div><br></div><div><br></div></div>