9 #include "baseinterface.h" 12 struct IDirect3DDevice9;
13 struct IDirect3DSwapChain9;
21 #define WM_USER 0x0400 44 PEAppState_Device_Created,
45 PEAppState_Device_Error,
47 PEAppState_SwitchedOut,
58 PE_USAGE_STANDALONE = 1,
60 PE_USAGE_WEB_BROWSER = 2,
64 PE_USAGE_OWN_D3D = 16,
66 PE_USAGE_OWN_WINDOW = 32,
70 #define PE_WM_FIRST WM_USER+2301 72 #define PE_WM_SHOWCURSOR WM_USER+2301 74 #define PE_WM_QUIT WM_USER+2302 76 #define PE_WM_SETCAPTURE WM_USER+2303 78 #define PE_WM_RELEASECAPTURE WM_USER+2304 80 #define PE_WM_SETFOCUS WM_USER+2305 82 #define PE_IME_SETOPENSTATUS WM_USER+2306 84 #define PE_IME_SETFOCUS WM_USER+2307 86 #define PE_APP_SWITCH WM_USER+2308 88 #define PE_APP_SHOW_ERROR_MSG WM_USER+2309 90 #define PE_WM_LAST WM_USER+2399 93 #define PE_TIMERID_HEARTBEAT 5602 105 virtual HRESULT StartApp(
const char* sCommandLine = 0) = 0;
109 virtual HRESULT StopApp() = 0;
117 virtual void SetMainWindow(HWND hWnd,
bool bIsExternalWindow=
true) = 0;
118 virtual HWND GetMainWindow() = 0;
121 virtual int Run(HINSTANCE hInstance) = 0;
126 virtual HRESULT DoWork() = 0;
131 virtual HRESULT CreateFromD3D9Device(IDirect3DDevice9* pD3dDevice, IDirect3DSwapChain9* apSwapChain) = 0;
140 virtual HRESULT InitDeviceObjects() = 0;
149 virtual HRESULT RestoreDeviceObjects() = 0;
158 virtual HRESULT InvalidateDeviceObjects() = 0;
165 virtual HRESULT DeleteDeviceObjects() = 0;
170 virtual HRESULT Create( HINSTANCE hInstance = 0 ) = 0;
173 virtual HRESULT Init(HWND* pHWND = 0) = 0;
180 virtual HRESULT Render3DEnvironment(
bool bForceRender =
false) = 0;
187 virtual LRESULT MsgProcWinThread( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
bool bCallDefProcedure =
true) = 0;
190 virtual LRESULT MsgProcWinThreadCustom( UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
195 virtual LRESULT SendMessageToApp( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
198 virtual bool PostWinThreadMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
205 virtual bool GetMessageFromApp(
CWinRawMsg* pMsg) = 0;
210 virtual LRESULT MsgProcApp(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
213 virtual void EnablePassiveRendering(
bool bEnable ) = 0;
216 virtual bool IsPassiveRenderingEnabled( ) = 0;
222 virtual void Enable3DRendering(
bool bEnable) = 0;
226 virtual bool Is3DRenderingEnabled() = 0;
230 virtual void SetFullScreenMode(
bool bFullscreen) = 0;
231 virtual bool IsFullScreenMode() = 0;
235 virtual void BringWindowToTop() = 0;
240 virtual void SetAllowWindowClosing(
bool bAllowClosing) = 0;
241 virtual bool IsWindowClosingAllowed() = 0;
244 virtual void ShowMenu(
bool bShow) = 0;
247 virtual void GetResolution(
float* pX,
float* pY) = 0;
248 virtual void SetResolution(
float x,
float y) = 0;
251 virtual int GetMultiSampleType() = 0;
252 virtual void SetMultiSampleType(
int nType) = 0;
255 virtual int GetMultiSampleQuality() = 0;
256 virtual void SetMultiSampleQuality(
int nType) = 0;
259 virtual bool UpdateScreenMode() = 0;
263 virtual bool SetWindowedMode(
bool bWindowed) = 0;
265 virtual bool IsWindowedMode() = 0;
267 virtual void SetWindowText(
const char* pChar) = 0;
269 virtual const char* GetWindowText() = 0;
276 virtual void GetCursorPosition(
int* pX,
int * pY,
bool bInBackbuffer =
true) = 0;
283 virtual void GameToClient(
int& inout_x,
int & inout_y,
bool bInBackbuffer =
true) = 0;
290 virtual void ClientToGame(
int& inout_x,
int & inout_y,
bool bInBackbuffer =
true) = 0;
296 virtual void WriteConfigFile(
const char* sFileName) = 0;
299 virtual bool HasNewConfig() = 0;
302 virtual void SetHasNewConfig(
bool bHasNewConfig) = 0;
306 virtual void SetIgnoreWindowSizeChange(
bool bIgnoreSizeChange) = 0;
309 virtual bool GetIgnoreWindowSizeChange() = 0;
312 virtual HINSTANCE GetModuleHandle() = 0;
320 virtual void SetRefreshTimer(
float fTimeInterval,
int nFrameRateControl=0) = 0;
324 virtual float GetRefreshTimer() = 0;
327 virtual void GetWindowCreationSize(
int * pWidth,
int * pHeight) = 0;
338 virtual void ActivateApp(
bool bActivate) = 0;
341 virtual bool IsAppActive() = 0;
347 virtual DWORD GetCoreUsage() = 0;
353 virtual void SetCoreUsage(DWORD dwUsage) = 0;
363 virtual void SetMinUIResolution(
int nWidth,
int nHeight,
bool bAutoUIScaling =
true) = 0;
369 virtual void Exit(
int nReturnCode = 0) = 0;
374 virtual void SetReturnCode(
int nReturnCode) = 0;
375 virtual int GetReturnCode() = 0;
381 virtual bool IsTouchInputting() = 0;
383 virtual bool IsSlateMode() = 0;
386 virtual int32 GetTouchPointX() = 0;
387 virtual int32 GetTouchPointY() = 0;
390 virtual void WriteToLog(
const char* sFormat, ...) = 0;
393 virtual void AppLog(
const char* sMessage) { WriteToLog(sMessage); };
421 virtual void SetScreenResolution(
const Vector2& vSize){};
423 virtual float GetFPS() {
return 30.f; };
438 virtual void SetHasClosingRequest(
bool val) {};
446 virtual bool LoadNPLPackage(
const char* sFilePath, std::string * pOutMainFile = NULL) {
return false; };
456 virtual void FixWindowSize(
bool fixed) = 0;
virtual bool HasClosingRequest()
whether there is closing request in the message queue.
Definition: IParaEngineApp.h:437
define this to enable debugging of NPL code in visual studio
Definition: INPL.h:9
The base class for interfaces in ParaEngine.
Definition: baseinterface.h:29
virtual CRefCounted * AddToSingletonReleasePool(CRefCounted *pObject)
we will automatically release singleton object when app stops, in the verse order when object is adde...
Definition: IParaEngineApp.h:428
virtual bool IsServerMode()
server mode has no user interface
Definition: IParaEngineApp.h:431
different physics engine has different winding order.
Definition: EventBinding.h:32
virtual void GetScreenResolution(Vector2 *pOut)
change the full screen mode, it does not immediately change the device, call UpdateScreenMode() to up...
Definition: IParaEngineApp.h:419
virtual bool LoadNPLPackage(const char *sFilePath, std::string *pOutMainFile=NULL)
load NPL package from a disk folder.
Definition: IParaEngineApp.h:446
virtual const char * GetModuleDir()
get the NPL bin directory (main executable directory).
Definition: IParaEngineApp.h:453
Standard 2-dimensional vector.
Definition: ParaVector2.h:16
virtual void AppLog(const char *sMessage)
write app log to file with time and code location.
Definition: IParaEngineApp.h:393
raw win32 message
Definition: OSWindows.h:27
virtual const char * GetAppCommandLineByParam(const char *pParam, const char *defaultValue)
return a specified parameter value in the command line of the application.
Definition: IParaEngineApp.h:412
virtual void SetAppCommandLine(const char *pCommandLine)
set string specifying the command line for the application, excluding the program name...
Definition: IParaEngineApp.h:405
PE_USAGE
how ParaEngine core is used.
Definition: IParaEngineApp.h:55
PEAppState
ParaEngine application state.
Definition: IParaEngineApp.h:40
virtual void SystemMessageBox(const std::string &msg)
show a system message box to the user.
Definition: IParaEngineApp.h:399
a table of virtual functions which are used by plug-ins to access the game engine ...
Definition: IParaEngineApp.h:98
virtual const char * GetAppCommandLine()
get string specifying the command line for the application, excluding the program name...
Definition: IParaEngineApp.h:415
virtual void SetTouchInputting(bool bTouchInputting)
whether the last mouse input is from touch or mouse.
Definition: IParaEngineApp.h:396
virtual bool ForceRender()
render the current frame and does not return until everything is presented to screen.
Definition: IParaEngineApp.h:450
NPL Runtime Environment interface.
Definition: INPLRuntime.h:30