473,322 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Managed GUI for DirectX C++ Game Engine?

Hi,

A friend of mine is in the process of building a 3d game engine using
native DirectX in C++. I would like to contribute to the development of
an editor for this engine, but I would prefer to develop it in C#. We've
discussed the possibility of creating a COM-based interface to the
engine that the editor could use from C#, and I think that would work
well for most tasks.

However, I'm not quite sure how I would go about developing a WinForms
GUI that would include the engine as a native DirectX control. Could
anyone offer some advice on this? We would like to keep the low level
details of rendering, culling strategies, scene graph composition, etc.
in the actual engine, and have the editor simply drive the engine with
high level commands. Any thoughts?

Thanks,
John
Dec 22 '05 #1
3 6255
John,

There are two ways I can think of making this happen. The first is to
expose the engine as an ActiveX control, and then add a reference to it in
your project, creating an ActiveX host and interop wrapper.

The second way is to create a managed wrapper, which exposes a managed
interface which you can just use natively in .NET code.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"John Hann" <jo******@yahoo.com> wrote in message
news:I8********************@comcast.com...
Hi,

A friend of mine is in the process of building a 3d game engine using
native DirectX in C++. I would like to contribute to the development of an
editor for this engine, but I would prefer to develop it in C#. We've
discussed the possibility of creating a COM-based interface to the engine
that the editor could use from C#, and I think that would work well for
most tasks.

However, I'm not quite sure how I would go about developing a WinForms GUI
that would include the engine as a native DirectX control. Could anyone
offer some advice on this? We would like to keep the low level details of
rendering, culling strategies, scene graph composition, etc. in the actual
engine, and have the editor simply drive the engine with high level
commands. Any thoughts?

Thanks,
John

Dec 24 '05 #2
Nicholas,

Thank you for your input, it definitely helps. With the ActiveX/COM
approach, I think you get everything except the ability to display the
output of the engine in the C# interface. I don't know how a C# app
would host an ActiveX control that is rendering to a native DirectX
Surface. Do you know of any techniques for presenting legacy custom VB
controls (say, an editable dataview) in a C# UI? If there are any, I
would think that the integration points would be similar.

One possibility I've considered is implementing a method in the C# GUI
that the engine could call whenever it completes the rendering of a
frame. This could be implemented in a COM-callable wrapper. If the
engine can render to standard memory buffer, that buffer could be passed
to the GUI for rendering via Managed DirectX. I think this *could* work,
but isn't exactly elegant.

Another approach would be to get the C++ engine to write to directly to
a Managed DirectX device declared in the C# UI. I think that Managed
DirectX is simply a C# abstraction layer that interfaces with the native
APIs. If that is true, one would think that you could get a reference to
the native DirectX device and expose it though COM. Your thoughts?

Nicholas Paldino [.NET/C# MVP] wrote:
John,

There are two ways I can think of making this happen. The first is to
expose the engine as an ActiveX control, and then add a reference to it in
your project, creating an ActiveX host and interop wrapper.

The second way is to create a managed wrapper, which exposes a managed
interface which you can just use natively in .NET code.

Hope this helps.

Dec 24 '05 #3
John,

Actually, you don't need C#/.NET to do anything. Why not just create an
ActiveX control (which has its own rendering surface) which is a layer on
top of your engine? Then, you import this ActiveX control into your
project, and it will just work.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"John Hann" <jo******@yahoo.com> wrote in message
news:tL********************@comcast.com...
Nicholas,

Thank you for your input, it definitely helps. With the ActiveX/COM
approach, I think you get everything except the ability to display the
output of the engine in the C# interface. I don't know how a C# app would
host an ActiveX control that is rendering to a native DirectX Surface. Do
you know of any techniques for presenting legacy custom VB controls (say,
an editable dataview) in a C# UI? If there are any, I would think that the
integration points would be similar.

One possibility I've considered is implementing a method in the C# GUI
that the engine could call whenever it completes the rendering of a frame.
This could be implemented in a COM-callable wrapper. If the engine can
render to standard memory buffer, that buffer could be passed to the GUI
for rendering via Managed DirectX. I think this *could* work, but isn't
exactly elegant.

Another approach would be to get the C++ engine to write to directly to a
Managed DirectX device declared in the C# UI. I think that Managed DirectX
is simply a C# abstraction layer that interfaces with the native APIs. If
that is true, one would think that you could get a reference to the native
DirectX device and expose it though COM. Your thoughts?

Nicholas Paldino [.NET/C# MVP] wrote:
John,

There are two ways I can think of making this happen. The first is
to expose the engine as an ActiveX control, and then add a reference to
it in your project, creating an ActiveX host and interop wrapper.

The second way is to create a managed wrapper, which exposes a
managed interface which you can just use natively in .NET code.

Hope this helps.


Dec 27 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom | last post by:
The Microsoft update page scans my computer which has Windos XP Home Edition. The website recommends installing both DirectX 9.0A end-user runtime and Managed DirectX. The problem is I have...
1
by: Peter | last post by:
Hi, I'm considering to make my own little 3D game using C++ / DirectX. Problem is that I need to create some tools for that, and I need an editor with lots of buttons and controls. I bought a...
2
by: Michael Mayer | last post by:
First of all, sorry for the cross-post. Seems like there should be a managed directx newsgroup. I'm trying to open the following sample application that comes with the DirectX SDK....
1
by: Bleedledeep | last post by:
I am new to C#/.NET/DirectX, and could not find a simple example of how to read the X/Y location of the joystick. < YIKES!!! The DirectX.DirectInput is one serious pile of API! > After some...
0
by: wraith | last post by:
Hi to all, I would just like to ask a simple question... Could Managed DirectX 9 (SDK Summer 2004) be used in MVC++ 2003? I ask this question coz, I get an error when using Managed DirectX in...
12
by: Greg | last post by:
For all new desktop apps is managed/CLR recommended? I.e. Native MFC/Win32 not recommended in general for new desktop apps? Speaking in general, not referring to exceptions (e.g. drivers) -- Greg...
0
by: res7cxbi | last post by:
Hi, I took a look and followed the Game Development Tutorials by Derek on Coding4Fun and found them to be (in my opinion) the best beginning game development tutorials ever made on the face of...
3
by: Robert Hooker | last post by:
Does anyone have any information on when MDX2.0 will come out of Beta? It seems like its been in Beta for a looong time... Rob
11
by: raylopez99 | last post by:
I just downloaded the apparently free SDK for DirectX 9, all 200+ MB of it, but as I read about WPF I wonder: is DirectX obsolete? Should I even bother learning how to use it? After all, the end...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.