-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Pass user data in ImDrawData #1309
Comments
You can set the `RenderFn` pointer to NULL, call the `GetDrawData()` accessor and use that data directly you call your function.
(I imagine that an hypothetical 2.0 api would get rid of the callback to favor this approach.)
If you search in the PR here you'll find an old unmerged pull request #281 with a native Win32 example but it was rather noisy and not following the structure of other examples enough. I agree it would be nice extra to have such example available.
|
@n00bmind Edited my post above for clarity, it was terribly written, sorry for that. (note for self: avoid using phone to reply after landing from a long flight). I think I will rework the examples to use this approach soon. |
Hey, Cheers, and happy new year! |
Hello! While I appreciate (and we can use) the work in #1553, I don't see the connection with the question asked at the top of this topic here. My answer was that you can/should ignore the I will rework the examples/ apps to stop using Omar |
Yes sorry, it's just that I saw this issue linked on my github the other day and then I remembered about the example code.. |
Hi.
I've just started integrating your awesome library in my engine, but I'm going the pure manual route, so just OpenGL with no wrappers/helper libs.
I use a struct to hold some OpenGL related state, like compiled shader ids, etc, and I find I need to have access to it when my render callback is called, in order to get to this kind of data during rendering.
Since you already group all the data passed to the callback in a nice struct, I think it would be super useful to add a user-configurable void * there so that the callback can get any extra data needed.
Just a suggestion.
Also, I saw you don't have a pure Win32 example, so maybe I could upload a stripped-down version of my code when I manage to integrate the basic stuff, at least as a starting point?
The text was updated successfully, but these errors were encountered: