#region --- License ---
/* Licensed under the MIT/X11 license.
* Copyright (c) 2006-2008 the OpenTK Team.
* This notice may not be removed from any source distribution.
* See license.txt for licensing detailed licensing details.
*/
#endregion
using System;
using OpenTK.Platform;
namespace OpenTK.Graphics {
/// Provides methods for creating and interacting with an OpenGL context.
public interface IGraphicsContext : IDisposable {
/// Swaps buffers, presenting the rendered scene to the user.
void SwapBuffers();
/// Makes the GraphicsContext current in the calling thread.
/// An OpenTK.Platform.IWindowInfo structure that points to a valid window.
///
/// OpenGL commands in one thread, affect the GraphicsContext which is current in that thread.
/// It is an error to issue an OpenGL command in a thread without a current GraphicsContext.
///
void MakeCurrent(IWindowInfo window);
/// Gets a indicating whether this instance is current in the calling thread.
bool IsCurrent { get; }
/// Gets a indicating whether this instance has been disposed.
/// It is an error to access any instance methods if this property returns true.
bool IsDisposed { get; }
/// Gets or sets a value indicating whether VSyncing is enabled.
bool VSync { get; set; }
/// Updates the graphics context. This must be called when the region the graphics context
/// is drawn to is resized.
///
void Update(IWindowInfo window);
/// Gets the GraphicsMode of this instance.
GraphicsMode GraphicsMode { get; }
/// Loads all OpenGL entry points. Requires this instance to be current on the calling thread.
void LoadAll();
/// Gets a handle to the OpenGL rendering context.
IntPtr Context { get; }
/// Gets the address of an OpenGL extension function.
/// The name of the OpenGL function (e.g. "glGetString")
/// A pointer to the specified function or IntPtr.Zero if the function isn't
/// available in the current opengl context.
IntPtr GetAddress(string function);
}
}