question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple Contexts

See original GitHub issue

Is there a way for you to included the following native call methods like GetCurrentContext and SetCurrentContext?


    // Context creation and access
    // Each context create its own ImFontAtlas by default. You may instance one yourself and pass it to CreateContext() to share a font atlas between imgui contexts.
    // None of those functions is reliant on the current context.
    IMGUI_API ImGuiContext* CreateContext(ImFontAtlas* shared_font_atlas = NULL);
    IMGUI_API void          DestroyContext(ImGuiContext* ctx = NULL);   // NULL = destroy current context
    IMGUI_API ImGuiContext* **GetCurrentContext**();
    IMGUI_API void          **SetCurrentContext**(ImGuiContext* ctx);

https://github.com/ocornut/imgui/blob/master/imgui.h

I need to have the ability to support multiple contexts because I’m using multiple secondary buffers in Vulkan.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
SpaiRcommented, Jul 12, 2021

@perrymacmurray There is no solution, so you can implement it without any restrictions. At the moment I am more liberal about touching internal API, then before. I don’t think that anything else than context structs need to be done. I even think, that you can try to go with only basic code, which holds object pointer. No need to force yourself with implementing all struct fields etc. Only stuff you need to make things work. Just keep it clean, with general code style in mind.

0reactions
perrymacmurraycommented, Jul 12, 2021

Hi @SpaiR, sorry to revive a dead issue, but for my own code I was interested in switching between multiple contexts. Is there an existing way to do something like this, or is it still unimplemented?

If a solution doesn’t already exist, I’d love to give implementing context switching and maybe the internal API a shot, but I don’t completely understand what other than the contexts needs to be implemented. Do you have any advice?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Applying Learning in Multiple Contexts | Edutopia
When students manipulate new learning—by representing a math concept in a poem, for example—they create strong memories of it.
Read more >
React multiple contexts - Stack Overflow
Now I use this.context.someFunction(); . This works. How can I do this if I need functions from two different parent components?
Read more >
Context - React
Context provides a way to pass data through the component tree without having to pass ... If you need to read more than...
Read more >
React Context & Hooks Tutorial #7 - Creating Multiple Contexts
Hey gang, in this tutorial I'll show you how to create multiple different contexts for different, un-releated data.
Read more >
Usage of Multiple Contexts - React Deep Dive - Educative.io
It is entirely possible to use multiple Context Providers within the same component hierarchy. Nesting them is not a problem. Even Providers of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found