Renamed IGLContext to IGraphicsContext.

This commit is contained in:
the_fiddler 2008-01-31 13:17:42 +00:00
parent 5c6a261030
commit 1932e25689
10 changed files with 46 additions and 46 deletions

View file

@ -15,9 +15,9 @@ namespace OpenTK
/// <summary>
/// Represents and provides methods to manipulate an OpenGL render context.
/// </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>();
bool disposed;
@ -77,14 +77,14 @@ namespace OpenTK
#endregion
#region void ContextDestroyed(IGLContext context, EventArgs e)
#region void ContextDestroyed(IGraphicsContext context, EventArgs e)
/// <summary>
/// Handles the Destroy event.
/// </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>
void ContextDestroyed(IGLContext context, EventArgs e)
void ContextDestroyed(IGraphicsContext context, EventArgs e)
{
this.Destroy -= ContextDestroyed;
available_contexts.Remove(((IGLContextInternal)this).Context);
@ -94,7 +94,7 @@ namespace OpenTK
#region --- Public Members ---
#region public static IGLContext CurrentContext
#region public static IGraphicsContext CurrentContext
internal delegate ContextHandle GetCurrentContextDelegate();
internal static GetCurrentContextDelegate GetCurrentContext;
@ -142,7 +142,7 @@ namespace OpenTK
#endregion
#region --- IGLContext Members ---
#region --- IGraphicsContext Members ---
/// <summary>
/// Creates an OpenGL context.
@ -174,12 +174,12 @@ namespace OpenTK
/// <summary>
/// Creates an OpenGL context with the specified direct/indirect rendering mode and sharing state with the
/// specified IGLContext.
/// specified IGraphicsContext.
/// </summary>
/// <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)"/>
public void CreateContext(bool direct, IGLContext source)
public void CreateContext(bool direct, IGraphicsContext source)
{
implementation.CreateContext(direct, source);
this.Destroy += ContextDestroyed;
@ -217,7 +217,7 @@ namespace OpenTK
/// <summary>
/// Raised when a Context is destroyed.
/// </summary>
public event DestroyEvent<IGLContext> Destroy
public event DestroyEvent<IGraphicsContext> Destroy
{
add { implementation.Destroy += value; }
remove { implementation.Destroy -= value; }

View file

@ -21,7 +21,7 @@ namespace OpenTK
/// </summary>
public partial class GLControl : UserControl
{
IGLContext context;
IGraphicsContext context;
IPlatformIdle idle;
DisplayMode display_mode;
@ -86,13 +86,13 @@ namespace OpenTK
#endregion
#region public IGLContext Context
#region public IGraphicsContext Context
/// <summary>
/// Gets an interface to the underlying GLContext used by this GLControl.
/// </summary>
[Browsable(false)]
public IGLContext Context
public IGraphicsContext Context
{
get { return context; }
private set { context = value; }

View file

@ -74,7 +74,7 @@ namespace OpenTK
//InputDriver input_driver;
IGLContext glContext;
IGraphicsContext glContext;
#endregion
@ -236,13 +236,13 @@ namespace OpenTK
#endregion
#region public IGLContext Context
#region public IGraphicsContext Context
/// <summary>
/// Returns the opengl IGLontext associated with the current GameWindow.
/// Forces window creation.
/// </summary>
public IGLContext Context
public IGraphicsContext Context
{
get { return glContext; }
}

View file

@ -11,10 +11,10 @@ using System.Text;
namespace OpenTK.Platform
{
/// <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.
/// </summary>
internal sealed class DummyGLContext : IGLContext
internal sealed class DummyGLContext : IGraphicsContext
{
WindowInfo info = new WindowInfo();
DisplayMode mode;
@ -26,7 +26,7 @@ namespace OpenTK.Platform
#endregion
#region --- IGLContext Members ---
#region --- IGraphicsContext Members ---
public IntPtr Context { get { return IntPtr.Zero; } }
public IWindowInfo Info { get { return info; } }
@ -34,14 +34,14 @@ namespace OpenTK.Platform
public void CreateContext() { }
public void CreateContext(bool direct) { }
public void CreateContext(bool direct, IGLContext source) { }
public void CreateContext(bool direct, IGraphicsContext source) { }
public void SwapBuffers() { }
public void MakeCurrent() { }
public bool IsCurrent { get { return true; } set { } }
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); }
public void RegisterForDisposal(IDisposable resource)

View file

@ -13,16 +13,16 @@ namespace OpenTK.Platform
/// <summary>
/// Provides methods for creating and interacting with an OpenGL context.
/// </summary>
public interface IGLContext : IDisposable
public interface IGraphicsContext : IDisposable
{
/// <summary>
/// Creates an OpenGL context with the specified direct/indirect rendering mode and sharing state with the
/// specified IGLContext.
/// specified IGraphicsContext.
/// </summary>
/// <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)"/>
void CreateContext(bool direct, IGLContext source);
void CreateContext(bool direct, IGraphicsContext source);
/// <summary>Swaps buffers, presenting the rendered scene to the user.</summary>
void SwapBuffers();
@ -42,7 +42,7 @@ namespace OpenTK.Platform
/// <summary>
/// Raised when a Context is destroyed.
/// </summary>
event DestroyEvent<IGLContext> Destroy;
event DestroyEvent<IGraphicsContext> Destroy;
/// <summary>
/// Gets or sets a value indicating whether VSyncing is enabled.

View file

@ -20,8 +20,8 @@ namespace OpenTK.Platform
/// </summary>
internal interface INativeGLWindow : IResizable, IDisposable
{
//void CreateWindow(int width, int height, DisplayMode mode, out IGLContext context);
void CreateWindow(int width, int height, GraphicsFormat mode, out IGLContext context);
//void CreateWindow(int width, int height, DisplayMode mode, out IGraphicsContext context);
void CreateWindow(int width, int height, GraphicsFormat mode, out IGraphicsContext context);
void DestroyWindow();
void ProcessEvents();
void PointToClient(ref System.Drawing.Point p);
@ -33,7 +33,7 @@ namespace OpenTK.Platform
string Title { get; set; }
bool Visible { get; set; }
bool IsIdle { get; }
//IGLContext Context { get; }
//IGraphicsContext Context { get; }
IInputDriver InputDriver { get; }
bool Fullscreen { get; set; }

View file

@ -23,7 +23,7 @@ namespace OpenTK.Platform.Windows
/// 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.
/// </summary>
internal sealed class WinGLContext : IGLContext, IGLContextInternal, IGLContextCreationHack
internal sealed class WinGLContext : IGraphicsContext, IGLContextInternal, IGLContextCreationHack
{
private IntPtr deviceContext;
private ContextHandle renderContext;
@ -51,7 +51,7 @@ namespace OpenTK.Platform.Windows
#endregion
#region --- IGLContext Members ---
#region --- IGraphicsContext Members ---
#region public void CreateContext()
@ -71,9 +71,9 @@ namespace OpenTK.Platform.Windows
#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));
@ -161,7 +161,7 @@ namespace OpenTK.Platform.Windows
#endregion
public event DestroyEvent<IGLContext> Destroy;
public event DestroyEvent<IGraphicsContext> Destroy;
#endregion

View file

@ -307,9 +307,9 @@ namespace OpenTK.Platform.Windows
#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.Indent();

View file

@ -18,7 +18,7 @@ namespace OpenTK.Platform.X11
/// 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.
/// </summary>
internal sealed class X11GLContext : IGLContext, IGLContextInternal, IGLContextCreationHack
internal sealed class X11GLContext : IGraphicsContext, IGLContextInternal, IGLContextCreationHack
{
IntPtr context;
DisplayMode mode;
@ -118,7 +118,7 @@ namespace OpenTK.Platform.X11
#endregion
#region --- IGLContext Members ---
#region --- IGraphicsContext Members ---
#region public DisplayMode Mode
@ -154,9 +154,9 @@ namespace OpenTK.Platform.X11
#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
{
@ -288,7 +288,7 @@ namespace OpenTK.Platform.X11
#endregion
public event DestroyEvent<IGLContext> Destroy;
public event DestroyEvent<IGraphicsContext> Destroy;
#region public IntPtr GetAddress(string function)

View file

@ -392,9 +392,9 @@ namespace OpenTK.Platform.X11
#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)
throw new ApplicationException("Render window already exists!");
@ -478,7 +478,7 @@ namespace OpenTK.Platform.X11
#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>
/// Opens a new render window with the given DisplayMode.
@ -491,7 +491,7 @@ namespace OpenTK.Platform.X11
/// Colormap creation is currently disabled.
/// </para>
/// </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);
}