Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: glfw callback custom parameter

  1. #1
    Intern Contributor
    Join Date
    Aug 2016
    Posts
    83

    glfw callback custom parameter

    Hi,

    i think i'm gonna touch the advanced OpenGL programming now. Since my program become bigger and bigger, i started to organize it a bit. Therefore i have a controller class, that handles everything.
    Problem: I set some callback functions. But these need to affect some things in my controller class. So my question, is there a way to pass some custom parameter to the callback functions??

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,595
    Quote Originally Posted by 3DPrgmer View Post
    Problem: I set some callback functions. But these need to affect some things in my controller class. So my question, is there a way to pass some custom parameter to the callback functions??
    Not as a function parameter, but glfwSetWindowUserPointer() and glfwGetWindowUserPointer() can be used to associate user data with each window.

  3. #3
    Intern Contributor
    Join Date
    Aug 2016
    Posts
    83
    worked just fine. Thanks

  4. #4
    Newbie Newbie
    Join Date
    Aug 2016
    Location
    Berlin
    Posts
    2

    Talking

    I experienced a couple OpenGL instructional exercises, did a heap of pursuits however can't locate a decent answer for my issue

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •