Rendering in an MDI interface

Started by
2 comments, last by Blackkata 19 years, 1 month ago
Hello, Im making a map editor using C# and managed DirectX. Im putting the controls on one form thats an MDI form (Multipul Document Interface , like MS Word). and the Form thats being rendered to is a child form of the MDI form. When the child form is outiside of the MDI parent (like a popup window) it renders fine but when its inside the MDI parent it crashes on device.Present(). Does anyone know what i need to do o allow managed directX to render to the child while its inside of the parent? Thank you edit : by the way the error it gives me is an "Unknown error occured"
Advertisement
Have you read the Forum FAQ on Debugging D3D apps?
Stay Casual,KenDrunken Hyena
yes indeed I have, and tberes really no more information I can give. there isnt any code that wasnt win form generated except the intialization of the device

PresentParameters para = new PresentParameters();
para.Windowed = true;
para.SwapEffect = SwapEffect.Discard;

device = new Device(0,DeviceType.Hardware,
this,CreateFlags.SoftwareVertexProcessing,para);

and the rendering code whie is just

device.Clear(ClearFlags.Target,Color.Blue,1.0f,0);
try
{
device.Present();
}
catch(Exception x)
{
MessageBox.Show(x.Message);

}

The only error code I got which I even tried to look up with D3derr was "Unkown error" did I leave something out or do something wrong? If so let me know and Ill correct my post
has anyone out there done this before? Is there a better way to do this? I tried rendering to a picture box on the form but that didnt work either (got an error on minimize and maximize) so i tried to render to a form in a form. Anyone?

This topic is closed to new replies.

Advertisement