Rendering in an MDI interface
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"
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement