OpenGL绘制移动的正方形,该怎么解决

OpenGL绘制移动的正方形
本人正在学习《OpenGL超级宝典》,其中的一个例子“程序清单2.3”都是按书上的内容输入的代码,可是没有效果,请高手帮忙看看错在哪里?最好能够把正确的代码给我,谢谢了。
附:这是一个控制台应用程序。

C/C++ code

#include <windows.h>
#include <gl/glut.h>

GLfloat x1=100.0f;
GLfloat y1=150.0f;
GLfloat rsize=25;

GLfloat xstep=1.0f;
GLfloat ystep=1.0f;

GLfloat windowWidth;
GLfloat windowHeight;

void RenderScene(void)
{
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0f,0.0f,0.0f);
    glRectf(x1,y1,x1+rsize,y1-rsize);
    glutSwapBuffers();   //刷新绘图命令,并进行交换
}

void SetupRC(void)
{
    glClearColor(0.0f,0.0f,1.0f,1.0f);
}

void TimerFunction(int value)
{
    if(x1>windowWidth-rsize||x1<-windowWidth)
        xstep=-xstep;
    if(y1>windowHeight||y1<-windowHeight+rsize)
        ystep=-ystep;

    x1+=xstep;
    y1+=ystep;

    if(x1>(windowWidth-rsize+xstep))
        x1=windowWidth-rsize-1;
    else if(x1<-(windowWidth+xstep))
        x1=-windowWidth-1;

    if(y1>(windowHeight+ystep))
        y1=windowHeight-1;
    else if(y1<-(windowHeight-rsize+ystep))
        y1=-windowHeight+rsize-1;

    glutPostRedisplay();
    glutTimerFunc(33,TimerFunction,1);
}

void ChangeSize(GLsizei w,GLsizei h)
{   
    if(h==0) h=1;
    glViewport(0,0,w,h);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    if(w<=h)
    {
        windowHeight=250.0f*h/w;
        windowWidth=250.0f;
    }
    else
    {
        windowHeight=250.0f;
        windowWidth=250.0f*w/h;
    }
    glOrtho(0.0f,windowWidth,0.0f,windowHeight,1.0f,-1.0f);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
}


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

    glutDisplayFunc(RenderScene);
    glutReshapeFunc(ChangeSize);
    glutTimerFunc(33,TimerFunction,1);

    SetupRC();
    glutMainLoop();
    return 0;
}



------解决方案--------------------
可能是照相机的问题吧,先找一个可以运行的框架,
绘制出正方体,
然后在实现正方体移动,