X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fplat%2FOpenGL.cc;h=9e53586a7de795ef6eea88408bdb49f7d3b97f95;hb=297fdbde87e6db4732448a0950d1141c7265c169;hp=1f796494d0adeee26f3793bd8b4c6f4b8c6cac97;hpb=3591b88b94a6bb378af3d4abe6eb5233ce583104;p=org.ibex.core.git diff --git a/src/org/ibex/plat/OpenGL.cc b/src/org/ibex/plat/OpenGL.cc index 1f79649..9e53586 100644 --- a/src/org/ibex/plat/OpenGL.cc +++ b/src/org/ibex/plat/OpenGL.cc @@ -4,6 +4,8 @@ // IMPROVMENT: use alpha testing? might be faster #include +#include +#include #include #include #include @@ -99,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) {