/// <summary> /// draw a rendering queue, firing events before and after. /// </summary> /// <param name="queue"></param> /// <param name="args"></param> protected void Draw(RenderQueue queue, RenderQueueEventArgs args) { FireEvent(RenderQueueStarted, args); d_target.Draw(queue); args.handled = 0; FireEvent(RenderQueueEnded, args); }
/// <summary> /// Constructor for RenderingSurface objects. /// </summary> /// <param name="target"> /// RenderTarget object that will receive rendered output from the /// RenderingSurface being created. /// </param> /// <remarks> /// The RenderingSurface does not take ownership of \a target. When the /// RenderingSurface is finally destroyed, the RenderTarget will not have /// been destroyed, and it should be destoyed by whover created it, if that /// is desired. One reason for this is that there is not an exclusive one /// to one mapping from RenderingSurface to RenderTarget objects; it's /// entirely feasable that multiple RenderingSurface objects could be /// targetting a shared RenderTarget). /// </remarks> public RenderingSurface(IRenderTarget target) { d_target = target; d_invalidated = true; foreach (RenderQueueId value in Enum.GetValues(typeof(RenderQueueId))) { d_queues[value] = new RenderQueue(); } }
/// <summary> /// Draw geometry from the given RenderQueue onto the surface that this RenderTarget represents. /// </summary> /// <param name="queue"> /// RenderQueue object holding the geometry that should be drawn to the RenderTarget. /// </param> public virtual void Draw(RenderQueue queue) { queue.Draw(); }