#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include<GL/glut.h>
static GLfloat spin = 0.0;
void init( void )
{
glClearColor( 0.0, 0.0, 0.0, 0.0 );
glShadeModel( GL_FLAT );
}
void display( void )
{
glClear( GL_COLOR_BUFFER_BIT );
glPushMatrix( );
glRotatef( spin, 0.0, 0.0, 1.0 );
glColor3f( 1.0, 1.0, 1.0 );
glRectf( -25.0, -25.0, 25.0, 25.0 );
glPopMatrix( );
glutSwapBuffers( );
}
void spinDisplay( void )
{
spin = spin + 2.0;
if ( spin > 360.0 )
spin = spin - 360.0;
glutPostRedisplay( );
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载