Interface IGraphicsContext
Provides methods for creating and interacting with an OpenGL context.
Inherited Members
Namespace: OpenTK.Graphics
Assembly: OpenTK.dll
Syntax
public interface IGraphicsContext : IDisposable
Properties
ErrorChecking
Gets or sets a System.Boolean, indicating whether automatic error checking should be performed.
Declaration
bool ErrorChecking { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
It is an error to enable error checking inside a Begin()-End() region.
This method only affects the debug version of OpenTK.dll.
GraphicsMode
Gets the GraphicsMode of this instance.
Declaration
GraphicsMode GraphicsMode { get; }
Property Value
Type | Description |
---|---|
GraphicsMode |
IsCurrent
Gets a Boolean indicating whether this instance is current in the calling thread.
Declaration
bool IsCurrent { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsDisposed
Gets a Boolean indicating whether this instance has been disposed. It is an error to access any instance methods if this property returns true.
Declaration
bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
Boolean |
SwapInterval
Gets or sets a positive integer in the range [1, n), indicating the number of DisplayDevice refreshes between consecutive SwapBuffers() calls. The maximum value for n is implementation-dependent. The default value is 1. Invalid values will be clamped to the valid range.
Declaration
int SwapInterval { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
LoadAll()
Loads all OpenGL entry points. Requires this instance to be current on the calling thread.
Declaration
void LoadAll()
MakeCurrent(IWindowInfo)
Makes the GraphicsContext current in the calling thread.
Declaration
void MakeCurrent(IWindowInfo window)
Parameters
Type | Name | Description |
---|---|---|
IWindowInfo | window | An OpenTK.Platform.IWindowInfo structure that points to a valid window. |
Remarks
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.
SwapBuffers()
Swaps buffers, presenting the rendered scene to the user.
Declaration
void SwapBuffers()
Update(IWindowInfo)
Updates the graphics context. This must be called when the region the graphics context is drawn to is resized.
Declaration
void Update(IWindowInfo window)
Parameters
Type | Name | Description |
---|---|---|
IWindowInfo | window |