-1
\$\begingroup\$

This is somewhat of a niche question.

Most GUI frameworks have their own closed loop; something generally referred to as retained mode GUI. Code using them will look like:

int main() {
    GuiLib::Window myWindow(size, title, otherStuff);
    myWindow.setLoopCallback(&gameTick);
    return myWindow.runForever();
}

This is a problem for multiple reasons:

  • It constrains the structure my code can have.
  • It means the GUI has control over my application's framerate, unless I use multithreading tricks.
  • It means the GUI framework is at the root of my composition tree, instead of being a single asset I can plug in and out.

On the other side of the scale are immediate mode GUIs: dear imgui and nuklear. Code using them will look like:

int main() {
    SomeGLFrameWork::Window myWindow(size, title, otherStuff);
    while (!myWindow.isClosed()) {
        gameTick();
        drawGui();
        myWindow.display();
    }
    return 0;
}

Which is close to what I want.

The problem with these frameworks is that they're pretty niche, and they're based on calling C functions with their own syntax, which makes it impossible to reuse existing UI components from other frameworks. In particular, they can't use the droves of HTML+CSS+JS GUI components that can be found everywhere these days.

In other words, if I use imgui or nuklear for my game, I'll have to rebuild every GUI widget myself from the ground up. So my question is:

Is there a GUI framework compatible with existing GUI components (ideally HTML+CSS) and that can be called from inside a game loop?

\$\endgroup\$

closed as off-topic by Tyyppi_77, Bálint, Almo, Maximus Minimus, Patrick Hughes Feb 11 at 18:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about "how to get started," "what to learn next," or "which technology to use" are discussion-oriented questions which involve answers that are either based on opinion, or which are all equally valid. Those kinds of questions are outside the scope of this site. Visit our help center for more information." – Tyyppi_77, Bálint, Almo, Maximus Minimus, Patrick Hughes
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ We don't do technology recommendations here. You might want to take a look at softwarerecs.stackexchange.com. \$\endgroup\$ – Tyyppi_77 Feb 11 at 12:57
  • \$\begingroup\$ I think the question is on-topic. I'm not asking "what is the best technology to do X", or "what engine should I use to create a game", I have a specific use-case and I'm asking if there exist any technology that match this use case at all. \$\endgroup\$ – Narrateur du chaos Feb 11 at 13:27
  • 1
    \$\begingroup\$ @Narrateurduchaos - the close reason is not "what is the best technology" but rather "which technology to use" which seems sufficiently scoped to cover even specific use cases. Think about it this way - you've asked "is there a technology to do X" - assume that the answer is "yes", what comes next is that the question then becomes a technology recommendation. \$\endgroup\$ – Maximus Minimus Feb 11 at 15:38
  • \$\begingroup\$ ImGUI is what I use \$\endgroup\$ – Felipe Gutierrez Feb 12 at 6:49

Browse other questions tagged or ask your own question.