public int Compare(IRenderRequestBaseInternal <TWorld> first, IRenderRequestBaseInternal <TWorld> second) { int resolutionFirst = first.Resolution.Width * first.Resolution.Height; int resolutionSecond = second.Resolution.Width * second.Resolution.Height; return(Math.Sign(resolutionFirst - resolutionSecond)); }
void InitRR <T>(T rr) where T : class { IRenderRequestBaseInternal <ToyWorld> rrBase = rr as IRenderRequestBaseInternal <ToyWorld>; // Assume that all renderRequests created by factory inherit from IRenderRequestBaseInternal if (rrBase == null) { throw new RenderRequestNotImplementedException( string.Format("Incorrect type argument; the type {0} is not registered for use in this controller version.", typeof(T).Name)); } rrBase.Renderer = Renderer; rrBase.World = World; }
public void RemoveRenderRequest(IRenderRequestBaseInternal <TWorld> request) { m_renderRequestQueue.Remove(request); m_dirtyRenderRequestQueue.Remove(request); }
protected virtual void Process(IRenderRequestBaseInternal <TWorld> request) { request.Draw(); }