Browse Source

Update documentation. Add contributor credit. Minor code comment fixes.

Lasse Öörni 8 years ago
parent
commit
90e95ab2e3

+ 2 - 0
Docs/GettingStarted.dox

@@ -401,6 +401,8 @@ The engine can be configured using the following command line options.
 -headless    Headless mode. No application window will be created
 -headless    Headless mode. No application window will be created
 -landscape   Use landscape orientations (iOS only, default)
 -landscape   Use landscape orientations (iOS only, default)
 -portrait    Use portrait orientations (iOS only)
 -portrait    Use portrait orientations (iOS only)
+-monitor <num> Monitor number to use
+-hz <freq>   Monitor refresh rate to use
 -prepass     Use light pre-pass rendering
 -prepass     Use light pre-pass rendering
 -deferred    Use deferred rendering
 -deferred    Use deferred rendering
 -renderpath <name> Use the named renderpath (must enter full resource name)
 -renderpath <name> Use the named renderpath (must enter full resource name)

+ 2 - 0
Docs/Reference.dox

@@ -210,6 +210,8 @@ The full list of supported parameters, their datatypes and default values: (also
 - ForceGL2 (bool) When true, forces OpenGL 2 use even if OpenGL 3 is available. No effect on Direct3D or mobile builds. Default false.
 - ForceGL2 (bool) When true, forces OpenGL 2 use even if OpenGL 3 is available. No effect on Direct3D or mobile builds. Default false.
 - Multisample (int) Hardware multisampling level. Default 1 (no multisampling.)
 - Multisample (int) Hardware multisampling level. Default 1 (no multisampling.)
 - Orientations (string) Space-separated list of allowed orientations. Effective only on iOS. All possible values are "LandscapeLeft", "LandscapeRight", "Portrait" and "PortraitUpsideDown". Default "LandscapeLeft LandscapeRight".
 - Orientations (string) Space-separated list of allowed orientations. Effective only on iOS. All possible values are "LandscapeLeft", "LandscapeRight", "Portrait" and "PortraitUpsideDown". Default "LandscapeLeft LandscapeRight".
+- Monitor (int) Monitor number to use. 0 is the default (primary) monitor.
+- RefreshRate (int) Monitor refresh rate in Hz to use.
 - DumpShaders (string) Filename to dump used shader variations to for precaching.
 - DumpShaders (string) Filename to dump used shader variations to for precaching.
 - %RenderPath (string) Default renderpath resource name. Default empty, which causes forward rendering (bin/CoreData/RenderPaths/Forward.xml) to be used.
 - %RenderPath (string) Default renderpath resource name. Default empty, which causes forward rendering (bin/CoreData/RenderPaths/Forward.xml) to be used.
 - Shadows (bool) Shadow rendering enable. Default true.
 - Shadows (bool) Shadow rendering enable. Default true.

+ 2 - 0
Docs/Urho3D.dox

@@ -139,6 +139,7 @@ Urho3D development, contributions and bugfixes by:
 - Ner'zhul
 - Ner'zhul
 - Newb I the Newbd
 - Newb I the Newbd
 - OvermindDL1
 - OvermindDL1
+- PredatorMF
 - Scellow
 - Scellow
 - Skrylar
 - Skrylar
 - TheComet93
 - TheComet93
@@ -1079,6 +1080,7 @@ From 1.6 to master:
 - The shader function GetWorldTangent() now returns a 4-component vector.
 - The shader function GetWorldTangent() now returns a 4-component vector.
 - Build system - the "Urho3D-CMake-common.cmake" file is now renamed to "UrhoCommon.cmake".
 - Build system - the "Urho3D-CMake-common.cmake" file is now renamed to "UrhoCommon.cmake".
 - StaticModel::SetModel() will no longer warn and redirect to AnimatedModel::SetModel() if the wrong function is called from C++ code. The AngelScript API will instead redirect properly without producing a warning.
 - StaticModel::SetModel() will no longer warn and redirect to AnimatedModel::SetModel() if the wrong function is called from C++ code. The AngelScript API will instead redirect properly without producing a warning.
+- Graphics::SetMode(), Graphics::GetDesktopResolution() and Graphics::GetResolutions() have gained an extra parameter to specify the monitor to use. Use Graphics::GetMonitorCount() to get the number of attached monitors. Monitor number 0 means the default primary monitor.
 */
 */
 
 
 }
 }

