About Store Forum Documentation Contact



Post Reply 
Embedding an Esenthel render window into large industrial application
Author Message
flcpy Offline
Member

Post: #1
Embedding an Esenthel render window into large industrial application
Hi,

I'm trying to display the content of your engine in a simple Win32 window. (I think your engine can be used for industrial applications, so your engine needs to be imported and embeded into a main window, such as mdi, win32, winform or wpf...)

Is there a way that the esenthel engine can use an external windows handle ? (maybe with StartEEManually and EEApplication::hwnd ())

best regards,
fabrice.
01-21-2010 10:06 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Embedding an Esenthel render window into large industrial application
Hello,

This is currently not supported.

The easier way is to use built-in Gui Controls inside the engine, just like World Editor or any other tools work.
01-21-2010 10:48 PM
Find all posts by this user Quote this message in a reply
flcpy Offline
Member

Post: #3
RE: Embedding an Esenthel render window into large industrial application
First solution to this problem is using simple Win32 sdk calls :

1) create a parent window (using createwindow(...))
2) change the parent of the EE window with the following :

HWND hWnd = (HWnd) App.hwnd();
// EE is now a child window
SetWindowLong(hWnd,GWL_EXSTYLE,WS_EX_LEFT);
SetWindowLong(hWnd,GWL_STYLE,WS_CHILD|WS_VISIBLE);
// EE have a parent
SetParent(hWnd,window._hwnd);
SetWindowPos(hWnd,HWND_TOP,0,0,640,480,SWP_SHOWWINDOW);

3) Detach mouse :
App.flag=APP_NO_CAPTION|APP_NO_CLOSE|APP_MINIMIZABLE|APP_RESIZABLE|APP_WORK_IN_B​ACKGROUND;

4) needs some hooks (threading, keyboard, etc.)

I give you the c++ file (which is just for testing purpose) from your modified tutorial of EE :
08 - Custom Parameters.cpp
windowlong.cpp


best regards,
fabrice.


Attached File(s) Image(s)
   
(This post was last modified: 01-22-2010 12:13 AM by flcpy.)
01-22-2010 12:12 AM
Find all posts by this user Quote this message in a reply
flcpy Offline
Member

Post: #4
RE: Embedding an Esenthel render window into large industrial application
In WPF now


Attached File(s) Image(s)
   
01-22-2010 12:54 PM
Find all posts by this user Quote this message in a reply
mih Offline
Member

Post: #5
RE: Embedding an Esenthel render window into large industrial application
didn't know that It's possible ;D Nice work !wink
01-22-2010 02:05 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #6
RE: Embedding an Esenthel render window into large industrial application
I know its a old thread but... Is here someone that has managed to get this beyond a simple window? Im currently working on a tool for my game and i really like to use the standard Windows UI to support it. I tried the method described here above but not very successful since i never tried this before and the access limitation of the win parameters in the engine doesn't make it easier either.

I appreciate if someone likes to help or join me for a little project to get this working smile


Thnx,
~Dynad

There is always evil somewhere, you just have to look for it properly.
05-12-2011 06:09 PM
Visit this user's website Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #7
RE: Embedding an Esenthel render window into large industrial application
there is no real solution. all you can do is use this hack, its not a real deal tho.. just esenthel window following another window and being drawn on top of it.. not inside. it works, but has some drawbacks. if you do not plan to draw controls over esenthel-rendered area then you should be fine. i assume full screen mode wont be required (as it crashes in this case). I cant remember if i had any problems with window resizing.. you should test it.
(This post was last modified: 05-12-2011 07:19 PM by rndbit.)
05-12-2011 07:18 PM
Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #8
RE: Embedding an Esenthel render window into large industrial application
I'm writing editor too wink I use .NET Windows Forms C# for that. Now it's only LUA Code editor, but I want to render game world there (just for getting world position in realtime, i was thinking about inserting some objects (OBJ_TRIGGER), but I can do it in my lua script).
I think example above should work. It gets handle from Esenthel...
You can try with ShowWindow(hWnd), and then StartEEManually() from Game DLL tutorial.
I'm really not sure, i will try do it this week
05-12-2011 07:27 PM
Find all posts by this user Quote this message in a reply
flcpy Offline
Member

