Jump to content
  • Advertisement
Sign in to follow this  
BlackGhost

[.net] Embedding C++ engine to C# level editor

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

Hi, I'm trying to embed an "in-engine" test feature in my C# level editor. I want the game's engine (written in C++) to start running the level in a .NET window, so I create a new process that executes the game and pass the level file and the HANDLE to the window I want to render to as parameters. The problem is, the game's engine will receive no kind of input messages (e.g. keystrokes, mouse) from that window. Can someone who knows the workings of .NET forms offer any assistance as to why that happens? Is there a way to pass the window messages to the process running the game, so that I can actually play my level in the .NET window? Thanks for any replies.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I think you could overide the WndProc method in your form. Then you can process the necessary messages and pass them to your game. Another alternative would be to do away with those messages in your engine and just use directinput.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Then you can process the necessary messages and pass them to your game.


The problem is: how do I do that? If I use the Win32 SendMessage function using P/Invoke to send the message to the game engine's process HWND (processs.MainWindowHandle property), I end up re-processing the same message in my .NET application because that HWND is the same handle to my .NET window.

(I don't know if directinput would work around this problem, and I don't care actually. I want to gain an understanding on this particular problem more than I want to make it work).

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!