Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

webbsk

Windows Forms & DirectX

This topic is 5213 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

I''m trying to render DirectX in an a panel of a form. My problem is that all I can ever accomplish is rendering DirectX to the entire form. I''d like to be able to add some other controls to control my rendering and I''d like to put them on the form. But I can''t even get a toolbar to remain visible after I make the call show the DirectX. Does anyone know a solution to this or know where I could find one? I''m using C#, but I''ll take a solution written in VB or managed C++ too. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Using Delphi I''ve succesfully rendered in a panel by passing its hwnd to the createdevice call.
I am sure it must be possible in managed DirectX as well. The constructor takes a Control as the third parameter, so if you cast it it should work.

mydevice = new Device(0, DeviceType.Hardware, (mypanel as Control), CreateFlags.SoftwareVertexProcessing, presentParams);

Share this post


Link to post
Share on other sites
Create a control which has a DirectX device, etc, and can be embedded in other controls.

Share this post


Link to post
Share on other sites
Maybe I should elaborate. I'm trying to use a lot of the sample code that comes with the SDK (e.g. d3dapp.cs, D3DMesh.cs, DXUtil) because I'm trying to use DirectInput for keyboard input but use form events for mouse input. The problem is that all this code is geared toward using the entire form. I'm refering to the "Scrawl" application. In D3DMesh.cs, they inherit from a GraphicsSample class to define a GraphicsClass class. The GraphicsSample class is defined in d3dapp.cs and it inherits from System.Windows.Forms.Form. So the entire set of files is all based on rendering to an entire window. But I'm looking for an example that implements all those features as a panel so that I don't have to rewrite all the other files (e.g. dinput.cs, d3denumeration.cs, d3dfont.cs, etc.) Has anyone found this on the web anywhere? Because all my searches are turning up nothing. d3dapp.cs in particular is a huge and very complex file and would be hard to duplicate.

[edited by - webbsk on May 10, 2004 11:27:33 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
the owner of the device must be a control like a picturebox and not a form.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!