+ 1 - 0
README.md

@@ -93,6 +93,7 @@ Urho3D development, contributions and bugfixes by:
 - Ner'zhul
 - Ner'zhul
 - Newb I the Newbd
 - Newb I the Newbd
 - OvermindDL1
 - OvermindDL1
+- PredatorMF
 - Scellow
 - Scellow
 - Skrylar
 - Skrylar
 - TheComet93
 - TheComet93

+ 3 - 1
Source/Tools/Urho3DPlayer/Urho3DPlayer.cpp

@@ -82,7 +82,7 @@ void Urho3DPlayer::Setup()
         ErrorExit("Usage: Urho3DPlayer <scriptfile> [options]\n\n"
         ErrorExit("Usage: Urho3DPlayer <scriptfile> [options]\n\n"
             "The script file should implement the function void Start() for initializing the "
             "The script file should implement the function void Start() for initializing the "
             "application and subscribing to all necessary events, such as the frame update.\n"
             "application and subscribing to all necessary events, such as the frame update.\n"
-            #ifndef WIN32
+            #ifndef _WIN32
             "\nCommand line options:\n"
             "\nCommand line options:\n"
             "-x <res>     Horizontal resolution\n"
             "-x <res>     Horizontal resolution\n"
             "-y <res>     Vertical resolution\n"
             "-y <res>     Vertical resolution\n"
@@ -112,6 +112,8 @@ void Urho3DPlayer::Setup()
             "-headless    Headless mode. No application window will be created\n"
             "-headless    Headless mode. No application window will be created\n"
             "-landscape   Use landscape orientations (iOS only, default)\n"
             "-landscape   Use landscape orientations (iOS only, default)\n"
             "-portrait    Use portrait orientations (iOS only)\n"
             "-portrait    Use portrait orientations (iOS only)\n"
+            "-monitor <num> Monitor number to use\n"
+            "-hz <freq>   Monitor refresh rate to use\n"
             "-prepass     Use light pre-pass rendering\n"
             "-prepass     Use light pre-pass rendering\n"
             "-deferred    Use deferred rendering\n"
             "-deferred    Use deferred rendering\n"
             "-renderpath <name> Use the named renderpath (must enter full resource name)\n"
             "-renderpath <name> Use the named renderpath (must enter full resource name)\n"

+ 9 - 9
Source/Urho3D/Graphics/Direct3D11/D3D11Graphics.cpp

@@ -306,9 +306,9 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
 
 
     bool maximize = false;
     bool maximize = false;
 
 
-    // make sure monitor index is not bigger than the currently detected monitors
-    int monitors = SDL_GetNumVideoDisplays();
-    if (monitor >= monitors || monitor < 0)
+    // Make sure monitor index is not bigger than the currently detected monitors
+    int monitors = SDL_GetNumVideoDisplays();
+    if (monitor >= monitors || monitor < 0)
         monitor = 0; // this monitor is not present, use first monitor
         monitor = 0; // this monitor is not present, use first monitor
 
 
     // Find out the full screen mode display format (match desktop color depth)
     // Find out the full screen mode display format (match desktop color depth)
@@ -2102,12 +2102,12 @@ void Graphics::AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen,
         }
         }
         else 
         else 
         {
         {
-            if (newFullscreen || newBorderless) 
-            {
-                // reposition the window on the specified monitor
-                SDL_Rect display_rect;
-                SDL_GetDisplayBounds(monitor, &display_rect);
-                SDL_SetWindowPosition(window_, display_rect.x, display_rect.y);
+            if (newFullscreen || newBorderless) 
+            {
+                // Reposition the window on the specified monitor
+                SDL_Rect display_rect;
+                SDL_GetDisplayBounds(monitor, &display_rect);
+                SDL_SetWindowPosition(window_, display_rect.x, display_rect.y);
             }
             }
             SDL_SetWindowSize(window_, newWidth, newHeight);
             SDL_SetWindowSize(window_, newWidth, newHeight);
         }
         }

+ 3 - 3
Source/Urho3D/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -338,7 +338,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
 
 
     bool maximize = false;
     bool maximize = false;
 
 
-    // make sure monitor index is not bigger than the currently detected monitors
+    // Make sure monitor index is not bigger than the currently detected monitors
     int monitors = SDL_GetNumVideoDisplays();
     int monitors = SDL_GetNumVideoDisplays();
     if (monitor >= monitors || monitor < 0)
     if (monitor >= monitors || monitor < 0)
         monitor = 0; // this monitor is not present, use first monitor
         monitor = 0; // this monitor is not present, use first monitor
