mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-12 20:05:41 +00:00
Cache default display mode.
This commit is contained in:
parent
aa21965023
commit
e295acdd37
|
@ -20,6 +20,7 @@ namespace OpenTK.Graphics
|
||||||
bool stereo;
|
bool stereo;
|
||||||
IntPtr index; // The id of the pixel format or visual.
|
IntPtr index; // The id of the pixel format or visual.
|
||||||
|
|
||||||
|
static GraphicsMode defaultMode;
|
||||||
static IGraphicsMode implementation;
|
static IGraphicsMode implementation;
|
||||||
static object mode_selection_lock = new object();
|
static object mode_selection_lock = new object();
|
||||||
|
|
||||||
|
@ -292,7 +293,12 @@ namespace OpenTK.Graphics
|
||||||
/// <summary>Returns an OpenTK.GraphicsFormat compatible with the underlying platform.</summary>
|
/// <summary>Returns an OpenTK.GraphicsFormat compatible with the underlying platform.</summary>
|
||||||
public static GraphicsMode Default
|
public static GraphicsMode Default
|
||||||
{
|
{
|
||||||
get { return new GraphicsMode(DisplayDevice.Default.BitsPerPixel, 16, 0, 0, 0, 2, false); }
|
get
|
||||||
|
{
|
||||||
|
if (defaultMode == null)
|
||||||
|
defaultMode = new GraphicsMode(DisplayDevice.Default.BitsPerPixel, 16, 0, 0, 0, 2, false);
|
||||||
|
return defaultMode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue