X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fplat%2FOpenGL.cc;h=9e53586a7de795ef6eea88408bdb49f7d3b97f95;hb=3419f19eae26a68874ff4c9eb56e93c7d84b93a1;hp=ada14987388d1dfa27c35efd9f6a8ad8742e5132;hpb=76b21655a0710caf4f972c107a3ab991032d7e10;p=org.ibex.core.git diff --git a/src/org/ibex/plat/OpenGL.cc b/src/org/ibex/plat/OpenGL.cc index ada1498..9e53586 100644 --- a/src/org/ibex/plat/OpenGL.cc +++ b/src/org/ibex/plat/OpenGL.cc @@ -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 +#include +#include #include #include #include @@ -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) {