Hi,
My project uses directX to render several MDI child forms. In the activate event of each child form is:
In the OnPaint Event of each form is the render loop. A few questions -
1. Is there a better way to switch between rendering forms other than creating a new device each time.
2. With this setup, sometimes when I press the close box on one of the child forms the program takes extremely long o shut down the form. Is there something I should be doing in the Closing code to exit properly?
3. My render loop looks like this:
For some reason, the first node is drawing, the world is moving , but the second node does not appear. Is there something I need to do to the mesh to make it draw a second time?
Thanks -
My project uses directX to render several MDI child forms. In the activate event of each child form is:
Code:
parameters = new PresentParameters();
parameters.SwapEffect = SwapEffect.Discard;
parameters.AutoDepthStencilFormat = DepthFormat.D16;
parameters.EnableAutoDepthStencil = true;
parameters.Windowed = true;
video = new Device(0,DeviceType.Hardware, this,CreateFlags.SoftwareVertexProcessing,parameters);
In the OnPaint Event of each form is the render loop. A few questions -
1. Is there a better way to switch between rendering forms other than creating a new device each time.
2. With this setup, sometimes when I press the close box on one of the child forms the program takes extremely long o shut down the form. Is there something I should be doing in the Closing code to exit properly?
3. My render loop looks like this:
Code:
node = Mesh.Sphere(this.video,0.1f,15,15);
video.BeginScene();
node.DrawSubset(0);
video.Transform.World = Matrix.Translation(0.5f,0.5f,0.0f);
node.DrawSubset(0);
video.EndScene();
video.Present();
this.Invalidate();
For some reason, the first node is drawing, the world is moving , but the second node does not appear. Is there something I need to do to the mesh to make it draw a second time?
Thanks -