mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-26 17:25:37 +00:00
Split items that should be internal in different interfaces, for explicit implementations.
This commit is contained in:
parent
94043ee334
commit
201f88552d
|
@ -15,21 +15,6 @@ namespace OpenTK.Platform
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IGLContext : IDisposable
|
public interface IGLContext : IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Gets a handle to the OpenGL rendering context.
|
|
||||||
/// </summary>
|
|
||||||
IntPtr Context { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the IWindowInfo describing the window associated with this context.
|
|
||||||
/// </summary>
|
|
||||||
IWindowInfo Info { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the DisplayMode of the context.
|
|
||||||
/// </summary>
|
|
||||||
DisplayMode Mode { get; }
|
|
||||||
|
|
||||||
/// <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 IGLContext.
|
||||||
|
@ -54,39 +39,52 @@ namespace OpenTK.Platform
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool IsCurrent { get; }
|
bool IsCurrent { 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.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>A System.IntPtr that holds the handle to the current OpenGL context.</returns>
|
|
||||||
IntPtr GetCurrentContext();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raised when a Context is destroyed.
|
/// Raised when a Context is destroyed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
event DestroyEvent<IGLContext> Destroy;
|
event DestroyEvent<IGLContext> Destroy;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the address of an OpenGL extension function.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="function">The name of the OpenGL function (e.g. "glGetString")</param>
|
|
||||||
/// <returns>
|
|
||||||
/// A pointer to the specified function or IntPtr.Zero if the function isn't
|
|
||||||
/// available in the current opengl context.
|
|
||||||
/// </returns>
|
|
||||||
/// <see cref="Marshal.GetDelegateForFunctionPointer"/>
|
|
||||||
IntPtr GetAddress(string function);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the display modes supported by the current opengl context.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>An IEnumerable containing all supported display modes.</returns>
|
|
||||||
IEnumerable<DisplayMode> GetDisplayModes();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether VSyncing is enabled.
|
/// Gets or sets a value indicating whether VSyncing is enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool VSync { get; set; }
|
bool VSync { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
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.
|
||||||
|
// TODO: RegisterForDisposal/DisposeResources for 0.3.15 (GC & OpenGL)
|
||||||
|
// TODO: Remove or move GetDisplayModes to another class.
|
||||||
|
internal interface IGLContextInternal
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a handle to the OpenGL rendering context.
|
||||||
|
/// </summary>
|
||||||
|
ContextHandle Context { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the IWindowInfo describing the window associated with this context.
|
||||||
|
/// </summary>
|
||||||
|
IWindowInfo Info { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the DisplayMode of the context.
|
||||||
|
/// </summary>
|
||||||
|
DisplayMode Mode { 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.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A System.IntPtr that holds the handle to the current OpenGL context.</returns>
|
||||||
|
ContextHandle GetCurrentContext();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers an OpenGL resource for disposal.
|
/// Registers an OpenGL resource for disposal.
|
||||||
|
@ -104,7 +102,22 @@ namespace OpenTK.Platform
|
||||||
/// Disposes all registered OpenGL resources.
|
/// Disposes all registered OpenGL resources.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void DisposeResources();
|
void DisposeResources();
|
||||||
}
|
|
||||||
|
|
||||||
public delegate void DestroyEvent<T>(T sender, EventArgs e);
|
/// <summary>
|
||||||
|
/// Returns the display modes supported by the current opengl context.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>An IEnumerable containing all supported display modes.</returns>
|
||||||
|
IEnumerable<DisplayMode> GetDisplayModes();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the address of an OpenGL extension function.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="function">The name of the OpenGL function (e.g. "glGetString")</param>
|
||||||
|
/// <returns>
|
||||||
|
/// A pointer to the specified function or IntPtr.Zero if the function isn't
|
||||||
|
/// available in the current opengl context.
|
||||||
|
/// </returns>
|
||||||
|
/// <see cref="Marshal.GetDelegateForFunctionPointer"/>
|
||||||
|
IntPtr GetAddress(string function);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue