mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-12 20:45:33 +00:00
Removed IGLContextCreationHack interface (no longer used).
This commit is contained in:
parent
e1a30509cb
commit
f978762c04
|
@ -18,7 +18,7 @@ namespace OpenTK.Graphics
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents and provides methods to manipulate an OpenGL render context.
|
/// Represents and provides methods to manipulate an OpenGL render context.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class GraphicsContext : IGraphicsContext, IGraphicsContextInternal, IGLContextCreationHack
|
public sealed class GraphicsContext : IGraphicsContext, IGraphicsContextInternal
|
||||||
{
|
{
|
||||||
IGraphicsContext implementation; // The actual render context implementation for the underlying platform.
|
IGraphicsContext implementation; // The actual render context implementation for the underlying platform.
|
||||||
List<IDisposable> dispose_queue = new List<IDisposable>();
|
List<IDisposable> dispose_queue = new List<IDisposable>();
|
||||||
|
@ -48,13 +48,17 @@ namespace OpenTK.Graphics
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="format">The OpenTK.Graphics.GraphicsMode of the GraphicsContext.</param>
|
/// <param name="format">The OpenTK.Graphics.GraphicsMode of the GraphicsContext.</param>
|
||||||
/// <param name="window">The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to.</param>
|
/// <param name="window">The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to.</param>
|
||||||
public GraphicsContext(GraphicsMode format, IWindowInfo window)
|
public GraphicsContext(GraphicsMode mode, IWindowInfo window)
|
||||||
{
|
{
|
||||||
if (window == null) throw new ArgumentNullException("window", "Must point to a valid window.");
|
bool designMode = false;
|
||||||
|
if (mode == null && window == null)
|
||||||
|
designMode = true;
|
||||||
|
else if (mode == null) throw new ArgumentNullException("mode", "Must be a valid GraphicsMode.");
|
||||||
|
else if (window == null) throw new ArgumentNullException("window", "Must point to a valid window.");
|
||||||
|
|
||||||
Debug.Print("Creating GraphicsContext.");
|
Debug.Print("Creating GraphicsContext.");
|
||||||
Debug.Indent();
|
Debug.Indent();
|
||||||
Debug.Print("GraphicsMode: {0}", format);
|
Debug.Print("GraphicsMode: {0}", mode);
|
||||||
Debug.Print("IWindowInfo: {0}", window);
|
Debug.Print("IWindowInfo: {0}", window);
|
||||||
|
|
||||||
IGraphicsContext shareContext = null;
|
IGraphicsContext shareContext = null;
|
||||||
|
@ -71,10 +75,12 @@ namespace OpenTK.Graphics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Configuration.RunningOnWindows)
|
if (designMode)
|
||||||
implementation = new OpenTK.Platform.Windows.WinGLContext(format, window, shareContext);
|
implementation = new OpenTK.Platform.DummyGLContext(mode);
|
||||||
|
else if (Configuration.RunningOnWindows)
|
||||||
|
implementation = new OpenTK.Platform.Windows.WinGLContext(mode, window, shareContext);
|
||||||
else if (Configuration.RunningOnX11)
|
else if (Configuration.RunningOnX11)
|
||||||
implementation = new OpenTK.Platform.X11.X11GLContext(format, window, shareContext, DirectRendering);
|
implementation = new OpenTK.Platform.X11.X11GLContext(mode, window, shareContext, DirectRendering);
|
||||||
else
|
else
|
||||||
throw new PlatformNotSupportedException("Please, refer to http://www.opentk.com for more information.");
|
throw new PlatformNotSupportedException("Please, refer to http://www.opentk.com for more information.");
|
||||||
|
|
||||||
|
@ -175,18 +181,11 @@ namespace OpenTK.Graphics
|
||||||
#region --- IGraphicsContext Members ---
|
#region --- IGraphicsContext Members ---
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an OpenGL context.
|
/// Creates an OpenGL context with the specified direct/indirect rendering mode and sharing state with the
|
||||||
/// </summary>
|
/// specified IGraphicsContext.
|
||||||
public void CreateContext()
|
|
||||||
{
|
|
||||||
CreateContext(true, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates an OpenGL context with a direct or indirect rendering mode. This parameter is ignored
|
|
||||||
/// on Windows platforms (direct mode only).
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="direct">Set to true for direct rendering or false otherwise.</param>
|
/// <param name="direct">Set to true for direct rendering or false otherwise.</param>
|
||||||
|
/// <param name="source">The source IGraphicsContext to share state from.</param>.
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// <para>
|
/// <para>
|
||||||
/// Direct rendering is the default rendering mode for OpenTK, since it can provide higher performance
|
/// Direct rendering is the default rendering mode for OpenTK, since it can provide higher performance
|
||||||
|
@ -197,19 +196,7 @@ namespace OpenTK.Graphics
|
||||||
/// indirect rendering on Windows platforms).
|
/// indirect rendering on Windows platforms).
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public void CreateContext(bool direct)
|
void CreateContext(bool direct, IGraphicsContext source)
|
||||||
{
|
|
||||||
CreateContext(direct, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates an OpenGL context with the specified direct/indirect rendering mode and sharing state with the
|
|
||||||
/// specified IGraphicsContext.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="direct">Set to true for direct rendering or false otherwise.</param>
|
|
||||||
/// <param name="source">The source IGraphicsContext to share state from.</param>.
|
|
||||||
/// <seealso cref="CreateContext(bool)"/>
|
|
||||||
public void CreateContext(bool direct, IGraphicsContext source)
|
|
||||||
{
|
{
|
||||||
this.Destroy += ContextDestroyed;
|
this.Destroy += ContextDestroyed;
|
||||||
|
|
||||||
|
@ -362,20 +349,6 @@ namespace OpenTK.Graphics
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- IGLContextCreationHack Members ---
|
|
||||||
|
|
||||||
bool IGLContextCreationHack.SelectDisplayMode(DisplayMode mode, IWindowInfo info)
|
|
||||||
{
|
|
||||||
return (implementation as IGLContextCreationHack).SelectDisplayMode(mode, info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void IGLContextCreationHack.SetWindowHandle(IntPtr handle)
|
|
||||||
{
|
|
||||||
(implementation as IGLContextCreationHack).SetWindowHandle(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region --- IDisposable Members ---
|
#region --- IDisposable Members ---
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -48,13 +48,6 @@ namespace OpenTK.Graphics
|
||||||
|
|
||||||
public delegate void DestroyEvent<T>(T sender, EventArgs e);
|
public delegate void DestroyEvent<T>(T sender, EventArgs e);
|
||||||
|
|
||||||
// TODO: Remove in 0.3.15
|
|
||||||
internal interface IGLContextCreationHack
|
|
||||||
{
|
|
||||||
bool SelectDisplayMode(DisplayMode mode, IWindowInfo info);
|
|
||||||
void SetWindowHandle(IntPtr handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Functions for internal use by OpenTK.
|
// Functions for internal use by OpenTK.
|
||||||
// TODO: RegisterForDisposal/DisposeResources for 0.3.15 (GC & OpenGL)
|
// TODO: RegisterForDisposal/DisposeResources for 0.3.15 (GC & OpenGL)
|
||||||
// TODO: Remove or move GetDisplayModes to another class.
|
// TODO: Remove or move GetDisplayModes to another class.
|
||||||
|
@ -63,13 +56,13 @@ namespace OpenTK.Graphics
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IGraphicsContextInternal
|
public interface IGraphicsContextInternal
|
||||||
{
|
{
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Creates an OpenGL context with the specified direct/indirect rendering mode and sharing state with the
|
///// Creates an OpenGL context with the specified direct/indirect rendering mode and sharing state with the
|
||||||
/// specified IGraphicsContext.
|
///// specified IGraphicsContext.
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="direct">Set to true for direct rendering or false otherwise.</param>
|
///// <param name="direct">Set to true for direct rendering or false otherwise.</param>
|
||||||
/// <param name="source">The source IGraphicsContext to share state from.</param>.
|
///// <param name="source">The source IGraphicsContext to share state from.</param>.
|
||||||
/// <seealso cref="CreateContext(bool)"/>
|
///// <seealso cref="CreateContext(bool)"/>
|
||||||
//void CreateContext(bool direct, IGraphicsContext source);
|
//void CreateContext(bool direct, IGraphicsContext source);
|
||||||
|
|
||||||
/// <summary>Prepares the entry points for OpenGL.</summary>
|
/// <summary>Prepares the entry points for OpenGL.</summary>
|
||||||
|
|
Loading…
Reference in a new issue