Browse Source

Mention EventProfiler in the documentation. Simplify code in DebugHud to activate/deactivate event profiler.

Lasse Öörni 9 years ago
parent
commit
2ca6d16b28
3 changed files with 7 additions and 18 deletions
  1. 1 0
      Docs/GettingStarted.dox
  2. 2 0
      Docs/Reference.dox
  3. 4 18
      Source/Urho3D/Engine/DebugHud.cpp

+ 1 - 0
Docs/GettingStarted.dox

@@ -460,6 +460,7 @@ F1          Toggle console
 F2          Toggle profiling display
 F3          Toggle physics debug geometry
 F4          Toggle octree debug geometry
+F5          Toggle event profiling display
 \endverbatim
 
 If a joystick is connected, it can also be used for controlling the player character.

+ 2 - 0
Docs/Reference.dox

@@ -77,6 +77,7 @@ After Engine initialization, the following subsystems will always exist:
 The following subsystems are optional, so GetSubsystem() may return null if they have not been created:
 
 - Profiler: Provides hierarchical function execution time measurement using the operating system performance counter. Exists if profiling has been compiled in (configurable from the root CMakeLists.txt)
+- EventProfiler: Same as Profiler but for events.
 - Graphics: Manages the application window, the rendering context and resources. Exists if not in headless mode.
 - Renderer: Renders scenes in 3D and manages rendering quality settings. Exists if not in headless mode.
 - Script: Provides the AngelScript execution environment. Needs to be created and registered manually.
@@ -185,6 +186,7 @@ The full list of supported parameters, their datatypes and default values:
 - LogName (string) %Log filename. Default "Urho3D.log".
 - FrameLimiter (bool) Whether to cap maximum framerate to 200 (desktop) or 60 (Android/iOS.) Default true.
 - WorkerThreads (bool) Whether to create worker threads for the %WorkQueue subsystem according to available CPU cores. Default true.
+- EventProfiler (bool) Whether to create the EventProfiler subsystem. Default true.
 - ResourcePrefixPaths (string) A semicolon-separated list of resource prefix paths to use. If not specified then the default prefix path is set to executable path. The resource prefix paths can also be defined using URHO3D_PREFIX_PATH env-var. When both are defined, the paths set by -pp takes higher precedence.
 - ResourcePaths (string) A semicolon-separated list of resource paths to use. If corresponding packages (ie. Data.pak for Data directory) exist they will be used instead. Default "Data;CoreData".
 - ResourcePackages (string) A semicolon-separated list of resource packages to use. Default empty.

+ 4 - 18
Source/Urho3D/Engine/DebugHud.cpp

@@ -238,24 +238,10 @@ void DebugHud::SetMode(unsigned mode)
     memoryText_->SetVisible((mode & DEBUGHUD_SHOW_MEMORY) != 0);
     eventProfilerText_->SetVisible((mode & DEBUGHUD_SHOW_EVENTPROFILER) != 0);
 #ifdef URHO3D_PROFILING
-    if ((mode & DEBUGHUD_SHOW_EVENTPROFILER) != 0)
-    {
-        // event profiler is created on engine initialization if "EventProfiler" parameter is set
-        EventProfiler* eventProfiler = GetSubsystem<EventProfiler>();
-        if (eventProfiler)
-            EventProfiler::SetActive(true);
-    }
-    else
-    {
-        // event profiler is created on engine initialization if "EventProfiler" parameter is set
-        EventProfiler* eventProfiler = GetSubsystem<EventProfiler>();
-        if (eventProfiler)
-        {
-            EventProfiler::SetActive(false);
-            eventProfiler->Clear();
-        }
-           
-    }
+    // Event profiler is created on engine initialization if "EventProfiler" parameter is set
+    EventProfiler* eventProfiler = GetSubsystem<EventProfiler>();
+    if (eventProfiler)
+        EventProfiler::SetActive((mode & DEBUGHUD_SHOW_EVENTPROFILER) != 0);
 #endif
     mode_ = mode;
 }