Closed galek closed 8 years ago
I think you mean ATF's ModelViewer sample app.
I don't know what EngineCLR is or what it is expecting, but if it needs a Windows handle, then m_designControl.Handle will be the Windows handle of the Control that OpenGL draws on. All handles in Windows are 32 bits, so that's OK to convert the IntPtr to an Int32. I suspect that you'll have to use the debugger inside EngineCLR to see what is going wrong.
EngineCLR-it's my engine. HWND is needed for rendering in winforms element For standart winforms all is fine->so code is stable. Rephrase my question:how get HWND for sub-element in form?
By "sub-element", you mean "child Control", right? The DesignControl has no child Controls. The m_designControl.Controls property is always empty.
By "sub-element", you mean "child Control", right? Yes
Ok,thanks for reply.So maybe I must give up the ATF
Edit: I'll wait for your answer until tomorrow and close the request
Use m_designControl.Handle instead. The m_designControl variable is the rendering control but it is already used as an opengl context.
Please note that ModelViewer sample is design to use ATF OpenGL based scene graph. I suggest to create new ATF application that utilizes all the ATF services except rendering since you already have one.
As indicated above, the m_designControl is already used as an opengl context, so if you are creating new context or swap chain using same handle it will most likely cause problem.
Alan
Thanks for reply, i'm not seen
Hi,how i can get HWND per element?
My sample based on MeshViewer: void IInitializable.Initialize() { ControlInfo cinfo = new ControlInfo("3D View", "3d viewer", StandardControlGroup.CenterPermanent); m_controlHostService.RegisterControl(m_designControl, cinfo, null); { this.engine = new EngineCLR.EngineCLR(cinfo.Control.Handle.ToInt32()); engine.EngineInit(); engine.Resize(1920, 1080); } } }
But it's not work