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(); }
public void Initialize(GraphicsDevice graphicsDevice) { mSpriteBatch = new SpriteBatchStack(graphicsDevice); CreateRasterizerStates(); CreateBasicEffect(graphicsDevice); }
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(); }
public void Initialize(GraphicsDevice graphicsDevice) { mSpriteBatch = new SpriteBatchStack(graphicsDevice); CreateRasterizerStates(); }
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(); }