Sign in to follow this  

Embedding Direct3D 9 into a winform

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

Hey GameDev

I'm creating a tile based 2D RPG and I've come to the stage where I need to create a world editor.

I don't know a great deal of programming windows or buttons and stuff so I'm looking to use Direct3D 9 in conjunction with a WinForm.

I need to be able to have a Direct3D window take up some of the WinForm, but still have space left over for my buttons or droplists.

Does anyone know a tutorial or could explain to me how I'd be able to do this? Embed a Direct3D 9 window into a winform...

If there is an easier/better way I'm all ears [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img] Thanks GameDev Edited by littletray26

Share this post


Link to post
Share on other sites
It can be done, but you need to create a client area within your window specifically reserved for D3D and use its handle ([i]not[/i] the form handle) in D3D calls. Otherwise DirectX will indiscriminately draw all over your components and it'll be a mess. What is your language? C#? It might have a "canvas" component you can use... at least I could do that in D3D11. Don't know about D3D9.

Share this post


Link to post
Share on other sites
[quote name='Bacterius' timestamp='1351332731' post='4994382']
It can be done, but you need to create a client area within your window specifically reserved for D3D and use its handle ([i]not[/i] the form handle) in D3D calls. Otherwise DirectX will indiscriminately draw all over your components and it'll be a mess. What is your language? C#? It might have a "canvas" component you can use... at least I could do that in D3D11. Don't know about D3D9.
[/quote]

My language is C++.

How would I go about reserving a space in the form and getting it's handle?

Share this post


Link to post
Share on other sites

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