C# Class Squared.Render.RenderCoordinator

Inheritance: IDisposable
Afficher le fichier Open project: sq/Fracture Class Usage Examples

Méthodes publiques

Свойство Type Description
CreateResourceLock object
EnableThreading bool
Manager RenderManager
PrepareLock object
ThreadGroup ThreadGroup
UseResourceLock object
WorkStopwatch Stopwatch

Méthodes publiques

Méthode Description
AfterPresent ( System.Action action ) : void

Queues an operation to occur immediately after Present.

BeforePresent ( System.Action action ) : void

Queues an operation to occur immediately before Present, after all drawing commands have been issued.

BeginDraw ( ) : bool
Dispose ( ) : void
DisposeResource ( IDisposable resource ) : void
EndDraw ( ) : void
RenderCoordinator ( IGraphicsDeviceService deviceService, Thread mainThread, ThreadGroup threadGroup ) : System

Constructs a render coordinator. A render manager and synchronous draw methods are automatically provided for you.

RenderCoordinator ( RenderManager manager, Func synchronousBeginDraw, System.Action synchronousEndDraw ) : System

Constructs a render coordinator.

SynchronousDrawToRenderTarget ( RenderTarget2D renderTarget, DefaultMaterialSet materials, Action drawBehavior ) : bool

Synchronously renders a complete frame to the specified render target. Automatically sets up the device's viewport and the view transform of your materials and restores them afterwards.

WaitForActiveDraw ( ) : bool

Méthodes protégées

Méthode Description
CheckMainThread ( bool allowThreading ) : void
DefaultBeginDraw ( ) : bool
DefaultEndDraw ( ) : void
OnDeviceReset ( object sender, EventArgs args ) : void
OnDeviceResetting ( object sender, EventArgs args ) : void
PrepareFrame ( Frame frame, bool threaded ) : void
PrepareNextFrame ( Frame newFrame, bool threaded ) : void

Finishes preparing the current Frame and readies it to be sent to the graphics device for rendering.

RenderFrameToDraw ( bool endDraw ) : void
RunAfterPresentHandlers ( ) : void
RunBeforePresentHandlers ( ) : void
ThreadedDraw ( ) : void

Private Methods

Méthode Description
CoreInitialize ( ) : void
FlushDisposeList ( List list ) : void
FlushPendingDisposes ( ) : void
RenderFrame ( Frame frame, bool acquireLock ) : void
WaitForActiveDraws ( ) : bool
WaitForActiveSynchronousDraw ( ) : bool
WaitForPendingWork ( ) : void

Method Details

AfterPresent() public méthode

Queues an operation to occur immediately after Present.
public AfterPresent ( System.Action action ) : void
action System.Action
Résultat void

BeforePresent() public méthode

Queues an operation to occur immediately before Present, after all drawing commands have been issued.
public BeforePresent ( System.Action action ) : void
action System.Action
Résultat void

BeginDraw() public méthode

public BeginDraw ( ) : bool
Résultat bool

CheckMainThread() protected méthode

protected CheckMainThread ( bool allowThreading ) : void
allowThreading bool
Résultat void

DefaultBeginDraw() protected méthode

protected DefaultBeginDraw ( ) : bool
Résultat bool

DefaultEndDraw() protected méthode

protected DefaultEndDraw ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

DisposeResource() public méthode

public DisposeResource ( IDisposable resource ) : void
resource IDisposable
Résultat void

EndDraw() public méthode

public EndDraw ( ) : void
Résultat void

OnDeviceReset() protected méthode

protected OnDeviceReset ( object sender, EventArgs args ) : void
sender object
args System.EventArgs
Résultat void

OnDeviceResetting() protected méthode

protected OnDeviceResetting ( object sender, EventArgs args ) : void
sender object
args System.EventArgs
Résultat void

PrepareFrame() protected méthode

protected PrepareFrame ( Frame frame, bool threaded ) : void
frame Frame
threaded bool
Résultat void

PrepareNextFrame() protected méthode

Finishes preparing the current Frame and readies it to be sent to the graphics device for rendering.
protected PrepareNextFrame ( Frame newFrame, bool threaded ) : void
newFrame Frame
threaded bool
Résultat void

RenderCoordinator() public méthode

Constructs a render coordinator. A render manager and synchronous draw methods are automatically provided for you.
public RenderCoordinator ( IGraphicsDeviceService deviceService, Thread mainThread, ThreadGroup threadGroup ) : System
deviceService IGraphicsDeviceService
mainThread Thread
threadGroup ThreadGroup
Résultat System

RenderCoordinator() public méthode

Constructs a render coordinator.
public RenderCoordinator ( RenderManager manager, Func synchronousBeginDraw, System.Action synchronousEndDraw ) : System
manager RenderManager The render manager responsible for creating frames and dispatching them to the graphics device.
synchronousBeginDraw Func The function responsible for synchronously beginning a rendering operation. This will be invoked on the rendering thread.
synchronousEndDraw System.Action The function responsible for synchronously ending a rendering operation and presenting it to the screen. This will be invoked on the rendering thread.
Résultat System

RenderFrameToDraw() protected méthode

protected RenderFrameToDraw ( bool endDraw ) : void
endDraw bool
Résultat void

RunAfterPresentHandlers() protected méthode

protected RunAfterPresentHandlers ( ) : void
Résultat void

RunBeforePresentHandlers() protected méthode

protected RunBeforePresentHandlers ( ) : void
Résultat void

SynchronousDrawToRenderTarget() public méthode

Synchronously renders a complete frame to the specified render target. Automatically sets up the device's viewport and the view transform of your materials and restores them afterwards.
public SynchronousDrawToRenderTarget ( RenderTarget2D renderTarget, DefaultMaterialSet materials, Action drawBehavior ) : bool
renderTarget Microsoft.Xna.Framework.Graphics.RenderTarget2D
materials DefaultMaterialSet
drawBehavior Action
Résultat bool

ThreadedDraw() protected méthode

protected ThreadedDraw ( ) : void
Résultat void

WaitForActiveDraw() public méthode

public WaitForActiveDraw ( ) : bool
Résultat bool

Property Details

CreateResourceLock public_oe property

You must acquire this lock before applying changes to the device, creating objects, or loading content.
public object CreateResourceLock
Résultat object

EnableThreading public_oe property

If set to false, threads will not be used for rendering.
public bool EnableThreading
Résultat bool

Manager public_oe property

public RenderManager Manager
Résultat RenderManager

PrepareLock public_oe property

This lock is held during frame preparation.
public object PrepareLock
Résultat object

ThreadGroup public_oe property

public ThreadGroup ThreadGroup
Résultat ThreadGroup

UseResourceLock public_oe property

You must acquire this lock before rendering or resetting the device.
public object UseResourceLock
Résultat object

WorkStopwatch public_oe property

public Stopwatch WorkStopwatch
Résultat Stopwatch