Skip to content
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

Node editor demo expanded #561

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Conversation

hwps
Copy link

@hwps hwps commented Jun 2, 2023

This PR expands on the node editor demo to make it a functional example of a node-based UI.

Features:

  • multiple node types
  • multiple connector types
  • linking between connectors of the same type
  • detaching and reattaching links
  • getting value from linked node if slot is connected

node_editor

Some notes:

  • only tested with the glfw_opengl3 backend
  • uses system malloc, not sure if nk_malloc should be preferred.
  • uses the standard panel close button , then checks for NK_WINDOW_HIDDEN whether to delete a node or display it. Not sure if there's some pitfall here.

@leobenaducci
Copy link

Nice stuff

@RobLoach
Copy link
Contributor

I like where this is going. I'm not sure what's wrong with the demo though? This is the sdl_renderer....
Screenshot at 2023-09-12 03-25-01

@hwps
Copy link
Author

hwps commented Sep 15, 2023

@RobLoach Can you click the connectors to draw a link or right click to add nodes?

Maybe there should be some more nodes or at least links in the initial state. I realize now that for someone not used to a node-based UI it might be non-obvious what to do.

@hwps
Copy link
Author

hwps commented Dec 11, 2023

Ok, finally did this slight update to the init state. Screenshot attached.

Screenshot 2023-12-11 at 19 44 53

@riri
Copy link
Contributor

riri commented Dec 11, 2023

Nice work! I ran it on glfw_opengl3 and x11_xft demos (screenshot for the later below)

x11_xft

Copy link
Contributor

@RobLoach RobLoach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally had another look at this. Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants