title: GLFWwindowsizefun accessibility in OOP
body: <p>There is a <a href="http://www.glfw.org/docs/latest/group__window.html#gaa40cd24840daa8c62f36cafc847c72b6" rel="nofollow">glfwSetWindowSizeCallback</a> function for setting a callback function  <a href="http://www.glfw.org/docs/latest/group__window.html#gaaca1c2715759d03da9834eac19323d4a" rel="nofollow">GLFWwindowsizefun</a> which is called after a GLFWwindow is resized. Now the problem is that in my user interface library I've got a class called <code>Window</code> which holds members <code>GLFWwindow glfw_window;</code> <code>glm::mat4 ortho_proj;</code>, and in the size callback function I want to do <code>ortho_proj = glm::ortho(0.0f, (float)_width, (float)_height, 0.0f, -1.0f, 1.0f);</code>, but I can't because the the callback function is static and is not a member of the <code>Window</code> class, and AFAIK it can not be. So the only way I know, for accessing the <code>ortho_proj</code> variable in the callback function is making the variable static, but I don't want that, because in that case I would face problems creating multiple windows in a single program.</p>
  
  <p>This is the class definition:</p>
  
  <pre><code>class Window
  {
      private:
          GLFWwindow* glfw_window;
          mat4 ortho_proj;
      public:
          Window(int _width, int _height, const char* _title);
          bool update();
          void render();
          ~Window();
  };
  </code></pre>
  
  <p>This is the <em>bad</em> callback function (it would work if ortho_proj would be public and static and if I would add <code>Window::</code> before <code>ortho_proj</code>)</p>
  
  <pre><code>void window_size_callback(GLFWwindow* _window, int _width, int _height)
  {
      ortho_proj = ortho(0.0f, (float)_width, (float)_height, 0.0f, -1.0f, 1.0f);
  }
  </code></pre>
  
  <p>So are there any ways of accessing the the <code>ortho_proj</code> variable in the callback function, or maybe the callback function can somehow be a class member? Or are there any GLFW functions returning a boolean if the window has been resized?</p>