示例#1
0
        public void Initialize(GraphicsDevice graphicsDevice, SystemManagers managers)
        {
            SamplerState    = SamplerState.LinearClamp;
            mCamera         = new RenderingLibrary.Camera(managers);
            mLayersReadOnly = new ReadOnlyCollection <Layer>(mLayers);

            mLayers.Add(new Layer());
            mLayers[0].Name = "Main Layer";

            mGraphicsDevice = graphicsDevice;

            mSpriteBatch = new SpriteBatchStack(mGraphicsDevice);

            mSinglePixelTexture = new Texture2D(mGraphicsDevice, 1, 1, false, SurfaceFormat.Color);
            Color[] pixels = new Color[1];
            pixels[0] = Color.White;
            mSinglePixelTexture.SetData <Color>(pixels);

            mDottedLineTexture = new Texture2D(mGraphicsDevice, 2, 1, false, SurfaceFormat.Color);
            pixels             = new Color[2];
            pixels[0]          = Color.White;
            pixels[1]          = Color.Transparent;
            mDottedLineTexture.SetData <Color>(pixels);

            CreateRasterizerStates();

            mCamera.UpdateClient();
        }
示例#2
0
        public void Initialize(GraphicsDevice graphicsDevice)
        {
            mSpriteBatch = new SpriteBatchStack(graphicsDevice);

            CreateRasterizerStates();

            CreateBasicEffect(graphicsDevice);
        }
示例#3
0
        internal void RenderLayer(SystemManagers managers, Layer layer, bool prerender = true)
        {
            //////////////////Early Out////////////////////////////////
            if (layer.Renderables.Count == 0)
            {
                return;
            }
            ///////////////End Early Out///////////////////////////////

            if (prerender)
            {
                PreRender(layer.Renderables);
            }

            SpriteBatchStack.PerformStartOfLayerRenderingLogic();

            spriteRenderer.BeginSpriteBatch(mRenderStateVariables, layer, BeginType.Push, mCamera);

            layer.SortRenderables();

            Render(layer.Renderables, managers, layer);

            spriteRenderer.EndSpriteBatch();
        }
示例#4
0
        public void Initialize(GraphicsDevice graphicsDevice)
        {
            mSpriteBatch = new SpriteBatchStack(graphicsDevice);

            CreateRasterizerStates();
        }
示例#5
0
        public void Initialize(GraphicsDevice graphicsDevice, SystemManagers managers)
        {
            SamplerState = SamplerState.LinearClamp;
            mCamera = new RenderingLibrary.Camera(managers);
            mLayersReadOnly = new ReadOnlyCollection<Layer>(mLayers);

            mLayers.Add(new Layer());
            mLayers[0].Name = "Main Layer";

            mGraphicsDevice = graphicsDevice;

            mSpriteBatch = new SpriteBatchStack(mGraphicsDevice);

            mSinglePixelTexture = new Texture2D(mGraphicsDevice, 1, 1, false, SurfaceFormat.Color);
            Color[] pixels = new Color[1];
            pixels[0] = Color.White;
            mSinglePixelTexture.SetData<Color>(pixels);

            mDottedLineTexture = new Texture2D(mGraphicsDevice, 2, 1, false, SurfaceFormat.Color);
            pixels = new Color[2];
            pixels[0] = Color.White;
            pixels[1] = Color.Transparent;
            mDottedLineTexture.SetData<Color>(pixels);

            CreateRasterizerStates();

            mCamera.UpdateClient();
        }