我对OpenGL有些问题 我在Visual Studio 2015中编写了这段代码,但是当我编译它时,Visual Studio向我显示了错误,例如“函数调用中的参数太多”和“找不到glClear”和“glLookAt函数不接受18个参数”和...... 我该如何解决? 这是我的代码:
#define glclear
#include "stdafx.h"
#include <Windows.h>
#include <glut.h>
void display()
{
glclear(GL_COLOR_BUFFER_BIT);
gluLookAt(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
glutWireTeapot(2, 0);
glFlush();
}
void init()
{
glClearColor(1, 0, 1, 0, 1, 0, 1, 0);
glColor3b(0, 0, 0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-4, 0, 4, 0, -4, 0, 4, 0, -4, 0, 4, 0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
int main(int argc, char** argv);
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutInitWindowSize(300, 300);
glutInitWindowPosition(0, 0);
glutCreateWindow("Orthographic Projection");
glutDisplayFunc(Display);
init();
glutMainLoop();
}