Show / Hide Table of Contents

Class MacOSOpenGLComponent

Inheritance
object
MacOSOpenGLComponent
Implements
IOpenGLComponent
IPalComponent
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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
CreateFromWindow(WindowHandle)

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
ILogger
Logger

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
Create(GraphicsApiHints)
OpenGLGraphicsApiHints

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
CreateFromWindow(WindowHandle)

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
GLLoader
IBindingsContext

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
SetCurrentContext(OpenGLContextHandle)

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 NSOpenGLContext from.

Returns
Type Description
nint

The NSOpenGLContext associated with the context handle.

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
SharedContext

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 -1 if no context is current.

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
ToolkitOptions
Init(ToolkitOptions)

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
GetCurrentContext()

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
SwapMethod

Uninitialize()

Uninitialize the component. Frees any native resources used by the component.

Declaration
public void Uninitialize()
See Also
Uninit()

Implements

IOpenGLComponent
IPalComponent
In this article
Back to top Generated by DocFX