diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-11-27 17:44:08 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-11-27 17:44:08 +0000 |
| commit | 2b85bf81680e2243ef5a5daf85d9eb04321c7278 (patch) | |
| tree | dc7d3e1cdbd44ed10b358412098b73d24b64d143 /src/fl_vertex.cxx | |
| parent | 4dc5732a3e0f376786d1d6b788e5cf601439e890 (diff) | |
Preliminary commit of my MacOS X work.
**** THIS CODE COMPILES BUT DOES NOT WORK. ****
TODO: fix event handling - getting blank windows, etc.
TODO: re-port OpenGL code.
TODO: add support for images with alpha.
TODO: add support for more then just beeps in fl_beep().
TODO: other stuff I'm sure...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1765 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_vertex.cxx')
| -rw-r--r-- | src/fl_vertex.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/fl_vertex.cxx b/src/fl_vertex.cxx index c2f65aed1..27b9faf59 100644 --- a/src/fl_vertex.cxx +++ b/src/fl_vertex.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_vertex.cxx,v 1.5.2.3.2.1 2001/11/22 15:35:01 easysw Exp $" +// "$Id: fl_vertex.cxx,v 1.5.2.3.2.2 2001/11/27 17:44:08 easysw Exp $" // // Portable drawing routines for the Fast Light Tool Kit (FLTK). // @@ -123,6 +123,8 @@ void fl_vertex(double x,double y) { void fl_end_points() { #ifdef WIN32 for (int i=0; i<n; i++) SetPixel(fl_gc, p[i].x, p[i].y, fl_RGB()); +#elif defined(__APPLE__) + for (int i=0; i<n; i++) { MoveTo(p[i].x, p[i].y); Line(0, 0); } #else if (n>1) XDrawPoints(fl_display, fl_window, fl_gc, p, n, 0); #endif @@ -131,6 +133,10 @@ void fl_end_points() { void fl_end_line() { #ifdef WIN32 if (n>1) Polyline(fl_gc, p, n); +#elif defined(__APPLE__) + if (n<=1) return; + MoveTo(p[0].x, p[0].y); + for (int i=1; i<n; i++) LineTo(p[i].x, p[i].y); #else if (n>1) XDrawLines(fl_display, fl_window, fl_gc, p, n, 0); #endif @@ -153,6 +159,14 @@ void fl_end_polygon() { SelectObject(fl_gc, fl_brush()); Polygon(fl_gc, p, n); } +#elif defined(__APPLE__) + if (n<=1) return; + PolyHandle ph = OpenPoly(); + MoveTo(p[0].x, p[0].y); + for (int i=1; i<n; i++) LineTo(p[i].x, p[i].y); + ClosePoly(); + PaintPoly(ph); + KillPoly(ph); #else if (n>2) XFillPolygon(fl_display, fl_window, fl_gc, p, n, Convex, 0); #endif @@ -192,6 +206,14 @@ void fl_end_complex_polygon() { SelectObject(fl_gc, fl_brush()); PolyPolygon(fl_gc, p, counts, numcount); } +#elif defined(__APPLE__) + if (n<=1) return; + PolyHandle ph = OpenPoly(); + MoveTo(p[0].x, p[0].y); + for (int i=1; i<n; i++) LineTo(p[i].x, p[i].y); + ClosePoly(); + PaintPoly(ph); + KillPoly(ph); #else if (n>2) XFillPolygon(fl_display, fl_window, fl_gc, p, n, 0, 0); #endif @@ -216,6 +238,9 @@ void fl_circle(double x, double y,double r) { Pie(fl_gc, llx, lly, llx+w, lly+h, 0,0, 0,0); } else Arc(fl_gc, llx, lly, llx+w, lly+h, 0,0, 0,0); +#elif defined(__APPLE__) + Rect rt; rt.left=llx; rt.right=llx+w; rt.top=lly; rt.bottom=lly+h; + (what == POLYGON ? PaintOval : FrameOval)(&rt); #else (what == POLYGON ? XFillArc : XDrawArc) (fl_display, fl_window, fl_gc, llx, lly, w, h, 0, 360*64); @@ -223,5 +248,5 @@ void fl_circle(double x, double y,double r) { } // -// End of "$Id: fl_vertex.cxx,v 1.5.2.3.2.1 2001/11/22 15:35:01 easysw Exp $". +// End of "$Id: fl_vertex.cxx,v 1.5.2.3.2.2 2001/11/27 17:44:08 easysw Exp $". // |
