新手关于opengl的问题
按书上的教程一步一步如下:
new一个win32 simple application
在stdafx.h里加上:
#include <GL/gl.h>
#include <GL/glaux.h>
#include <afxtempl.h>
在把cpp修改为:#include <GL/gl.h>
#include <GL/glaux.h>
#include <windows.h>
void main(void)
{
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
auxInitPosition(0,0,500,500);
auxInitWindow("simple");
glClearColor(0.0,0.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glRectf(-0.5,-0.5,0.5,0.5);
glFlush();
_sleep(1000);
}
编译显示gl.h有一行(WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);)出现如下问题:
gl.h(1152) : error C2144: syntax error : missing ';' before type 'void'
gl.h(1152) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
gl.h(1152) : fatal error C1004: unexpected end of file found
还没弄懂程序是怎么回事,新手第一步就遭受如此挫折,还怎么往下进行啊。
望大侠指点迷津