Integration of external GUI in to Panda 3D?

Hello,

How easy is integrate external GUI in to Panda3D? It is possible?

I have experience with Noesis GUI, but as standalone application used with GLFW for display it in window. And I think it would be great idea use Noesis in Panda 3D for GUI.
Why Noesis? I can use Blend studio from VisualStudio and draw gui without coding it. And support most controls from WPF. It is something like WPF.

Btw. it is for C++ therefore I will use C++ in Panda3D.

It looks like they provide an integration guide in their documentation:
https://noesisengine.com/docs/Gui.Core.SDKGuide.html

Complete integration would involve the following steps:

  • Implementing rendering, either by making a custom RenderDevice implementation on top of Panda’s rendering functions or via their reference GLRenderDevice.
  • Passing keyboard/mouse input from Panda to Noesis. This is probably best done with a DataNode sub-class that lives in the data graph; see RocketInputHandler in the Panda3D source code for how to do this.
  • (Optional) Implementing resource loading via the Panda3D Virtual File System.
  • (Optional) Hooking up their logging system to the Panda3D notify system.

Based on a cursory glance at their documentation, they do seem to provide a GLRenderDevice that may make the first point rather easy. This would involve adding a draw callback onto a DisplayRegion of choice in which you invoke their Render function.

Feel free to ask if you need help with anything. It might also be helpful to look at the libRocket implementation in the Panda3D source code as an example of how an external GUI system can be integrated.

Thanks and Sorry for late reply.

I have few questions:

  1. Should I integrade Noesis in Panda source code, or can I do it in pre-build binaries?
  2. I read manual but maybe I can’t find how to use opengl in Panda? It is by default?

I read about DisplayRegions, but I don’t know how I draw or render the GUI in to region.

I tried something, but I have problem with compilation.

I created custom region inspired from RocketRegion, but for Noesis.

then I use Region:

std::string cname = "Noesis Region";
	PT(GraphicsOutput) gpo;
	gpo = window->get_graphics_output();
	PT(NoesisRegion) nsr = NoesisRegion::make(cname, gpo);
	nsr->set_sort(20);

	PT(NodePath) myNode2D = new NodePath(new Camera("myCam2D"));
	PT(OrthographicLens) ole = new OrthographicLens();
	ole->set_film_size(2, 2);
	ole->set_near_far(-1000, 1000);
	PT(Camera) pcam = DCAST(Camera, myNode2D->node());
	pcam->set_lens(ole);

	PT(NodePath) ndp = new NodePath("myRender2D");
	ndp->set_depth_test(false);
	ndp->set_depth_write(false);
	myNode2D->reparent_to(*ndp);
	nsr->set_camera(*myNode2D);

after compilation I got this errors:

Error (active) E2422 defaulted default constructor cannot be constexpr because the corresponding implicitly declared default constructor would not be constexpr Panda and Noesis …\Panda3D-1.10.0\include\weakPointerToVoid.h 28

Error (active) E2422 defaulted default constructor cannot be constexpr because the corresponding implicitly declared default constructor would not be constexpr Panda and Noesis …\Panda3D-1.10.0\include\frameBufferProperties.h 148

Error (active) E2422 defaulted default constructor cannot be constexpr because the corresponding implicitly declared default constructor would not be constexpr Panda and Noesis …\Panda3D-1.10.0\include\pointerToVoid.h 35

I discover this errors are due this:

PT(NodePath) ndp = new NodePath("myRender2D");

now I don’t know, what I am doing wrong?

Ok, I found that NodePath and DisplayRegion cant be pointer.

After that code is compiled. But program crash, I try resolve it tommorow or later.

Sorry for the late response.

You can do it either way. There is no need to build Panda from source in order to make a plug-in for it.

Yes, this is by default, by the load-display pandagl setting in Config.prc.

I discover it while I waiting for answer, however, thanks. :slight_smile: