My Project
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ParaEngine::ParaEngineSettings Class Reference

global settings for ParaEngine. More...

#include <ParaEngineSettings.h>

Inheritance diagram for ParaEngine::ParaEngineSettings:
ParaEngine::IAttributeFields ParaEngine::IObject ParaEngine::CRefCounted

Public Member Functions

virtual int GetAttributeClassID ()
 attribute class ID should be identical, unless one knows how overriding rules work. More...
 
virtual const char * GetAttributeClassName ()
 a static string, describing the attribute class object's name
 
virtual const char * GetAttributeClassDescription ()
 a static string, describing the attribute class object
 
virtual int InstallFields (CAttributeClass *pClass, bool bOverride)
 this class should be implemented if one wants to add new attribute. More...
 
virtual IAttributeFieldsGetChildAttributeObject (const std::string &sName)
 get attribute by child object. More...
 
virtual int GetChildAttributeObjectCount (int nColumnIndex=0)
 get the number of child objects (row count) in the given column. More...
 
virtual int GetChildAttributeColumnCount ()
 we support multi-dimensional child object. More...
 
virtual IAttributeFieldsGetChildAttributeObject (int nRowIndex, int nColumnIndex=0)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetScriptEditor_s, const char **)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetScriptEditor_s, const char *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetCtorColor_s, Vector3 *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetCtorColor_s, Vector3)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetCtorHeight_s, float *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetCtorHeight_s, float)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetCtorSpeed_s, float *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetCtorSpeed_s, float)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetSelectionColor_s, Vector3 *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetSelectionColor_s, Vector3)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsDebugging_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsTouchInputting_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsSlateMode_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsServerMode_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsEditing_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetEditingMode_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetLockWindowSize_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsShowWindowTitleBar_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetShowWindowTitleBar_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetGameEffectSet_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, LoadGameEffectSet_s, int)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetTextureLOD_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetTextureLOD_s, int)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetLocale_s, const char **)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetLocale_s, const char *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetCurrentLanguage_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetMouseInverse_s1, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetMouseInverse_s1, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetIgnoreWindowSizeChange_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetIgnoreWindowSizeChange_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetWindowText1_s, const char **)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetWindowText1_s, const char *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsWindowClosingAllowed_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetAllowWindowClosing_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, HasClosingRequest_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetHasClosingRequest_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsFullScreenMode_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetFullScreenMode_s, bool)
 
 ATTRIBUTE_METHOD (ParaEngineSettings, BringWindowToTop_s)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, HasNewConfig_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetHasNewConfig_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetScreenResolution_s, Vector2 *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetScreenResolution_s, Vector2)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetMultiSampleType_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetMultiSampleType_s, int)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetMultiSampleQuality_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetMultiSampleQuality_s, int)
 
 ATTRIBUTE_METHOD (ParaEngineSettings, UpdateScreenMode_s)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetShowMenu_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsProfilingEnabled_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, EnableProfiling_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, Is3DRenderingEnabled_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, Enable3DRendering_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetAsyncLoaderItemsLeft_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetAsyncLoaderBytesReceived_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetAsyncLoaderRemainingBytes_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetVertexShaderVersion_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetPixelShaderVersion_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetRefreshTimer_s, float *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetRefreshTimer_s, float)
 
 ATTRIBUTE_METHOD (ParaEngineSettings, AllocConsole_s)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetConsoleTextAttribute_s, int)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetAppCount_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetCoreUsage_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetCoreUsage_s, int)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetProcessId_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetSystemInfoString_s, const char **)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetMaxMacAddress_s, const char **)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetMaxIPAddress_s, const char **)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetAutoLowerFrameRateWhenNotFocused_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetAutoLowerFrameRateWhenNotFocused_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetToggleSoundWhenNotFocused_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetToggleSoundWhenNotFocused_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, Is32bitsTextureEnabled_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, Enable32bitsTexture_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetAppHasFocus_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetAppHasFocus_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsMouseCaptured_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetCaptureMouse_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsSandboxMode_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetSandboxMode_s, bool)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetDisplayMode_s, const char **)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetMonitorResolution_s, Vector2 *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetWindowResolution_s, Vector2 *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetDefaultOpenFileFolder_s, const char *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetOpenFolder_s, const char **)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetIcon_s, const char *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetPlatform_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsMobilePlatform_s, bool *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, Is64BitsSystem_s, bool *)
 
 ATTRIBUTE_METHOD (ParaEngineSettings, RecreateRenderer_s)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetFPS_s, float *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetDrawCallCount_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetTriangleCount_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetPeakMemoryUse_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetCurrentMemoryUse_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetVertexBufferPoolTotalBytes_s, int *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetWritablePath_s, const char **)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetWritablePath_s, const char *)
 
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetAppHWND_s, double *)
 
void SetScriptEditor (const string &sEditorFilePath)
 set the default script editor file path for ParaEngine.The windows notepad.exe is used if not specified. More...
 
const string & GetScriptEditor ()
 Get the default script editor for ParaEngine. More...
 
void SetDefaultOpenFileFolder (const char *sDefaultOpenFileFolder)
 the default open file folder. More...
 
const char * GetOpenFolder ()
 display a dialog to let the user select a folder. More...
 
void RecreateRenderer ()
 
LinearColor GetCtorColor ()
 get the construction animation color. More...
 
void SetCtorColor (const LinearColor &color)
 set the construction animation color. More...
 
void AllocConsole ()
 allocate a console with redirected stdin/stdout/stderr, mostly for script debugging. More...
 
void SetConsoleTextAttribute (int wAttributes)
 Sets the attributes of characters written to the console screen buffer by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function. More...
 
DWORD GetCoreUsage ()
 Get the current ParaEngine app usage. More...
 
void SetCoreUsage (DWORD dwUsage)
 Set the current ParaEngine app usage. More...
 
int GetProcessId ()
 get current process id
 
LinearColor GetSelectionColor (int nGroupID=0)
 get the selection color. More...
 
void SetSelectionColor (const LinearColor &color, int nGroupID=0)
 set the construction animation color. More...
 
float GetCtorHeight ()
 Get the construction animation region's height in meters. More...
 
void SetCtorHeight (float fHeight)
 set the construction height. More...
 
float GetCtorSpeed ()
 Get the construction Speed. More...
 
void SetCtorSpeed (float fSpeed)
 set the construction Speed. More...
 
int GetPeakMemoryUse ()
 Returns the peak (maximum so far) resident set size (physical memory use) measured in bytes, or zero if the value cannot be determined on this OS.
 
int GetCurrentMemoryUse ()
 Returns the current resident set size (physical memory use) measured in bytes, or zero if the value cannot be determined on this OS.
 
void LoadGameEffectSet (int nSetID)
 Load the game effect set. More...
 
int GetGameEffectSet ()
 
void SetTextureLOD (int nLOD)
 Most detailed level-of-detail value to set for the mipmap chain. More...
 
int GetTextureLOD ()
 
int GetAppCount ()
 
int GetDrawCallCount ()
 get total number of draw calls in last rendered frame
 
int GetTriangleCount ()
 get total number of triangles in last rendered frame
 
int GetFPS ()
 get most recent frame per second. More...
 
void Enable32bitsTexture (bool bEnable)
 whether we will load files whose name ends with _32bits as 32 bits textures. More...
 
bool Is32bitsTextureEnabled ()
 whether we will load files whose name ends with _32bits as 32 bits textures. More...
 
bool HasNewConfig ()
 whether ParaEngine is loaded from config/config.new.txt. More...
 
void SetHasNewConfig (bool bHasNewConfig)
 
const char * GetLocale ()
 The locale is what makes it possible to know what language the interface is using and thus determine which specific code is going to be executed. More...
 
void SetLocale (const char *sLocale)
 
void SetIcon (const char *sIconFile)
 set the application icon at runtime. More...
 
LanguageType GetCurrentLanguage ()
 unlike GetLocale(), which may be changed by the user. More...
 
void SetCurrentLanguage (LanguageType lang)
 this function should not be called by the user. More...
 
void SetFullScreenMode (bool bFullscreen)
 whether to use full screen mode, it does not immediately change the device, call UpdateScreenMode() to update the device. More...
 
bool IsFullScreenMode ()
 
void BringWindowToTop ()
 The BringWindowToTop current window to the top of the Z order. More...
 
Vector2 GetScreenResolution ()
 change the full screen mode, it does not immediately change the device, call UpdateScreenMode() to update the device. More...
 
void SetScreenResolution (const Vector2 &vSize)
 
Vector2 GetWindowResolution ()
 get current render window resolution. More...
 
int GetMultiSampleType ()
 anti-aliasing for both windowed and full screen mode. More...
 
void SetMultiSampleType (int nType)
 
int GetMultiSampleQuality ()
 anti-aliasing for both windowed and full screen mode. More...
 
void SetMultiSampleQuality (int nType)
 
int GetVertexShaderVersion ()
 get the vertex shader version. More...
 
int GetPixelShaderVersion ()
 get the pixel shader version. More...
 
const std::string & GetDispalyMode ()
 get all supported display mode(width,height,refresh rate)
 
Vector2 GetMonitorResolution ()
 
const std::string & GetSystemInfoString (bool bRefresh=false)
 fetch OS information string. More...
 
void UpdateScreenMode ()
 call this function to update changes of FullScreen Mode and Screen Resolution. More...
 
void Enable3DRendering (bool bPause)
 disable 3D rendering, do not present the scene. More...
 
bool Is3DRenderingEnabled ()
 whether 3D rendering is enabled, do not present the scene. More...
 
void SetWindowText1 (const char *pChar)
 
const char * GetWindowText1 ()
 
void SetMouseInverse (bool bInverse)
 set whether the mouse is inversed. More...
 
bool GetMouseInverse ()
 
int GetAsyncLoaderItemsLeft (int nItemType)
 Get the number of items left in the asynchronous content loader queue. More...
 
int GetAsyncLoaderBytesReceived (int nItemType)
 get the total number of bytes processed. More...
 
int GetAsyncLoaderRemainingBytes ()
 get total estimated size in bytes in the async loader
 
void SetAutoLowerFrameRateWhenNotFocused (bool bEnabled)
 default to false. if true, we will lower frame rate when the window is not focused.
 
bool GetAutoLowerFrameRateWhenNotFocused ()
 
void SetToggleSoundWhenNotFocused (bool bEnabled)
 if true, sound volume will be set to 0, when not focused.
 
bool GetToggleSoundWhenNotFocused ()
 
void SetAppHasFocus (bool bEnabled)
 app has focus
 
bool GetAppHasFocus ()
 get app focus
 
void SetCaptureMouse (bool bCapture)
 
bool IsMouseCaptured ()
 
void SetLockWindowSize (bool bEnabled)
 lock window size, so that window size is totally controlled by application instead of user. More...
 
void SetShowWindowTitleBar (bool bEnabled)
 show/hide title bar
 
bool IsShowWindowTitleBar ()
 
const std::string & GetMaxMacAddress ()
 
const std::string & GetMaxIPAddress ()
 
size_t GetVertexBufferPoolTotalBytes ()
 get total number of bytes in vertex buffer pool for quick stats. More...
 
bool HasClosingRequest ()
 whether there is closing request in the message queue. More...
 
void SetHasClosingRequest (bool val)
 
const char * GetWritablePath ()
 get the current writable path
 
void SetWritablePath (const char *sPath)
 set current writable path. More...
 
- Public Member Functions inherited from ParaEngine::IAttributeFields
 ATTRIBUTE_METHOD1 (IAttributeFields, GetName_s, const char **)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, SetName_s, const char *)
 
 ATTRIBUTE_METHOD (IAttributeFields, PrintObject_s)
 
 ATTRIBUTE_METHOD (IAttributeFields, AddRef_s)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, GetRefCount_s, int *)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, SetTime_s, int)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, GetTime_s, int *)
 
 ATTRIBUTE_METHOD (IAttributeFields, Release_s)
 
virtual const std::string & GetIdentifier ()
 
virtual void SetIdentifier (const std::string &sID)
 
virtual bool IsModified ()
 whether some of the fields are modified.It is up to the implementation class to provide this functionality if necessary. More...
 
virtual void SetModified (bool bModified)
 set whether any field has been modified. More...
 
virtual bool ValidateFields ()
 validate all fields and return true if validation passed. More...
 
virtual string GetValidationMessage ()
 get the recent validation message due to the most recent call to ValidateFields()
 
virtual bool ResetField (int nFieldID)
 Reset the field to its initial or default value. More...
 
virtual bool InvokeEditor (int nFieldID, const std::string &sParameters)
 Invoke an (external) editor for a given field. More...
 
virtual bool AddChildAttributeObject (IAttributeFields *pChild, int nRowIndex=-1, int nColumnIndex=0)
 add child object. More...
 
virtual void * QueryObjectByName (const std::string &sObjectType)
 convert to object of a given type. More...
 
virtual void * QueryObject (int nObjectType)
 convert to object of a given type. More...
 
virtual int GetTime ()
 get the current local time in case it is animated in milli seconds frames. More...
 
virtual void SetTime (int nTime)
 
virtual CDynamicAttributeFieldGetDynamicField (const std::string &sName)
 Get a dynamic field with a given name. More...
 
virtual CDynamicAttributeFieldGetDynamicField (int nIndex)
 Get a dynamic field with a given index. More...
 
virtual const char * GetDynamicFieldNameByIndex (int nIndex)
 get field name by index
 
virtual int GetDynamicFieldCount ()
 how many dynamic field this object currently have. More...
 
virtual int SetDynamicField (const std::string &sName, const CVariable &value)
 set a dynamic field with a given name. More...
 
virtual int AddDynamicField (const std::string &sName, ATTRIBUTE_FIELDTYPE dwType)
 add dynamic field and return field index
 
virtual void RemoveAllDynamicFields ()
 remove all dynamic fields
 
virtual int SaveDynamicFieldsToString (std::string &output)
 save only text dynamic fields to fieldname = value text strings. More...
 
virtual int LoadDynamicFieldsFromString (const std::string &input)
 load only text dynamic fields from string More...
 
CAttributeClassGetAttributeClass ()
 get the main attribute class object. More...
 
void PrintObject ()
 print the content of this object to a text file at temp/doc/[ClassName].txt. More...
 
- Public Member Functions inherited from ParaEngine::IObject
virtual void Clone (IObject *obj) const
 Clone the object's contains to a pointer. More...
 
virtual IObjectClone () const
 Clone the object's contains and return a pointer to the newly created object. More...
 
virtual bool Equals (const IObject *obj) const
 Compare the object with another object. More...
 
virtual const ITypeGetType () const
 
virtual std::string ToString () const
 
WeakPtr_typeGetWeakReference ()
 get weak reference object. More...
 
virtual int ProcessObjectEvent (const ObjectEvent &event)
 this function is only used to backward compatibility of ParaObject:AddEvent() function. More...
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
virtual int Release ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Static Public Member Functions

static ParaEngineSettingsGetSingleton ()
 get an instance of this class. More...
 
static bool IsSandboxMode ()
 if true, IO is restricted to current working directory and writable directory. More...
 
static void SetSandboxMode (bool val)
 if true, IO is restricted to current working directory and writable directory. More...
 
static void SetOceanTechnique (DWORD dwTechnique)
 
static LinearColor GetCtorColorS ()
 
static void SetCtorColorS (const LinearColor &color)
 
static LinearColor GetSelectionColorS ()
 
static void SetSelectionColorS (const LinearColor &color)
 
static float GetCtorHeightS ()
 
static void SetCtorHeightS (float fHeight)
 
static float GetCtorSpeedS ()
 
static void SetCtorSpeedS (float fSpeed)
 
static void GetClientSize (int *width, int *height)
 get client width and height
 
static void EnableProfiling (bool bEnable)
 start/stop all profilers. More...
 
static bool IsProfilingEnabled ()
 
static string GetStats (DWORD dwFields)
 get the render engine stats to output. More...
 
static void SetRefreshTimer (float fTimerInterval)
 render refresh/io time interval. More...
 
static float GetRefreshTimer ()
 render refresh/io time interval. More...
 
static int GetPlatform ()
 get platform id: #define PARA_PLATFORM_UNKNOWN 0 #define PARA_PLATFORM_IOS 1 #define PARA_PLATFORM_ANDROID 2 #define PARA_PLATFORM_WIN32 3 #define PARA_PLATFORM_MARMALADE 4 #define PARA_PLATFORM_LINUX 5
 
static bool IsMobilePlatform ()
 
static bool Is64BitsSystem ()
 whether the current system is compiled with 64bits version. More...
 
static void LoadGameEffectSetS (int nSetID)
 
static int GetGameEffectSetS ()
 
static bool IsDebugging ()
 whether ParaEngine is compiled as debug build. More...
 
static bool IsTouchInputting ()
 whether touch input is in action
 
static bool IsSlateMode ()
 whether in slate mode
 
static bool IsEditing ()
 whether the game engine is in developing mode. More...
 
static void SetEditingMode (bool bEnable)
 set editing mode. More...
 
static bool IsServerMode ()
 whether we are running in server mode without GUI support
 
static const char * GetLocaleS ()
 
static void SetLocaleS (const char *sLocale)
 
static bool IsProductActivated ()
 If ActivateProduct() is called and returns true before this function is called when the application starts, then this function will return true. More...
 
static bool ActivateProduct (const char *sActivationCode)
 activate the product using a activation code. More...
 
static const char * GetProductKey (const char *sProductName)
 Get the product key for the current application. More...
 
static bool GenerateActivationCodes (const char *sOutputFileName, int nFrom, int nTo)
 generate product activation codes in large numbers in to a given file. More...
 
static bool SetWindowedMode (bool bWindowed)
 switch to either windowed mode or full screen mode. More...
 
static bool IsWindowedMode ()
 return true if it is currently under windowed mode. More...
 
static void SetAllowWindowClosing (bool bAllowClosing)
 set whether the user can close the window (sending WM_CLOSE message). More...
 
static bool IsWindowClosingAllowed ()
 get whether the user can close the window (sending WM_CLOSE message). More...
 
static void ShowMenu (bool bShow)
 turn on/off menu
 
static void SetIgnoreWindowSizeChange (bool bIgnoreSizeChange)
 switch to ignore windows size change. More...
 
static bool GetIgnoreWindowSizeChange ()
 return true if it is currently under windowed mode. More...
 
static void EnablePassiveRendering (bool bEnable)
 passive rendering, it will not render the scene, but simulation and time remains the same. More...
 
static bool IsPassiveRenderingEnabled ()
 passive rendering, it will not render the scene, but simulation and time remains the same. More...
 
static void SetWindowText (const char *pChar)
 set the window title when at windowed mode
 
static const char * GetWindowText ()
 get the window title when at windowed mode
 
static void WriteConfigFile (const char *sFileName)
 write the current setting to config file. More...
 
static void SetMouseInverse_s (bool bInverse)
 
static bool GetMouseInverse_s ()
 
static const char * GetAppCommandLine ()
 get string specifying the command line for the application, excluding the program name. More...
 
static const char * GetAppCommandLineByParam (const char *pParam, const object &defaultValue)
 return a specified parameter value in the command line of the application. More...
 
static void SetAppCommandLine (const char *pCommandLine)
 set string specifying the command line for the application, excluding the program name. More...
 
static int GetAsyncLoaderItemsLeftS (int nItemType)
 same as above, except it is meant to be called from the scripting interface
 
static int GetAsyncLoaderBytesReceivedS (int nItemType)
 same as above, except it is meant to be called from the scripting interface
 
static intptr_t GetAppHWND ()
 
- Static Public Member Functions inherited from ParaEngine::IAttributeFields
static HRESULT GetAttributeClassID_s (IAttributeFields *cls, int *p1)
 
static HRESULT GetAttributeClassName_s (IAttributeFields *cls, const char **p1)
 
static bool OpenWithDefaultEditor (const char *sFilename, bool bWaitOnReturn=false)
 Open a given file with the default registered editor in the game engine. More...
 

Protected Member Functions

void LoadNameIndex ()
 
- Protected Member Functions inherited from ParaEngine::IAttributeFields
virtual CAttributeClassCreateAttributeClass ()
 initialize fields
 
virtual CDynamicAttributesSetGetDynamicAttributes (bool bCreateIfNotExist=false)
 

Additional Inherited Members

- Public Types inherited from ParaEngine::IAttributeFields
typedef ParaEngine::weak_ptr< IObject, IAttributeFieldsWeakPtr_type
 
- Public Types inherited from ParaEngine::IObject
typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 
- Protected Attributes inherited from ParaEngine::IObject
WeakPtr_type m_weak_reference
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Detailed Description

global settings for ParaEngine.

such as rendering technique, window setting, etc. Most settings can be set from the script interface

Member Function Documentation

§ ActivateProduct()

bool ParaEngineSettings::ActivateProduct ( const char *  sActivationCode)
static

activate the product using a activation code.

This function must be called every time the application start with a valid license code, otherwise, IsProductActivated() will always be false.

Note
: IsProductActivated() and ActivateProduct() provides a very simple method to ship product with shareware One can use license code generation tools in ParaIDE to generate, say 2000, valid license codes at a time into a text file.

§ AllocConsole()

void ParaEngine::ParaEngineSettings::AllocConsole ( )

allocate a console with redirected stdin/stdout/stderr, mostly for script debugging.

§ BringWindowToTop()

void ParaEngine::ParaEngineSettings::BringWindowToTop ( )

The BringWindowToTop current window to the top of the Z order.

This function only works if IsFullScreenMode() is false.

§ Enable32bitsTexture()

void ParaEngine::ParaEngineSettings::Enable32bitsTexture ( bool  bEnable)

whether we will load files whose name ends with _32bits as 32 bits textures.

disabling this will reduce memory usage by 6 times, but the rendered image will not be as sharp. since DXT5 or DXT3 compression is used instead.

§ Enable3DRendering()

void ParaEngineSettings::Enable3DRendering ( bool  bPause)

disable 3D rendering, do not present the scene.

This is usually called before and after we show a standard win32 window during full screen mode

§ EnablePassiveRendering()

void ParaEngine::ParaEngineSettings::EnablePassiveRendering ( bool  bEnable)
static

passive rendering, it will not render the scene, but simulation and time remains the same.

Default is false this function is usually used in server mode, when the application is run in silent mode

§ EnableProfiling()

void ParaEngine::ParaEngineSettings::EnableProfiling ( bool  bEnable)
static

start/stop all profilers.

anything using Start_S does not take effect.

§ GenerateActivationCodes()

bool ParaEngineSettings::GenerateActivationCodes ( const char *  sOutputFileName,
int  nFrom,
int  nTo 
)
static

generate product activation codes in large numbers in to a given file.

this function is only available in debug build.

Parameters
sOutputFileNamethe text file that store the generated keys: each key is on a separate line if this is NULL, a automatically generated file name will be used, which is of the following format. temp/ParaEngine Licenses 1.0.1.0_enUS_1-2000.txt, where v1.0.1.0 is the software version number, enUS is the language, 0-2000 is nFrom-nTo This file is usually submitted to shareware website so that they can sell your software.
nFromcopy number
nTocopy number
Returns

§ GetAppCommandLine()

const char * ParaEngine::ParaEngineSettings::GetAppCommandLine ( )
static

get string specifying the command line for the application, excluding the program name.

§ GetAppCommandLineByParam()

const char * ParaEngine::ParaEngineSettings::GetAppCommandLineByParam ( const char *  pParam,
const object defaultValue 
)
static

return a specified parameter value in the command line of the application.

If the parameter does not exist, the return value is NULL.

Parameters
pParamkey to get
defaultValueif the key does not exist, this value will be added and returned. This can be NULL.

§ GetAsyncLoaderBytesReceived()

int ParaEngine::ParaEngineSettings::GetAsyncLoaderBytesReceived ( int  nItemType)

get the total number of bytes processed.

Parameters
nItemType-2 : all remote assets(excluding HTTP web requests) in the queue. -1 : all url requests(include web request) in the queue. 0 : all local requests in the queue. 1 : Smaller remote requests in the queue. 2 : HTTP web requests in the queue. 3 : big remote requests in the queue.

§ GetAsyncLoaderItemsLeft()

int ParaEngine::ParaEngineSettings::GetAsyncLoaderItemsLeft ( int  nItemType)

Get the number of items left in the asynchronous content loader queue.

Parameters
nItemType-2 : all remote assets(excluding HTTP web requests) in the queue. -1 : all outstanding resources in the queue. 0 : all local requests in the queue. 1 : Smaller remote requests in the queue. 2 : HTTP web requests in the queue. 3 : big remote requests in the queue.

§ GetAttributeClassID()

virtual int ParaEngine::ParaEngineSettings::GetAttributeClassID ( )
inlinevirtual

attribute class ID should be identical, unless one knows how overriding rules work.

Reimplemented from ParaEngine::IAttributeFields.

§ GetChildAttributeColumnCount()

int ParaEngine::ParaEngineSettings::GetChildAttributeColumnCount ( )
virtual

we support multi-dimensional child object.

by default objects have only one column.

Reimplemented from ParaEngine::IAttributeFields.

§ GetChildAttributeObject()

IAttributeFields * ParaEngine::ParaEngineSettings::GetChildAttributeObject ( const std::string &  sName)
virtual

get attribute by child object.

used to iterate across the attribute field hierarchy.

Reimplemented from ParaEngine::IAttributeFields.

§ GetChildAttributeObjectCount()

int ParaEngine::ParaEngineSettings::GetChildAttributeObjectCount ( int  nColumnIndex = 0)
virtual

get the number of child objects (row count) in the given column.

please note different columns can have different row count.

Reimplemented from ParaEngine::IAttributeFields.

§ GetCoreUsage()

DWORD ParaEngine::ParaEngineSettings::GetCoreUsage ( )

Get the current ParaEngine app usage.

[main thread only]

Returns
see PE_USAGE

§ GetCtorColor()

LinearColor ParaEngineSettings::GetCtorColor ( )

get the construction animation color.

§ GetCtorHeight()

float ParaEngineSettings::GetCtorHeight ( )

Get the construction animation region's height in meters.

§ GetCtorSpeed()

float ParaEngineSettings::GetCtorSpeed ( )

Get the construction Speed.

in meters per second

§ GetCurrentLanguage()

ParaEngine::LanguageType ParaEngine::ParaEngineSettings::GetCurrentLanguage ( )

unlike GetLocale(), which may be changed by the user.

The current language can not be changed by user.

§ GetFPS()

int ParaEngine::ParaEngineSettings::GetFPS ( )

get most recent frame per second.

§ GetIgnoreWindowSizeChange()

bool ParaEngine::ParaEngineSettings::GetIgnoreWindowSizeChange ( )
static

return true if it is currently under windowed mode.

§ GetLocale()

const char * ParaEngineSettings::GetLocale ( )

The locale is what makes it possible to know what language the interface is using and thus determine which specific code is going to be executed.

Returns
: "frFR": French "deDE": German "enUS": American english "enGB": British english "koKR": Korean "zhCN": Chinese (simplified) "zhTW": Chinese (traditional) "ruRU": Russian (UI AddOn) "esES": Spanish

§ GetMultiSampleQuality()

int ParaEngine::ParaEngineSettings::GetMultiSampleQuality ( )

anti-aliasing for both windowed and full screen mode.

it does not immediately change the device, call UpdateScreenMode() to update the device.

§ GetMultiSampleType()

int ParaEngine::ParaEngineSettings::GetMultiSampleType ( )

anti-aliasing for both windowed and full screen mode.

it does not immediately change the device, call UpdateScreenMode() to update the device.

§ GetOpenFolder()

const char * ParaEngine::ParaEngineSettings::GetOpenFolder ( )

display a dialog to let the user select a folder.

the default folder can be set by "SetDefaultOpenFileFolder"

§ GetPixelShaderVersion()

int ParaEngineSettings::GetPixelShaderVersion ( )

get the pixel shader version.

This can be roughly used to auto-adjust graphics settings.

Returns
0,1,2,3,4

§ GetProductKey()

const char * ParaEngineSettings::GetProductKey ( const char *  sProductName)
static

Get the product key for the current application.

Parameters
sProductNamethis can be NULL, it is reserved for future use
Returns
product key is returned.

§ GetRefreshTimer()

float ParaEngineSettings::GetRefreshTimer ( )
static

render refresh/io time interval.

§ GetScreenResolution()

Vector2 ParaEngine::ParaEngineSettings::GetScreenResolution ( )

change the full screen mode, it does not immediately change the device, call UpdateScreenMode() to update the device.

§ GetScriptEditor()

const string & ParaEngineSettings::GetScriptEditor ( )

Get the default script editor for ParaEngine.

§ GetSelectionColor()

LinearColor ParaEngineSettings::GetSelectionColor ( int  nGroupID = 0)

get the selection color.

§ GetSingleton()

ParaEngineSettings & ParaEngineSettings::GetSingleton ( )
static

get an instance of this class.

§ GetStats()

string ParaEngineSettings::GetStats ( DWORD  dwFields)
static

get the render engine stats to output.

Parameters
outputthe output buffer.
dwFieldscurrent it is 0, which just collect graphics card settings.

§ GetSystemInfoString()

const std::string & ParaEngine::ParaEngineSettings::GetSystemInfoString ( bool  bRefresh = false)

fetch OS information string.

Parameters
bRefreshtrue to force all parameters to be refreshed.
Returns
: the output string. each attribute is printed on a single line, such as "Processor type: 586"

§ GetVertexBufferPoolTotalBytes()

size_t ParaEngine::ParaEngineSettings::GetVertexBufferPoolTotalBytes ( )

get total number of bytes in vertex buffer pool for quick stats.

§ GetVertexShaderVersion()

int ParaEngineSettings::GetVertexShaderVersion ( )

get the vertex shader version.

This can be roughly used to auto-adjust graphics settings.

Returns
0,1,2,3,4

§ GetWindowResolution()

Vector2 ParaEngine::ParaEngineSettings::GetWindowResolution ( )

get current render window resolution.

§ HasClosingRequest()

bool ParaEngine::ParaEngineSettings::HasClosingRequest ( )

whether there is closing request in the message queue.

In windows, the user clicks the close button. For long running task in the main thread, it is recommended to periodically check this value to end the task prematurely if necessary.

§ HasNewConfig()

bool ParaEngine::ParaEngineSettings::HasNewConfig ( )

whether ParaEngine is loaded from config/config.new.txt.

if this is true, we need to ask the user to save to config/config.txt. This is usually done at start up.

§ InstallFields()

int ParaEngineSettings::InstallFields ( CAttributeClass pClass,
bool  bOverride 
)
virtual

this class should be implemented if one wants to add new attribute.

This function is always called internally.

Reimplemented from ParaEngine::IAttributeFields.

§ Is32bitsTextureEnabled()

bool ParaEngine::ParaEngineSettings::Is32bitsTextureEnabled ( )

whether we will load files whose name ends with _32bits as 32 bits textures.

disabling this will reduce memory usage by 6 times, but the rendered image will not be as sharp. since DXT5 or DXT3 compression is used instead.

§ Is3DRenderingEnabled()

bool ParaEngineSettings::Is3DRenderingEnabled ( )

whether 3D rendering is enabled, do not present the scene.

This is usually called before and after we show a standard win32 window during full screen mode, such as a flash window

§ Is64BitsSystem()

bool ParaEngine::ParaEngineSettings::Is64BitsSystem ( )
static

whether the current system is compiled with 64bits version.

§ IsDebugging()

bool ParaEngineSettings::IsDebugging ( )
static

whether ParaEngine is compiled as debug build.

§ IsEditing()

bool ParaEngineSettings::IsEditing ( )
static

whether the game engine is in developing mode.

§ IsPassiveRenderingEnabled()

bool ParaEngine::ParaEngineSettings::IsPassiveRenderingEnabled ( )
static

passive rendering, it will not render the scene, but simulation and time remains the same.

Default is false this function is usually used in server mode, when the application is run in silent mode

§ IsProductActivated()

bool ParaEngineSettings::IsProductActivated ( )
static

If ActivateProduct() is called and returns true before this function is called when the application starts, then this function will return true.

Otherwise it will return false.

Note
: IsProductActivated() and ActivateProduct() provides a very simple method to ship product with shareware One can use license code generation tools in ParaIDE to generate, say 2000, valid license codes at a time into a text file.
Returns

§ IsSandboxMode()

bool ParaEngine::ParaEngineSettings::IsSandboxMode ( )
static

if true, IO is restricted to current working directory and writable directory.

Under win32, this is true by default.

§ IsWindowClosingAllowed()

bool ParaEngineSettings::IsWindowClosingAllowed ( )
static

get whether the user can close the window (sending WM_CLOSE message).

Default to true. When set to false, the scripting interface will receive WM_CLOSE message via system event. And can use ParaEngine.Exit() to quit the application after user confirmation, etc.

§ IsWindowedMode()

bool ParaEngineSettings::IsWindowedMode ( )
static

return true if it is currently under windowed mode.

§ LoadGameEffectSet()

void ParaEngineSettings::LoadGameEffectSet ( int  nSetID)

Load the game effect set.

This function can be used to load a predefined set of ParaEngine's rendering choices, such as best performance, maximum speed, etc. Please note that ParaEngine may change the set content as computer hardware evolves Hence, for more granular control over the rendering settings, please use respective functions in the ParaScene and ParaTerrain namespace,etc. Please note if a computer does not support a shader in an effect set, the game engine will automatically degrade to a previous level.

Parameters
nSetIDThe following set id are internally supported. 1024: force using fixed function pipeline. It will run on the oldest possible hardware without using any shaders. 0: recommended setting at the time the game engine is released. 1: use more expensive settings than the set id=0. 2: use more expensive settings than the set id=1. -1: use less expensive settings than the set id=0. -2: use less expensive settings than the set id=-1.

§ SetAllowWindowClosing()

void ParaEngineSettings::SetAllowWindowClosing ( bool  bAllowClosing)
static

set whether the user can close the window (sending WM_CLOSE message).

Default to true. When set to false, the scripting interface will receive WM_CLOSE message via system event. And can use ParaEngine.Exit() to quit the application after user confirmation, etc.

§ SetAppCommandLine()

void ParaEngine::ParaEngineSettings::SetAppCommandLine ( const char *  pCommandLine)
static

set string specifying the command line for the application, excluding the program name.

calling this function multiple times with different command line is permitted. The latter settings will merge and override the previous ones.

Parameters
pCommandLinesuch as key="value" key2="value2"

§ SetConsoleTextAttribute()

void ParaEngine::ParaEngineSettings::SetConsoleTextAttribute ( int  wAttributes)

Sets the attributes of characters written to the console screen buffer by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function.

This function affects text written after the function call.

Parameters
wAttributesplease see SetConsoleTextAttribute for a list of font color and styles.

§ SetCoreUsage()

void ParaEngine::ParaEngineSettings::SetCoreUsage ( DWORD  dwUsage)

Set the current ParaEngine app usage.

[main thread only]

Parameters
dwUsagebitwise of PE_USAGE

§ SetCtorColor()

void ParaEngineSettings::SetCtorColor ( const LinearColor color)

set the construction animation color.

§ SetCtorHeight()

void ParaEngineSettings::SetCtorHeight ( float  fHeight)

set the construction height.

§ SetCtorSpeed()

void ParaEngineSettings::SetCtorSpeed ( float  fSpeed)

set the construction Speed.

in meters per second

§ SetCurrentLanguage()

void ParaEngine::ParaEngineSettings::SetCurrentLanguage ( LanguageType  lang)

this function should not be called by the user.

we will always use the default system language. Use SetLocale() for users.

§ SetDefaultOpenFileFolder()

void ParaEngine::ParaEngineSettings::SetDefaultOpenFileFolder ( const char *  sDefaultOpenFileFolder)

the default open file folder.

§ SetEditingMode()

void ParaEngineSettings::SetEditingMode ( bool  bEnable)
static

set editing mode.

Parameters
bEnabletrue if enable.

§ SetFullScreenMode()

void ParaEngine::ParaEngineSettings::SetFullScreenMode ( bool  bFullscreen)

whether to use full screen mode, it does not immediately change the device, call UpdateScreenMode() to update the device.

§ SetIcon()

void ParaEngine::ParaEngineSettings::SetIcon ( const char *  sIconFile)

set the application icon at runtime.

Parameters
sIconFileone of the ico file for win32. or it can be "IDI_APPLICATION", "IDI_ERROR", etc for system defined icon.

§ SetIgnoreWindowSizeChange()

void ParaEngine::ParaEngineSettings::SetIgnoreWindowSizeChange ( bool  bIgnoreSizeChange)
static

switch to ignore windows size change.

default to false. if false, the user is allowed to adjust window size in windowed mode.

§ SetLocale()

void ParaEngineSettings::SetLocale ( const char *  sLocale)
See also
GetLocale().

§ SetLockWindowSize()

void ParaEngine::ParaEngineSettings::SetLockWindowSize ( bool  bEnabled)

lock window size, so that window size is totally controlled by application instead of user.

both min/max/resize window is ignored.

§ SetMouseInverse()

void ParaEngineSettings::SetMouseInverse ( bool  bInverse)

set whether the mouse is inversed.

§ SetOceanTechnique()

void ParaEngineSettings::SetOceanTechnique ( DWORD  dwTechnique)
static
Parameters
dwTechnique0 for basic, the higher the more advanced. up to 3.

§ SetRefreshTimer()

void ParaEngineSettings::SetRefreshTimer ( float  fTimerInterval)
static

render refresh/io time interval.

§ SetSandboxMode()

void ParaEngine::ParaEngineSettings::SetSandboxMode ( bool  val)
static

if true, IO is restricted to current working directory and writable directory.

Under win32, this is true by default.

§ SetScriptEditor()

void ParaEngineSettings::SetScriptEditor ( const string &  sEditorFilePath)

set the default script editor file path for ParaEngine.The windows notepad.exe is used if not specified.

§ SetSelectionColor()

void ParaEngineSettings::SetSelectionColor ( const LinearColor color,
int  nGroupID = 0 
)

set the construction animation color.

§ SetTextureLOD()

void ParaEngine::ParaEngineSettings::SetTextureLOD ( int  nLOD)

Most detailed level-of-detail value to set for the mipmap chain.

Default value is 0 More specifically, if the texture was created with the dimensions of 256x256, setting the most detailed level to 0 indicates that 256 x 256 is the largest mipmap available, setting the most detailed level to 1 indicates that 128 x 128 is the largest mipmap available, and so on, up to the most detailed mip level (the smallest texture size) for the chain.

§ SetWindowedMode()

bool ParaEngineSettings::SetWindowedMode ( bool  bWindowed)
static

switch to either windowed mode or full screen mode.

§ SetWritablePath()

void ParaEngine::ParaEngineSettings::SetWritablePath ( const char *  sPath)

set current writable path.

TODO: This can be a security problem. use with care.

§ UpdateScreenMode()

void ParaEngine::ParaEngineSettings::UpdateScreenMode ( )

call this function to update changes of FullScreen Mode and Screen Resolution.

§ WriteConfigFile()

void ParaEngineSettings::WriteConfigFile ( const char *  sFileName)
static

write the current setting to config file.

Such as graphics mode and whether full screen, etc. config file at ./config.txt will be automatically loaded when the game engine starts.

Parameters
sFileNameif this is "", it will be the default config file at ./config.txt

The documentation for this class was generated from the following files: