title: Pointing to a function that is a class member - GLFW setKeycallback
body: <p>I'm writing a GLFW app, in which I've wrapped the function calls into a simple class. I'm having trouble setting the key callback.
  My class is defined as:</p>
  <pre><code>class GAME 
  {
  private:
      bool running;
  public:
      GAME();
      int execute();
      void events(int, int);
      int loop();
      int render();
  };
  </code></pre>
  <p>The execute function is:</p>
  <pre><code>int GAME::execute() 
      {
          glfwOpenWindow(640, 320, 8, 8, 8, 8, 0, 0, GLFW_WINDOW);
          glfwSetWindowTitle(&quot;Viraj&quot;);
          glfwSetKeyCallback(events);
          running = true;
          while(glfwGetWindowParam(GLFW_OPENED))
          {
              glfwPollEvents();
              loop();
              render();
          }
          return 0;
      }
  </code></pre>
  <p>Compiling the following code on Visual Studio 2010 gives the error:</p>
  <p><code>error C3867: 'GAME::events': function call missing argument list; use '&amp;GAME::events' to create a pointer to member</code></p>
  <p>Using <code>&amp;GAME::events</code> gives:</p>
  <p><code>error C2664: 'glfwSetKeyCallback' : cannot convert parameter 1 from 'void (__thiscall GAME::* )(int,int)' to 'GLFWkeyfun' 1&gt;          There is no context in which this conversion is possible</code></p>