@@ -529,7 +529,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
     eventData[P_BORDERLESS] = borderless_;
     eventData[P_BORDERLESS] = borderless_;
     eventData[P_RESIZABLE] = resizable_;
     eventData[P_RESIZABLE] = resizable_;
     eventData[P_HIGHDPI] = highDPI_;
     eventData[P_HIGHDPI] = highDPI_;
-    eventData[P_MONITOR] = monitor_;
+    eventData[P_MONITOR] = monitor_;
     eventData[P_REFRESHRATE] = refreshRate_;
     eventData[P_REFRESHRATE] = refreshRate_;
     SendEvent(E_SCREENMODE, eventData);
     SendEvent(E_SCREENMODE, eventData);
 
 
@@ -2354,7 +2354,7 @@ void Graphics::AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen,
         else {
         else {
             if (newFullscreen || newBorderless) 
             if (newFullscreen || newBorderless) 
             {
             {
-                // reposition the window on the specified monitor
+                // Reposition the window on the specified monitor
                 SDL_Rect display_rect;
                 SDL_Rect display_rect;
                 SDL_GetDisplayBounds(monitor, &display_rect);
                 SDL_GetDisplayBounds(monitor, &display_rect);
                 SDL_SetWindowPosition(window_, display_rect.x, display_rect.y);
                 SDL_SetWindowPosition(window_, display_rect.x, display_rect.y);

+ 1 - 1
Source/Urho3D/Graphics/Graphics.h

@@ -372,7 +372,7 @@ public:
     PODVector<int> GetMultiSampleLevels() const;
     PODVector<int> GetMultiSampleLevels() const;
     /// Return the desktop resolution.
     /// Return the desktop resolution.
     IntVector2 GetDesktopResolution(int monitor) const;
     IntVector2 GetDesktopResolution(int monitor) const;
-    /// Return the number of currently connected monitors
+    /// Return the number of currently connected monitors.
     int GetMonitorCount() const;
     int GetMonitorCount() const;
     /// Return hardware format for a compressed image format, or 0 if unsupported.
     /// Return hardware format for a compressed image format, or 0 if unsupported.
     unsigned GetFormat(CompressedFormat format) const;
     unsigned GetFormat(CompressedFormat format) const;

+ 3 - 3
Source/Urho3D/Graphics/OpenGL/OGLGraphics.cpp

@@ -295,7 +295,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
     fullscreen = true;
     fullscreen = true;
 #endif
 #endif
 
 
-    // make sure monitor index is not bigger than the currently detected monitors
+    // Make sure monitor index is not bigger than the currently detected monitors
     int monitors = SDL_GetNumVideoDisplays();
     int monitors = SDL_GetNumVideoDisplays();
     if (monitor >= monitors || monitor < 0)
     if (monitor >= monitors || monitor < 0)
         monitor = 0; // this monitor is not present, use first monitor
         monitor = 0; // this monitor is not present, use first monitor
@@ -423,7 +423,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
             SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
             SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
         }
         }
 
 
-        // reposition the window on the specified monitor
+        // Reposition the window on the specified monitor
         SDL_Rect display_rect;
         SDL_Rect display_rect;
         SDL_GetDisplayBounds(monitor, &display_rect);
         SDL_GetDisplayBounds(monitor, &display_rect);
         SDL_SetWindowPosition(window_, display_rect.x, display_rect.y);
         SDL_SetWindowPosition(window_, display_rect.x, display_rect.y);
@@ -541,7 +541,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
     eventData[P_BORDERLESS] = borderless_;
     eventData[P_BORDERLESS] = borderless_;
     eventData[P_RESIZABLE] = resizable_;
     eventData[P_RESIZABLE] = resizable_;
     eventData[P_HIGHDPI] = highDPI_;
     eventData[P_HIGHDPI] = highDPI_;
-    eventData[P_MONITOR] = monitor_;
+    eventData[P_MONITOR] = monitor_;
     eventData[P_REFRESHRATE] = refreshRate_;
     eventData[P_REFRESHRATE] = refreshRate_;
     SendEvent(E_SCREENMODE, eventData);
     SendEvent(E_SCREENMODE, eventData);