Skip to content

Commit

Permalink
Merge pull request #8250 from Maniekko/docs/misc
Browse files Browse the repository at this point in the history
[Documentation] Miscellaneous XML documentation
  • Loading branch information
SimonDarksideJ committed May 10, 2024
2 parents b9b7b8c + 22bf195 commit 08b7d2a
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 10 deletions.
14 changes: 10 additions & 4 deletions MonoGame.Framework/Game.cs
Expand Up @@ -86,7 +86,8 @@ public Game()
PlatformConstruct();

}


/// <summary/>
~Game()
{
Dispose(false);
Expand All @@ -100,14 +101,16 @@ internal void Log(string Message)

#region IDisposable Implementation

private bool _isDisposed;
private bool _isDisposed;
/// <inheritdoc cref="IDisposable.Dispose()"/>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
EventHelpers.Raise(this, Disposed, EventArgs.Empty);
}


/// <summary/>
protected virtual void Dispose(bool disposing)
{
if (!_isDisposed)
Expand Down Expand Up @@ -192,7 +195,10 @@ public GameComponentCollection Components
{
get { return _components; }
}


/// <summary>
/// Gets or sets time to sleep between frames when the game is not active
/// </summary>
public TimeSpan InactiveSleepTime
{
get { return _inactiveSleepTime; }
Expand Down
13 changes: 13 additions & 0 deletions MonoGame.Framework/GameComponent.cs
Expand Up @@ -20,6 +20,10 @@ public class GameComponent : IGameComponent, IUpdateable, IDisposable
/// </summary>
public Game Game { get; private set; }

/// <summary>
/// Indicates whether <see cref="Update(GameTime)">GameComponent.Update(GameTime)</see> should be
/// called when <see cref="Game.Update(GameTime)">Game.Update(GameTime)</see> is called.
/// </summary>
public bool Enabled
{
get { return _enabled; }
Expand All @@ -33,6 +37,11 @@ public bool Enabled
}
}

/// <summary>
/// Indicates the order in which the <see cref="GameComponent"/>
/// should be updated relative to other <see cref="GameComponent"/> instances.
/// Lower values are updated first.
/// </summary>
public int UpdateOrder
{
get { return _updateOrder; }
Expand Down Expand Up @@ -61,11 +70,15 @@ public GameComponent(Game game)
this.Game = game;
}

/// <summary/>
~GameComponent()
{
Dispose(false);
}

/// <summary>
/// Called when the <see cref="GameComponent"/> needs to be initialized.
/// </summary>
public virtual void Initialize() { }

/// <summary>
Expand Down
7 changes: 7 additions & 0 deletions MonoGame.Framework/GameWindow.cs
Expand Up @@ -218,6 +218,9 @@ protected void OnOrientationChanged ()
EventHelpers.Raise(this, OrientationChanged, EventArgs.Empty);
}

/// <summary>
/// Called when the window needs to be painted.
/// </summary>
protected void OnPaint ()
{
}
Expand Down Expand Up @@ -254,6 +257,10 @@ internal void OnFileDrop(FileDropEventArgs e)
EventHelpers.Raise(this, FileDrop, e);
}

/// <summary>
/// Sets the supported display orientations.
/// </summary>
/// <param name="orientations">Supported display orientations</param>
protected internal abstract void SetSupportedOrientations (DisplayOrientation orientations);

