questionable patch: merge of a lot of stuff from the svg branch
[org.ibex.core.git] / src / org / ibex / plat / OpenGL.cc
index ada1498..9e53586 100644 (file)
@@ -1,12 +1,11 @@
-// Copyright 2000-2005 the Contributors, as shown in the revision logs.
-// Licensed under the GNU General Public License version 2 ("the License").
-// You may not use this file except in compliance with the License.
-
+// Copyright 2003 Adam Megacz, see the COPYING file for licensing [LGPL]
 // Author: Brian Alliet
 
 // IMPROVMENT: use alpha testing? might be faster
 
 #include <org/ibex/plat/OpenGL.h>
+#include <org/ibex/graphics/PixelBuffer.h>
+#include <org/ibex/graphics/Polygon.h>
 #include <org/ibex/plat/OpenGL$GLPixelBuffer.h>
 #include <org/ibex/plat/OpenGL$GLPicture.h>
 #include <org/ibex/plat/OpenGL$RectGLPicture.h>
@@ -102,6 +101,18 @@ void OpenGL$GLPixelBuffer::fillTrapezoid(jint x1, jint x2, jint y1, jint x3, jin
     } glEnd();
 }
 
+void OpenGL$GLPixelBuffer::natFill(org::ibex::graphics::Polygon* p, jint argb) {
+    activateContext();
+    setColor(argb);
+    for(jint contour=0; contour < p->numcontours; contour++) {
+        glBegin(GL_POLYGON); {
+        for(jint i = elements(p->contours)[contour]; i < elements(p->contours)[contour+1]; i++) {
+            glVertex3f(elements(p->x)[i], elements(p->y)[i], 0.0f );   
+        } glEnd();
+        }
+    }
+}
+
 void OpenGL$GLPixelBuffer::setClip(jint x1, jint y1, jint x2, jint y2) {
     //fprintf(stderr,"setClip: %d %d %d %d\n",x1,y1,x2,y2);
     if(x1==0 && y1==0 && x2==width && y2==height) {