0

我有一个 C++ 类,其中包含我想传递给 glutDisplayFunc() 的绘制函数。glutDisplayFunc 将函数指针 (void (*)() ) 作为其参数。我努力了 :

    Model myModel(pathToTextures);
    //Model contains the Draw function that draws the vertices and the textures
    std::function<void(void)> myfunc=std::bind(&Mymodel::Draw,&modelna);

    glutDisplayFunc(myfunc);

编译器无法将 std::function 指针转换为所需的。我怎样才能绕过这个成员函数指针的障碍?

4

1 回答 1

0

我想asmjit库可以为您做到这一点。

于 2016-04-19T13:06:10.927 回答