public TextureDesc(Microsoft.Xna.Framework.Graphics.RenderTarget2D texture) { SharedHandle = (uint)texture.GetSharedHandle().ToInt64(); Width = (uint)texture.Width; Height = (uint)texture.Height; Format = 0; Usage = 1; Description = new byte[256]; }
protected virtual void InitializeEntity(bool addToManagers) { LoadStaticContent(ContentManagerName); RenderTargetInstance = new Microsoft.Xna.Framework.Graphics.RenderTarget2D(FlatRedBall.FlatRedBallServices.GraphicsDevice, FlatRedBall.Camera.Main.DestinationRectangle.Width, FlatRedBall.Camera.Main.DestinationRectangle.Height); PostInitialize(); if (addToManagers) { AddToManagers(null); } }
public override Texture CreateTexture(string textureId, int width, int height) { var bmp = new Microsoft.Xna.Framework.Graphics.RenderTarget2D(game.GraphicsDevice, width, height, false, Microsoft.Xna.Framework.Graphics.SurfaceFormat.Color, Microsoft.Xna.Framework.Graphics.DepthFormat.None, 1, Microsoft.Xna.Framework.Graphics.RenderTargetUsage.PreserveContents); return(new MONOTexture(textureId, bmp)); }
public override void SetTarget(Texture tex) { var tx = tex.GetTexture(); Microsoft.Xna.Framework.Graphics.RenderTarget2D currentView = tx as Microsoft.Xna.Framework.Graphics.RenderTarget2D; batch = game.SpriteBatch; batch.End(); game.GraphicsDevice.SetRenderTarget(currentView); batch.Begin(Microsoft.Xna.Framework.Graphics.SpriteSortMode.Deferred, Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend, Microsoft.Xna.Framework.Graphics.SamplerState.PointClamp, Microsoft.Xna.Framework.Graphics.DepthStencilState.None, Microsoft.Xna.Framework.Graphics.RasterizerState.CullCounterClockwise); }
public TextureObject CreateTextureObjectFromTarget(string name, Microsoft.Xna.Framework.Graphics.RenderTarget2D target) { if (!_systemReady) { throw new EngineException("System not ready for creation", true); } if (!_textures.ContainsKey(name)) { TextureObject newTexture = new TextureObject(name, target, true); _textures[name] = newTexture; return(newTexture); } else { return(_textures[name]); } }
protected override void InitGraphics() { Logger.Info("Gfx", $"Init Graphics {viewWidth} x {viewHeight} scale = {viewScale}"); view?.Dispose(); view = new Microsoft.Xna.Framework.Graphics.RenderTarget2D(game.GraphicsDevice, viewWidth, viewHeight, false, Microsoft.Xna.Framework.Graphics.SurfaceFormat.Color, Microsoft.Xna.Framework.Graphics.DepthFormat.None, 1, Microsoft.Xna.Framework.Graphics.RenderTargetUsage.PreserveContents); }