internal override void PrepareXNAResources() { ReleaseXNAResources(); switch (Mode) { case Modes.IR1024: VideoTextureBuffer = new TextureDoubleBuffer(XDevice, 1280, 1024, SurfaceFormat.Bgra4444); break; case Modes.IR480: VideoTextureBuffer = new TextureDoubleBuffer(XDevice, 640, 488, SurfaceFormat.Bgra4444); break; case Modes.RGB1024: VideoTextureBuffer = new TextureDoubleBuffer(XDevice, 1280, 1024, SurfaceFormat.Color); Prebuffer = new byte[1280 * 1024 * 4]; break; case Modes.RGB480: VideoTextureBuffer = new TextureDoubleBuffer(XDevice, 640, 480, SurfaceFormat.Color); Prebuffer = new byte[640 * 480 * 4]; break; case Modes.Depth480: DepthTextureBuffer = new TextureDoubleBuffer(XDevice, 640, 480, SurfaceFormat.Bgra4444, DepthAvgFrameCount); VideoTextureBuffer = new TextureDoubleBuffer(XDevice, 640, 480, SurfaceFormat.Color); Prebuffer = new byte[640 * 480 * 4]; break; } }
internal override void PrepareXNAResources() { DepthTextureBuffer = new TextureDoubleBuffer(XDevice, 640, 480, SurfaceFormat.Bgra4444); VideoTextureBuffer = new TextureDoubleBuffer(XDevice, 640, 480, SurfaceFormat.Color); XNAReady = true; UploadTextures(); }
public void SetDevice(GraphicsDevice device, Effect effect) { XDevice = device; XEffect = effect; if (DataTexture != null) { DataTexture.Dispose(); DataTexture = null; } RefreshTexture(); Rect = new Microsoft.Xna.Framework.Rectangle(0, 0, XDevice.PresentationParameters.BackBufferWidth, XDevice.PresentationParameters.BackBufferHeight); XPlane.SetDevice(XDevice); }
private void RefreshTexture() { if (XDevice != null && !XDevice.IsDisposed) { if ((DataTexture == null || (Data != null && DataTexture.Width != Data.Length)) && XDevice != null && Data != null) { DataTexture = new TextureDoubleBuffer(XDevice, Data.Length, 1, SurfaceFormat.Single); } if (DataTexture != null) { DataTexture.SetData <float>(Data); } } }
internal override void ReleaseXNAResources() { XNAReady = false; if (VideoTextureBuffer != null) { VideoTextureBuffer.Dispose(); VideoTextureBuffer = null; } if (DepthTextureBuffer != null) { DepthTextureBuffer.Dispose(); DepthTextureBuffer = null; } FileLoaded = false; }