C# Class OpenTK.GLControl

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.
Inheritance: System.Windows.Forms.UserControl
Datei anzeigen Open project: prepare/HTML-Renderer Class Usage Examples

Private Properties

Property Type Description
GLControl System
GrabScreenshot System.Drawing.Bitmap
InitializeComponent void
ValidateState void

Public Methods

Method Description
GLControl ( OpenTK.Graphics.GraphicsMode mode ) : System

Constructs a new GLControl with the specified GraphicsMode.

GLControl ( OpenTK.Graphics.GraphicsMode mode, int major, int minor, GraphicsContextFlags flags ) : System

Constructs a new GLControl with the specified GraphicsMode.

GetEglDisplay ( ) : IntPtr
GetEglSurface ( ) : IntPtr
MakeCurrent ( ) : void

Makes the underlying this GLControl current in the calling thread. All OpenGL commands issued are hereafter interpreted by this GLControl.

SwapBuffers ( ) : void

Swaps the front and back buffers, presenting the rendered scene to the screen.

Protected Methods

Method Description
ChildCtorOnlyResetGraphicMode ( OpenTK.Graphics.GraphicsMode mode ) : void
Dispose ( bool disposing ) : void

Clean up any resources being used.

OnHandleCreated ( EventArgs e ) : void

Raises the HandleCreated event.

OnHandleDestroyed ( EventArgs e ) : void

Raises the HandleDestroyed event.

OnPaint ( PaintEventArgs e ) : void

Raises the System.Windows.Forms.Control.Paint event.

OnParentChanged ( EventArgs e ) : void

Raises the ParentChanged event.

OnResize ( EventArgs e ) : void

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.

Private Methods

Method Description
GLControl ( ) : System
GrabScreenshot ( ) : Bitmap
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

ValidateState ( ) : void

Method Details

ChildCtorOnlyResetGraphicMode() protected method

protected ChildCtorOnlyResetGraphicMode ( OpenTK.Graphics.GraphicsMode mode ) : void
mode OpenTK.Graphics.GraphicsMode
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

GLControl() public method

Constructs a new GLControl with the specified GraphicsMode.
public GLControl ( OpenTK.Graphics.GraphicsMode mode ) : System
mode OpenTK.Graphics.GraphicsMode The OpenTK.Graphics.GraphicsMode of the control.
return System

GLControl() public method

Constructs a new GLControl with the specified GraphicsMode.
public GLControl ( OpenTK.Graphics.GraphicsMode mode, int major, int minor, GraphicsContextFlags flags ) : System
mode OpenTK.Graphics.GraphicsMode The OpenTK.Graphics.GraphicsMode of the control.
major int The major version for the OpenGL GraphicsContext.
minor int The minor version for the OpenGL GraphicsContext.
flags GraphicsContextFlags The GraphicsContextFlags for the OpenGL GraphicsContext.
return System

GetEglDisplay() public method

public GetEglDisplay ( ) : IntPtr
return System.IntPtr

GetEglSurface() public method

public GetEglSurface ( ) : IntPtr
return System.IntPtr

MakeCurrent() public method

Makes the underlying this GLControl current in the calling thread. All OpenGL commands issued are hereafter interpreted by this GLControl.
public MakeCurrent ( ) : void
return void

OnHandleCreated() protected method

Raises the HandleCreated event.
protected OnHandleCreated ( EventArgs e ) : void
e System.EventArgs Not used.
return void

OnHandleDestroyed() protected method

Raises the HandleDestroyed event.
protected OnHandleDestroyed ( EventArgs e ) : void
e System.EventArgs Not used.
return void

OnPaint() protected method

Raises the System.Windows.Forms.Control.Paint event.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs A System.Windows.Forms.PaintEventArgs that contains the event data.
return void

OnParentChanged() protected method

Raises the ParentChanged event.
protected OnParentChanged ( EventArgs e ) : void
e System.EventArgs A System.EventArgs that contains the event data.
return void

OnResize() protected method

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.
protected OnResize ( EventArgs e ) : void
e System.EventArgs A System.EventArgs that contains the event data.
return void

SwapBuffers() public method

Swaps the front and back buffers, presenting the rendered scene to the screen.
public SwapBuffers ( ) : void
return void