Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[GLControl] Clarified docs regarding multiple contexts

  • Loading branch information...
commit 24be068742dc2881f63a023f85687c6636381111 1 parent cd42f92
@thefiddler thefiddler authored
Showing with 35 additions and 9 deletions.
  1. +35 −9 Source/GLControl/GLControl.cs
View
44 Source/GLControl/GLControl.cs
@@ -287,6 +287,7 @@ protected override void OnParentChanged(EventArgs e)
/// <summary>
/// Swaps the front and back buffers, presenting the rendered scene to the screen.
+ /// This method will have no effect on a single-buffered <c>GraphicsMode</c>.
/// </summary>
public void SwapBuffers()
{
@@ -299,8 +300,19 @@ public void SwapBuffers()
#region public void MakeCurrent()
/// <summary>
- /// Makes the underlying this GLControl current in the calling thread.
- /// All OpenGL commands issued are hereafter interpreted by this GLControl.
+ /// <para>
+ /// Makes <see cref="GLControl.Context"/> current in the calling thread.
+ /// All OpenGL commands issued are hereafter interpreted by this context.
+ /// </para>
+ /// <para>
+ /// When using multiple <c>GLControl</c>s, calling <c>MakeCurrent</c> on
+ /// one control will make all other controls non-current in the calling thread.
+ /// </para>
+ /// <seealso cref="Context"/>
+ /// <para>
+ /// A <c>GLControl</c> can only be current in one thread at a time.
+ /// To make a control non-current, call <c>GLControl.Context.MakeCurrent(null)</c>.
+ /// </para>
/// </summary>
public void MakeCurrent()
{
@@ -330,7 +342,12 @@ public bool IsIdle
#region public IGraphicsContext Context
/// <summary>
- /// Gets an interface to the underlying GraphicsContext used by this GLControl.
+ /// Gets the <c>IGraphicsContext</c> instance that is associated with the <c>GLControl</c>.
+ /// The associated <c>IGraphicsContext</c> is updated whenever the <c>GLControl</c>
+ /// handle is created or recreated.
+ /// When using multiple <c>GLControl</c>s, ensure that <c>Context</c>
+ /// is current before performing any OpenGL operations.
+ /// <seealso cref="MakeCurrent"/>
/// </summary>
[Browsable(false)]
public IGraphicsContext Context
@@ -365,7 +382,11 @@ public float AspectRatio
#region public bool VSync
/// <summary>
- /// Gets or sets a value indicating whether vsync is active for this GLControl.
+ /// Gets or sets a value indicating whether vsync is active for this <c>GLControl</c>.
+ /// When using multiple <c>GLControl</c>s, ensure that <see cref="Context"/>
+ /// is current before accessing this property.
+ /// <seealso cref="Context"/>
+ /// <seealso cref="MakeCurrent"/>
/// </summary>
[Description("Indicates whether GLControl updates are synced to the monitor's refresh rate.")]
public bool VSync
@@ -400,11 +421,10 @@ public bool VSync
#region public GraphicsMode GraphicsMode
/// <summary>
- /// Gets the GraphicsMode of the GraphicsContext attached to this GLControl.
+ /// Gets the <c>GraphicsMode</c> of the <c>IGraphicsContext</c> associated with
+ /// this <c>GLControl</c>. If you wish to change <c>GraphicsMode</c>, you must
+ /// destroy and recreate the <c>GLControl</c>.
/// </summary>
- /// <remarks>
- /// To change the GraphicsMode, you must destroy and recreate the GLControl.
- /// </remarks>
public GraphicsMode GraphicsMode
{
get
@@ -430,7 +450,13 @@ public IWindowInfo WindowInfo
#region public Bitmap GrabScreenshot()
- /// <summary>Grabs a screenshot of the frontbuffer contents.</summary>
+ /// <summary>
+ /// Grabs a screenshot of the frontbuffer contents.
+ /// When using multiple <c>GLControl</c>s, ensure that <see cref="Context"/>
+ /// is current before accessing this property.
+ /// <seealso cref="Context"/>
+ /// <seealso cref="MakeCurrent"/>
+ /// </summary>
/// <returns>A System.Drawing.Bitmap, containing the contents of the frontbuffer.</returns>
/// <exception cref="OpenTK.Graphics.GraphicsContextException">
/// Occurs when no OpenTK.Graphics.GraphicsContext is current in the calling thread.
Please sign in to comment.
Something went wrong with that request. Please try again.