Renamed IGLContext to IGraphicsContext.
This commit is contained in:
parent
5c6a261030
commit
1932e25689
10 changed files with 46 additions and 46 deletions
|
@ -15,9 +15,9 @@ namespace OpenTK
|
||||||
/// <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 GLContext : IGLContext, IGLContextInternal, IGLContextCreationHack
|
public sealed class GLContext : IGraphicsContext, IGLContextInternal, IGLContextCreationHack
|
||||||
{
|
{
|
||||||
IGLContext 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>();
|
||||||
bool disposed;
|
bool disposed;
|
||||||
|
|
||||||
|
@ -77,14 +77,14 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region void ContextDestroyed(IGLContext context, EventArgs e)
|
#region void ContextDestroyed(IGraphicsContext context, EventArgs e)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles the Destroy event.
|
/// Handles the Destroy event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context">The OpenTK.Platform.IGLContext that was destroyed.</param>
|
/// <param name="context">The OpenTK.Platform.IGraphicsContext that was destroyed.</param>
|
||||||
/// <param name="e">Not used.</param>
|
/// <param name="e">Not used.</param>
|
||||||
void ContextDestroyed(IGLContext context, EventArgs e)
|
void ContextDestroyed(IGraphicsContext context, EventArgs e)
|
||||||
{
|
{
|
||||||
this.Destroy -= ContextDestroyed;
|
this.Destroy -= ContextDestroyed;
|
||||||
available_contexts.Remove(((IGLContextInternal)this).Context);
|
available_contexts.Remove(((IGLContextInternal)this).Context);
|
||||||
|
@ -94,7 +94,7 @@ namespace OpenTK
|
||||||
|
|
||||||
#region --- Public Members ---
|
#region --- Public Members ---
|
||||||
|
|
||||||
#region public static IGLContext CurrentContext
|
#region public static IGraphicsContext CurrentContext
|
||||||
|
|
||||||
internal delegate ContextHandle GetCurrentContextDelegate();
|
internal delegate ContextHandle GetCurrentContextDelegate();
|
||||||
internal static GetCurrentContextDelegate GetCurrentContext;
|
internal static GetCurrentContextDelegate GetCurrentContext;
|
||||||
|
@ -142,7 +142,7 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- IGLContext Members ---
|
#region --- IGraphicsContext Members ---
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an OpenGL context.
|
/// Creates an OpenGL context.
|
||||||
|
@ -174,12 +174,12 @@ namespace OpenTK
|
||||||
|
|
||||||
/// <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 IGLContext.
|
/// 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 IGLContext to share state from.</param>.
|
/// <param name="source">The source IGraphicsContext to share state from.</param>.
|
||||||
/// <seealso cref="CreateContext(bool)"/>
|
/// <seealso cref="CreateContext(bool)"/>
|
||||||
public void CreateContext(bool direct, IGLContext source)
|
public void CreateContext(bool direct, IGraphicsContext source)
|
||||||
{
|
{
|
||||||
implementation.CreateContext(direct, source);
|
implementation.CreateContext(direct, source);
|
||||||
this.Destroy += ContextDestroyed;
|
this.Destroy += ContextDestroyed;
|
||||||
|
@ -217,7 +217,7 @@ namespace OpenTK
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raised when a Context is destroyed.
|
/// Raised when a Context is destroyed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event DestroyEvent<IGLContext> Destroy
|
public event DestroyEvent<IGraphicsContext> Destroy
|
||||||
{
|
{
|
||||||
add { implementation.Destroy += value; }
|
add { implementation.Destroy += value; }
|
||||||
remove { implementation.Destroy -= value; }
|
remove { implementation.Destroy -= value; }
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace OpenTK
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class GLControl : UserControl
|
public partial class GLControl : UserControl
|
||||||
{
|
{
|
||||||
IGLContext context;
|
IGraphicsContext context;
|
||||||
IPlatformIdle idle;
|
IPlatformIdle idle;
|
||||||
DisplayMode display_mode;
|
DisplayMode display_mode;
|
||||||
|
|
||||||
|
@ -86,13 +86,13 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public IGLContext Context
|
#region public IGraphicsContext Context
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets an interface to the underlying GLContext used by this GLControl.
|
/// Gets an interface to the underlying GLContext used by this GLControl.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public IGLContext Context
|
public IGraphicsContext Context
|
||||||
{
|
{
|
||||||
get { return context; }
|
get { return context; }
|
||||||
private set { context = value; }
|
private set { context = value; }
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace OpenTK
|
||||||
|
|
||||||
//InputDriver input_driver;
|
//InputDriver input_driver;
|
||||||
|
|
||||||
IGLContext glContext;
|
IGraphicsContext glContext;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -236,13 +236,13 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public IGLContext Context
|
#region public IGraphicsContext Context
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the opengl IGLontext associated with the current GameWindow.
|
/// Returns the opengl IGLontext associated with the current GameWindow.
|
||||||
/// Forces window creation.
|
/// Forces window creation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IGLContext Context
|
public IGraphicsContext Context
|
||||||
{
|
{
|
||||||
get { return glContext; }
|
get { return glContext; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,10 @@ using System.Text;
|
||||||
namespace OpenTK.Platform
|
namespace OpenTK.Platform
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty IGLContext implementation to be used inside the Visual Studio designer.
|
/// An empty IGraphicsContext implementation to be used inside the Visual Studio designer.
|
||||||
/// This class supports OpenTK, and is not intended for use by OpenTK programs.
|
/// This class supports OpenTK, and is not intended for use by OpenTK programs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal sealed class DummyGLContext : IGLContext
|
internal sealed class DummyGLContext : IGraphicsContext
|
||||||
{
|
{
|
||||||
WindowInfo info = new WindowInfo();
|
WindowInfo info = new WindowInfo();
|
||||||
DisplayMode mode;
|
DisplayMode mode;
|
||||||
|
@ -26,7 +26,7 @@ namespace OpenTK.Platform
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- IGLContext Members ---
|
#region --- IGraphicsContext Members ---
|
||||||
|
|
||||||
public IntPtr Context { get { return IntPtr.Zero; } }
|
public IntPtr Context { get { return IntPtr.Zero; } }
|
||||||
public IWindowInfo Info { get { return info; } }
|
public IWindowInfo Info { get { return info; } }
|
||||||
|
@ -34,14 +34,14 @@ namespace OpenTK.Platform
|
||||||
|
|
||||||
public void CreateContext() { }
|
public void CreateContext() { }
|
||||||
public void CreateContext(bool direct) { }
|
public void CreateContext(bool direct) { }
|
||||||
public void CreateContext(bool direct, IGLContext source) { }
|
public void CreateContext(bool direct, IGraphicsContext source) { }
|
||||||
|
|
||||||
public void SwapBuffers() { }
|
public void SwapBuffers() { }
|
||||||
public void MakeCurrent() { }
|
public void MakeCurrent() { }
|
||||||
public bool IsCurrent { get { return true; } set { } }
|
public bool IsCurrent { get { return true; } set { } }
|
||||||
public IntPtr GetCurrentContext() { return IntPtr.Zero; }
|
public IntPtr GetCurrentContext() { return IntPtr.Zero; }
|
||||||
|
|
||||||
public event DestroyEvent<IGLContext> Destroy;
|
public event DestroyEvent<IGraphicsContext> Destroy;
|
||||||
void OnDestroy() { if (Destroy != null) Destroy(this, EventArgs.Empty); }
|
void OnDestroy() { if (Destroy != null) Destroy(this, EventArgs.Empty); }
|
||||||
|
|
||||||
public void RegisterForDisposal(IDisposable resource)
|
public void RegisterForDisposal(IDisposable resource)
|
||||||
|
|
|
@ -13,16 +13,16 @@ namespace OpenTK.Platform
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides methods for creating and interacting with an OpenGL context.
|
/// Provides methods for creating and interacting with an OpenGL context.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IGLContext : IDisposable
|
public interface IGraphicsContext : IDisposable
|
||||||
{
|
{
|
||||||
/// <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 IGLContext.
|
/// 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 IGLContext 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, IGLContext source);
|
void CreateContext(bool direct, IGraphicsContext source);
|
||||||
|
|
||||||
/// <summary>Swaps buffers, presenting the rendered scene to the user.</summary>
|
/// <summary>Swaps buffers, presenting the rendered scene to the user.</summary>
|
||||||
void SwapBuffers();
|
void SwapBuffers();
|
||||||
|
@ -42,7 +42,7 @@ namespace OpenTK.Platform
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raised when a Context is destroyed.
|
/// Raised when a Context is destroyed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
event DestroyEvent<IGLContext> Destroy;
|
event DestroyEvent<IGraphicsContext> Destroy;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether VSyncing is enabled.
|
/// Gets or sets a value indicating whether VSyncing is enabled.
|
||||||
|
|
|
@ -20,8 +20,8 @@ namespace OpenTK.Platform
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal interface INativeGLWindow : IResizable, IDisposable
|
internal interface INativeGLWindow : IResizable, IDisposable
|
||||||
{
|
{
|
||||||
//void CreateWindow(int width, int height, DisplayMode mode, out IGLContext context);
|
//void CreateWindow(int width, int height, DisplayMode mode, out IGraphicsContext context);
|
||||||
void CreateWindow(int width, int height, GraphicsFormat mode, out IGLContext context);
|
void CreateWindow(int width, int height, GraphicsFormat mode, out IGraphicsContext context);
|
||||||
void DestroyWindow();
|
void DestroyWindow();
|
||||||
void ProcessEvents();
|
void ProcessEvents();
|
||||||
void PointToClient(ref System.Drawing.Point p);
|
void PointToClient(ref System.Drawing.Point p);
|
||||||
|
@ -33,7 +33,7 @@ namespace OpenTK.Platform
|
||||||
string Title { get; set; }
|
string Title { get; set; }
|
||||||
bool Visible { get; set; }
|
bool Visible { get; set; }
|
||||||
bool IsIdle { get; }
|
bool IsIdle { get; }
|
||||||
//IGLContext Context { get; }
|
//IGraphicsContext Context { get; }
|
||||||
IInputDriver InputDriver { get; }
|
IInputDriver InputDriver { get; }
|
||||||
bool Fullscreen { get; set; }
|
bool Fullscreen { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace OpenTK.Platform.Windows
|
||||||
/// Provides methods to create and control an opengl context on the Windows platform.
|
/// Provides methods to create and control an opengl context on the Windows platform.
|
||||||
/// This class supports OpenTK, and is not intended for use by OpenTK programs.
|
/// This class supports OpenTK, and is not intended for use by OpenTK programs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal sealed class WinGLContext : IGLContext, IGLContextInternal, IGLContextCreationHack
|
internal sealed class WinGLContext : IGraphicsContext, IGLContextInternal, IGLContextCreationHack
|
||||||
{
|
{
|
||||||
private IntPtr deviceContext;
|
private IntPtr deviceContext;
|
||||||
private ContextHandle renderContext;
|
private ContextHandle renderContext;
|
||||||
|
@ -51,7 +51,7 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- IGLContext Members ---
|
#region --- IGraphicsContext Members ---
|
||||||
|
|
||||||
#region public void CreateContext()
|
#region public void CreateContext()
|
||||||
|
|
||||||
|
@ -71,9 +71,9 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public void CreateContext(bool direct, IGLContext source)
|
#region public void CreateContext(bool direct, IGraphicsContext source)
|
||||||
|
|
||||||
public void CreateContext(bool direct, IGLContext source)
|
public void CreateContext(bool direct, IGraphicsContext source)
|
||||||
{
|
{
|
||||||
Debug.WriteLine(String.Format("OpenGL context is bound to handle: {0}", this.windowInfo.Handle));
|
Debug.WriteLine(String.Format("OpenGL context is bound to handle: {0}", this.windowInfo.Handle));
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public event DestroyEvent<IGLContext> Destroy;
|
public event DestroyEvent<IGraphicsContext> Destroy;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -307,9 +307,9 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public void CreateWindow(int width, int height, GraphicsFormat format, out IGLContext context)
|
#region public void CreateWindow(int width, int height, GraphicsFormat format, out IGraphicsContext context)
|
||||||
|
|
||||||
public void CreateWindow(int width, int height, GraphicsFormat format, out IGLContext context)
|
public void CreateWindow(int width, int height, GraphicsFormat format, out IGraphicsContext context)
|
||||||
{
|
{
|
||||||
Debug.Print("Creating native window.");
|
Debug.Print("Creating native window.");
|
||||||
Debug.Indent();
|
Debug.Indent();
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace OpenTK.Platform.X11
|
||||||
/// Provides methods to create and control an opengl context on the X11 platform.
|
/// Provides methods to create and control an opengl context on the X11 platform.
|
||||||
/// This class supports OpenTK, and is not intended for use by OpenTK programs.
|
/// This class supports OpenTK, and is not intended for use by OpenTK programs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal sealed class X11GLContext : IGLContext, IGLContextInternal, IGLContextCreationHack
|
internal sealed class X11GLContext : IGraphicsContext, IGLContextInternal, IGLContextCreationHack
|
||||||
{
|
{
|
||||||
IntPtr context;
|
IntPtr context;
|
||||||
DisplayMode mode;
|
DisplayMode mode;
|
||||||
|
@ -118,7 +118,7 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region --- IGLContext Members ---
|
#region --- IGraphicsContext Members ---
|
||||||
|
|
||||||
#region public DisplayMode Mode
|
#region public DisplayMode Mode
|
||||||
|
|
||||||
|
@ -154,9 +154,9 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public void CreateContext(bool direct, IGLContext shareContext)
|
#region public void CreateContext(bool direct, IGraphicsContext shareContext)
|
||||||
|
|
||||||
public void CreateContext(bool direct, IGLContext shareContext)
|
public void CreateContext(bool direct, IGraphicsContext shareContext)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -288,7 +288,7 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public event DestroyEvent<IGLContext> Destroy;
|
public event DestroyEvent<IGraphicsContext> Destroy;
|
||||||
|
|
||||||
#region public IntPtr GetAddress(string function)
|
#region public IntPtr GetAddress(string function)
|
||||||
|
|
||||||
|
|
|
@ -392,9 +392,9 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public void CreateWindow(int width, int height, GraphicsFormat format, out IGLContext glContext)
|
#region public void CreateWindow(int width, int height, GraphicsFormat format, out IGraphicsContext glContext)
|
||||||
|
|
||||||
public void CreateWindow(int width, int height, GraphicsFormat format, out IGLContext glContext)
|
public void CreateWindow(int width, int height, GraphicsFormat format, out IGraphicsContext glContext)
|
||||||
{
|
{
|
||||||
if (exists)
|
if (exists)
|
||||||
throw new ApplicationException("Render window already exists!");
|
throw new ApplicationException("Render window already exists!");
|
||||||
|
@ -478,7 +478,7 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public void CreateWindow(int width, int height, DisplayMode mode, out IGLContext glContext)
|
#region public void CreateWindow(int width, int height, DisplayMode mode, out IGraphicsContext glContext)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Opens a new render window with the given DisplayMode.
|
/// Opens a new render window with the given DisplayMode.
|
||||||
|
@ -491,7 +491,7 @@ namespace OpenTK.Platform.X11
|
||||||
/// Colormap creation is currently disabled.
|
/// Colormap creation is currently disabled.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public void CreateWindow(int width, int height, DisplayMode mode, out IGLContext glContext)
|
public void CreateWindow(int width, int height, DisplayMode mode, out IGraphicsContext glContext)
|
||||||
{
|
{
|
||||||
this.CreateWindow(width, height, new GraphicsFormat(), out glContext);
|
this.CreateWindow(width, height, new GraphicsFormat(), out glContext);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue