/// <summary> /// 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. /// </summary> public bool SynchronousDrawToRenderTarget( RenderTarget2D renderTarget, DefaultMaterialSet materials, PendingDrawHandler drawBehavior, object userData = null ) { return(SynchronousDrawToRenderTargetSetup(renderTarget, materials, drawBehavior, userData)); }
/// <summary> /// Queues a draw operation to the specified render target. /// The draw operation will occur at the start of the next frame before the frame itself has been rendered. /// </summary> /// <param name="onComplete">A Future instance that will have userData stored into it when rendering is complete.</param> public bool QueueDrawToRenderTarget( RenderTarget2D renderTarget, DefaultMaterialSet materials, PendingDrawHandler handler, object userData = null, IFuture onComplete = null, ViewTransform?viewTransform = null ) { if (!ValidateDrawToRenderTarget(renderTarget, materials)) { return(false); } lock (PendingDrawQueue) PendingDrawQueue.Add(new PendingDraw { RenderTarget = renderTarget, Handler = handler, Materials = materials, UserData = userData, OnComplete = onComplete, ViewTransform = viewTransform }); return(true); }