Class MacOSOpenGLComponent
Inherited Members
Namespace: OpenTK.Platform.Native.macOS
Assembly: OpenTK.Platform.dll
Syntax
public class MacOSOpenGLComponent : 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
Provides a logger for this component.
Declaration
public ILogger? Logger { get; set; }
Property Value
Type | Description |
---|---|
ILogger |
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. |
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. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | OpenGL context handle is null. |
GetBindingsContext(OpenGLContextHandle)
Gets a IBindingsContext from an OpenGLContextHandle.
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. |
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 none are current. |
GetNSOpenGLContext(OpenGLContextHandle)
Returns the NSOpenGLContext
associated with the specified context handle.
Declaration
public nint GetNSOpenGLContext(OpenGLContextHandle handle)
Parameters
Type | Name | Description |
---|---|---|
OpenGLContextHandle | handle | A handle to an OpenGL context to get the associated |
Returns
Type | Description |
---|---|
nint | 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. |
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
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. |
GetSwapInterval()
Gets the swap interval of the current OpenGL context.
Declaration
public int GetSwapInterval()
Returns
Type | Description |
---|---|
int | The current swap interval. |
Initialize(ToolkitOptions)
Initialize the component.
Declaration
public void Initialize(ToolkitOptions options)
Parameters
Type | Name | Description |
---|---|---|
ToolkitOptions | options | The options to initialize the component with. |
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 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
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. |