Пример #1
0
 public SpriteBatchStruct(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState,
                               DepthStencilState depthStencilState, RasterizerState rasterizerState,
                               Effect effect, Camera camera)
 {
     SB = new SpriteBatch(Drawing.StaticGraphicsDevice);
     SB_SpriteSortMode = sortMode;
     SB_BlendState = blendState;
     SB_SamplerState = samplerState;
     SB_DepthStencilState = depthStencilState;
     SB_RasterizerState = rasterizerState;
     SB_Effect = effect;
     SB_Camera = camera;
     wasBegin = false;
 }
Пример #2
0
        /// <summary> Метод создания SpriteBatch. </summary>
        /// <param name="id"> Уникальный номер, по которому будет использоваться созданный SpriteBatch. </param>
        public static void CreateSpriteBatch(int id, SpriteSortMode sortMode = SpriteSortMode.Deferred,
                                             BlendState blendState = null, SamplerState samplerState = null,
                                             DepthStencilState depthStencilState = null,
                                             RasterizerState rasterizerState = null, Effect effect = null,
                                             Camera camera = null)
        {
            if (SpriteBatchs.ContainsKey(id))
            {
                Log.Write("Drawing.CreateSpriteBatch: sbID '" + id + "' уже занят и будет перезаписан.",
                    Log.MessageType.WARNING);

                SpriteBatchs[id] = new SpriteBatchStruct(sortMode, blendState, samplerState, depthStencilState,
                    rasterizerState, effect, camera);
            }
            else
            {
                SpriteBatchs.Add(id,
                    new SpriteBatchStruct(sortMode, blendState, samplerState, depthStencilState, rasterizerState,
                        effect, camera));
            }
        }