我正试图在上构建和运行以下项目来玩射线行进和着色:
https://github.com/lightbits/ray-march/blob/master/raymarch-dev.md
我不太熟悉OS或openGL上的编译。
错误:
我要编译这个项目,但是glfwOpenWindow失败了,
glfwOpenWindow(
width, height,
8, 8, 8, 0,
24, 8,
false ) 我没有收到任何错误信息,也不知道为什么失败。我认为问题来自于我为构建代码库所做的工作。
我所做的:
外部包括:
#include <glload/gl_3_1_comp.h> // OpenGL version 3.1, compatability profile
#include <glload/gll.hpp> // The C-style loading interface
#include <GL/glfw.h> // Context
#include <glm/glm.hpp> // OpenGL mathematics
#include <glm/gtc/type_ptr.hpp> // for value_ptr(matrix)
#include <string>#include <glload/gl_3_1_comp.h> // OpenGL version 3.1, compatability profile #include <glload/gll.hpp> // The C-style loading interface带着,
`#include <OpenGL/gl3.h>`if(glload::LoadFunctions() == glload::LS_LOAD_FAILED) return false;g++ main.cpp fileio.cpp opengl.cpp -I /usr/local/include/GL/ -L /usr/local/lib/ -framework OpenGL -lGLFW发布于 2015-05-22 23:26:17
从链接的代码中,我们有opengl.cpp与
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, 0); // 0 lets the system choose the profile
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, OPENGL_VERSION_MAJOR);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, OPENGL_VERSION_MINOR);
glfwOpenWindowHint(GLFW_FSAA_SAMPLES, fsaa);
glfwOpenWindowHint(GLFW_WINDOW_NO_RESIZE, GL_TRUE);和头文件一起
const int OPENGL_VERSION_MAJOR = 3;
const int OPENGL_VERSION_MINOR = 1; 因此,这是请求OSX上不支持的OpenGL 3.1上下文_which?onlz支持GL2.1以下的legacz上下文,或从GL3.2开始的GL核心配置文件上下文。当然,GLFW将无法创建GL上下文。
我还没有检查剩下的代码,但是您可能需要一个GL3.2核心配置文件。
https://stackoverflow.com/questions/30406849
复制相似问题