orx  stable
Portable Game Engine
orxProfiler.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
43 #ifndef _orxPROFILER_H_
44 #define _orxPROFILER_H_
45 
46 
47 #include "orxInclude.h"
48 
49 #include "core/orxThread.h"
50 
51 
52 /* *** Uncomment the line below to enable orx profiling in non debug builds *** */
53 //#define __orxPROFILER__
54 
55 
58 #ifdef __orxPROFILER__
59 
60  #define orxPROFILER_PUSH_MARKER(NAME) \
61  do \
62  { \
63  static orxS32 s32ProfilerID = orxPROFILER_KS32_MARKER_ID_NONE; \
64  \
65  if(orxProfiler_IsMarkerIDValid(s32ProfilerID) == orxFALSE) \
66  { \
67  s32ProfilerID = orxProfiler_GetIDFromName(NAME); \
68  } \
69  \
70  orxProfiler_PushMarker(s32ProfilerID); \
71  } while(orxFALSE)
72 
73 
74  #define orxPROFILER_POP_MARKER() \
75  do \
76  { \
77  orxProfiler_PopMarker(); \
78  } while(orxFALSE)
79 
80  #define orxPROFILER_KU32_HISTORY_LENGTH (3 * 60)
81 
82 #else /* __orxPROFILER__ */
83 
84  #define orxPROFILER_PUSH_MARKER(NAME)
85 
86  #define orxPROFILER_POP_MARKER()
87 
88  #define orxPROFILER_KU32_HISTORY_LENGTH 2
89 
90 #endif /* __orxPROFILER__ */
91 
92 
95 #define orxPROFILER_KS32_MARKER_ID_NONE -1
96 
97 
99 extern orxDLLAPI void orxFASTCALL orxProfiler_Setup();
100 
104 extern orxDLLAPI orxSTATUS orxFASTCALL orxProfiler_Init();
105 
107 extern orxDLLAPI void orxFASTCALL orxProfiler_Exit();
108 
109 
114 extern orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetIDFromName(const orxSTRING _zName);
115 
120 extern orxDLLAPI orxBOOL orxFASTCALL orxProfiler_IsMarkerIDValid(orxS32 _s32MarkerID);
121 
122 
126 extern orxDLLAPI void orxFASTCALL orxProfiler_PushMarker(orxS32 _s32MarkerID);
127 
130 extern orxDLLAPI void orxFASTCALL orxProfiler_PopMarker();
131 
135 extern orxDLLAPI void orxFASTCALL orxProfiler_EnableMarkerOperations(orxBOOL _bEnable);
136 
140 extern orxDLLAPI orxBOOL orxFASTCALL orxProfiler_AreMarkerOperationsEnabled();
141 
145 extern orxDLLAPI void orxFASTCALL orxProfiler_Pause(orxBOOL _bPause);
146 
150 extern orxDLLAPI orxBOOL orxFASTCALL orxProfiler_IsPaused();
151 
152 
155 extern orxDLLAPI void orxFASTCALL orxProfiler_ResetAllMarkers();
156 
159 extern orxDLLAPI void orxFASTCALL orxProfiler_ResetAllMaxima();
160 
164 extern orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetResetTime();
165 
169 extern orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetMaxResetTime();
170 
171 
175 extern orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetMarkerCounter();
176 
177 
182 extern orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetNextMarkerID(orxS32 _s32MarkerID);
183 
188 extern orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetNextSortedMarkerID(orxS32 _s32MarkerID);
189 
190 
196 extern orxDLLAPI orxSTATUS orxFASTCALL orxProfiler_SelectQueryFrame(orxU32 _u32QueryFrame, orxU32 _u32ThreadID);
197 
198 
203 extern orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetMarkerTime(orxS32 _s32MarkerID);
204 
209 extern orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetMarkerMaxTime(orxS32 _s32MarkerID);
210 
215 extern orxDLLAPI const orxSTRING orxFASTCALL orxProfiler_GetMarkerName(orxS32 _s32MarkerID);
216 
221 extern orxDLLAPI orxU32 orxFASTCALL orxProfiler_GetMarkerPushCounter(orxS32 _s32MarkerID);
222 
223 
228 extern orxDLLAPI orxBOOL orxFASTCALL orxProfiler_IsUniqueMarker(orxS32 _s32MarkerID);
229 
230 
235 extern orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetUniqueMarkerStartTime(orxS32 _s32MarkerID);
236 
241 extern orxDLLAPI orxU32 orxFASTCALL orxProfiler_GetUniqueMarkerDepth(orxS32 _s32MarkerID);
242 
243 
244 #endif /* _orxPROFILER_H_ */
245 
orxDLLAPI void orxFASTCALL orxProfiler_ResetAllMaxima()
orxDLLAPI void orxFASTCALL orxProfiler_Setup()
orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetMarkerTime(orxS32 _s32MarkerID)
orxDLLAPI orxBOOL orxFASTCALL orxProfiler_IsMarkerIDValid(orxS32 _s32MarkerID)
orxDLLAPI const orxSTRING orxFASTCALL orxProfiler_GetMarkerName(orxS32 _s32MarkerID)
orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetMaxResetTime()
orxDLLAPI void orxFASTCALL orxProfiler_ResetAllMarkers()
orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetMarkerMaxTime(orxS32 _s32MarkerID)
orxDLLAPI orxSTATUS orxFASTCALL orxProfiler_SelectQueryFrame(orxU32 _u32QueryFrame, orxU32 _u32ThreadID)
orxDLLAPI void orxFASTCALL orxProfiler_EnableMarkerOperations(orxBOOL _bEnable)
orxDLLAPI void orxFASTCALL orxProfiler_Pause(orxBOOL _bPause)
orxDLLAPI orxU32 orxFASTCALL orxProfiler_GetMarkerPushCounter(orxS32 _s32MarkerID)
orxDLLAPI orxBOOL orxFASTCALL orxProfiler_AreMarkerOperationsEnabled()
orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetIDFromName(const orxSTRING _zName)
orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetResetTime()
orxDLLAPI void orxFASTCALL orxProfiler_PopMarker()
orxSTATUS
Definition: orxType.h:243
orxDLLAPI orxU32 orxFASTCALL orxProfiler_GetUniqueMarkerDepth(orxS32 _s32MarkerID)
orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetUniqueMarkerStartTime(orxS32 _s32MarkerID)
orxDLLAPI void orxFASTCALL orxProfiler_PushMarker(orxS32 _s32MarkerID)
orxDLLAPI orxBOOL orxFASTCALL orxProfiler_IsPaused()
orxDLLAPI void orxFASTCALL orxProfiler_Exit()
orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetNextMarkerID(orxS32 _s32MarkerID)
#define orxDLLAPI
Definition: orxDecl.h:387
orxDLLAPI orxBOOL orxFASTCALL orxProfiler_IsUniqueMarker(orxS32 _s32MarkerID)
orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetMarkerCounter()
orxDLLAPI orxSTATUS orxFASTCALL orxProfiler_Init()
orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetNextSortedMarkerID(orxS32 _s32MarkerID)

Generated for orx by doxygen 1.5.6