The Open Toolkit library
1.0
|
OpenGL-aware WinForms control. The WinForms designer will always call the default constructor. Inherit from this class and call one of its specialized constructors to enable antialiasing or custom GraphicsModes. More...
Inherits UserControl.
Public Member Functions | |
GLControl () | |
Constructs a new instance. More... | |
GLControl (GraphicsMode mode) | |
Constructs a new instance with the specified GraphicsMode. More... | |
GLControl (GraphicsMode mode, int major, int minor, GraphicsContextFlags flags) | |
Constructs a new instance with the specified GraphicsMode. More... | |
void | SwapBuffers () |
Swaps the front and back buffers, presenting the rendered scene to the screen. More... | |
void | MakeCurrent () |
Makes the underlying this GLControl current in the calling thread. All OpenGL commands issued are hereafter interpreted by this GLControl. More... | |
Bitmap | GrabScreenshot () |
Grabs a screenshot of the frontbuffer contents. More... | |
Protected Member Functions | |
override void | OnHandleCreated (EventArgs e) |
Raises the HandleCreated event. More... | |
override void | OnHandleDestroyed (EventArgs e) |
Raises the HandleDestroyed event. More... | |
override void | OnPaint (PaintEventArgs e) |
Raises the System.Windows.Forms.Control.Paint event. More... | |
override void | OnResize (EventArgs e) |
Raises the Resize event. Note: this method may be called before the OpenGL context is ready. Check that IsHandleCreated is true before using any OpenGL methods. More... | |
override void | OnParentChanged (EventArgs e) |
Raises the ParentChanged event. More... | |
override void | Dispose (bool disposing) |
Clean up any resources being used. More... | |
Properties | |
bool | IsIdle [get] |
Gets a value indicating whether the current thread contains pending system messages. More... | |
IGraphicsContext | Context [get, set] |
Gets an interface to the underlying GraphicsContext used by this GLControl. More... | |
float | AspectRatio [get] |
Gets the aspect ratio of this GLControl. More... | |
bool | VSync [get, set] |
Gets or sets a value indicating whether vsync is active for this GLControl. More... | |
GraphicsMode | GraphicsMode [get] |
Gets the GraphicsMode of the GraphicsContext attached to this GLControl. More... | |
IWindowInfo | WindowInfo [get] |
Gets the OpenTK.Platform.IWindowInfo for this instance. More... | |
OpenGL-aware WinForms control. The WinForms designer will always call the default constructor. Inherit from this class and call one of its specialized constructors to enable antialiasing or custom GraphicsModes.
OpenTK.GLControl.GLControl | ( | ) |
Constructs a new instance.
OpenTK.GLControl.GLControl | ( | GraphicsMode | mode | ) |
Constructs a new instance with the specified GraphicsMode.
mode | The OpenTK.Graphics.GraphicsMode of the control. |
OpenTK.GLControl.GLControl | ( | GraphicsMode | mode, |
int | major, | ||
int | minor, | ||
GraphicsContextFlags | flags | ||
) |
Constructs a new instance with the specified GraphicsMode.
mode | The OpenTK.Graphics.GraphicsMode of the control. |
major | The major version for the OpenGL GraphicsContext. |
minor | The minor version for the OpenGL GraphicsContext. |
flags | The GraphicsContextFlags for the OpenGL GraphicsContext. |
|
protected |
Clean up any resources being used.
disposing | true if managed resources should be disposed; otherwise, false. |
Bitmap OpenTK.GLControl.GrabScreenshot | ( | ) |
Grabs a screenshot of the frontbuffer contents.
OpenTK.Graphics.GraphicsContextException | Occurs when no OpenTK.Graphics.GraphicsContext is current in the calling thread. |
void OpenTK.GLControl.MakeCurrent | ( | ) |
|
protected |
Raises the HandleCreated event.
e | Not used. |
|
protected |
Raises the HandleDestroyed event.
e | Not used. |
|
protected |
Raises the System.Windows.Forms.Control.Paint event.
e | A System.Windows.Forms.PaintEventArgs that contains the event data. |
|
protected |
Raises the ParentChanged event.
e | A System.EventArgs that contains the event data. |
|
protected |
Raises the Resize event. Note: this method may be called before the OpenGL context is ready. Check that IsHandleCreated is true before using any OpenGL methods.
e | A System.EventArgs that contains the event data. |
void OpenTK.GLControl.SwapBuffers | ( | ) |
Swaps the front and back buffers, presenting the rendered scene to the screen.
|
get |
Gets the aspect ratio of this GLControl.
|
getset |
Gets an interface to the underlying GraphicsContext used by this GLControl.
|
get |
|
get |
Gets a value indicating whether the current thread contains pending system messages.
|
getset |
Gets or sets a value indicating whether vsync is active for this GLControl.
|
get |
Gets the OpenTK.Platform.IWindowInfo for this instance.