hi, i have this code…
#include<gl\glut.h>
void init()
{
glClearColor(0.0,0.0,0.0,1.0);
glViewport(0,0,500,500);
gluOrtho2D(-5.0,495.0,-5.0,495.0);
glMatrixMode(GL_MODELVIEW);
}
int hapa=0;
void Display()
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glTranslatef(20.0*hapa,0,0);
glRectf(-5,-5,5,5);
glFlush();
}
void update(int);
int main(int a,char** b)
{
glutInit(&a,b);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(500,500);
glutCreateWindow("Dritare");
init();
glutDisplayFunc(Display);
glutMainLoop();
}
void update(int value)
{
hapa++;
glutPostRedisplay();
glutTimerFunc(1000,update,0);
}
and it just shows me a white window when i try to compile…
ps. when i remove update function does not shows nothing too but if i replace translatef(…) with rotate function it works
thank you in advance