Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
GraphicsOutput.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core;
4 using SiliconStudio.Core.Mathematics;
5 
6 namespace SiliconStudio.Paradox.Graphics
7 {
8  public partial class GraphicsOutput : ComponentBase
9  {
10  private readonly object lockModes = new object();
11  private readonly GraphicsAdapter adapter;
12  private DisplayMode currentDisplayMode;
13  private DisplayMode[] supportedDisplayModes;
14  private readonly Rectangle desktopBounds;
15 
16  /// <summary>
17  /// Gets the current display mode.
18  /// </summary>
19  /// <value>The current display mode.</value>
20  public DisplayMode CurrentDisplayMode
21  {
22  get
23  {
24  lock (lockModes)
25  {
26  if (currentDisplayMode == null)
27  {
28  InitializeCurrentDisplayMode();
29  }
30  }
31  return currentDisplayMode;
32  }
33  }
34 
35  /// <summary>
36  /// Returns a collection of supported display modes for this <see cref="GraphicsOutput"/>.
37  /// </summary>
38  public DisplayMode[] SupportedDisplayModes
39  {
40  get
41  {
42  lock (lockModes)
43  {
44  if (supportedDisplayModes == null)
45  {
46  InitializeSupportedDisplayModes();
47  }
48  }
49  return supportedDisplayModes;
50  }
51  }
52 
53  /// <summary>
54  /// Gets the desktop bounds of the current output.
55  /// </summary>
56  public Rectangle DesktopBounds
57  {
58  get
59  {
60  return desktopBounds;
61  }
62  }
63 
64  /// <summary>
65  /// Gets the adapter this output is attached.
66  /// </summary>
67  /// <value>The adapter.</value>
68  public GraphicsAdapter Adapter
69  {
70  get { return adapter; }
71  }
72  }
73 }
Base class for a framework component.
Describes the display mode.
Definition: DisplayMode.cs:10
This class represents a graphics adapter.
Structure using the same layout than System.Drawing.Rectangle
Definition: Rectangle.cs:35