public UIRenderPlane(UISpriteBatch batch, Promise <Texture2D> texture) { this.GD = batch.GraphicsDevice; this.Target = batch.GetBuffer(); this.Texture = texture; this.Batch = batch; //GD.PresentationParameters.RenderTargetUsage = RenderTargetUsage.PreserveContents; /** Switch the render target **/ Batch.Pause(); GD.SetRenderTarget(0, Target); GD.Clear(Color.TransparentBlack); Batch.Resume(); /** * batch.Pause(); * var buffer = batch.GetBuffer(); * var gd = GameFacade.GraphicsDevice; * * var renderTarget = gd.GetRenderTarget(0); * gd.SetRenderTarget(0, buffer); * batch.Resume(); * gd.render * //gd.Clear(Color.TransparentBlack);**/ }
public UIRenderPlane(UISpriteBatch batch, Promise<Texture2D> texture) { this.GD = batch.GraphicsDevice; this.Target = batch.GetBuffer(); this.Texture = texture; this.Batch = batch; //GD.PresentationParameters.RenderTargetUsage = RenderTargetUsage.PreserveContents; /** Switch the render target **/ Batch.Pause(); GD.SetRenderTarget(0, Target); GD.Clear(Color.TransparentBlack); Batch.Resume(); /** batch.Pause(); var buffer = batch.GetBuffer(); var gd = GameFacade.GraphicsDevice; var renderTarget = gd.GetRenderTarget(0); gd.SetRenderTarget(0, buffer); batch.Resume(); gd.render //gd.Clear(Color.TransparentBlack);**/ }
public void Dispose() { if (!UISpriteBatch.Invalidated) { Batch.Pause(); GD.SetRenderTarget(0, null); Texture.SetValue(Target.GetTexture()); Batch.Resume(); Batch.FreeBuffer(Target); } }
public UIRenderPlane(UISpriteBatch batch, Promise<Texture2D> texture) { this.GD = batch.GraphicsDevice; this.Target = batch.GetBuffer(); this.Texture = texture; this.Batch = batch; /** Switch the render target **/ Batch.Pause(); GD.SetRenderTarget(0, Target); GD.Clear(Color.TransparentBlack); Batch.Resume(); }
public UIRenderPlane(UISpriteBatch batch, Promise <Texture2D> texture) { this.GD = batch.GraphicsDevice; this.Target = batch.GetBuffer(); this.Texture = texture; this.Batch = batch; if (!UISpriteBatch.Invalidated) { /** Switch the render target **/ Batch.Pause(); GD.SetRenderTarget(0, Target); GD.Clear(Color.TransparentBlack); Batch.Resume(); } }
public void Dispose() { Batch.Pause(); GD.SetRenderTarget(0, null); Texture.SetValue(Target.GetTexture()); Batch.Resume(); /** * batch.Pause(); * gd.SetRenderTarget(0, (RenderTarget2D)renderTarget); * batch.FreeBuffer(buffer); * **/ Batch.FreeBuffer(Target); }
public override void Draw(UISpriteBatch batch) { if (!UISpriteBatch.Invalidated) { if (!_3DScene.IsInvalidated) { batch.Pause(); Avatar.Draw(GameFacade.GraphicsDevice); batch.Resume(); } } }
public override void Draw(UISpriteBatch batch) { base.Draw(batch); if (m_CurrentItem == m_PieTree) { //var oldd = GameFacade.GraphicsDevice.DepthStencilBuffer; //GameFacade.GraphicsDevice.DepthStencilBuffer = new DepthStencilBuffer(GameFacade.GraphicsDevice, oldd.Width, oldd.Height, oldd.Format); //todo: how to do this in xna4... GameFacade.GraphicsDevice.Clear(ClearOptions.DepthBuffer, new Vector4(0), 16777215, 0); //use a temp depth buffer for drawing this... this is an awful idea but will do until we get a better 3D UI element drawing system. batch.Pause(); m_Head.Draw(GameFacade.GraphicsDevice); batch.Resume(); //GameFacade.GraphicsDevice.DepthStencilBuffer = oldd; } //if we're top level, draw head! }
public override void Draw(UISpriteBatch batch) { batch.Pause(); SimScene.Draw(GameFacade.GraphicsDevice); batch.Resume(); }