DXScene initialization
#2
The initialization and creation of the DXScene is done when the DXViewportView is loaded - to initialize the DXScene we need to know the size of the view so that the back buffers (render targets) can be created and for DirectXOverlay PresentationType the hWnd of the surface need to be created. The size is (usually) known when the control is loaded so the initialization code is executed in the DXViewportView.Loaded event handler. 

After the DXScene, DirectX device and the back buffers are created then the DXSceneInitialized event is called.

But it is possible that at load time the size of the DXViewportView is still 0. In this case the IsInitialized is set to true and the DXSceneInitialized event is called but the back buffers are not created. In this case the IsEnabled property is set to false - it is set to true when the valid size is set.


From the screenshot I see that you are defining multiple DXViewportViews in a Grid. Note that when the row width and height are defined with a star then the size  is evenly distributed between cells. But in case you are using GridSplitter and if used have manually change the size of the Grid with GridSplitter and if you then add another column / row with size set to star, then the size of the newly created cells will be 0 - so the DXViewportView will be created and loaded into a 0x0 space. In this case you need to manually resize the grid to show the control.

But maybe there is some other reason for the problem - I see that you are using a pre-release version of DXEngine with using multiple DXViewportViews that show the same DXScene. In this case it would be great if you could update the sample that I have sent to you so that I would be able to reproduce the problem.
Andrej Benedik
  


Messages In This Thread
DXScene initialization - by janovrom - 07-27-2020, 04:58 PM
RE: DXScene initialization - by abenedik - 07-28-2020, 12:59 PM
RE: DXScene initialization - by janovrom - 07-28-2020, 03:02 PM
RE: DXScene initialization - by abenedik - 07-29-2020, 01:10 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)