-
Notifications
You must be signed in to change notification settings - Fork 25
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
Multiple Contexts #1
Comments
These global GLFW/OpenGL states are holding temporarily only for rendering purpose. They're not ImGui states. Almost all of them are refreshed in every rendering loop when calling:
except CImGui.jl/src/backend/OpenGL/impl.jl Line 30 in 2b6caaa
and make CImGui.jl/src/backend/GLFW/impl.jl Line 129 in 2b6caaa
then this modified example will work: https://gist.github.com/Gnimuc/b9308bb8ed0a81b4fe1e76d706837f3d |
Thank you for the example!
nice. I am still experiencing some issues with that fix, that seem to be related to the event handling: for example, in your code multicontext.jl I sometimes cannot close window1 and only window2 and sometimes the other way around. Also it seems that currently there is no possiblity to manage the callbacks manually via
which might be of interest also for single multiple contexts. regards, |
That's because the script didn't destory GLFW windows instance in the rendering loop: https://gist.github.com/Gnimuc/b9308bb8ed0a81b4fe1e76d706837f3d#file-multicontext-jl-L118-L123
As for the callbacks, I didn't implement that because I thought they were not very useful in that one can always overload these callbacks before GLFW initialization. But this feature is very simple to implement by following: so feel free to submit a PR. Or I'll fix it this weekend. |
Indeed, I got it working in the way you proposed; the "issues" were just in my implementation. Could resolve them now |
UPDATE: Now the master branch supports multi-viewport and this multiple contexts support is being removed since it's not recommended to use Dear ImGui in this way. Also, see #52. |
Hello, I have just recently read about this Wrapper. Thank you for porting!
For a multi-window setup I found that
SetCurrentContext
is exported, but additionally I had to manually save and restore all global variablesg_*
fromCImGui.OpenGLBackend
andCImGui.GLFWBackend
per-window setup
rendering:
with something like this
Is there a chance to have these two variable-sets attached to the "current" ImGui context?
regards,
Christian
The text was updated successfully, but these errors were encountered: