我使用这段代码:
#include <glew.h>
#include <freeglut.h>
#include <iostream>
void DisplayManager::createWindow(int argv, char** argc) {
glutInit(&argv, argc);
std::cout << "GLEW Version : " << GLEW_VERSION << std::endl;
glewExperimental = TRUE;
if (glewInit() != GLEW_OK) {
std::cout << "glewInit failed, aborting." << std::endl;
}
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(windowX, windowY);
glutInitWindowSize(width, height);
glutCreateWindow(title);
glutDisplayFunc(displayFunktion);
glClearColor(1.0f, 0.0f, 1.0f, 1.0f);
std::cout << "created Window" << std::endl;
}
控制台输出为:
GLEW版本:1
glewInit失败,中止。
创建了窗口
据我所知,我已经正确安装了glew,过剩也很好。