Jump to content

[SOLVED] Include Windows UI control in Unigine dialog


photo

Recommended Posts

I would like to incorporate a 3rd-party Windows control (deriving from CWnd) into my existing Unigine-driven Windows application. Is there a recommended way to do this?

 

As an experiment, I tried simply adding the control to the Unigine window from application C++ using Windows CreateWindowEx API. The control was present (evidenced by mouse cursor changing when hovering where control should be) but invisible as Unigine UI was being drawn over it.

 

Next, I tried creating new C++ class deriving from WidgetExternBase. In widget constructor, I again use CreateWindowEx to add control to Unigine window. In render function I call Invalidate() on control, forcing it to be redrawn. This helps make control visible on screen, but still is competing with Unigine -- Unigine and Windows are both drawing simultaneously to the area on screen, resulting in flickering. Eventually, I would also need to query widget position Windows control correctly: correct position, size, any applied clipping, etc.

 

Continuing with the above approach seems like a lot of work and probably very error-prone. Is there a simpler way?

Link to comment

Hello, Adam.

 

I'm not sure what you're trying to achieve and assume you want to draw native UI inside Unigine viewport. For that cases I believe you have to inherit from our App class and write your implementation which will manage window order & focus so you'll be able to see custom controls.

 

Another way is to use Unigine as a viewport and surround it with native UI. That approach also require custom App class.

 

Have a look at this integration sample: https://developer.unigine.com/en/docs/1.0/cpp_api/usage/unigine_app/AppQt

Link to comment
×
×
  • Create New...