Browse Source

Change virtual functions in Application back to public so that making conforming derived classes is more straightforward.

Lasse Öörni 12 years ago
parent
commit
afb9e2ce5f
4 changed files with 7 additions and 12 deletions
  1. 6 6
      Engine/Engine/Application.h
  2. 0 2
      Samples/01_HelloWorld/HelloWorld.h
  3. 0 3
      Samples/Sample.h
  4. 1 1
      Urho3D/bin/Urho3D.h

+ 6 - 6
Engine/Engine/Application.h

@@ -39,20 +39,20 @@ class Application : public Object
 public:
 public:
     /// Construct. Parse default engine parameters from the command line, and create the engine in an uninitialized state.
     /// Construct. Parse default engine parameters from the command line, and create the engine in an uninitialized state.
     Application(Context* context);
     Application(Context* context);
-    /// Initialize the engine and run the main loop, then return the application exit code. Catch out-of-memory exceptions while running.
-    int Run();
 
 
-protected:
-    /// Setup before engine initialization. This is a chance to eg. modify the engine parameters. Call ErrorExit() to terminate without initializing the engine.
+    /// Setup before engine initialization. This is a chance to eg. modify the engine parameters. Call ErrorExit() to terminate without initializing the engine. Called by Application.
     virtual void Setup() {}
     virtual void Setup() {}
-    /// Setup after engine initialization and before running the main loop. Call ErrorExit() to terminate without running the main loop.
+    /// Setup after engine initialization and before running the main loop. Call ErrorExit() to terminate without running the main loop. Called by Application.
     virtual void Start() {}
     virtual void Start() {}
-    /// Cleanup after the main loop.
+    /// Cleanup after the main loop. Called by Application.
     virtual void Stop() {}
     virtual void Stop() {}
 
 
+    /// Initialize the engine and run the main loop, then return the application exit code. Catch out-of-memory exceptions while running.
+    int Run();
     /// Show an error message (last log message if empty), terminate the main loop, and set failure exit code.
     /// Show an error message (last log message if empty), terminate the main loop, and set failure exit code.
     void ErrorExit(const String& message = String::EMPTY);
     void ErrorExit(const String& message = String::EMPTY);
 
 
+protected:
     /// Urho3D engine.
     /// Urho3D engine.
     SharedPtr<Engine> engine_;
     SharedPtr<Engine> engine_;
     /// Engine parameters map.
     /// Engine parameters map.

+ 0 - 2
Samples/01_HelloWorld/HelloWorld.h

@@ -48,10 +48,8 @@ private:
     /// Constructs a new Text instance, containing the 'Hello World' String, and
     /// Constructs a new Text instance, containing the 'Hello World' String, and
     /// adds it to the UI root element.
     /// adds it to the UI root element.
     void CreateText();
     void CreateText();
-
     /// Subscribe to application-wide logic update events.
     /// Subscribe to application-wide logic update events.
     void SubscribeToEvents();
     void SubscribeToEvents();
-
     /// Callback method invoked when a logic update event is dispatched.
     /// Callback method invoked when a logic update event is dispatched.
     void HandleUpdate(StringHash eventType, VariantMap& eventData);
     void HandleUpdate(StringHash eventType, VariantMap& eventData);
 };
 };

+ 0 - 3
Samples/Sample.h

@@ -45,7 +45,6 @@ public:
 
 
     /// Setup before engine initialization. Modifies the engine parameters.
     /// Setup before engine initialization. Modifies the engine parameters.
     virtual void Setup();
     virtual void Setup();
-
     /// Setup after engine initialization. Creates the logo, console & debug HUD.
     /// Setup after engine initialization. Creates the logo, console & debug HUD.
     virtual void Start();
     virtual void Start();
 
 
@@ -59,10 +58,8 @@ protected:
 private:
 private:
     /// Create logo.
     /// Create logo.
     void CreateLogo();
     void CreateLogo();
-
     /// Create console and debug HUD.
     /// Create console and debug HUD.
     void CreateConsoleAndDebugHud();
     void CreateConsoleAndDebugHud();
-
     /// Handle key down event.
     /// Handle key down event.
     void HandleKeyDown(StringHash eventType, VariantMap& eventData);
     void HandleKeyDown(StringHash eventType, VariantMap& eventData);
 };
 };

+ 1 - 1
Urho3D/bin/Urho3D.h

@@ -29,7 +29,7 @@ namespace Urho3D
 
 
 class ScriptFile;
 class ScriptFile;
 
 
-/// Urho3D script shell application, which runs a script specified on the command line.
+/// Urho3D main application, which runs a script specified on the command line.
 class Urho3D : public Application
 class Urho3D : public Application
 {
 {
     OBJECT(Urho3D);
     OBJECT(Urho3D);