void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glPushMatrix();
glutWireSphere(1.0, 10, 10); /* draw sun */
// glRotatef ((GLfloat) year, 0.0, 1.0, 0.0);
glTranslatef (2.0, 0.0, 0.0);
glRotatef ((GLfloat) day, 0.0, 1.0, 0.0);
glutWireSphere(0.2, 5, 5); /* draw smaller planet */
glPopMatrix();
glutSwapBuffers();
}
- 在项目中要加上所使用的静态库文件xxx.lib,最好不用LIBS+=的方式引用,这样很可能加载不上,导致程序结果不显示。