Post: #9
RE: Embedding an Esenthel render window into large industrial application
Hello dynad,

I'am the guy who wrote this code (wpf with Esenthel).
How can i help you ?
05-12-2011 07:46 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #10
RE: Embedding an Esenthel render window into large industrial application
Hey,

Did you add more functionality to this project? Can you draw multiple renders on a win32 window? Im currently busy with my own tool and i don't want to use the standard EE Gui for it. So if you have something that can help me out would be cool wink

There is always evil somewhere, you just have to look for it properly.
05-12-2011 07:50 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #11
RE: Embedding an Esenthel render window into large industrial application
You could try using one of the GUI libraries listed in this thread.
05-12-2011 08:31 PM
Find all posts by this user Quote this message in a reply
flcpy Offline
Member

Post: #12
RE: Embedding an Esenthel render window into large industrial application
I gave Esenthel a long time ago. I just wrote the code to test the integration in wpf.
what do you mean by drawing multiple renders on a win32 window?
If i remember that correctly, Esenthel works on its own thread (using StartEEManually) and we use setParent to change its parent's window to our HwndHost ( http://msdn.microsoft.com/fr-fr/library/...dhost.aspx )
Now, Esenthel is a simple control like any other and you can use the power of WPF for your interface.

Note that you need to check the problem of airspace issue ( http://msdn.microsoft.com/en-us/library/aa970688.aspx ).


I give you the source but i have removed my version of Esenthel so i can't re-test this app now.
But the source are very simple, please, follow this path :

1----------------------------------------------------------------------------
PROJECT: WpfApplication1
Method : MainWindow.xaml.cs/MainWindow_Loaded
Find Win32 HINstance and call _engine.Init(....)
2-----------------------------------------------------------------------------
PROJECT: NetDCCore.Client.D3DEngine
Method :D3DEngine.cpp/D3DEngine::Init
call StartEEManually((Ptr)dll_module_instance);
This is an Esenthel init function which runs the InitPre/Init and shut functions
3-----------------------------------------------------------------------------
PROJECT: NetDCCore.Client.D3DEngine
Method :Engine.cpp/Init
call TransFormToChild( App.hwnd(),mHwndMain);
which encaspluate the main EE window in the given child window which is a WPF HWndHost.


void TransFormToChild(void *Ptr,void *Parent)
{

HWND hWnd = (HWND) Ptr;
HWND hWndParent = (HWND) Parent;
SetWindowLong(hWnd,GWL_EXSTYLE,WS_EX_LEFT|WS_EX_NOPARENTNOTIFY);
SetWindowLong(hWnd,GWL_STYLE,WS_CHILD|WS_VISIBLE);
SetParent(hWnd,hWndParent);
//SetWindowPos(hWnd,HWND_TOP,0,0,640,480,SWP_SHOWWINDOW);
}


End.
-----------------------------------------------------

Hope this help you.

Note: this source is for testing purpose only.


Attached File(s)
.rar  NetDCCore.Client.D3DEngine.rar (Size: 66.1 KB / Downloads: 33)
(This post was last modified: 05-12-2011 09:15 PM by flcpy.)
05-12-2011 09:10 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #13
RE: Embedding an Esenthel render window into large industrial application
Thanks for the help!, ok i fixed all the problems from the c++ build.. with the latest ee sdk. But i have 1 error left inside the Wpf app... it doesnt know "using Win32;". Do i need to install more beside the VB/C# package of VS?

There is always evil somewhere, you just have to look for it properly.
(This post was last modified: 05-12-2011 11:35 PM by Dynad.)
05-12-2011 10:40 PM
Visit this user's website Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #14
RE: Embedding an Esenthel render window into large industrial application
Does this allow mouse/keyboard input within the EE window?
05-13-2011 12:05 AM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #15
RE: Embedding an Esenthel render window into large industrial application
Ok, i got it working now.. works pretty good grin

Thanks again! smile

There is always evil somewhere, you just have to look for it properly.
05-13-2011 04:16 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply