|
|
发表于 2006-2-13 08:45:00
|
显示全部楼层
Re:初学OPENGL的问题:代码怎样才能在VC。NET中运行?
#include <windows.h>
#include <GL/gl.h>
#include <GL/glaux.h>
// Generate auto linkage for OpenGL libraries
#pragma comment(lib, "OPENGL32.LIB")
#pragma comment(lib, "GLAUX.LIB")
#pragma comment(lib, "GLU32.LIB")
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);
}
|
|