Jump to content
  • Advertisement
Sign in to follow this  
_Flecko

DX in a Form or Control

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

Are there any advantages or disadvantages to putting DirectX in a windows form vs. in a user control?

Share this post


Link to post
Share on other sites
Advertisement
I've never tried it, but instinct tells me that it would be easier/smoother in a Form (are you talking MDX?)..

Depending upon the control, it might inherit too much "overhead" depending upon what you're subclassing from..

you may also want to google Tom Miller's blog..I think they're going back and forth in optimizing the rendering loop under MDX to reduce as much overhead as possible, so it's definitely worth a read to get it into your own MDX code.

hth,

Share this post


Link to post
Share on other sites
It's trivial to put the code in a user control, I copied from my window code and changed three or four lines. I subclass System.Windows.Forms.UserControls. Tom Miller's latest render loop works for both.

The reason I asked is that right now I'm developing two apps that share a lot of code, a game and a level editor, but while for the game the DX rendering area takes up either the whole window or the whole screen, the editor is a mixture of a WYSIWYG DX view and a bunch of editing controls. It would be easier to maintain the project if I could do the game by just stretching my DX control across a windows form since then I'd only have one class to maintain, but I don't want to do it if it affects DX's capabilities or slows it down.

Share this post


Link to post
Share on other sites
Sounds plausible.

Maybe try designing the codebase to follow an MVC design. Then you'd simply need to define 2 Views of your data: 1 for the actual game, the other for the editor...

hth,

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!