Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User pointer for callbacks? #875

Closed
zeyonaut opened this issue Oct 15, 2016 · 2 comments
Closed

User pointer for callbacks? #875

zeyonaut opened this issue Oct 15, 2016 · 2 comments

Comments

@zeyonaut
Copy link

As you are pursuing multi-context, it would be useful to be able to set a pointer to user data when setting up the callbacks, similar to how GLFW does it. For example,

io.SetClipboardTextFn = [](const char* text)
    {
        glfwSetClipboardString(g_Window, text);
    };

The window must be a global variable in this case, but if a context specific pointer was given back, then an instance-local window could be passed in. Is this a feature you would be interested in implementing?

@ocornut
Copy link
Owner

ocornut commented Oct 15, 2016

I agree it would be a useful change. It'll be a breaking change but not everybody override it and breakage will be trivial so I think I'll just go for it.

@ocornut
Copy link
Owner

ocornut commented Oct 15, 2016

Done

@ocornut ocornut closed this as completed Oct 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants