Class ANGLEOpenGLComponent
Inherited Members
Namespace: OpenTK.Platform.Native.ANGLE
Assembly: OpenTK.Platform.dll
Syntax
public class ANGLEOpenGLComponent : IOpenGLComponent, IPalComponent
Properties
CanCreateFromSurface
True if the component driver can create a context from surfaces using CreateFromSurface().
Declaration
public bool CanCreateFromSurface { get; }
Property Value
Type | Description |
---|---|
bool |
CanCreateFromWindow
True if the component driver can create a context from windows using CreateFromWindow(WindowHandle).
Declaration
public bool CanCreateFromWindow { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
CanShareContexts
True if the component driver has the capability to share display lists between OpenGL contexts.
Declaration
public bool CanShareContexts { get; }
Property Value
Type | Description |
---|---|
bool |
Logger
The logger that this component uses to log diagnostic messages.
Declaration
public ILogger? Logger { get; set; }
Property Value
Type | Description |
---|---|
ILogger |
See Also
Name
Name of the abstraction layer component.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
Provides
Specifies which PAL components this object provides.
Declaration
public PalComponents Provides { get; }
Property Value
Type | Description |
---|---|
PalComponents |
Methods
CreateFromSurface()
Create and OpenGL context for a surface.
Declaration
public OpenGLContextHandle CreateFromSurface()
Returns
Type | Description |
---|---|
OpenGLContextHandle | An OpenGL context handle. |
CreateFromWindow(WindowHandle)
Create an OpenGL context for a window.
Declaration
public OpenGLContextHandle CreateFromWindow(WindowHandle handle)
Parameters
Type | Name | Description |
---|---|---|
WindowHandle | handle | The window for which the OpenGL context should be created. |
Returns
Type | Description |
---|---|
OpenGLContextHandle | An OpenGL context handle. |
See Also
DestroyContext(OpenGLContextHandle)
Destroy an OpenGL context.
Declaration
public void DestroyContext(OpenGLContextHandle handle)
Parameters
Type | Name | Description |
---|---|---|
OpenGLContextHandle | handle | Handle to the OpenGL context to destroy. |
See Also
GetBindingsContext(OpenGLContextHandle)
Gets a IBindingsContext from an OpenGLContextHandle. Pass this to LoadBindings(IBindingsContext) to load the OpenGL bindings.
Declaration
public IBindingsContext GetBindingsContext(OpenGLContextHandle handle)
Parameters
Type | Name | Description |
---|---|---|
OpenGLContextHandle | handle | The handle to get a bindings context for. |
Returns
Type | Description |
---|---|
IBindingsContext | The created bindings context. |
See Also
GetCurrentContext()
Get the current OpenGL context for this thread.
Declaration
public OpenGLContextHandle? GetCurrentContext()
Returns
Type | Description |
---|---|
OpenGLContextHandle | Handle to the current OpenGL context, null if no context is current. |
See Also
GetEglContext(OpenGLContextHandle)
Returns the EGLContext
associated with the specified context handle.
Declaration
public EGLContext GetEglContext(OpenGLContextHandle handle)
Parameters
Type | Name | Description |
---|---|---|
OpenGLContextHandle | handle | A handle to an OpenGL context to get the associated |
Returns
Type | Description |
---|---|
EGLContext | The |
GetEglDisplay()
Returns the EGLDisplay
used by OpenTK.
Declaration
public EGLDisplay GetEglDisplay()
Returns
Type | Description |
---|---|
EGLDisplay | The |
GetEglSurface(OpenGLContextHandle)
Returns the EGLSurface
associated with the specified context handle.
Declaration
public EGLSurface GetEglSurface(OpenGLContextHandle handle)
Parameters
Type | Name | Description |
---|---|---|
OpenGLContextHandle | handle | A handle to an OpenGL context to get the associated |
Returns
Type | Description |
---|---|
EGLSurface | The |
GetProcedureAddress(OpenGLContextHandle, string)
Get the procedure address for an OpenGL command.
Declaration
public nint GetProcedureAddress(OpenGLContextHandle handle, string procedureName)
Parameters
Type | Name | Description |
---|---|---|
OpenGLContextHandle | handle | Handle to an OpenGL context. |
string | procedureName | Name of the OpenGL command. |
Returns
Type | Description |
---|---|
nint | The procedure address to the OpenGL command. |
GetSharedContext(OpenGLContextHandle)
Gets the context which the given context shares display lists with.
Declaration
public OpenGLContextHandle? GetSharedContext(OpenGLContextHandle handle)
Parameters
Type | Name | Description |
---|---|---|
OpenGLContextHandle | handle | Handle to the OpenGL context. |
Returns
Type | Description |
---|---|
OpenGLContextHandle | Handle to the OpenGL context the given context shares display lists with. |
See Also
GetSwapInterval()
Gets the swap interval of the current OpenGL context, or -1
if no context is current.
Declaration
public int GetSwapInterval()
Returns
Type | Description |
---|---|
int | The current swap interval, or |
Initialize(ToolkitOptions)
Initialize the component.
Declaration
public void Initialize(ToolkitOptions options)
Parameters
Type | Name | Description |
---|---|---|
ToolkitOptions | options | The options to initialize the component with. |
See Also
SetCurrentContext(OpenGLContextHandle?)
Set the current OpenGL context for this thread.
Declaration
public bool SetCurrentContext(OpenGLContextHandle? handle)
Parameters
Type | Name | Description |
---|---|---|
OpenGLContextHandle | handle | Handle to the OpenGL context to make current, or null to make no context current. |
Returns
Type | Description |
---|---|
bool | true when the OpenGL context is successfully made current. |
See Also
SetSwapInterval(int)
Sets the swap interval of the current OpenGL context.
Declaration
public void SetSwapInterval(int interval)
Parameters
Type | Name | Description |
---|---|---|
int | interval | The new swap interval. |
SwapBuffers(OpenGLContextHandle)
Swaps the buffer of the specified context.
Declaration
public void SwapBuffers(OpenGLContextHandle handle)
Parameters
Type | Name | Description |
---|---|---|
OpenGLContextHandle | handle | Handle to the context. |
See Also
Uninitialize()
Uninitialize the component. Frees any native resources used by the component.
Declaration
public void Uninitialize()