   wonky cursor border but not body, same data.
  Hi,I've been playing around with GUI systems and made this custom cursor. The shape is drawn first, followed by the a white border. Strangly, the shape is the correct shape, but the border is wonky. Here is an image of the cursor:As you can see, they both use the same data. Scaling the cursor makes no difference, as the superimposed sub images demonstrate.and here is the code to draw it:void GUI_cursor::draw(float fps, float X, float Y){float points[45] = {0,0,-0.736,0.733, -0.736,0.272, -1.094,0.615,  -1.212,0.463, -0.832,0.2431, -1.075,0};unsigned int index;const float scale = 80;glColor4f(0,0,0,1);index = 0;glPushMatrix();glTranslatef(xpos+X, ypos+Y,0);glBegin(GL_POLYGON);for(int p = 0; p < 7; p++){glVertex2f(points[index++]*scale,points[index++]*scale);}glEnd();index = 0;glColor4f(1,1,1,1);glBegin(GL_LINE_LOOP);for(int p = 0; p < 7; p++){glVertex2f(points[index++]*scale,points[index++]*scale);}glEnd();glPopMatrix();};I don't want to replace the cursor with an image since this GUI library is not supposed to be all-singing all-dancing, I'm just doing it for learning purposes. But I'd like to know the problem behind the strange border.   
  glBegin(GL_POLYGON)...glEnd() can only be used to draw convex polygons, whereas your cursor is concave. So, in fact, the border is the correct shape (according to your data points) and the body is being drawn incorrectly.I suggest splitting the body into a set of convex polygons.   ;Quote:Original post by bakery2k1glBegin(GL_POLYGON)...glEnd() can only be used to draw convex polygons, whereas your cursor is concave. So, in fact, the border is the correct shape (according to your data points) and the body is being drawn incorrectly.I suggest splitting the body into a set of convex polygons.Ok, so the data was wrong, and the body only appeared correct due to being drawn in the wrong mode. I've tweaked the corner with the problem and now the cursor looks as I intended. I think I'll leave in the convex polygon problem, since its not causing any visual problem.Thanks, bakery2kl.;Quote:Original post by speciesUnknownI think I'll leave in the convex polygon problem, since its not causing any visual problem.Not on your card, on your OS, with your currently installed driver. On any other combination, you can't rely on it looking at all like this.   