KOVIAHN Posted September 21, 2020 Share Posted September 21, 2020 (edited) 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) thank you. Edited September 21, 2020 by KOVIAHN Link to comment
silent Posted September 21, 2020 Share Posted September 21, 2020 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
rohit.gonsalves Posted September 22, 2020 Share Posted September 22, 2020 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
adgsf432 Posted September 22, 2020 Share Posted September 22, 2020 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
rohit.gonsalves Posted September 22, 2020 Share Posted September 22, 2020 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
KOVIAHN Posted October 19, 2020 Author Share Posted October 19, 2020 Dear rohit.gonsalves. There were difficulties assuming that it would not work from the beginning. Thanks to the key words in the answer, I came up with a solution, and I actually got the desired result. Thank you very much. :) 2 Link to comment
Recommended Posts