# GLFW window callbacks inside classes

**URL:** <https://discourse.glfw.org/t/glfw-window-callbacks-inside-classes/2671>\
**Category:** support\
**Created:** [July 1, 2024, 9:46am UTC](https://discourse.glfw.org/t/glfw-window-callbacks-inside-classes/2671 "2024-07-01T09:46:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [July 1, 2024, 10:26am UTC](https://discourse.glfw.org/t/glfw-window-callbacks-inside-classes/2671/2 "2024-07-01T10:26:11Z")

</div>

Hi @Gert2198 welcome to the GLFW forum,

You can’t use member functions as callbacks unless they are `static`, as the signature is different for member functions (they require the object pointer to dereference).

You can use [window user pointers](https://www.glfw.org/docs/latest/window_guide.html#window_userptr) to set the member pointer so you can then call your member function from a free function.

For example see [What is a possible use of glfwGetWindowUserPointer? - #2 by tombsar](https://discourse.glfw.org/t/what-is-a-possible-use-of-glfwgetwindowuserpointer/1294/2)

---

_[View the full topic](https://discourse.glfw.org/t/glfw-window-callbacks-inside-classes/2671)._
