コード例 #1
0
        /// <summary>
        /// Register a render of the component type T for the provided technique type
        /// </summary>
        /// <typeparam name="T">Component type</typeparam>
        /// <param name="techniqueType">Technique type</param>
        /// <param name="render">Render instance</param>
        /// <remarks>
        /// A render and technique are not the same thing.A render is used for render the component geometry,
        /// and a technique is and algorithm for obtain a specifique effect. A technique will use several renders depending
        /// on the presents components types in the scene. Also the renders and the techniques inheritates form IRenderTechnique
        /// the diference is that the renders inherit form IGeometryRender and the techniques even from IAttachableTechnique or IRenderTechnique
        /// </remarks>
        public static void RegisterRender <TComp, TTech>(Render render)
            where TComp : class
            where TTech : Technique
        {
            var entries = TrCache <TTech> .RenderRegistries;
            var entry   = entries.Find(x => x is RenderRegistry <TComp>);

            if (entry == null)
            {
                entry = new RenderRegistry <TComp>();
                entries.Add(entry);
            }
            entry.Render = render;
        }
コード例 #2
0
        public static void RegisterRender <TComp, TTech, TRender>()
            where TComp : class
            where TTech : Technique
            where TRender : Render
        {
            var entries = TrCache <TTech> .RenderRegistries;
            var entry   = entries.Find(x => x is RenderRegistry <TComp, TRender>);

            if (entry == null)
            {
                entry = new RenderRegistry <TComp, TRender>();
                entries.Add(entry);
            }

            entry.Render = null;
            entry.IsLazy = true;
        }
コード例 #3
0
 public bool Equals(RenderRegistry <TComp> other)
 {
     return(other.Render == Render);
 }