RenderContext

Description

abstract class Tinman.AddOns.API.RenderContext

Derived from

Disposable abstract
INativeHandle

Extended by

WGLContext sealed

Full source code is included in the Tinman 3D SDK download.

Abstract base for classes that represent a render context for a specific API.

This render context will be current for the calling thread as long as Begin has been called more often than End. Use Prepare and Select to choose the output window for rendering, while this render context is current.

Public / Constructors

Create


[OwnerReturn]
public static method Create → (2)

api in : GLApi

The render context API.

multiSampling in : MultiSampleType

The multisampling settings to use.

returns → RenderContext

The RenderContext object or null if not available.

Creates a new RenderContext object for the given API.

Current


[OwnerReturn]
public static method Current → (1)

api in : GLApi

The render context API.

returns → RenderContext

The RenderContext object or null if not available.

Creates a RenderContext object that wraps the current render context of the calling thread.

Public / Methods

Begin


public abstract method Begin → ()

returns → bool

true if this render context is the current one,
false if this render context cannot be made the current one.

Begins to use this render context as the current one of the calling thread.

Each call to Begin that returns true must have a paired call to End. Calls to Begin and End may be nested. This render context will be made current upon the first call to Begin.

BeginThrow


public method BeginThrow → (1)

source in : string

The error source to use when throwing an exception.

Calls Begin and throws an exception if it returns false.

RenderException

If Begin has returned false.

CanCreate


public static method CanCreate → (1)

api in : GLApi

The render context API.

returns → bool

true if Create will return a non-null value,
false if not.

Checks if Create will return a non-null value for the given api in.

End


public abstract method End → ()

Ends using this render context as the current one of the calling thread.

This render context will be made not current upon the last call to End or when the RenderContext object is disposed. If End is called without a matching call to Begin, it will return silently.

Prepare


[BeginEnd]
public abstract method Prepare → (1)

window in : INativeWindow

[not-null]
The native window to prepare.

returns → bool

true if window in may be passed to Select,
false if window in cannot be used with this context.

Prepares the given native window for being used with this render context.

Present


[BeginEnd]
public abstract method Present → ()

returns → bool

true if presentation has finished
false if presentation has failed.

Presents the current renderings using the window that has been specified with Prepare, using the presentation mode of this render context.

Select


[BeginEnd]
public abstract method Select → (1)

window in : INativeWindow

The native window to use (must have been prepared with Prepare) or null.

returns → bool

true if window in has been selected for this render context,
false if not.

Selects the given native window for being used with this render context.

Public / Attributes

Api


public abstract attribute Api → (get)

value : GLApi

The API.

The API of this GL context.

Gl


public abstract attribute Gl → (get)

value : GLBase

[not-null]
The API wrapper object.

The GLBase object that wraps the API of this GL context.