00001 /* Orx - Portable Game Engine 00002 * 00003 * Copyright (c) 2008-2011 Orx-Project 00004 * 00005 * This software is provided 'as-is', without any express or implied 00006 * warranty. In no event will the authors be held liable for any damages 00007 * arising from the use of this software. 00008 * 00009 * Permission is granted to anyone to use this software for any purpose, 00010 * including commercial applications, and to alter it and redistribute it 00011 * freely, subject to the following restrictions: 00012 * 00013 * 1. The origin of this software must not be misrepresented; you must not 00014 * claim that you wrote the original software. If you use this software 00015 * in a product, an acknowledgment in the product documentation would be 00016 * appreciated but is not required. 00017 * 00018 * 2. Altered source versions must be plainly marked as such, and must not be 00019 * misrepresented as being the original software. 00020 * 00021 * 3. This notice may not be removed or altered from any source 00022 * distribution. 00023 */ 00024 00043 #ifndef _orxPROFILER_H_ 00044 #define _orxPROFILER_H_ 00045 00046 00047 #include "orxInclude.h" 00048 00049 00050 /* *** Uncomment the line below to enable orx profiling in non debug builds *** */ 00051 //#define __orxPROFILER__ 00052 00053 00054 #ifdef __orxDEBUG__ 00055 00056 #define __orxPROFILER__ 00057 00058 #endif /* __orxDEBUG__ */ 00059 00060 00063 #ifdef __orxPROFILER__ 00064 00065 #define orxPROFILER_PUSH_MARKER(NAME) \ 00066 do \ 00067 { \ 00068 static orxS32 s32ProfilerID = orxPROFILER_KS32_MARKER_ID_NONE;\ 00069 \ 00070 if(orxProfiler_IsMarkerIDValid(s32ProfilerID) == orxFALSE) \ 00071 { \ 00072 s32ProfilerID = orxProfiler_GetIDFromName(NAME); \ 00073 } \ 00074 \ 00075 orxProfiler_PushMarker(s32ProfilerID); \ 00076 } while(orxFALSE) 00077 00078 00079 #define orxPROFILER_POP_MARKER() orxProfiler_PopMarker(); 00080 00081 #else /* __orxPROFILER__ */ 00082 00083 #define orxPROFILER_PUSH_MARKER(NAME) 00084 00085 #define orxPROFILER_POP_MARKER() 00086 00087 #endif /* __orxPROFILER__ */ 00088 00089 00092 #define orxPROFILER_KS32_MARKER_ID_NONE -1 00093 00094 00096 extern orxDLLAPI void orxFASTCALL orxProfiler_Setup(); 00097 00101 extern orxDLLAPI orxSTATUS orxFASTCALL orxProfiler_Init(); 00102 00104 extern orxDLLAPI void orxFASTCALL orxProfiler_Exit(); 00105 00106 00111 extern orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetIDFromName(const orxSTRING _zName); 00112 00117 extern orxDLLAPI orxBOOL orxFASTCALL orxProfiler_IsMarkerIDValid(orxS32 _s32MarkerID); 00118 00119 00123 extern orxDLLAPI void orxFASTCALL orxProfiler_PushMarker(orxS32 _s32MarkerID); 00124 00127 extern orxDLLAPI void orxFASTCALL orxProfiler_PopMarker(); 00128 00129 00132 extern orxDLLAPI void orxFASTCALL orxProfiler_ResetAllMarkers(); 00133 00136 extern orxDLLAPI void orxFASTCALL orxProfiler_ResetAllMaxima(); 00137 00141 extern orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetResetTime(); 00142 00143 00147 extern orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetMarkerCounter(); 00148 00149 00154 extern orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetNextMarkerID(orxS32 _s32MarkerID); 00155 00160 extern orxDLLAPI orxS32 orxFASTCALL orxProfiler_GetNextSortedMarkerID(orxS32 _s32MarkerID); 00161 00162 00167 extern orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetMarkerTime(orxS32 _s32MarkerID); 00168 00173 extern orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetMarkerMaxTime(orxS32 _s32MarkerID); 00174 00179 extern orxDLLAPI const orxSTRING orxFASTCALL orxProfiler_GetMarkerName(orxS32 _s32MarkerID); 00180 00185 extern orxDLLAPI orxU32 orxFASTCALL orxProfiler_GetMarkerPushCounter(orxS32 _s32MarkerID); 00186 00187 00192 extern orxDLLAPI orxBOOL orxFASTCALL orxProfiler_IsUniqueMarker(orxS32 _s32MarkerID); 00193 00194 00199 extern orxDLLAPI orxDOUBLE orxFASTCALL orxProfiler_GetUniqueMarkerStartTime(orxS32 _s32MarkerID); 00200 00205 extern orxDLLAPI orxU32 orxFASTCALL orxProfiler_GetUniqueMarkerDepth(orxS32 _s32MarkerID); 00206 00207 00208 #endif /* _orxPROFILER_H_ */ 00209
1.5.6