Browse Source

Documentation

BearishSun 10 years ago
parent
commit
4df779fdd5

+ 1 - 2
BansheeCore/Include/BsStringTable.h

@@ -238,8 +238,7 @@ namespace BansheeEngine
 	};
 	};
 
 
 	/**
 	/**
-	 * @brief	Class that handles string localization. Stores strings and their translations
-	 * 			in various languages, along with the ability to switch currently active language.
+	 * @brief	Used for string localization. Stores strings and their translations in various languages.
 	 */
 	 */
 	class BS_CORE_EXPORT StringTable : public Resource
 	class BS_CORE_EXPORT StringTable : public Resource
 	{
 	{

+ 3 - 3
BansheeCore/Include/BsStringTableManager.h

@@ -7,7 +7,8 @@
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
 	/**
 	/**
-	 * @brief	Manages string tables used for localizing text.
+	 * @brief	Manages string tables used for localizing text. Allows you to add 
+	 *			and remove different tables and change the active language.
 	 */
 	 */
 	class BS_CORE_EXPORT StringTableManager : public Module<StringTableManager>
 	class BS_CORE_EXPORT StringTableManager : public Module<StringTableManager>
 	{
 	{
@@ -37,8 +38,7 @@ namespace BansheeEngine
 		void removeTable(UINT32 id);
 		void removeTable(UINT32 id);
 
 
 		/**
 		/**
-		 * @brief	Registers a new, or replaces an old string table at
-		 *			the specified id.
+		 * @brief	Registers a new string table or replaces an old one at the specified id.
 		 */
 		 */
 		void setTable(UINT32 id, HStringTable table);
 		void setTable(UINT32 id, HStringTable table);
 
 

+ 4 - 4
BansheeCore/Include/BsTexture.h

@@ -9,16 +9,16 @@
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
 	/**
 	/**
-	 * @brief	Properties that describe how is the texture used.
+	 * @brief	Flags that describe how is a texture used.
 	 */
 	 */
     enum TextureUsage
     enum TextureUsage
     {
     {
 		TU_STATIC = GBU_STATIC, /**< A regular texture that is not often or ever updated from the CPU. */
 		TU_STATIC = GBU_STATIC, /**< A regular texture that is not often or ever updated from the CPU. */
 		TU_DYNAMIC = GBU_DYNAMIC, /**< A regular texture that is often updated by the CPU. */
 		TU_DYNAMIC = GBU_DYNAMIC, /**< A regular texture that is often updated by the CPU. */
-		TU_RENDERTARGET = 0x200, /**< Texture used for rendering by the GPU. */
+		TU_RENDERTARGET = 0x200, /**< Texture that can be rendered to by the GPU. */
 		TU_DEPTHSTENCIL = 0x400, /**< Texture used as a depth/stencil buffer by the GPU. */
 		TU_DEPTHSTENCIL = 0x400, /**< Texture used as a depth/stencil buffer by the GPU. */
 		TU_LOADSTORE = 0x800, /**< Texture that allows load/store operations from the GPU program. */
 		TU_LOADSTORE = 0x800, /**< Texture that allows load/store operations from the GPU program. */
-		TU_CPUCACHED = 0x1000, /**< All texture data will also be cached in system memory. */
+		TU_CPUCACHED = 0x1000, /**< Ensures all texture data will also be cached in system memory. */
 		TU_DEFAULT = TU_STATIC
 		TU_DEFAULT = TU_STATIC
     };
     };
 
 
@@ -423,7 +423,7 @@ namespace BansheeEngine
 		 * @param	height				Height of the texture in pixels.
 		 * @param	height				Height of the texture in pixels.
 		 * @param	numMips				Number of mip-maps the texture has. This number excludes the full resolution map.
 		 * @param	numMips				Number of mip-maps the texture has. This number excludes the full resolution map.
 		 * @param	format				Format of the pixels.
 		 * @param	format				Format of the pixels.
-		 * @param	usage				Describes how we plan on using the texture in the pipeline.
+		 * @param	usage				Describes planned texture use.
 		 * @param	hwGammaCorrection	If true the texture data is assumed to have been gamma corrected and will be
 		 * @param	hwGammaCorrection	If true the texture data is assumed to have been gamma corrected and will be
 		 *								converted back to linear space when sampled on GPU.
 		 *								converted back to linear space when sampled on GPU.
 		 * @param	multisampleCount	If higher than 1, texture containing multiple samples per pixel is created.
 		 * @param	multisampleCount	If higher than 1, texture containing multiple samples per pixel is created.

+ 2 - 2
BansheeUtility/Include/BsTime.h

@@ -41,7 +41,7 @@ namespace BansheeEngine
 		float getFrameDelta() const { return mFrameDelta; }
 		float getFrameDelta() const { return mFrameDelta; }
 
 
 		/**
 		/**
-		 * @brief	Returns the number of the current frame. First frame is 0.
+		 * @brief	Returns the sequential index of the current frame. First frame is 0.
 		 *
 		 *
 		 * @return	The current frame.
 		 * @return	The current frame.
 		 *
 		 *
@@ -51,7 +51,7 @@ namespace BansheeEngine
 
 
 		/**
 		/**
 		 * @brief	Returns the precise time since application start, in microseconds.
 		 * @brief	Returns the precise time since application start, in microseconds.
-		 * 			Unlike other getTime methods this time is not only updated every frame,
+		 * 			Unlike other time methods this is not only updated every frame,
 		 * 			but will return exact time at the moment it is called.
 		 * 			but will return exact time at the moment it is called.
 		 * 			
 		 * 			
 		 * @note	You will generally only want to use this for performance measurements and similar.
 		 * @note	You will generally only want to use this for performance measurements and similar.

+ 1 - 1
MBansheeEngine/AsyncOp.cs

@@ -37,7 +37,7 @@ namespace BansheeEngine
         /// Retrieves the value returned by the async operation. Only valid if <see cref="IsCompleted"/> returns true.
         /// Retrieves the value returned by the async operation. Only valid if <see cref="IsCompleted"/> returns true.
         /// </summary>
         /// </summary>
         /// <typeparam name="T">Type of the return value. Caller must ensure to provide the valid type.</typeparam>
         /// <typeparam name="T">Type of the return value. Caller must ensure to provide the valid type.</typeparam>
-        /// <returns></returns>
+        /// <returns>Return value of the async operation.</returns>
         public T GetReturnValue<T>()
         public T GetReturnValue<T>()
         {
         {
             return (T)Internal_GetReturnValue(mCachedPtr);
             return (T)Internal_GetReturnValue(mCachedPtr);

+ 27 - 0
MBansheeEngine/Input.cs

@@ -170,12 +170,39 @@ namespace BansheeEngine
         public delegate void TextInputEventDelegate(TextInputEvent ev);
         public delegate void TextInputEventDelegate(TextInputEvent ev);
         public delegate void PointerEventDelegate(PointerEvent ev);
         public delegate void PointerEventDelegate(PointerEvent ev);
 
 
+        /// <summary>
+        /// Triggered when a button on any device is pressed.
+        /// </summary>
 		public static event ButtonEventDelegate OnButtonDown;
 		public static event ButtonEventDelegate OnButtonDown;
+
+        /// <summary>
+        /// Triggered when a button on any device is released.
+        /// </summary>
         public static event ButtonEventDelegate OnButtonUp;
         public static event ButtonEventDelegate OnButtonUp;
+
+        /// <summary>
+        /// Triggered when a textual character is entered.
+        /// </summary>
         public static event TextInputEventDelegate OnCharInput;
         public static event TextInputEventDelegate OnCharInput;
+
+        /// <summary>
+        /// Triggered when the pointing device (mouse, touch) is moved.
+        /// </summary>
         public static event PointerEventDelegate OnPointerMoved;
         public static event PointerEventDelegate OnPointerMoved;
+
+        /// <summary>
+        /// Triggered when a button on the pointing device (mouse, touch) is pressed.
+        /// </summary>
         public static event PointerEventDelegate OnPointerPressed;
         public static event PointerEventDelegate OnPointerPressed;
+
+        /// <summary>
+        /// Triggered when a button on the pointing device (mouse, touch) is released.
+        /// </summary>
         public static event PointerEventDelegate OnPointerReleased;
         public static event PointerEventDelegate OnPointerReleased;
+
+        /// <summary>
+        /// Triggered when a button on the pointing device (mouse, touch) is pressed twice in rappid succession.
+        /// </summary>
         public static event PointerEventDelegate OnPointerDoubleClick;
         public static event PointerEventDelegate OnPointerDoubleClick;
 
 
         /// <summary>
         /// <summary>

+ 48 - 5
MBansheeEngine/StringTable.cs

@@ -6,42 +6,79 @@ using System.Text;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// Used for string localization. Stores strings and their translations in various languages.
+    /// </summary>
     public sealed class StringTable : Resource
     public sealed class StringTable : Resource
     {
     {
-        // Constructor for runtime use only (dummy parameter to differentiate from the normal constructor)
+        /// <summary>
+        /// Constructor for runtime use only.
+        /// </summary>
+        /// <param name="dummy">Dummy parameter to differentiate from the normal constructor.</param>
         private StringTable(bool dummy)
         private StringTable(bool dummy)
         {  }
         {  }
 
 
+        /// <summary>
+        /// Creates a new empty string table.
+        /// </summary>
         public StringTable()
         public StringTable()
         {
         {
             Internal_CreateInstance(this);
             Internal_CreateInstance(this);
         }
         }
 
 
-        public int GetNumStrings()
+        /// <summary>
+        /// Returns the total number of strings in the table.
+        /// </summary>
+        public int StringCount
         {
         {
-            return Internal_GetNumStrings(mCachedPtr);
+            get { return Internal_GetNumStrings(mCachedPtr); }
         }
         }
 
 
-        public string[] GetIdentifiers()
+        /// <summary>
+        /// Returns all identifiers that the string table contains localized strings for.
+        /// </summary>
+        public string[] Identifiers
         {
         {
-            return Internal_GetIdentifiers(mCachedPtr);
+            get { return Internal_GetIdentifiers(mCachedPtr); }
         }
         }
 
 
+        /// <summary>
+        /// Adds or modifies string translation for the specified language.
+        /// </summary>
+        /// <param name="identifier">Identifier of the string to add/modify.</param>
+        /// <param name="language">Language to add/modify the translation for.</param>
+        /// <param name="value">Translated string in the specified language.</param>
         public void SetString(string identifier, Language language, string value)
         public void SetString(string identifier, Language language, string value)
         {
         {
             Internal_SetString(mCachedPtr, identifier, language, value);
             Internal_SetString(mCachedPtr, identifier, language, value);
         }
         }
 
 
+        /// <summary>
+        /// Adds or modifies string translation for the currently active language.
+        /// </summary>
+        /// <param name="identifier">Identifier of the string to add/modify.</param>
+        /// <param name="value">Translated string in the active language.</param>
         public void SetString(string identifier, string value)
         public void SetString(string identifier, string value)
         {
         {
             Internal_SetStringDefault(mCachedPtr, identifier, value);
             Internal_SetStringDefault(mCachedPtr, identifier, value);
         }
         }
 
 
+        /// <summary>
+        /// Removes the string described by identifier, from all languages.
+        /// </summary>
+        /// <param name="identifier">Identifier of the string to remove.</param>
         public void RemoveString(string identifier)
         public void RemoveString(string identifier)
         {
         {
             Internal_RemoveString(mCachedPtr, identifier);
             Internal_RemoveString(mCachedPtr, identifier);
         }
         }
 
 
+        /// <summary>
+        /// Returns a string translation for the specified language.
+        /// </summary>
+        /// <param name="identifier">Identifier of the string to look up.</param>
+        /// <param name="language">Language to retrieve the translation for.</param>
+        /// <returns>String translation for the specified language. Returns the identifier itself if one doesn't exist.
+        /// </returns>
         public string GetString(string identifier, Language language)
         public string GetString(string identifier, Language language)
         {
         {
             string value;
             string value;
@@ -49,6 +86,12 @@ namespace BansheeEngine
             return value;
             return value;
         }
         }
 
 
+        /// <summary>
+        /// Returns a string translation for the currently active language.
+        /// </summary>
+        /// <param name="identifier">Identifier of the string to look up.</param>
+        /// <returns>String translation for the active language. Returns the identifier itself if one doesn't exist.
+        /// </returns>
         public string GetString(string identifier)
         public string GetString(string identifier)
         {
         {
             string value;
             string value;

+ 36 - 9
MBansheeEngine/StringTables.cs

@@ -3,30 +3,53 @@ using System.Runtime.CompilerServices;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// Manages string tables used for localizing text. Allows you to add and remove different tables and change the 
+    /// active language.
+    /// </summary>
     public sealed class StringTables
     public sealed class StringTables
     {
     {
-        public Language GetActiveLanguage()
+        /// <summary>
+        /// Currently active language that determines the translations retrieved from localized strings.
+        /// </summary>
+        public Language ActiveLanguage
         {
         {
-            Language value;
-            Internal_GetActiveLanguage(out value);
-            return value;
+            get
+            {
+                Language value;
+                Internal_GetActiveLanguage(out value);
+                return value;
+            }
+            set
+            {
+                Internal_SetActiveLanguage(value);
+            }
         }
         }
 
 
-		public void SetActiveLanguage(Language language)
-		{
-            Internal_SetActiveLanguage(language);
-		}
-
+        /// <summary>
+        /// Returns the string table with the specified id. If the table doesn't exist new one is created.
+        /// </summary>
+        /// <param name="id">Identifier of the string table.</param>
+        /// <returns>String table with the specified identifier.</returns>
         public StringTable GetTable(int id)
         public StringTable GetTable(int id)
         {
         {
             return Internal_GetTable(id);
             return Internal_GetTable(id);
         }
         }
 
 
+        /// <summary>
+        /// Registers a new string table or replaces an old one at the specified id.
+        /// </summary>
+        /// <param name="id">Id of the string table to add/replace.</param>
+        /// <param name="table">New string table to assign to the specified identifier.</param>
         public void RegisterTable(int id, StringTable table)
         public void RegisterTable(int id, StringTable table)
         {
         {
             Internal_SetTable(id, table);
             Internal_SetTable(id, table);
         }
         }
 
 
+        /// <summary>
+        /// Removes the string table with the specified id.
+        /// </summary>
+        /// <param name="id">Identifier of the table to remove.</param>
         public void UnregisterTable(int id)
         public void UnregisterTable(int id)
         {
         {
             Internal_RemoveTable(id);
             Internal_RemoveTable(id);
@@ -45,6 +68,10 @@ namespace BansheeEngine
         private static extern void Internal_RemoveTable(int id);
         private static extern void Internal_RemoveTable(int id);
     }
     }
 
 
+    /// <summary>
+    /// A set of all languages that localized strings can be translated to. Loosely based on ISO 639-1 two letter language 
+    /// codes.
+    /// </summary>
     public enum Language
     public enum Language
 	{
 	{
 		Afar, 
 		Afar, 

+ 54 - 2
MBansheeEngine/Texture.cs

@@ -3,8 +3,15 @@ using System.Runtime.CompilerServices;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// Base class for all textures. Contains a set of pixels of certain dimensions that can be used for rendering
+    /// or read/written directly.
+    /// </summary>
     public class Texture : Resource
     public class Texture : Resource
     {
     {
+        /// <summary>
+        /// Returns the pixel format for the texture surface.
+        /// </summary>
         public PixelFormat PixelFormat
         public PixelFormat PixelFormat
         {
         {
             get
             get
@@ -15,6 +22,9 @@ namespace BansheeEngine
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Returns a value that signals the engine in what way is the texture expected to be used.
+        /// </summary>
         public TextureUsage Usage
         public TextureUsage Usage
         {
         {
             get
             get
@@ -25,6 +35,9 @@ namespace BansheeEngine
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Width of the texture in pixels.
+        /// </summary>
         public int Width
         public int Width
         {
         {
             get
             get
@@ -35,6 +48,9 @@ namespace BansheeEngine
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Height of the texture in pixels.
+        /// </summary>
         public int Height
         public int Height
         {
         {
             get
             get
@@ -45,6 +61,11 @@ namespace BansheeEngine
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Determines does the texture contain gamma corrected data. If true then the GPU will automatically convert
+        /// the pixels to linear space before reading from the texture, and convert them to gamma space when writing
+        /// to the texture.
+        /// </summary>
         public bool GammaCorrection
         public bool GammaCorrection
         {
         {
             get
             get
@@ -55,6 +76,9 @@ namespace BansheeEngine
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Number of samples per pixel. Zero or one mean no multisampling will be used.
+        /// </summary>
         public int SampleCount
         public int SampleCount
         {
         {
             get
             get
@@ -65,6 +89,9 @@ namespace BansheeEngine
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Returns how many mipmap levels does the texture contain.
+        /// </summary>
         public int MipmapCount
         public int MipmapCount
         {
         {
             get
             get
@@ -97,14 +124,39 @@ namespace BansheeEngine
         private static extern void Internal_GetMipmapCount(IntPtr thisPtr, out int value);
         private static extern void Internal_GetMipmapCount(IntPtr thisPtr, out int value);
     }
     }
 
 
-    // Note: Do not modify IDs as they must match TextureUsage C++ enum
-    public enum TextureUsage
+    /// <summary>
+    /// Flags that describe how is a texture used.
+    /// </summary>
+    public enum TextureUsage // Note: Must match C++ enum TextureUsage
     {
     {
+        /// <summary>
+        /// A regular texture that is not often or ever updated from the CPU.
+        /// </summary>
         Default = 0x1,
         Default = 0x1,
+
+        /// <summary>
+        /// A regular texture that is often updated by the CPU.
+        /// </summary>
         Dynamic = 0x2,
         Dynamic = 0x2,
+
+        /// <summary>
+        /// Texture that can be rendered to by the GPU.
+        /// </summary>
         Render = 0x200,
         Render = 0x200,
+
+        /// <summary>
+        /// Texture used as a depth/stencil buffer by the GPU.
+        /// </summary>
         DepthStencil = 0x400,
         DepthStencil = 0x400,
+
+        /// <summary>
+        /// Texture that allows load/store operations from the GPU program.
+        /// </summary>
         LoadStore = 0x800,
         LoadStore = 0x800,
+
+        /// <summary>
+        /// Ensures all texture data will also be cached in system memory so it can be read by the CPU.
+        /// </summary>
         CPUCached = 0x1000
         CPUCached = 0x1000
     }
     }
 }
 }

+ 54 - 1
MBansheeEngine/Texture2D.cs

@@ -3,33 +3,86 @@ using System.Runtime.CompilerServices;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// A two dimensional texture.
+    /// </summary>
     public sealed class Texture2D : Texture
     public sealed class Texture2D : Texture
     {
     {
-        // For internal use by the runtime
+        /// <summary>
+        /// Constructor for the internal use by the runtime.
+        /// </summary>
         private Texture2D()
         private Texture2D()
         { }
         { }
 
 
+        /// <summary>
+        /// Creates a new blank 2D texture.
+        /// </summary>
+        /// <param name="width">Width of the texture in pixels.</param>
+        /// <param name="height">Height of the texture in pixels.</param>
+        /// <param name="format">Format of the pixels.</param>
+        /// <param name="usage">Describes planned texture use.</param>
+        /// <param name="numSamples">If higher than 1, texture containing multiple samples per pixel is created.</param>
+        /// <param name="hasMipmaps">Should the texture allocate memory for the entire mip-map chain or only the top level.
+        ///                          </param>
+        /// <param name="gammaCorrection">If true the texture data is assumed to have be gamma corrected and will be
+        ///                               converted back to linear space when sampled on GPU, and converted to gamma space
+        ///                               before being written by the GPU.</param>
         public Texture2D(int width, int height, PixelFormat format = PixelFormat.R8G8B8A8, TextureUsage usage = TextureUsage.Default, 
         public Texture2D(int width, int height, PixelFormat format = PixelFormat.R8G8B8A8, TextureUsage usage = TextureUsage.Default, 
             int numSamples = 1, bool hasMipmaps = false, bool gammaCorrection = false)
             int numSamples = 1, bool hasMipmaps = false, bool gammaCorrection = false)
         {
         {
             Internal_CreateInstance(this, format, width, height, usage, numSamples, hasMipmaps, gammaCorrection);
             Internal_CreateInstance(this, format, width, height, usage, numSamples, hasMipmaps, gammaCorrection);
         }
         }
 
 
+        /// <summary>
+        /// Returns pixels for the specified mip level. Pixels will be read from system memory, which means the texture has
+        /// to be created with <see cref="TextureUsage.CPUCached"/>. If the texture was updated from the GPU the pixels
+        /// retrieved from this method will not reflect that, and you should use <see cref="GetGPUPixels"/> instead.
+        /// </summary>
+        /// <param name="mipLevel">Mip level to retrieve pixels for. Top level (0) is the highest quality.</param>
+        /// <returns>A set of pixels for the specified mip level.</returns>
         public PixelData GetPixels(int mipLevel = 0)
         public PixelData GetPixels(int mipLevel = 0)
         {
         {
             return Internal_GetPixels(mCachedPtr, mipLevel);
             return Internal_GetPixels(mCachedPtr, mipLevel);
         }
         }
 
 
+        /// <summary>
+        /// Sets pixels for the specified mip level.
+        /// </summary>
+        /// <param name="data">Pixels to assign to the specified mip level. Pixel data must match the mip level size
+        ///                    and texture pixel format.</param>
+        /// <param name="mipLevel">Mip level to set pixels for. Top level (0) is the highest quality.</param>
         public void SetPixels(PixelData data, int mipLevel = 0)
         public void SetPixels(PixelData data, int mipLevel = 0)
         {
         {
             Internal_SetPixels(mCachedPtr, data, mipLevel);
             Internal_SetPixels(mCachedPtr, data, mipLevel);
         }
         }
 
 
+        /// <summary>
+        /// Sets pixels for the specified mip level.
+        /// </summary>
+        /// <param name="data">Pixels to assign to the specified mip level. Size of the array must match texture width
+        ///                    multiplied by height. Data is expected to be laid out row by row. Pixels will be
+        ///                    automatically converted to the valid pixel format.</param>
+        /// <param name="mipLevel">Mip level to set pixels for. Top level (0) is the highest quality.</param>
         public void SetPixels(Color[] data, int mipLevel = 0)
         public void SetPixels(Color[] data, int mipLevel = 0)
         {
         {
+            if (data == null || data.Length != (Width*Height))
+            {
+                int size = data == null ? 0 : data.Length;
+                Debug.LogError("SetPixels called with incorrect size: " + size);
+            }
+
             Internal_SetPixelsArray(mCachedPtr, data, mipLevel);
             Internal_SetPixelsArray(mCachedPtr, data, mipLevel);
         }
         }
 
 
+        /// <summary>
+        /// Reads texture pixels directly from the GPU. This is similar to <see cref="GetPixels"/> but the texture doesn't
+        /// need to be created with <see cref="TextureUsage.CPUCached"/>, and the data will contain any updates performed by
+        /// the GPU. This method can be potentially slow as it introduces a CPU-GPU synchronization point. Additionally
+        /// this method is asynchronous which means the data is not available immediately.
+        /// </summary>
+        /// <param name="mipLevel">Mip level to retrieve pixels for. Top level (0) is the highest quality.</param>
+        /// <returns><see cref="AsyncOp"/> object that will contain <see cref="PixelData"/> object when the operation 
+        ///          completes.</returns>
         public AsyncOp GetGPUPixels(int mipLevel = 0)
         public AsyncOp GetGPUPixels(int mipLevel = 0)
         {
         {
             return Internal_GetGPUPixels(mCachedPtr, mipLevel);
             return Internal_GetGPUPixels(mCachedPtr, mipLevel);

+ 44 - 1
MBansheeEngine/Texture3D.cs

@@ -3,8 +3,14 @@ using System.Runtime.CompilerServices;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// A three dimensional texture.
+    /// </summary>
     public sealed class Texture3D : Texture
     public sealed class Texture3D : Texture
     {
     {
+        /// <summary>
+        /// Depth of the texture in pixels.
+        /// </summary>
         public int Depth
         public int Depth
         {
         {
             get
             get
@@ -15,26 +21,63 @@ namespace BansheeEngine
             }
             }
         }
         }
 
 
-        // For internal use by the runtime
+        /// <summary>
+        /// Constructor for internal use by the runtime.
+        /// </summary>
         private Texture3D()
         private Texture3D()
         { }
         { }
 
 
+        /// <summary>
+        /// Creates a new blank 3D texture.
+        /// </summary>
+        /// <param name="width">Width of the texture in pixels.</param>
+        /// <param name="height">Height of the texture in pixels.</param>
+        /// <param name="depth">Depth of the texture in pixels.</param>
+        /// <param name="format">Format of the pixels.</param>
+        /// <param name="usage">Describes planned texture use.</param>
+        /// <param name="hasMipmaps">Should the texture allocate memory for the entire mip-map chain or only the top level.
+        ///                          </param>
+        /// <param name="gammaCorrection">If true the texture data is assumed to have be gamma corrected and will be
+        ///                               converted back to linear space when sampled on GPU, and converted to gamma space
+        ///                               before being written by the GPU.</param>
         public Texture3D(PixelFormat format, int width, int height, int depth, TextureUsage usage = TextureUsage.Default, 
         public Texture3D(PixelFormat format, int width, int height, int depth, TextureUsage usage = TextureUsage.Default, 
             bool hasMipmaps = false, bool gammaCorrection = false)
             bool hasMipmaps = false, bool gammaCorrection = false)
         {
         {
             Internal_CreateInstance(this, format, width, height, depth, usage, hasMipmaps, gammaCorrection);
             Internal_CreateInstance(this, format, width, height, depth, usage, hasMipmaps, gammaCorrection);
         }
         }
 
 
+        /// <summary>
+        /// Returns pixels for the specified mip level. Pixels will be read from system memory, which means the texture has
+        /// to be created with <see cref="TextureUsage.CPUCached"/>. If the texture was updated from the GPU the pixels
+        /// retrieved from this method will not reflect that, and you should use <see cref="GetGPUPixels"/> instead.
+        /// </summary>
+        /// <param name="mipLevel">Mip level to retrieve pixels for. Top level (0) is the highest quality.</param>
+        /// <returns>A set of pixels for the specified mip level.</returns>
         public PixelData GetPixels(int mipLevel = 0)
         public PixelData GetPixels(int mipLevel = 0)
         {
         {
             return Internal_GetPixels(mCachedPtr, mipLevel);
             return Internal_GetPixels(mCachedPtr, mipLevel);
         }
         }
 
 
+        /// <summary>
+        /// Sets pixels for the specified mip level.
+        /// </summary>
+        /// <param name="data">Pixels to assign to the specified mip level. Pixel data must match the mip level size
+        ///                    and texture pixel format.</param>
+        /// <param name="mipLevel">Mip level to set pixels for. Top level (0) is the highest quality.</param>
         public void SetPixels(PixelData data, int mipLevel = 0)
         public void SetPixels(PixelData data, int mipLevel = 0)
         {
         {
             Internal_SetPixels(mCachedPtr, data, mipLevel);
             Internal_SetPixels(mCachedPtr, data, mipLevel);
         }
         }
 
 
+        /// <summary>
+        /// Reads texture pixels directly from the GPU. This is similar to <see cref="GetPixels"/> but the texture doesn't
+        /// need to be created with <see cref="TextureUsage.CPUCached"/>, and the data will contain any updates performed by
+        /// the GPU. This method can be potentially slow as it introduces a CPU-GPU synchronization point. Additionally
+        /// this method is asynchronous which means the data is not available immediately.
+        /// </summary>
+        /// <param name="mipLevel">Mip level to retrieve pixels for. Top level (0) is the highest quality.</param>
+        /// <returns><see cref="AsyncOp"/> object that will contain <see cref="PixelData"/> object when the operation 
+        ///          completes.</returns>
         public AsyncOp GetGPUPixels(int mipLevel = 0)
         public AsyncOp GetGPUPixels(int mipLevel = 0)
         {
         {
             return Internal_GetGPUPixels(mCachedPtr, mipLevel);
             return Internal_GetGPUPixels(mCachedPtr, mipLevel);

+ 48 - 1
MBansheeEngine/TextureCube.cs

@@ -3,28 +3,72 @@ using System.Runtime.CompilerServices;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// A cube texture. Cube texture consists of six two dimensional texture faces that can be accessed separately.
+    /// </summary>
     public sealed class TextureCube : Texture
     public sealed class TextureCube : Texture
     {
     {
-        // For internal use by the runtime
+        /// <summary>
+        /// Constructor for internal use by the runtime.
+        /// </summary>
         private TextureCube()
         private TextureCube()
         { }
         { }
 
 
+        /// <summary>
+        /// Creates a new blank cube texture.
+        /// </summary>
+        /// <param name="width">Width of a single face of the texture in pixels.</param>
+        /// <param name="height">Height of a single face of the texture in pixels.</param>
+        /// <param name="format">Format of the pixels.</param>
+        /// <param name="usage">Describes planned texture use.</param>
+        /// <param name="numSamples">If higher than 1, texture containing multiple samples per pixel is created.</param>
+        /// <param name="hasMipmaps">Should the texture allocate memory for the entire mip-map chain or only the top level.
+        ///                          </param>
+        /// <param name="gammaCorrection">If true the texture data is assumed to have be gamma corrected and will be
+        ///                               converted back to linear space when sampled on GPU, and converted to gamma space
+        ///                               before being written by the GPU.</param>
         public TextureCube(PixelFormat format, int width, int height, TextureUsage usage = TextureUsage.Default,
         public TextureCube(PixelFormat format, int width, int height, TextureUsage usage = TextureUsage.Default,
             int numSamples = 1, bool hasMipmaps = false, bool gammaCorrection = false)
             int numSamples = 1, bool hasMipmaps = false, bool gammaCorrection = false)
         {
         {
             Internal_CreateInstance(this, format, width, height, usage, numSamples, hasMipmaps, gammaCorrection);
             Internal_CreateInstance(this, format, width, height, usage, numSamples, hasMipmaps, gammaCorrection);
         }
         }
 
 
+        /// <summary>
+        /// Returns pixels for the specified mip level of the specified face. Pixels will be read from system memory, 
+        /// which means the texture has to be created with <see cref="TextureUsage.CPUCached"/>. If the texture was updated 
+        /// from the GPU the pixels retrieved from this method will not reflect that, and you should use 
+        /// <see cref="GetGPUPixels"/> instead.
+        /// </summary>
+        /// <param name="face">Face of the cube to access.</param>
+        /// <param name="mipLevel">Mip level to retrieve pixels for. Top level (0) is the highest quality.</param>
+        /// <returns>A set of pixels for the specified mip level.</returns>
         public PixelData GetPixels(CubeFace face = CubeFace.PositiveX, int mipLevel = 0)
         public PixelData GetPixels(CubeFace face = CubeFace.PositiveX, int mipLevel = 0)
         {
         {
             return Internal_GetPixels(mCachedPtr, face, mipLevel);
             return Internal_GetPixels(mCachedPtr, face, mipLevel);
         }
         }
 
 
+        /// <summary>
+        /// Sets pixels for the specified mip level of the specified face..
+        /// </summary>
+        /// <param name="data">Pixels to assign to the specified mip level. Pixel data must match the mip level size
+        ///                    and texture pixel format.</param>
+        /// <param name="face">Face of the cube to access.</param>
+        /// <param name="mipLevel">Mip level to set pixels for. Top level (0) is the highest quality.</param>
         public void SetPixels(PixelData data, CubeFace face = CubeFace.PositiveX, int mipLevel = 0)
         public void SetPixels(PixelData data, CubeFace face = CubeFace.PositiveX, int mipLevel = 0)
         {
         {
             Internal_SetPixels(mCachedPtr, data, face, mipLevel);
             Internal_SetPixels(mCachedPtr, data, face, mipLevel);
         }
         }
 
 
+        /// <summary>
+        /// Reads texture pixels directly from the GPU. This is similar to <see cref="GetPixels"/> but the texture doesn't
+        /// need to be created with <see cref="TextureUsage.CPUCached"/>, and the data will contain any updates performed by
+        /// the GPU. This method can be potentially slow as it introduces a CPU-GPU synchronization point. Additionally
+        /// this method is asynchronous which means the data is not available immediately.
+        /// </summary>
+        /// <param name="face">Face of the cube to access.</param>
+        /// <param name="mipLevel">Mip level to retrieve pixels for. Top level (0) is the highest quality.</param>
+        /// <returns><see cref="AsyncOp"/> object that will contain <see cref="PixelData"/> object when the operation 
+        ///          completes.</returns>
         public AsyncOp GetGPUPixels(CubeFace face = CubeFace.PositiveX, int mipLevel = 0)
         public AsyncOp GetGPUPixels(CubeFace face = CubeFace.PositiveX, int mipLevel = 0)
         {
         {
             return Internal_GetGPUPixels(mCachedPtr, face, mipLevel);
             return Internal_GetGPUPixels(mCachedPtr, face, mipLevel);
@@ -44,6 +88,9 @@ namespace BansheeEngine
         private static extern void Internal_SetPixels(IntPtr thisPtr, PixelData data, CubeFace face, int mipLevel);
         private static extern void Internal_SetPixels(IntPtr thisPtr, PixelData data, CubeFace face, int mipLevel);
     }
     }
 
 
+    /// <summary>
+    /// Indices for the faces of a cube texture.
+    /// </summary>
     public enum CubeFace
     public enum CubeFace
     {
     {
         PositiveX = 0,
         PositiveX = 0,

+ 23 - 0
MBansheeEngine/Time.cs

@@ -6,29 +6,52 @@ using System.Text;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// Manages all time related functionality.
+    /// </summary>
     public static class Time
     public static class Time
     {
     {
+        /// <summary>
+        /// Gets the time elapsed since application start, in seconds. Only gets updated once per frame.
+        /// </summary>
         public static float Elapsed
         public static float Elapsed
         {
         {
             get { return Internal_GetElapsed(); }
             get { return Internal_GetElapsed(); }
         }
         }
 
 
+        /// <summary>
+        /// Gets the time since last frame was executed, in seconds. Only gets updated once per frame.
+        /// </summary>
         public static float FrameDelta
         public static float FrameDelta
         {
         {
             get { return Internal_GetFrameDelta(); }
             get { return Internal_GetFrameDelta(); }
         }
         }
 
 
+        /// <summary>
+        /// Returns the sequential index of the current frame. First frame is 0.
+        /// </summary>
         public static UInt64 FrameIdx
         public static UInt64 FrameIdx
         {
         {
             get { return Internal_GetFrameNumber(); }
             get { return Internal_GetFrameNumber(); }
         }
         }
 
 
+        /// <summary>
+        /// Returns the precise time since application start, in microseconds. Unlike other time methods this is 
+        /// not only updated every frame, but will return exact time at the moment it is called.
+        /// </summary>
         public static UInt64 Precise
         public static UInt64 Precise
         {
         {
             get { return Internal_GetPrecise(); }
             get { return Internal_GetPrecise(); }
         }
         }
 
 
+        /// <summary>
+        /// Multiply to convert microseconds to seconds.
+        /// </summary>
         public const float MicroToSecond = 1.0f/1000000.0f;
         public const float MicroToSecond = 1.0f/1000000.0f;
+
+        /// <summary>
+        /// Multiply to convert seconds to microseconds.
+        /// </summary>
         public const float SecondToMicro = 1000000.0f;
         public const float SecondToMicro = 1000000.0f;
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]

+ 58 - 1
MBansheeEngine/VirtualInput.cs

@@ -6,14 +6,32 @@ using System.Text;
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+    /// <summary>
+    /// Handles virtual input that allows you to receive virtual input events that hide the actual physical input, allowing 
+    /// you to easily change the input keys while being transparent to the external code.
+    /// </summary>
     public static class VirtualInput
     public static class VirtualInput
     {
     {
         public delegate void OnButtonEventDelegate(VirtualButton btn, int deviceIdx);
         public delegate void OnButtonEventDelegate(VirtualButton btn, int deviceIdx);
 
 
+        /// <summary>
+        /// Triggered when a physical button combination corresponding to a virtual button is pressed.
+        /// </summary>
         public static event OnButtonEventDelegate OnButtonDown;
         public static event OnButtonEventDelegate OnButtonDown;
+
+        /// <summary>
+        /// Triggered when a physical button combination corresponding to a virtual button is released.
+        /// </summary>
         public static event OnButtonEventDelegate OnButtonUp;
         public static event OnButtonEventDelegate OnButtonUp;
+
+        /// <summary>
+        /// Triggered every frame while a physical button combination corresponding to a virtual button is being held down.
+        /// </summary>
         public static event OnButtonEventDelegate OnButtonHeld;
         public static event OnButtonEventDelegate OnButtonHeld;
 
 
+        /// <summary>
+        /// Input configuration that describes how physical keys map to virtual keys.
+        /// </summary>
         public static InputConfiguration KeyConfig
         public static InputConfiguration KeyConfig
         {
         {
             get
             get
@@ -26,39 +44,78 @@ namespace BansheeEngine
                 Internal_SetKeyConfig(value);
                 Internal_SetKeyConfig(value);
             }
             }
         }
         }
-		
+
+        /// <summary>
+        /// Checks if the physical button combination corresponding to the specified virtual button is being pressed this
+        /// frame.
+        /// </summary>
+        /// <param name="button">Virtual button to check.</param>
+        /// <param name="deviceIdx">Optional device index in case multiple input devices are available.</param>
 		public static bool IsButtonDown(VirtualButton button, int deviceIdx = 0)
 		public static bool IsButtonDown(VirtualButton button, int deviceIdx = 0)
 	    {
 	    {
             return Internal_IsButtonDown(button, deviceIdx);
             return Internal_IsButtonDown(button, deviceIdx);
 	    }
 	    }
 
 
+        /// <summary>
+        /// Checks if the physical button combination corresponding to the specified virtual button is being released this
+        /// frame.
+        /// </summary>
+        /// <param name="button">Virtual button to check.</param>
+        /// <param name="deviceIdx">Optional device index in case multiple input devices are available.</param>
         public static bool IsButtonUp(VirtualButton button, int deviceIdx = 0)
         public static bool IsButtonUp(VirtualButton button, int deviceIdx = 0)
         {
         {
             return Internal_IsButtonUp(button, deviceIdx);
             return Internal_IsButtonUp(button, deviceIdx);
         }
         }
 
 
+        /// <summary>
+        /// Checks if the physical button combination corresponding to the specified virtual button is being held down.
+        /// </summary>
+        /// <param name="button">Virtual button to check.</param>
+        /// <param name="deviceIdx">Index of the device to check.</param>
         public static bool IsButtonHeld(VirtualButton button, int deviceIdx = 0)
         public static bool IsButtonHeld(VirtualButton button, int deviceIdx = 0)
         {
         {
             return Internal_IsButtonHeld(button, deviceIdx);
             return Internal_IsButtonHeld(button, deviceIdx);
         }
         }
 
 
+        /// <summary>
+        /// Returns normalized value for the specified input axis. 
+        /// </summary>
+        /// <param name="axis">Virtual axis identifier.</param>
+        /// <param name="deviceIdx">Optional device index in case multiple input devices are available.</param>
+        /// <returns>Axis value, normally in [-1.0, 1.0] range, but can be outside the range for devices with unbound axes 
+        ///          (e.g. mouse).</returns>
         public static float GetAxisValue(VirtualAxis axis, int deviceIdx = 0)
         public static float GetAxisValue(VirtualAxis axis, int deviceIdx = 0)
         {
         {
             return Internal_GetAxisValue(axis, deviceIdx);
             return Internal_GetAxisValue(axis, deviceIdx);
         }
         }
 
 
+        /// <summary>
+        /// Triggered by the runtime when the virtual button is pressed.
+        /// </summary>
+        /// <param name="button">Virtual button that was pressed.</param>
+        /// <param name="deviceIdx">Index of the device the button was pressed on.</param>
         private static void Internal_TriggerButtonDown(VirtualButton button, int deviceIdx)
         private static void Internal_TriggerButtonDown(VirtualButton button, int deviceIdx)
         {
         {
             if (OnButtonDown != null)
             if (OnButtonDown != null)
                 OnButtonDown(button, deviceIdx);
                 OnButtonDown(button, deviceIdx);
         }
         }
 
 
+        /// <summary>
+        /// Triggered by the runtime when the virtual button is released.
+        /// </summary>
+        /// <param name="button">Virtual button that was released.</param>
+        /// <param name="deviceIdx">Index of the device the button was released on.</param>
         private static void Internal_TriggerButtonUp(VirtualButton button, int deviceIdx)
         private static void Internal_TriggerButtonUp(VirtualButton button, int deviceIdx)
         {
         {
             if (OnButtonUp != null)
             if (OnButtonUp != null)
                 OnButtonUp(button, deviceIdx);
                 OnButtonUp(button, deviceIdx);
         }
         }
 
 
+        /// <summary>
+        /// Triggered by the runtime every frame while a virtual button is being held down.
+        /// </summary>
+        /// <param name="button">Virtual button that is being held down.</param>
+        /// <param name="deviceIdx">Index of the device the button is being held down on.</param>
         private static void Internal_TriggerButtonHeld(VirtualButton button, int deviceIdx)
         private static void Internal_TriggerButtonHeld(VirtualButton button, int deviceIdx)
         {
         {
             if (OnButtonHeld != null)
             if (OnButtonHeld != null)

+ 1 - 1
TODO.txt

@@ -54,7 +54,6 @@ Polish
 
 
 Ribek use:
 Ribek use:
  - Hook up color picker to guicolor field
  - Hook up color picker to guicolor field
- - UseCustomInspector isn't implemented
  - Camera, Renderable, Material, Texture inspector
  - Camera, Renderable, Material, Texture inspector
  - Test release mode
  - Test release mode
  - Ability to create assets in Project view (At least Material)
  - Ability to create assets in Project view (At least Material)
@@ -84,6 +83,7 @@ Stage 2 polish:
  - C# script compiling in editor
  - C# script compiling in editor
  - VS integration
  - VS integration
  - When managed exception happens log an error and continue execution
  - When managed exception happens log an error and continue execution
+  - Doing a pass over all methods referencing Internal_ methods ensuring they do proper checking on C# side would be good
  - Game publishing (Build window, collect resources, output exe, default viewport) (described below)
  - Game publishing (Build window, collect resources, output exe, default viewport) (described below)
 
 
 Optional:
 Optional: