Sistema: OS X 10.11.5; Gráficos Intel HD 3000384 MB
GLFW: 3.1.2 (del repositorio de preparación)
Estoy intentando ejecutar la aplicación OpenGL. Como se describe aquí, la versión de OpenGL del núcleo para mi sistema operativo y tarjeta de video es 3.3. Mi código:
glfwInit();
glfwWindowHint( GLFW_CONTEXT_VERSION_MAJOR, 3 );
glfwWindowHint( GLFW_CONTEXT_VERSION_MINOR, 3 );
glfwWindowHint( GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE );
if( !glfwCreateWindow( 600, 400, "Window", nullptr, nullptr ) ) {
printf( "error: Failed to create window\n" );
exit( 1 );
}
Me falla después de la declaración if. ¿Qué está mal?
Debería intentar configurar una devolución de llamada de error; glfw generalmente informará lo que salió mal.
Además, ¿intentó comprobar si glfwInit()
devuelve GLFW_FALSE
?
Olvidó establecer el bit compatible hacia adelante en verdadero, que también es necesario.
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
Como han dicho otros, la verificación de errores también es importante.
Consulte esta entrada en las preguntas frecuentes:
@shurcooL gracias, tienes razón
Comentario más útil
Olvidó establecer el bit compatible hacia adelante en verdadero, que también es necesario.
Como han dicho otros, la verificación de errores también es importante.
Consulte esta entrada en las preguntas frecuentes:
4.1 - ¿Cómo creo un contexto OpenGL 3.0+?