mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 06:05:29 +00:00
Moved GraphicsMode to IGraphicsContext as it is universally useful.
Implemented GraphicsMode property on X11 and Mac OS X. Replaced tabs with spaces in AglContext.cs.
This commit is contained in:
parent
9e9e33e73f
commit
93a467a11f
|
@ -330,7 +330,7 @@ namespace OpenTK
|
|||
/// </remarks>
|
||||
public GraphicsMode GraphicsMode
|
||||
{
|
||||
get { return (Context as IGraphicsContextInternal).GraphicsMode; }
|
||||
get { return Context.GraphicsMode; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -385,7 +385,7 @@ namespace OpenTK.Graphics
|
|||
/// </summary>
|
||||
public GraphicsMode GraphicsMode
|
||||
{
|
||||
get { return (implementation as IGraphicsContextInternal).GraphicsMode; }
|
||||
get { return implementation.GraphicsMode; }
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
|
|
|
@ -51,6 +51,9 @@ namespace OpenTK.Graphics
|
|||
/// </summary>
|
||||
/// <param name="window"></param>
|
||||
void Update(IWindowInfo window);
|
||||
|
||||
/// <summary>Gets the GraphicsMode of this instance.</summary>
|
||||
GraphicsMode GraphicsMode { get; }
|
||||
}
|
||||
|
||||
public delegate void DestroyEvent<T>(T sender, EventArgs e);
|
||||
|
@ -87,9 +90,6 @@ namespace OpenTK.Graphics
|
|||
// </summary>
|
||||
//IWindowInfo Info { get; }
|
||||
|
||||
/// <summary>Gets the GraphicsMode of the context.</summary>
|
||||
GraphicsMode GraphicsMode { get; }
|
||||
|
||||
///// <summary>
|
||||
///// Gets a System.IntPtr containing the handle to the OpenGL context which is current in the
|
||||
///// calling thread, or IntPtr.Zero if no OpenGL context is current.
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace OpenTK.Platform.MacOS
|
|||
bool mVSync = false;
|
||||
IntPtr displayID;
|
||||
|
||||
GraphicsMode mode;
|
||||
GraphicsMode graphics_mode;
|
||||
CarbonWindowInfo carbonWindow;
|
||||
IntPtr shareContextRef;
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace OpenTK.Platform.MacOS
|
|||
Debug.Print("Context Type: {0}", shareContext);
|
||||
Debug.Print("Window info: {0}", window);
|
||||
|
||||
this.mode = mode;
|
||||
this.graphics_mode = mode;
|
||||
this.carbonWindow = (CarbonWindowInfo)window;
|
||||
|
||||
if (shareContext is AglContext)
|
||||
|
@ -332,6 +332,11 @@ namespace OpenTK.Platform.MacOS
|
|||
}
|
||||
}
|
||||
|
||||
GraphicsMode IGraphicsContext.GraphicsMode
|
||||
{
|
||||
get { return graphics_mode; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
@ -405,11 +410,6 @@ namespace OpenTK.Platform.MacOS
|
|||
get { return (ContextHandle)contextRef; }
|
||||
}
|
||||
|
||||
GraphicsMode IGraphicsContextInternal.GraphicsMode
|
||||
{
|
||||
get { throw new Exception("The method or operation is not implemented."); }
|
||||
}
|
||||
|
||||
void IGraphicsContextInternal.RegisterForDisposal(IDisposable resource)
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
|
|
|
@ -221,6 +221,15 @@ namespace OpenTK.Platform.Windows
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region GraphicsMode IGLContext.GraphicsMode
|
||||
|
||||
GraphicsMode IGraphicsContext.GraphicsMode
|
||||
{
|
||||
get { return format; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public event DestroyEvent<IGraphicsContext> Destroy;
|
||||
|
||||
#endregion
|
||||
|
@ -268,15 +277,6 @@ namespace OpenTK.Platform.Windows
|
|||
*/
|
||||
#endregion
|
||||
|
||||
#region GraphicsMode IGLContextInternal.GraphicsMode
|
||||
|
||||
GraphicsMode IGraphicsContextInternal.GraphicsMode
|
||||
{
|
||||
get { return format; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public IntPtr GetAddress(string function_string)
|
||||
|
||||
public IntPtr GetAddress(string function_string)
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace OpenTK.Platform.X11
|
|||
bool vsync_supported;
|
||||
int vsync_interval;
|
||||
bool glx_loaded;
|
||||
GraphicsMode graphics_mode;
|
||||
|
||||
bool disposed;
|
||||
|
||||
|
@ -147,6 +148,8 @@ namespace OpenTK.Platform.X11
|
|||
|
||||
if (!Glx.IsDirect(currentWindow.Display, context.Handle))
|
||||
Debug.Print("Warning: Context is not direct.");
|
||||
|
||||
graphics_mode = mode;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -279,6 +282,15 @@ namespace OpenTK.Platform.X11
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region public DisplayMode Mode
|
||||
|
||||
GraphicsMode IGraphicsContext.GraphicsMode
|
||||
{
|
||||
get { return graphics_mode; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void RegisterForDisposal(IDisposable resource)
|
||||
{
|
||||
throw new NotSupportedException("Use OpenTK.GraphicsContext instead.");
|
||||
|
@ -315,15 +327,6 @@ namespace OpenTK.Platform.X11
|
|||
|
||||
#endregion
|
||||
|
||||
#region public DisplayMode Mode
|
||||
|
||||
GraphicsMode IGraphicsContextInternal.GraphicsMode
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ContextHandle IGLContextInternal.Context
|
||||
|
||||
ContextHandle IGraphicsContextInternal.Context
|
||||
|
|
Loading…
Reference in a new issue