2 #include <boost/thread.hpp> 3 #include <boost/shared_ptr.hpp> 4 #include <boost/asio.hpp> 5 #include "util/Mutex.hpp" 6 #include "ipc_message_queue.hpp" 7 #include "InterprocessQueue.hpp" 8 #include "IParaEngineApp.h" 9 #include "InterprocessMsg.h" 10 #include "AutoUpdaterApp.h" 11 #include <boost/asio/steady_timer.hpp> 15 class CMyProcessAppThread;
16 class CCommandLineParser;
35 int Run(HINSTANCE hInst,
const char* sCmdLine);
40 int Start(
int nMinResolutionWidth = 0,
int nMinResolutionHeight = 0);
44 HWND GetMainHWnd(){
return m_hWnd;}
47 virtual bool SendHostMsg(
int nMsg, DWORD param1 = 0, DWORD param2 = 0,
const char* filename = NULL,
const char* sCode = NULL,
int nPriority = 0);
50 static LRESULT CALLBACK DefaultWinThreadWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
61 double GetElapsedAppTime();
93 CInterprocessQueue* m_ipAppQueueIn;
94 CInterprocessQueue* m_ipHostQueueOut;
97 bool m_bMainLoopExited;
108 std::string m_sRedistDir;
110 Domain_Map_t m_trusted_domains;
113 Boost_Thread_ptr_type m_win_thread;
115 DWORD m_dwWinThreadID;
118 friend class CMyProcessAppThread;
void handle_mainloop_timer(const boost::system::error_code &err)
the main loop in the main thread.
Definition: InterprocessAppClient.cpp:314
bool CheckLoad()
load ParaEngineClient.dll if not loaded before.
Definition: InterprocessAppClient.cpp:279
int Run(HINSTANCE hInst, const char *sCmdLine)
run the application using a given command line.
Definition: InterprocessAppClient.cpp:185
HRESULT StartWindowThread()
create the default win32 windows for rendering.
Definition: InterprocessAppClient.cpp:523
virtual int SetCommandLine(const char *sCmdLine)
init command line so that we can use IPC calls before calling Run() method.
Definition: InterprocessAppClient.cpp:173
void SetParentWindow(HWND hWndParent)
set the parent window
Definition: InterprocessAppClient.cpp:224
different physics engine has different winding order.
Definition: EventBinding.h:32
This is used to create an application using interprocess communication.
Definition: InterprocessAppClient.h:19
virtual bool SendHostMsg(int nMsg, DWORD param1=0, DWORD param2=0, const char *filename=NULL, const char *sCode=NULL, int nPriority=0)
sent interprocess message to the host process.
Definition: InterprocessAppClient.cpp:650
int HandleAppMsg(InterProcessMessage &msg)
return 0 if succeed, otherwise we will terminate the application.
Definition: InterprocessAppClient.cpp:53
void SetAppName(const char *appName)
set the application name
Definition: InterprocessAppClient.cpp:161
boost::asio::steady_timer m_main_timer
the main timer that ticks 30 times a second
Definition: InterprocessAppClient.h:104
a DLL/so plug-in loaded explicitly at runtime.
Definition: PluginLoader.hpp:51
This is used to create an application using interprocess communication.
Definition: AutoUpdaterApp.h:12
a table of virtual functions which are used by plug-ins to access the game engine ...
Definition: IParaEngineCore.h:17
cross platform mutex
Definition: Mutex.hpp:88
void DefaultWinThreadProc()
Definition: InterprocessAppClient.cpp:538
it represents an interprocess message
Definition: InterprocessQueue.hpp:27
void PrintGetLastError()
print the GetLastError
bool m_bAutoUpdateWhenStart
whether we will automatically update the client when receiving PEAPP_Start.
Definition: InterprocessAppClient.h:82
boost::asio::io_service m_main_io_service
the main game loop
Definition: InterprocessAppClient.h:102
void EnableAutoUpdateWhenComplete(bool bEnable)
enable auto update when complete.
Definition: InterprocessAppClient.cpp:673
a table of virtual functions which are used by plug-ins to access the game engine ...
Definition: IParaEngineApp.h:98
std::string m_app_host
the interprocess queue name for the host app.
Definition: InterprocessAppClient.h:79
std::string m_app_name
the application name is also the interprocess message queue name.
Definition: InterprocessAppClient.h:77