C# Класс OpenTK.Graphics.GraphicsContext

Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CreateContext void
Dispose void
FindSharedContext IGraphicsContext
GraphicsContext System
GraphicsContext System
IGraphicsContextInternal System.IntPtr

Открытые методы

Метод Описание
Assert ( ) : void

Checks if a GraphicsContext exists in the calling thread and throws a GraphicsContextMissingException if it doesn't.

CreateDummyContext ( ) : GraphicsContext

Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries.

Instances created by this method will not be functional. Instance methods will have no effect.

This method requires that a context is current on the calling thread.

CreateDummyContext ( ContextHandle handle ) : GraphicsContext

Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries.

Instances created by this method will not be functional. Instance methods will have no effect.

CreateExternalContext ( System.Platform externalGfxContext ) : GraphicsContext

TODO: for used with glfw context

Dispose ( ) : void

Disposes of the GraphicsContext.

GraphicsContext ( ContextHandle handle, IWindowInfo window ) : System

Constructs a new GraphicsContext from a pre-existing context created outside of OpenTK.

GraphicsContext ( ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, int major, int minor, GraphicsContextFlags flags ) : System

Constructs a new GraphicsContext from a pre-existing context created outside of OpenTK.

GraphicsContext ( OpenTK.Graphics.GraphicsMode mode, IWindowInfo window ) : System

Constructs a new GraphicsContext with the specified GraphicsMode and attaches it to the specified window.

GraphicsContext ( OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, int major, int minor, GraphicsContextFlags flags ) : System

Constructs a new GraphicsContext with the specified GraphicsMode, version and flags, and attaches it to the specified window.

Different hardware supports different flags, major and minor versions. Invalid parameters will be silently ignored.

LoadAll ( ) : void

Loads all OpenGL entry points.

MakeCurrent ( IWindowInfo window ) : void

Makes the GraphicsContext the current rendering target.

You can use this method to bind the GraphicsContext to a different window than the one it was created from.

SwapBuffers ( ) : void

Swaps buffers on a context. This presents the rendered scene to the user.

Update ( IWindowInfo window ) : void

Updates the graphics context. This must be called when the render target is resized for proper behavior on Mac OS X.

Приватные методы

Метод Описание
CreateContext ( bool direct, IGraphicsContext source ) : void

Creates an OpenGL context with the specified direct/indirect rendering mode and sharing state with the specified IGraphicsContext.

Direct rendering is the default rendering mode for OpenTK, since it can provide higher performance in some circumastances.

The 'direct' parameter is a hint, and will ignored if the specified mode is not supported (e.g. setting indirect rendering on Windows platforms).

Dispose ( bool manual ) : void
FindSharedContext ( ) : IGraphicsContext
GraphicsContext ( ContextHandle handle ) : System
GraphicsContext ( OpenTK externalGraphicsContext ) : System
IGraphicsContextInternal ( string function ) : IntPtr

Gets the address of an OpenGL extension function.

Описание методов

Assert() публичный статический Метод

Checks if a GraphicsContext exists in the calling thread and throws a GraphicsContextMissingException if it doesn't.
Generated when no GraphicsContext is current in the calling thread.
public static Assert ( ) : void
Результат void

CreateDummyContext() публичный статический Метод

Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries.

Instances created by this method will not be functional. Instance methods will have no effect.

This method requires that a context is current on the calling thread.

public static CreateDummyContext ( ) : GraphicsContext
Результат GraphicsContext

CreateDummyContext() публичный статический Метод

Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries.

Instances created by this method will not be functional. Instance methods will have no effect.

public static CreateDummyContext ( ContextHandle handle ) : GraphicsContext
handle ContextHandle The handle of a context.
Результат GraphicsContext

CreateExternalContext() публичный статический Метод

TODO: for used with glfw context
public static CreateExternalContext ( System.Platform externalGfxContext ) : GraphicsContext
externalGfxContext System.Platform
Результат GraphicsContext

Dispose() публичный Метод

Disposes of the GraphicsContext.
public Dispose ( ) : void
Результат void

GraphicsContext() публичный Метод

Constructs a new GraphicsContext from a pre-existing context created outside of OpenTK.
Occurs if handle is identical to a context already registered with OpenTK.
public GraphicsContext ( ContextHandle handle, IWindowInfo window ) : System
handle ContextHandle The handle of the existing context. This must be a valid, unique handle that is not known to OpenTK.
window IWindowInfo The window this context is bound to. This must be a valid window obtained through Utilities.CreateWindowInfo.
Результат System

GraphicsContext() публичный Метод

Constructs a new GraphicsContext from a pre-existing context created outside of OpenTK.
Occurs if handle is identical to a context already registered with OpenTK.
public GraphicsContext ( ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, int major, int minor, GraphicsContextFlags flags ) : System
handle ContextHandle The handle of the existing context. This must be a valid, unique handle that is not known to OpenTK.
window IWindowInfo The window this context is bound to. This must be a valid window obtained through Utilities.CreateWindowInfo.
shareContext IGraphicsContext A different context that shares resources with this instance, if any. /// Pass null if the context is not shared or if this is the first GraphicsContext instruct you construct.
major int The major version of the context (e.g. "2" for "2.1").
minor int The minor version of the context (e.g. "1" for "2.1").
flags GraphicsContextFlags A bitwise combination of that describe this context.
Результат System

GraphicsContext() публичный Метод

Constructs a new GraphicsContext with the specified GraphicsMode and attaches it to the specified window.
public GraphicsContext ( OpenTK.Graphics.GraphicsMode mode, IWindowInfo window ) : System
mode OpenTK.Graphics.GraphicsMode The OpenTK.Graphics.GraphicsMode of the GraphicsContext.
window IWindowInfo The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to.
Результат System

GraphicsContext() публичный Метод

Constructs a new GraphicsContext with the specified GraphicsMode, version and flags, and attaches it to the specified window.
Different hardware supports different flags, major and minor versions. Invalid parameters will be silently ignored.
public GraphicsContext ( OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, int major, int minor, GraphicsContextFlags flags ) : System
mode OpenTK.Graphics.GraphicsMode The OpenTK.Graphics.GraphicsMode of the GraphicsContext.
window IWindowInfo The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to.
major int The major version of the new GraphicsContext.
minor int The minor version of the new GraphicsContext.
flags GraphicsContextFlags The GraphicsContextFlags for the GraphicsContext.
Результат System

LoadAll() публичный Метод

Loads all OpenGL entry points.
/// Occurs when this instance is not current on the calling thread. ///
public LoadAll ( ) : void
Результат void

MakeCurrent() публичный Метод

Makes the GraphicsContext the current rendering target.
You can use this method to bind the GraphicsContext to a different window than the one it was created from.
public MakeCurrent ( IWindowInfo window ) : void
window IWindowInfo A valid structure.
Результат void

SwapBuffers() публичный Метод

Swaps buffers on a context. This presents the rendered scene to the user.
public SwapBuffers ( ) : void
Результат void

Update() публичный Метод

Updates the graphics context. This must be called when the render target is resized for proper behavior on Mac OS X.
public Update ( IWindowInfo window ) : void
window IWindowInfo
Результат void