Class GLWidget
The GLWidget is a GTK widget for which an OpenGL context can be used to draw arbitrary graphics.
Inheritance
Namespace: OpenTK
Assembly: cs.temp.dll.dll
Syntax
[CLSCompliant(false)]
public class GLWidget : GLArea
Constructors
GLWidget()
Initializes a new instance of the GLWidget class.
Declaration
public GLWidget()
GLWidget(GraphicsMode)
Constructs a new GLWidget using a given GraphicsMode
Declaration
public GLWidget(GraphicsMode graphicsMode)
Parameters
Type | Name | Description |
---|---|---|
GraphicsMode | graphicsMode |
GLWidget(GraphicsMode, Int32, Int32, GraphicsContextFlags)
Initializes a new instance of the GLWidget class.
Declaration
public GLWidget(GraphicsMode graphicsMode, int glVersionMajor, int glVersionMinor, GraphicsContextFlags contextFlags)
Parameters
Type | Name | Description |
---|---|---|
GraphicsMode | graphicsMode | The |
System.Int32 | glVersionMajor | The major OpenGL version to attempt to initialize. |
System.Int32 | glVersionMinor | The minor OpenGL version to attempt to initialize. |
GraphicsContextFlags | contextFlags | Any flags which should be used during initialization of the |
Properties
ContextFlags
The set ContextFlags for this widget.
Declaration
public GraphicsContextFlags ContextFlags { get; }
Property Value
Type | Description |
---|---|
GraphicsContextFlags |
DeltaTime
Gets the time taken to render the last frame (in seconds).
Declaration
public double DeltaTime { get; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
Destroy()
Destroys this
Declaration
public override void Destroy()
Dispose(Boolean)
Disposes the current object, releasing any native resources it was using.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Finalize()
Destructs this object.
Declaration
protected void Finalize()
OnCreateContext()
Declaration
protected override GLContext OnCreateContext()
Returns
Type | Description |
---|---|
GLContext |
OnDrawn(Cairo.Context)
Called when the widget needs to be (fully or partially) redrawn.
Declaration
protected override bool OnDrawn(Cairo.Context cr)
Parameters
Type | Name | Description |
---|---|---|
Cairo.Context | cr |
Returns
Type | Description |
---|---|
System.Boolean |
OnInitialized()
Invokes the Initialized event.
Declaration
protected virtual void OnInitialized()
OnShuttingDown()
Invokes the ShuttingDown event.
Declaration
protected virtual void OnShuttingDown()
Events
GraphicsContextInitialized
Called when the first
Declaration
public static event EventHandler GraphicsContextInitialized
Event Type
Type | Description |
---|---|
System.EventHandler |
GraphicsContextShuttingDown
Called when the first
Declaration
public static event EventHandler GraphicsContextShuttingDown
Event Type
Type | Description |
---|---|
System.EventHandler |
Initialized
Called when this GLWidget has finished initializing and has a valid
Declaration
public event EventHandler Initialized
Event Type
Type | Description |
---|---|
System.EventHandler |
ShuttingDown
Called when this GLWidget is being disposed.
Declaration
public event EventHandler ShuttingDown
Event Type
Type | Description |
---|---|
System.EventHandler |