C# 클래스 OpenTK.Graphics.GraphicsContext

파일 보기 프로젝트 열기: prepare/HTML-Renderer 1 사용 예제들

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