Jump to content

  • Log In with Google      Sign In   
  • Create Account


n0pr0bl3m

Member Since 04 Jan 2012
Offline Last Active Jan 04 2012 05:46 PM

Topics I've Started

Need help [ OpenGL / glut ]

04 January 2012 - 04:45 PM

I'm really wondering why my code doesn't work ...

#include <GL\gl.h>
#include <GL\glu.h>
#include <GL\glut.h>


void display(void) {
GLfloat angel = 0.0f;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glRotatef(angel,0.0f,1.0f,0.0f);

glBegin(GL_TRIANGLES);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f(0.0f,0.5f,0.5f);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f(-0.5f,-0.5f,0.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f(0.5f,-0.5f,0.0f);
glEnd();

angel = angel + 0.5f;
glutSwapBuffers();
}



int main(int argc, char* argv[]) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize(800, 600);
glutCreateWindow("Test");


glutDisplayFunc(display);

glutMainLoop();
return 0;
}


I want to rotate the triangle I've made... It's just showing the triangle without any rotating :/

PARTNERS