Jump to content

Attaching Unigene engines to additional mfc dialogs


photo

Recommended Posts

Hello.

We are importing and using Unigine engine based on mfc.

The unigine engine is created and rendered as a customapp on the main screen.

However, it is difficult to attach the engine to the additional mfc child dialog.

1. Is it possible to additionally render unigine engine in mfc based add dialog?(instead unigine widget)

2. In unigine engine, rendering the main window using directx and rendering an additional dialog like a simple cubemap jpg image viewer with opengl works, Could this be an alternative?(Below Image)

image.thumb.png.eb7284e39717f0c09b64b517432b8e92.png

 

thank you.

Edited by KOVIAHN
Link to comment

KOVIAHN

Quote

However, it is difficult to attach the engine to the additional mfc child dialog.

What do you mean by difficult to attach? What have you already tried?

If you can send us some minimal test app with your MFC integration and custom window - we can check, but it would not be fast due to pre-release work and overall low MFC knowledge.

You can also check ViewportQt sample (it has multi-window support) and re-implement the same logic in your MFC application (if possible).

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Dear @KOVIAHN,

I have understood what you need. Reading MFC I thought you are using DirectX. But now it is clear from the picture above that your are using OpenGL. I have done this before with MFC, Unigine and DirectX.

By specification, DirectX (And I am pretty sure that OpenGL too) requires a separate swap chain for every window we want to be rendered by DirectX (or OpenGL runtimes). 

To render on additional window, you must have separate swap chain. I see you have it as you are rendering to second window using OpenGL. Why don't you create additional context using Unigine API and try it? It will work. Create new context using the additional window handle. In the second window you might render another view or just a node or material.

Please try this. Little tricky, if you have not worked with multiple swap chains and contexts before.

https://developer.unigine.com/en/docs/2.12/api/library/rendering/class.rendercontext

Rohit

Link to comment

Dear silent & rohit.gonsalves

---------------------------------------------------------------------------------------------------------------------------------------------------------------

To render on additional window, you must have separate swap chain. I see you have it as you are rendering to second window using OpenGL. Why don't you create additional context using Unigine API and try it? It will work. Create new context using the additional window handle. In the second window you might render another view or just a node or material.

---------------------------------------------------------------------------------------------------------------------------------------------------------------

I'll try this.

Thank you.

Link to comment
Quote

2. In unigine engine, rendering the main window using directx and rendering an additional dialog like a simple cubemap jpg image viewer with opengl works, Could this be an alternative?(Below Image)

Totally overlooked this line.

Suggestion:

Stick to DirectX only and render the second  using the same. Get rid of OpenGL. Don't mix the API at this testing phase.

Rohit

Link to comment
  • 4 weeks later...
×
×
  • Create New...