Graphical Node Editor: Would wxWidgets and OpenGlCanvas be the best way? Topic is solved

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
AmirShabani
In need of some credit
In need of some credit
Posts: 1
Joined: Sun Aug 23, 2020 3:23 am

Graphical Node Editor: Would wxWidgets and OpenGlCanvas be the best way?

Post by AmirShabani »

I'd like to create a program that has a graphical node editor section. I've setup the base of the GUI and functionality of the nodes, but I'd like to know if the method I've planned is the best way to approach it.

The main application frame is split into two sides with a SplitterWindow. On one side, there will be a node editor. Essentially a graph where the user can add a node (rectangle with text inside), move the node around on the graph, and plug it into other nodes (with a line connecting them). On the other side, a form will be available where the user can enter and change information related to the selected node. This side will only be using regular wxWidgets controls.

Would using OpenGL for the node editor side of the application be wise? A lot of the resources I've found have been specifically tailored to video games. For example, I'm not sure if I'll be needing to make a textured box if all i want is a rounded rectangle with lines. I'm not sure if OpenGL would be overkill for this purpose.

Any thoughts or suggestions?
Thanks in advance.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Graphical Node Editor: Would wxWidgets and OpenGlCanvas be the best way?

Post by doublemax »

As OpenGL is relatively "low level", i would only consider it, if you already have experience with it and know it very well. Otherwise it seems like an unreasonable amount of effort. Normally using wxDC/wxGraphicsContext for custom drawing should be fast enough. How many nodes do you expect to draw?

You should also check if wxArt2D or wxShapeFramework already have what you need:
https://www.wxart2d.org/cgi-bin/moin.cg ... creenShots
https://sourceforge.net/projects/wxsf/
Use the source, Luke!
Post Reply