随着我对跨平台框架/库的搜索工作的进行,GLFW被多次提及.所以,我决定尝试一下.现在,似乎我甚至无法启动一个窗口.: - /
#include
#include
#include
int main(int argc, char *argv[])
{
int running = GL_TRUE;
srand(time(NULL));
if (!glfwInit())
exit(EXIT_FAILURE);
if (!glfwOpenWindow(300, 300, 0, 0, 0, 0, 0, 0, GLFW_WINDOW))
{
glfwTerminate();
exit(EXIT_FAILURE);
}
while (running)
{
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(rand() % 255 + 1, rand() % 255 + 1, rand() % 255 + 1, 0);
glfwSwapBuffers();
running = !glfwGetKey(GLFW_KEY_ESC) && glfwGetWindowParam(GLFW_OPENED);
}
glfwTerminate();
exit(EXIT_SUCCESS);
}
我在MVC++ 2010中输入了这个,链接了头文件和2个lib文件(它有1个DLL文件,所以我把它扔进了SysWOW64文件夹),我得到了这些错误:
1>------ Build started: Project: glfwTest, Configuration: Debug Win32 ------
1> test.cpp
1>c:\users\andrew\documents\visual studio 2010\projects\glfwtest\glfwtest\test.cpp(8): …Run Code Online (Sandbox Code Playgroud)