Show / Hide Table of Contents

Interface IOpenGLComponent

Interface for drivers which provide the PAL OpenGL Component.

Inherited Members
IPalComponent.Name
IPalComponent.Provides
IPalComponent.Logger
IPalComponent.Initialize(ToolkitOptions)
Namespace: OpenTK.Core.Platform
Assembly: OpenTK.Core.dll
Syntax
public interface IOpenGLComponent : IPalComponent

Properties

CanCreateFromSurface

True if the component driver can create a context from surfaces.

Declaration
bool CanCreateFromSurface { get; }
Property Value
Type Description
bool

CanCreateFromWindow

True if the component driver can create a context from windows.

Declaration
bool CanCreateFromWindow { get; }
Property Value
Type Description
bool

CanShareContexts

True if the component driver has the capability to share display lists between OpenGL contexts.

Declaration
bool CanShareContexts { get; }
Property Value
Type Description
bool

Methods

CreateFromSurface()

Create and OpenGL context for a surface.

Declaration
OpenGLContextHandle CreateFromSurface()
Returns
Type Description
OpenGLContextHandle

An OpenGL context handle.

CreateFromWindow(WindowHandle)

Create an OpenGL context for a window.

Declaration
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.

DestroyContext(OpenGLContextHandle)

Destroy an OpenGL context.

Declaration
void DestroyContext(OpenGLContextHandle handle)
Parameters
Type Name Description
OpenGLContextHandle handle

Handle to the OpenGL context to destroy.

Exceptions
Type Condition
ArgumentNullException

OpenGL context handle is null.

GetBindingsContext(OpenGLContextHandle)

Gets a IBindingsContext from an OpenGLContextHandle.

Declaration
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.

GetCurrentContext()

Get the current OpenGL context for this thread.

Declaration
OpenGLContextHandle? GetCurrentContext()
Returns
Type Description
OpenGLContextHandle

Handle to the current OpenGL context, null if none are current.

GetProcedureAddress(OpenGLContextHandle, string)

Get the procedure address for an OpenGL command.

Declaration
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.

Exceptions
Type Condition
ArgumentNullException

OpenGL context handle or procedure name is null.

GetSharedContext(OpenGLContextHandle)

Gets the context which the given context shares display lists with.

Declaration
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.

GetSwapInterval()

Gets the swap interval of the current OpenGL context.

Declaration
int GetSwapInterval()
Returns
Type Description
int

The current swap interval.

SetCurrentContext(OpenGLContextHandle?)

Set the current OpenGL context for this thread.

Declaration
bool SetCurrentContext(OpenGLContextHandle? handle)
Parameters
Type Name Description
OpenGLContextHandle handle

Handle to the OpenGL context to make current, or null to make none current.

Returns
Type Description
bool

True when the OpenGL context is successfully made current.

SetSwapInterval(int)

Sets the swap interval of the current OpenGL context.

Declaration
void SetSwapInterval(int interval)
Parameters
Type Name Description
int interval

The new swap interval.

SwapBuffers(OpenGLContextHandle)

Swaps the buffer of the specified context.

Declaration
void SwapBuffers(OpenGLContextHandle handle)
Parameters
Type Name Description
OpenGLContextHandle handle

Handle to the context.

In this article
Back to top Generated by DocFX