Sign in to follow this  

Rendering in an MDI interface

This topic is 4663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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"

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

This topic is 4663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this