Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override void Draw(GameTime gameTime)
- {
- bloom.BeginDraw(renderTarget);
- bloom.ShowBuffer = BloomComponent.IntermediateBuffer.FinalResult;
- bloom.Draw(gameTime, renderTarget);
- DrawSceneToTexture(renderTarget);
- spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend,
- SamplerState.LinearClamp, DepthStencilState.Default,
- RasterizerState.CullNone);
- spriteBatch.Draw(renderTarget, rec, Color.White);
- spriteBatch.End();
- base.Draw(gameTime);
- }
- protected void DrawSceneToTexture(RenderTarget2D renderTarget)
- {
- GraphicsDevice.SetRenderTarget(renderTarget);
- GraphicsDevice.DepthStencilState = new DepthStencilState() { DepthBufferEnable = true };
- // Draw the scene
- GraphicsDevice.Clear(Color.CornflowerBlue);
- spriteBatch.Begin(SpriteSortMode.Deferred,
- BlendState.AlphaBlend,
- SamplerState.PointClamp,
- null, null, null, null);
- mLeavusSprite.Draw(this.spriteBatch);
- b.Draw(this.spriteBatch);
- spriteBatch.Draw(cursorTex, cursorPos, cursorSource,
- Color.White, 0.0f, Vector2.Zero, 3f, SpriteEffects.None, 0);
- spriteBatch.End();
- // Drop the render target
- GraphicsDevice.SetRenderTarget(null);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement