0

I have a Geforce GT 540M, my laptop uses Optimus so it will 'switch' between the Intel GPU and the Geforce GPU depending on the applications/settings etc.

As far as I can tell on the line to open a window, it returns false:

if( !glfwOpenWindow( 1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW ) )
{
    fprintf( stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the     tutorials.\n" );
    system("pause");
    glfwTerminate();
    return -1;
}

The system command was just to confirm the error message I received.

Is there a way to force the compiler to recognize my graphics card? My assumption is that it can only spot my Intel gpu.

4

1 回答 1

2

您要求 32 个深度位。这是一种相当不寻常的格式。典型的选择是组合 32 位深度模板格式的 24 个深度位和 8 个模板位。您还可以使用glfwOpenWindowHint请求 OpenGL-3 上下文,它应该为您提供 NVidia GPU 上的上下文。

glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 0);

err = glfwOpenWindow(...);
/* ... */
于 2014-01-23T22:22:24.067 回答