My Project
D3DWindowDefault.h
1 #pragma once
2 
3 #include "util/mutex.h"
4 #include <boost/thread.hpp>
5 #include <boost/shared_ptr.hpp>
6 #include <boost/asio.hpp>
7 #include <boost/date_time/posix_time/posix_time_types.hpp>
8 #include <boost/asio/steady_timer.hpp>
9 
10 #include "IParaEngineApp.h"
11 
12 namespace ParaEngine
13 {
26  {
27  public:
29 
31  virtual ~CD3DWindowDefault(){}
32 
33  public:
37  HRESULT StartWindowThread(HINSTANCE hInstance);
38  void DefaultWinThreadProc(HINSTANCE hInstance);
39  void handle_mainloop_timer(const boost::system::error_code& err);
40 
41  int Run(HINSTANCE hInstance);
42 
43  void SetAppInterface(IParaEngineApp* pApp) {m_pApp = pApp;};
44  IParaEngineApp* GetAppInterface(){return m_pApp;}
45 
51  int CalculateRenderTime(double fIdealInterval, double* pNextInterval);
52 
53  private:
54  bool m_bQuit;
55  IParaEngineApp* m_pApp;
56 
57  // the default window thread ptr.
58  Boost_Thread_ptr_type m_win_thread;
59  ParaEngine::mutex m_win_thread_mutex;
60 
61  bool m_bMainLoopExited;
62 
64  boost::asio::io_service m_main_io_service;
66  boost::asio::steady_timer m_main_timer;
67  // main render window hWnd.
68  HWND m_hWnd;
69  };
70 }
HRESULT StartWindowThread(HINSTANCE hInstance)
create the default win32 windows for rendering.
Definition: D3DWindowDefault.cpp:147
different physics engine has different winding order.
Definition: EventBinding.h:32
int CalculateRenderTime(double fIdealInterval, double *pNextInterval)
return true if this is a render tick, otherwise false.
Definition: D3DWindowDefault.cpp:161
a table of virtual functions which are used by plug-ins to access the game engine ...
Definition: IParaEngineApp.h:98
cross platform mutex
Definition: mutex.h:95
The default ParaEngine Window.
Definition: D3DWindowDefault.h:25