Pointing to a function that is a class member - glfw setKeycallback

前端 未结 7 1152
遇见更好的自我
遇见更好的自我 2020-12-02 11:27

I\'m writing a glfw app, in which I\'ve wrapped the function callse into a simple class. Im having trouble setting the key callback. My class is defined as:

         


        
相关标签:
7条回答
  • 2020-12-02 12:17

    In the header file make the events(int, int) to a static method. That solved the issue for me.

    class GAME 
    {
    private:
        bool running;
    public:
        GAME();
        int execute();
        static void events(int, int); //Changed here to static void 
        int loop();
        int render();
    };
    
    0 讨论(0)
提交回复
热议问题