|
|
#include<gl/gl.h>
#include<gl/glu.h>
#include<gl/glut.h>
void Init()
{
glClearColor(0.0,0.0,0.0,0.0);
glShadeModel(GL_FLAT);
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,1.0,1.0);
glLoadIdentity();
gluLookAt(0.0,0.0,5.0,0.0,0.0,0.0,0.0,1.0,0.0);
glScalef(1.0,2.0,1.0);
glutWireCube(1.0);
glFlush();
}
void reshape(int w,int h)
{
glViewport(0,0,(GLsizei)w,(GLsizei)h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrushtum(-1.0,1.0,-1.0,1.0,1.5,20.0);
glMatrixMode(GL_MODELVIEW);
}
int main(int argc, char* argv[])
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(100,100);
glutCreateWindow(argv[0]);
Init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMainLoop();
return 0;
}
编译错误:
error C2144: syntax error : missing ';' before type 'void'
error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found
我怎么也找不出问题所在,看错误提示好象是WINGDIAPI不认识没定义过,但这个是系统自带的文件,我没改过,也不敢改,到底是什么原因呢? [em24] [em24] |
|