diff --git a/examples/30.Profiling/Profiling.vcproj b/examples/30.Profiling/Profiling.vcproj new file mode 100644 index 00000000..494f9bb4 --- /dev/null +++ b/examples/30.Profiling/Profiling.vcproj @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/30.Profiling/Profiling_vc10.vcxproj b/examples/30.Profiling/Profiling_vc10.vcxproj new file mode 100644 index 00000000..7fba2fa9 --- /dev/null +++ b/examples/30.Profiling/Profiling_vc10.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 30.Profiling + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97} + 30.Profiling + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\30.Profiling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Profiling.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\30.Profiling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Profiling.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\30.Profiling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\30.Profiling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/30.Profiling/Profiling_vc11.vcxproj b/examples/30.Profiling/Profiling_vc11.vcxproj new file mode 100644 index 00000000..42242943 --- /dev/null +++ b/examples/30.Profiling/Profiling_vc11.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 24.CursorControl + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97} + 24.CursorControl + Win32Proj + + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\24.CursorControl.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)CursorControl.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\24.CursorControl.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)CursorControl.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\24.CursorControl.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\24.CursorControl.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/30.Profiling/Profiling_vc8.vcproj b/examples/30.Profiling/Profiling_vc8.vcproj new file mode 100644 index 00000000..faa34e95 --- /dev/null +++ b/examples/30.Profiling/Profiling_vc8.vcproj @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/30.Profiling/Profiling_vc9.vcproj b/examples/30.Profiling/Profiling_vc9.vcproj new file mode 100644 index 00000000..0b237daa --- /dev/null +++ b/examples/30.Profiling/Profiling_vc9.vcproj @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/BuildAllExamples_vc10.sln b/examples/BuildAllExamples_vc10.sln index 11190a60..cc6667e3 100644 --- a/examples/BuildAllExamples_vc10.sln +++ b/examples/BuildAllExamples_vc10.sln @@ -144,6 +144,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "25.XmlHandling", "25.XmlHan {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "30.Profiling", "30.Profiling\Profiling_vc10.vcxproj", "{65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -156,8 +158,6 @@ Global {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.2 = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.4 = SDL-Debug|x64 {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 @@ -402,6 +402,14 @@ Global {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.Build.0 = Release|Win32 {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.ActiveCfg = Release|x64 {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.Build.0 = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.ActiveCfg = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.Build.0 = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.ActiveCfg = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.Build.0 = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.ActiveCfg = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.Build.0 = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.ActiveCfg = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/include/CProfiler.h b/include/CProfiler.h index 58f63dfa..b17babb8 100644 --- a/include/CProfiler.h +++ b/include/CProfiler.h @@ -64,13 +64,14 @@ struct SProfileData return TimeSum; } +private: + //! Convert the whole data into a string core::stringw getAsString() const; //! Return a string which describes the columns returned by getAsString static core::stringw makeTitleString(); -private: // just to be used for searching as it does no initialization besides id SProfileData(u32 id) : Id(id) {} @@ -94,7 +95,7 @@ private: // And also why it works with id's instead of strings in the start/stop functions even if it makes using // the class slightly harder. // The class comes without reference-counting because the profiler-instance is never released (TBD). -class CProfiler +class IRRLICHT_API CProfiler { public: //! Constructor. You could use this to create a new profiler, but usually getProfiler() is used to access the global instance. @@ -260,7 +261,7 @@ But you can use the profiler for profiling your own projects without that. */ IRRLICHT_API CProfiler& IRRCALLCONV getProfiler(); //! Class where the objects profile their own life-time. -/** This is a compfort wrapper around the CProfiler start/stop mechanism which is easier to use +/** This is a comfort wrapper around the CProfiler start/stop mechanism which is easier to use when you want to profile a scope. You only have to create an object and it will profile it's own lifetime for the given id. */ class CProfileScope @@ -277,7 +278,7 @@ public: //! Object will create the given name, groupName combination for the id if it doesn't exist already /** \param id: Should be >= 0 as negative id's are reserved for Irrlicht. Also very large numbers (near INT_MAX) might - have been created already by the autoamtic add function of ::CProfiler. + have been created already by the automatic add function of ::CProfiler. \param name: Name for displaying profile data. \param groupName: Each id belongs into a group - this helps on displaying profile data. */ CProfileScope(s32 id, const core::stringw &name, const core::stringw &groupName)