Hello There,

I am trying to create a level editor for my game using a QGLWidget but I have run into a slight problem. When I use the standard paintGL() function like this:
Qt Code:
  1. void GLWidget::paintGL()
  2. {
  3. glClear(GL_COLOR_BUFFER_BIT);
  4. glBegin(GL_TRIANGLES);
  5. glVertex2f(0,0);
  6. glVertex2f(0,50);
  7. glVertex2f(50,0);
  8. glEnd();
  9. }
To copy to clipboard, switch view to plain text mode 

everything works fine. However, if I try and use my own function to draw a triangle:

Qt Code:
  1. void GLWidget::DrawAlphaTile(int x, int y)
  2. {
  3. glColor3f(1,0,0);
  4. glBegin(GL_TRIANGLES);
  5. glVertex2f(x,y);
  6. glVertex2f(x + 32, y);
  7. glVertex2f(x + 32,y - 32);
  8. glVertex2f(x,y - 32);
  9. glEnd();
  10. }
To copy to clipboard, switch view to plain text mode 

It does not work. Is there a way around this because there is a lot of user input involved with the integer parameters?

Thanks,
Matt