Guest User

IScreenManager

a guest
May 26th, 2018
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.26 KB | None | 0 0
  1. using ArbitraryPixel.Common.Graphics;
  2. using Microsoft.Xna.Framework;
  3. using System;
  4.  
  5. namespace ArbitraryPixel.Common.Screen
  6. {
  7.     /// <summary>
  8.     /// Represents an object that manages the screen.
  9.     /// </summary>
  10.     public interface IScreenManager
  11.     {
  12.         #region Properties
  13.         /// <summary>
  14.         /// Whether or not this screen manager should be in full screen mode.
  15.         /// </summary>
  16.         bool IsFullScreen { get; set; }
  17.  
  18.         /// <summary>
  19.         /// The current scale of this screen manager.
  20.         /// </summary>
  21.         Vector3 Scale { get; }
  22.  
  23.         /// <summary>
  24.         /// A matrix representing the current scale of this screen manager.
  25.         /// </summary>
  26.         Matrix ScaleMatrix { get; }
  27.  
  28.         /// <summary>
  29.         /// The dimensions of this manager's screen space.
  30.         /// </summary>
  31.         Point Screen { get; set; }
  32.  
  33.         /// <summary>
  34.         /// The dimensions of this manager's world space.
  35.         /// </summary>
  36.         Point World { get; set; }
  37.  
  38.         /// <summary>
  39.         /// Options that specify parameters to be used during BeginDraw.
  40.         /// </summary>
  41.         ScreenManagerOptions Options { get; set; }
  42.         #endregion
  43.  
  44.         #region Methods
  45.         /// <summary>
  46.         /// Apply this screen manager's settings to the specified graphics device manager object. This should be called during initialization, or when screen dimensions need to change.
  47.         /// </summary>
  48.         /// <param name="manager">An object responsible for managing a graphics device.</param>
  49.         void ApplySettings(IGrfxDeviceManager manager);
  50.  
  51.         /// <summary>
  52.         /// Set the specified graphics device up for rendering. This should be called at the start of a draw/render pass.
  53.         /// </summary>
  54.         /// <param name="device">An object responisible for representing a graphics device.</param>
  55.         void BeginDraw(IGrfxDevice device);
  56.  
  57.         /// <summary>
  58.         /// Convert a point in world coordiantes to screen coordinates.
  59.         /// </summary>
  60.         /// <param name="worldPoint">A point relative to world coordinates.</param>
  61.         /// <returns>The point converted to screen coordinates.</returns>
  62.         Vector2 PointToScreen(Point worldPoint);
  63.  
  64.         /// <summary>
  65.         /// Convert a point in world coordiantes to screen coordinates.
  66.         /// </summary>
  67.         /// <param name="worldPoint">A point relative to world coordinates.</param>
  68.         /// <returns>The point converted to screen coordinates.</returns>
  69.         Vector2 PointToScreen(Vector2 worldPoint);
  70.  
  71.         /// <summary>
  72.         /// Convert a point in screen coordinates to world coorindates.
  73.         /// </summary>
  74.         /// <param name="screenPoint">A point relative to screen coordinates</param>
  75.         /// <returns>The point converted to world coordinates.</returns>
  76.         Vector2 PointToWorld(Point screenPoint);
  77.  
  78.         /// <summary>
  79.         /// Convert a point in screen coordinates to world coorindates.
  80.         /// </summary>
  81.         /// <param name="screenPoint">A point relative to screen coordinates</param>
  82.         /// <returns>The point converted to world coordinates.</returns>
  83.         Vector2 PointToWorld(Vector2 screenPoint);
  84.         #endregion
  85.     }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment