我正在努力使用GLFW 3函数glfwCreateWindow创建一个窗口。我设置了一个错误回调函数,该函数几乎只打印出错误号和描述,并且据此还没有初始化GLFW库,即使glfwInit函数刚刚返回成功?
这是我的代码的补充
// Error callback function prints out any errors from GFLW to the console
static void error_callback( int error, const char *description )
{
cout << error << '\t' << description << endl;
}
bool Base::Init()
{
// Set error callback
/*!
* According to the documentation this can be use before glfwInit,
* and removing won't change anything anyway
*/
glfwSetErrorCallback( error_callback );
// Initialize GLFW
/*!
* This return succesfull, but...
*/
if( !glfwInit() )
{ …Run Code Online (Sandbox Code Playgroud)