Skip to content

Recommendations for integrating with UI libraries? #12

@YellowApple

Description

@YellowApple

Basically, I'd like to use Nuklear (via the egg that wraps it), but the egg in question seems to be written with the assumption that I'm using the glfw3 egg directly, and I'm not sure exactly where to stick the Nuklear-specific code in the context of a Hypergiant application.

Approaches I've considered:

  • Adding the (backend:new-frame), (nk:window-begin ...), (nk:window-end), and (backend:render!) calls to start's post-render hook (as well as (backend:init! ...) / (backend:init-font!) calls in init and (backend:shutdown!) in cleanup). This miraculously doesn't crash anything, and Hypergiant seems to have no problems, but Nuklear windows/widgets don't show up this way, and the application spams my STDOUT with GL error: invalid operation.
  • Doing the above, but using pre-render instead of post-render. Same issue.
  • Somehow using the ui scene, which is probably the "right" way to go about this, but I haven't the slightest idea how to bend either ui or Nuklear to satisfy the other's expectations. I'm guessing I somehow need to turn a Nuklear context into a Hyperscene node hierarchy somehow, but Nuklear (or at least the particular backend exposed by the nuklear egg) wants to render directly to a viewport or something. Maybe I just need to write a different Nuklear backend that turns windows/widgets into Hyperscene/Hypergiant nodes? And then add them to the ui scene? Or am I overthinking this?

I'm admittedly pretty new to this OpenGL thing, and I'm sure I'm going about this the entirely wrong way. I'm not even sure if this is the right place to ask this sort of question (maybe I should bug folks on the Nuklear side of the world instead?), but hopefully it's a good start to getting some kind of documentation or best practice or somesuch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions