小编Mik*_*sen的帖子

GLFW 3初始化了吗?

我正在努力使用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)

c++ opengl glfw

5
推荐指数
1
解决办法
4547
查看次数

标签 统计

c++ ×1

glfw ×1

opengl ×1