Ejemplo n.º 1
0
            public PipelineState ProducePipelineState(GlobeFlags flags, Primitive primitive, BlendState blendState, RasterizerState rasterizerState, DepthStencilState depthStencilState)
            {
                var t = Tuple.CreateNew(primitive, blendState, depthStencilState, rasterizerState, flags.HasFlag(GlobeFlags.USE_CARTCOORDS));

                if (factories.ContainsKey(t))
                {
                    return(factories[t][(int)flags]);
                }

                var f = new StateFactory(shader, typeof(GlobeFlags), primitive,
                                         flags.HasFlag(GlobeFlags.USE_CARTCOORDS)
                                                                                        ? VertexInputElement.FromStructure <CartVert>()
                                                                                        : VertexInputElement.FromStructure <GeoVert>(), blendState, rasterizerState, depthStencilState);

                factories.Add(t, f);

                return(f[(int)flags]);
            }
Ejemplo n.º 2
0
 void EnumFunc(GlobeFlags flags, PipelineState ps)
 {
     ps.VertexInputElements = flags.HasFlag(GlobeFlags.USE_CARTCOORDS) ? VertexInputElement.FromStructure <CartVert>() : VertexInputElement.FromStructure <GeoVert>();
 }