/// <summary>
Expand Down
5 changes: 4 additions & 1 deletion MonoGame.Framework/Graphics/Effect/SkinnedEffect.cs
Expand Up @@ -19,7 +19,10 @@ namespace Microsoft.Xna.Framework.Graphics
/// Built-in effect for rendering skinned character models.
/// </summary>
public class SkinnedEffect : Effect, IEffectMatrices, IEffectLights, IEffectFog, IEffectBones
{
{
/// <summary>
/// The maximum number of bones.
/// </summary>
public const int MaxBones = 72;

#region Effect Parameters
Expand Down
3 changes: 3 additions & 0 deletions MonoGame.Framework/Graphics/GraphicsDebug.cs
Expand Up @@ -4,6 +4,9 @@

namespace Microsoft.Xna.Framework.Graphics
{
/// <summary>
/// Represents a class for debugging graphics.
/// </summary>
public partial class GraphicsDebug
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions MonoGame.Framework/Graphics/OcclusionQuery.cs
Expand Up @@ -6,6 +6,9 @@

namespace Microsoft.Xna.Framework.Graphics
{
/// <summary>
/// Used to perform an occlusion query against the latest drawn objects.
/// </summary>
public partial class OcclusionQuery : GraphicsResource
{
private bool _inBeginEndPair; // true if Begin was called and End was not yet called.
Expand Down
6 changes: 6 additions & 0 deletions MonoGame.Framework/Graphics/PresentationParameters.cs
Expand Up @@ -15,10 +15,16 @@

namespace Microsoft.Xna.Framework.Graphics
{
/// <summary>
/// Contains graphics presentation parameters.
/// </summary>
public class PresentationParameters
{
#region Constants

/// <summary>
/// Default presentation rate
/// </summary>
public const int DefaultPresentRate = 60;

#endregion Constants
Expand Down
18 changes: 13 additions & 5 deletions MonoGame.Framework/Graphics/SpriteFont.cs
Expand Up @@ -11,7 +11,9 @@

namespace Microsoft.Xna.Framework.Graphics
{

/// <summary>
/// Represents a font texture.
/// </summary>
public sealed class SpriteFont
{
internal static class Errors
Expand Down Expand Up @@ -377,10 +379,16 @@ public struct Glyph
/// <summary>
/// Width of the character before kerning is applied.
/// </summary>
public float WidthIncludingBearings;

public static readonly Glyph Empty = new Glyph();

public float WidthIncludingBearings;

/// <summary>
/// Returns an empty glyph.
/// </summary>
public static readonly Glyph Empty = new Glyph();

/// <summary>
/// Returns a string representation of this <see cref="Glyph"/>.
/// </summary>
public override string ToString ()
{
return "CharacterIndex=" + Character + ", Glyph=" + BoundsInTexture + ", Cropping=" + Cropping + ", Kerning=" + LeftSideBearing + "," + Width + "," + RightSideBearing;
Expand Down
6 changes: 6 additions & 0 deletions MonoGame.Framework/Platform/Graphics/IWindowInfo.OpenGL.cs
Expand Up @@ -6,8 +6,14 @@

namespace MonoGame.OpenGL
{
/// <summary>
/// Represents an interface for retrieving window information.
/// </summary>
public interface IWindowInfo
{
/// <summary>
/// Gets the handle of the window.
/// </summary>
IntPtr Handle { get; }
}
}
Expand Up @@ -46,6 +46,7 @@ private bool PlatformGetResult(out int pixelCount)
return true;
}

/// <summary/>
protected override void Dispose(bool disposing)
{
if (!IsDisposed)
Expand Down
Expand Up @@ -45,6 +45,7 @@ private void PlatformGraphicsDeviceResetting()
{
}

/// <summary/>
protected override void Dispose(bool disposing)
{
if (!IsDisposed)
Expand Down
Expand Up @@ -41,6 +41,7 @@ TextureTarget IRenderTarget.GetFramebufferTarget(RenderTargetBinding renderTarge
});
}

/// <summary/>
protected override void Dispose(bool disposing)
{
if (!IsDisposed)
Expand Down
1 change: 1 addition & 0 deletions MonoGame.Framework/Platform/Graphics/Texture.OpenGL.cs
Expand Up @@ -22,6 +22,7 @@ private void PlatformGraphicsDeviceResetting()
glLastSamplerState = null;
}

/// <summary/>
protected override void Dispose(bool disposing)
{
if (!IsDisposed)
Expand Down
Expand Up @@ -142,6 +142,7 @@ private void PlatformSetData<T>(int offsetInBytes, T[] data, int startIndex, int
}
}

/// <summary/>
protected override void Dispose(bool disposing)
{
if (!IsDisposed)
Expand Down
Expand Up @@ -187,6 +187,7 @@ private void GetBufferData<T>(int offsetInBytes, T[] data, int startIndex, int e

}

/// <summary/>
protected override void Dispose(bool disposing)
{
if (!IsDisposed)
Expand Down
7 changes: 7 additions & 0 deletions MonoGame.Framework/Quaternion.cs
Expand Up @@ -1013,6 +1013,13 @@ public Vector4 ToVector4()
return new Vector4(X,Y,Z,W);
}

/// <summary>
/// Deconstruction method for <see cref="Quaternion"/>.
/// </summary>
/// <param name="x">The x coordinate in 3d-space.</param>
/// <param name="y">The y coordinate in 3d-space.</param>
/// <param name="z">The z coordinate in 3d-space.</param>
/// <param name="w">The rotation component.</param>
public void Deconstruct(out float x, out float y, out float z, out float w)
{
x = X;
Expand Down

0 comments on commit 08b7d2a

Please sign in to comment.