• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
~Helgon

Render DirectX in Windows Form

7 posts in this topic

Hi, approximately a month ago I already posted a question a little bit like this one. Back then I wanted to know what would be the best "Library/ Way of doing it" to render my DirectX Frame into a GUI. I proposed Qt, Windows Forms, wxWidgets. The feedback was pretty different. So I started to learn Qt and it seems to be a very powerful tool, but maybe a little bit to complex to learn it (with all the different Models etc. and how to implement them for everything ...). So I decided to switch back to "native" Windows Forms (As i anyway use DirectX Qt would not have any advantages because I don't need cross-platform compatibility). So I started to look for some samples how to achieve my goal. In the end I got it working with this ([url="http://www.codeproject.com/Articles/42121/DirectX-9-SDK-with-NET-Forms-C"]http://www.codeproject.com/Articles/42121/DirectX-9-SDK-with-NET-Forms-C[/url]) tutorial but I've encountered a huge problem: the interface between C++/CLI and the managed and unmanaged code is so "strange" that I almost can't use anything because it's "unmanged". Is this normal? Am I doing it wrong? Is there another way to how to solve this problem (Render into WindowsForms)? Or does someone maybe has a tutorial therefore or a sample of one of his projects? I would appreciate any help very much. Best regards

1

Share this post


Link to post
Share on other sites

I think what you are trying to do might be more difficult than its worth, if you don't mind me asking for what purpose?

Do you just want easy to use GUI buttons and stuff?

0

Share this post


Link to post
Share on other sites

I want to make a level-animation-etc. editor. To be able to have for example a tree view where I can select assets and then have them in the directX frame to place them. Or Slider to change the area of effect of an terrain-displacement tool, or when I select a entity to get the properties. Just the basic GUI you have when u start up a game editor. For example:

 

Warcr303.jpg


Do you know what I mean?

 

How would you approach the problem if not in the way i described it. Of course I could do the GUI by myself directly as elements in the DirectX frame or use Crazy Eddies , but why should it be that complicated? Maybe I just don't know the right way.

 

Regards

0

Share this post


Link to post
Share on other sites

Unless you're absolutely set on creating your own bindings to access DirectX from .NET, might I recommend either SlimDX or SharpDX?

 

http://slimdx.org/

http://code.google.com/p/sharpdx/

 

Both are managed wrappers around DirectX. SlimDX is older and supports D3D9 through D3D11; SharpDX only supports D3D10/11.  SlimDX diverges slightly from directly wrapping the DirectX spec; SharpDX is auto-generated from the headers and therefore cleaves very closely.

 

Either one of these should let you render into a .NET Windows Form with minimal effort.

1

Share this post


Link to post
Share on other sites
Oh, I totally forgot them both..
For me just SharpDX is an option because I want DX11 and it's near to the c++ version.
The only thing bugging me is that there aren't any "introduction" tutorials. Just to get a feel for how SharpDX syntax looks like but this probably is the best way because I anyway am a Java guy so it's more to my main language.

Thank you very much for the hint. As I said i totally forgot this happy.png

I already googeled some SharpDX Tutorials but if you can suggest me one I'm open for them smile.png

Thank you very much for the hint.

Edit: Just saw that there are samples in the SDK, but still open for suggestions :P Edited by ~Helgon
0

Share this post


Link to post
Share on other sites

SlimDX has a set of 3 intro tutorials on their site that will get drawing a triangle in a DirectX Context on a Windows Form.

 

When I say SlimDX diverges slightly, it is only very slightly.  IIRC, the state blocks (BlendState, RasterizerState, DepthStencilState) and some of the Desc structs have members slightly reorganized from their native cousins.  I've managed to port a fairly extensive C# graphics project from library to the other with minimal effort: other than changing the #using from SlimDX.whatever to SharpDX.whatever, and the mismatches in descs and states, almost everything behaves similarly and usually has the same name.

 

Because of that, I'll bet you could follow the SlimDX tutorials using SharpDX with some name substitution and get pretty close.  You'll find more help resources for SlimDX than SharpDX, so maybe you should consider using that.  They both support DX11, and both are good libraries.

1

Share this post


Link to post
Share on other sites

You do not need to create any binding for DirectX if you are doing everything in C++/Cli. To Render to an Form all you need to do is convert Form Handle to an HWND and pass that as your window handle. Then all your rendering will take place on the form. I did that for one of my editor and works perfectly. Do not listen to the comments that the people above are saying. I just hate when someone has no idea about something, yet they still post an answer.

Edited by BornToCode
0

Share this post


Link to post
Share on other sites

Hi, thanks for your suggestion. It would be great if just this was my whole problem. I gonna give it later today a shot and reply if it works or not.

 

Regards

0

Share this post


Link to post
Share on other sites

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  
Followers 0