quisiera que me ayudaran a poder rotar por si solo el cuadrado que e dibujado estoy tratando pero no veo resultados sigue estatico y no se mueve
#include <windows.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <stdlib.h>
#include <GL/glut.h>
#define ancho 320
#define altura 240
#define profundidad 500
void DibujaCuadrado();
void EjesXY();
void Teclado(unsigned char tecla, int x, int y);
int angulo=0;
int main(int argc, char** argv) {
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
glutInitWindowPosition(100, 0);
glutInitWindowSize(ancho, altura);
glutCreateWindow("Rotación de un Cuadrado en 2D");
glOrtho(-(ancho/2), (ancho/2), -(altura/2), (altura/2), -profundidad, profundidad);
glClearColor(1, 1, 1, 0);
glutDisplayFunc(DibujaCuadrado);
glutKeyboardFunc(Teclado);
glutMainLoop();
return 0;
}
void DibujaCuadrado() {
glClear(GL_COLOR_BUFFER_BIT);
EjesXY();
glPushMatrix();
glRotatef(angulo, 0, 0, 1);
glBegin(GL_QUADS);
glColor3f(1, 0, 0);glVertex2i(50,50);
glColor3f(1, 1, 0);glVertex2i(-50, 50);
glColor3f(1, 0, 0);glVertex2i(-50, -50);
glColor3f(1, 1, 0);glVertex2i(50, -50);
glEnd();
glPopMatrix();
glutSwapBuffers();
}
void EjesXY() {
glColor3f(1.0, 0.0, 1.0);
glBegin(GL_LINES);
glVertex2i(-ancho/2, 0);
glVertex2i(ancho/2, 0);
glVertex2i(0, altura/2);
glVertex2i(0, -altura/2);
glEnd();
}
void Teclado(unsigned char tecla, int x, int y) {
while(angulo=!0)
{
angulo++;
}
glutPostRedisplay();
}