vendredi 13 mars 2020

lambda function callback returns error : C++ no suitable conversion function from to exists

i try to implement simple lambda callback to open source function like this :

i want to pass to the lambda the : GLFWwindow* window; which is defined in the header of GLFWManager

void GLFWManager::handleExitGame()
{
    glfwSetKeyCallback(window, [this](GLFWwindow* window, int key, int scancode, int action, int mods)->GLFWkeyfun {

        if (key == GLFW_KEY_ESCAPE && action == GLFW_RELEASE)
        {

        }

    });
}

the signetures are :

GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun callback);
typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);

i keep getting this compiler error :

C++ no suitable conversion function from to exists

Aucun commentaire:

Enregistrer un commentaire