Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Embedding Direct3D 9 into a winform


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 littletray26   Members   -  Reputation: 267

Like
0Likes
Like

Posted 27 October 2012 - 01:31 AM

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 Posted Image Thanks GameDev

Edited by littletray26, 27 October 2012 - 01:32 AM.

The majority of Internet Explorer users don't understand the concept of a browsing application, or that there are options.
They just see the big blue 'e' and think "Internet". The thought process usually does not get much deeper than that.

Worms are the weirdest and nicest creatures, and will one day prove themselves to the world.

I love the word Clicky :)

Sponsor:

#2 Bacterius   Crossbones+   -  Reputation: 10843

Like
0Likes
Like

Posted 27 October 2012 - 04:12 AM

It can be done, but you need to create a client area within your window specifically reserved for D3D and use its handle (not 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.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”


#3 littletray26   Members   -  Reputation: 267

Like
0Likes
Like

Posted 27 October 2012 - 10:04 AM

It can be done, but you need to create a client area within your window specifically reserved for D3D and use its handle (not 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.


My language is C++.

How would I go about reserving a space in the form and getting it's handle?
The majority of Internet Explorer users don't understand the concept of a browsing application, or that there are options.
They just see the big blue 'e' and think "Internet". The thought process usually does not get much deeper than that.

Worms are the weirdest and nicest creatures, and will one day prove themselves to the world.

I love the word Clicky :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS