My Project
ParaScriptingMisc.h
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2004 - 2007 ParaEngine Dev Studio, All Rights Reserved.
3 // Date: 2005.10
4 // Description: API for misc functions and ParaEngine namespace.
5 //-----------------------------------------------------------------------------
6 #pragma once
7 #include "ParaScriptingGlobal.h"
8 #include "ParaScriptingScene.h"
9 #include <string>
10 namespace ParaScripting
11 {
12  class ParaAssetObject;
13  using namespace std;
14  using namespace luabind;
15 
20  class PE_CORE_DECL ParaMisc
21  {
22  public:
25  static int GetUnicodeCharNum(const char* str);
26 
33  static std::string UniSubString(const char* str, int nFrom, int nTo);
34 
40  static std::string UTF8ToUTF16(const std::string& utf8);
41 
47  static std::string UTF16ToUTF8(const std::string& utf16);
48 
53  static std::string SimpleEncode(const std::string& source);
54 
59  static std::string SimpleDecode(const std::string& source);
60 
62  static string md5(const string& source);
63  static string md5_(const string& source, bool bBinary);
64 
66  static string sha1(const string& source);
67  static string sha1_(const string& source, bool bBinary);
68 
70  static string base64(const string& source);
72  static string unbase64(const string& source);
73 
78  static long RandomLong(const object& seedTable);
80  static double RandomDouble(const object& seedTable);
81 
100  static const std::string& EncodingConvert(const std::string& srcEncoding, const std::string& dstEncoding, const std::string& bytes);
101 
103  static bool CopyTextToClipboard(const char* text);
104 
106  static const char* GetTextFromClipboard();
107  };
108 
113  class PE_CORE_DECL CParaEngine
114  {
115  public:
117  static ParaAttributeObject GetAttributeObject();
119  static void GetAttributeObject_(ParaAttributeObject& output);
120 
122  static string GetVersion();
123 
124  // this prevent functions to be generated in the documentation.
126  static string GetCopyright();
127  static string GetAuthorTo();
128  static string GetWatermark();
130 
132  static ParaAttributeObject GetViewportAttributeObject(int nViewportIndex);
133 
136  static bool ForceRender();
138  static bool Sleep(float fSeconds);
146  static bool SaveParaXMesh(const char* filename, ParaAssetObject& xmesh, bool bBinaryEncoding);
147 
148 
150  //
151  // some d3d functions.
152  //
154 
156  static ParaAssetObject GetRenderTarget();
157 
159  static bool SetRenderTarget(ParaAssetObject& pRenderTarget);
160  static bool SetRenderTarget2(int nIndex, const char* render_targetname);
161 
163  static bool StretchRect(ParaAssetObject& pSrcRenderTarget, ParaAssetObject& pDestRenderTarget);
164 
167  static bool DrawQuad();
168 
184  static bool SetVertexDeclaration(int nIndex);
185  };
186 }
Definition: PEtypes.h:507
it represents an attribute object associated with an object.
Definition: ParaScriptingGlobal.h:458
global game engine related functions, such as ParaEngineCore interface, copy right information...
Definition: ParaScriptingMisc.h:113
for luabind, The main drawback of this approach is that the compilation time will increase for the fi...
Definition: luaSQLite.cpp:1971
Contains miscellaneous functions.
Definition: ParaScriptingMisc.h:20
it represents an asset entity.
Definition: ParaScriptingCommon.h:85