2015年10月1日

GLFW callback member function


void Application::Initial() {
  window = glfwCreateWin....

  glfwSetWindowUserPointer(window, this);

  auto reshape_callback = [](GLFWwindow *window, int w, int h) {
    static_cast<Application *>(glfwGetWindowUserPointer(window))->Reshape(window, w, h);
  };


  glfwSetFramebufferSizeCallback(window, reshape_callback);
}

沒有留言:

張貼留言