BearishSun vor 10 Jahren
Ursprung
Commit
9c07b1508e

+ 4 - 0
MBansheeEngine/RenderTexture.cs

@@ -5,6 +5,10 @@ using System.Text;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Base class for all render textures of specific dimensions. Render textures allow the rendering to be performed
+    /// into a texture as opposed to a frame buffer.
+    /// </summary>
     public class RenderTexture : RenderTarget
     {
 

+ 34 - 0
MBansheeEngine/RenderTexture2D.cs

@@ -6,14 +6,34 @@ using System.Text;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// A two dimensional render texture. Allows rendering to be performed into a 2D texture which can then be read, as
+    /// opposed to rendering directly into the frame buffer.
+    /// </summary>
     public class RenderTexture2D : RenderTexture
     {
+        /// <summary>
+        /// Creates a new 2D render texture.
+        /// </summary>
+        /// <param name="format">Pixel format of the texture. Format must be a valid uncompressed color format.</param>
+        /// <param name="width">Width of the texture in pixels.</param>
+        /// <param name="height">Height of the texture in pixels.</param>
+        /// <param name="numSamples">Number of samples contained per pixel.</param>
+        /// <param name="gammaCorrection">Determines should the pixels written on the texture be gamma corrected.</param>
+        /// <param name="createDepth">Should the render texture also contain a depth/stencil buffer.</param>
+        /// <param name="depthStencilFormat">Format of the depth/stencil buffer, if <paramref name="createDepth"/> is
+        ///                                  enabled. Format must be a valid depth/stencil format.</param>
         public RenderTexture2D(PixelFormat format, int width, int height, int numSamples = 1, 
             bool gammaCorrection = false, bool createDepth = true, PixelFormat depthStencilFormat = PixelFormat.D24S8)
         {
             Internal_CreateDetailed(this, format, width, height, numSamples, gammaCorrection, createDepth, depthStencilFormat);
         }
 
+        /// <summary>
+        /// Creates a new 2D render texture using existing textures as render destinations.
+        /// </summary>
+        /// <param name="colorSurface">Color texture to render color data to.</param>
+        /// <param name="depthStencilSurface">Optional depth/stencil texture to render depth/stencil data to.</param>
         public RenderTexture2D(Texture2D colorSurface, Texture2D depthStencilSurface = null)
         {
             IntPtr[] colorSurfaceInstances = new IntPtr[1];
@@ -26,6 +46,11 @@ namespace BansheeEngine
             Internal_Create(this, colorSurfaceInstances, depthStencilInstance);
         }
 
+        /// <summary>
+        /// Creates a new 2D render texture using one or multiple color textures and a depth/stencil texture.
+        /// </summary>
+        /// <param name="colorSurfaces">Color texture(s) to render color data to. </param>
+        /// <param name="depthStencilSurface">>Optional depth/stencil texture to render depth/stencil data to.</param>
         public RenderTexture2D(Texture2D[] colorSurfaces, Texture2D depthStencilSurface = null)
         {
             IntPtr[] colorSurfaceInstances = new IntPtr[colorSurfaces.Length];
@@ -40,6 +65,9 @@ namespace BansheeEngine
             Internal_Create(this, colorSurfaceInstances, depthStencilInstance);
         }
 
+        /// <summary>
+        /// Returns the primary color surface that contains rendered color data.
+        /// </summary>
         public Texture2D colorSurface
         {
             get
@@ -50,6 +78,9 @@ namespace BansheeEngine
             }
         }
 
+        /// <summary>
+        /// Returns all of the color surfaces.
+        /// </summary>
         public Texture2D[] colorSurfaces
         {
             get
@@ -60,6 +91,9 @@ namespace BansheeEngine
             }
         }
 
+        /// <summary>
+        /// Returns the depth/stencil surface that contains rendered depth and stencil data.
+        /// </summary>
         public Texture2D depthStencilSurface
         {
             get

+ 4 - 1
MBansheeEngine/Resource.cs

@@ -3,7 +3,10 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    public class Resource : ScriptObject // TODO - Dummy class
+    /// <summary>
+    /// Base class for all resources. Resources can be persistently referenced by scene objects or other resources.
+    /// </summary>
+    public class Resource : ScriptObject
     {
 
     }

+ 20 - 0
MBansheeEngine/Resources.cs

@@ -3,19 +3,39 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Handles dynamic loading of resources during runtime. 
+    /// </summary>
     public static class Resources
     {
+        /// <summary>
+        /// Loads a resource at the specified path. If running outside of the editor you must make sure to mark that 
+        /// the resource gets included in the build. If running inside the editor this has similar functionality as
+        /// if loading using the project library.
+        /// </summary>
+        /// <typeparam name="T">Type of the resource.</typeparam>
+        /// <param name="path">Path of the resource, relative to game directory. If running from editor this will be
+        ///                    the same location as resource location in the project library.</param>
+        /// <returns>Loaded resource, or null if resource cannot be found.</returns>
         public static T Load<T>(string path) where T : Resource
         {
             return (T)Internal_Load(path);
         }
 
+        /// <summary>
+        /// Unloads a resource, freeing its memory.
+        /// </summary>
+        /// <param name="resource">Resource to unload.</param>
         public static void Unload(Resource resource)
         {
             if (resource != null)
                 Internal_Unload(resource.GetCachedPtr());
         }
 
+        /// <summary>
+        /// Unloads all resources that are no longer referenced. Usually the system keeps resources in memory even if
+        /// they are no longer referenced to avoid constant loading/unloading if resource is often passed around.
+        /// </summary>
         public static void UnloadUnused()
         {
             Internal_UnloadUnused();

+ 17 - 0
MBansheeEngine/Scene.cs

@@ -2,22 +2,39 @@
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Handles operations with the active scene (level).
+    /// </summary>
     public static class Scene
     {
+        /// <summary>
+        /// Returns the UUID of the scene prefab. This is empty if scene hasn't been saved yet.
+        /// </summary>
         internal static string ActiveSceneUUID { get; set; }
 
+        /// <summary>
+        /// Checks did we make any modifications to the scene since it was last saved.
+        /// </summary>
+        /// <returns>True if the scene was never saved, or was modified after last save.</returns>
         public static bool IsModified()
         {
             // TODO - Needs implementing
             return true;
         }
 
+        /// <summary>
+        /// Clears all scene objects from the current scene.
+        /// </summary>
         public static void Clear()
         {
             Internal_ClearScene();
             ActiveSceneUUID = null;
         }
 
+        /// <summary>
+        /// Loads a new scene.
+        /// </summary>
+        /// <param name="path">Path to the prefab to load.</param>
         public static void Load(string path)
         {
             Clear();