Esempio n. 1
0
 public void Dispose()
 {
     texFilterEffect?.Dispose();
     tex?.Dispose();
     _graphics?.Dispose();
     _spriteBatch?.Dispose();
 }
Esempio n. 2
0
        protected override void UnloadContent()
        {
            Batch?.Dispose();
            Watcher?.Dispose();

            base.Dispose();
        }
Esempio n. 3
0
        public void Dispose()
        {
            _graphicsDeviceManager.PreparingDeviceSettings -= OnPreparingDeviceChanged;

            SpriteBatch?.Dispose();
            WhiteTexture?.Dispose();
            BgRenderer.Dispose();
        }
Esempio n. 4
0
 public void Dispose()
 {
     _graphicsDevice?.Dispose();
     _spriteBatch?.Dispose();
     _plainWhite?.Dispose();
     _colorPickerBig?.Dispose();
     _colorPickerSmall?.Dispose();
 }
Esempio n. 5
0
        public void Dispose()
        {
            entityManager?.Dispose();
            entityManager = null;

            spriteBatch?.Dispose();
            spriteBatch = null;
        }
Esempio n. 6
0
        protected override void Dispose(bool disposing)
        {
            SpriteBatch?.Dispose();
            renderSurface?.Dispose();
            graphics.Dispose();
            AudioManager?.Dispose();

            base.Dispose(disposing);
        }
Esempio n. 7
0
 public void Dispose()
 {
     SpriteBatch?.Dispose();
     BackBuffer?.Dispose();
     DepthBuffer?.Dispose();
     GraphicsDevice?.Dispose();
     Device10?.Dispose();
     Device11?.Dispose();
 }
Esempio n. 8
0
 public void Dispose()
 {
     _renderedText?.Dispose();
     _renderedText = null;
     _renderTarget?.Dispose();
     _renderTarget = null;
     Font          = null;
     _sb?.Dispose();
     _sb = null;
 }
 public void Dispose()
 {
     text?.Dispose();
     text = null;
     target?.Dispose();
     target = null;
     Font   = null;
     batch?.Dispose();
     batch = null;
 }
Esempio n. 10
0
        protected sealed override void UnloadContent()
        {
            // Call overridden unload()
            Unload();

            // Components
            Loader?.Cleanup();
            SpriteBatch?.Dispose();

            // Pass back to XNA
            base.UnloadContent();
        }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         spriteBatch?.Dispose();
         texture?.Dispose();
         if (null != Game.Window)
         {
             Game.Window.ClientSizeChanged -= Window_ClientSizeChanged;
         }
     }
     base.Dispose(disposing);
 }
Esempio n. 12
0
        protected override void UnloadContent()
        {
            base.UnloadContent();

            if (keyboardInterceptor != null)
            {
                keyboardInterceptor.OnKeyAction -= OnKeyboardIntercept;
                keyboardInterceptor.Dispose();
            }

            spriteBatch?.Dispose();

            ClearShapes();
        }
Esempio n. 13
0
        protected override void LoadContent()
        {
            AudioManager.LoadBank("Master.bank");
            AudioManager.LoadBank("Master.strings.bank");

            _spriteBatch?.Dispose();
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            ScreenManager = new ScreenManager(this, 320, 180);
            ScreenManager.Init(Graphics, Window, _spriteBatch);
            ScreenManager.UpdateRenderRectangle(Window);

            Window.TextInput += DebugConsole.TextInputHandler;
        }
Esempio n. 14
0
        public void Dispose()
        {
            textRenderer?.Dispose();
            spriteBatch?.Dispose();

            (userInterface as IDisposable)?.Dispose();

            worldRenderer?.Dispose();

            worldProgram?.Dispose();
            blockTextureAtlas?.Dispose();

            window.Dispose();
        }
Esempio n. 15
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects).
                }

                _sb?.Dispose();
                _worldTempTarget?.Dispose();
                _preCompositorTarget.Dispose();
                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }
        public override void Unload()
        {
            base.Unload();

            _specularRadiancePrefilterGGX?.Dispose();
            _specularRadiancePrefilterGGX = null;

            _lamberFiltering?.Dispose();
            _lamberFiltering = null;

            _atmosphereCubeMapRenderTarget?.Dispose();
            _atmosphereCubeMapRenderTarget = null;

            _atmosphereCubeMap?.Dispose();
            _atmosphereCubeMap = null;

            _multiScatteringTexture?.Dispose();
            _multiScatteringTexture = null;

            TransmittanceLutTexture?.Dispose();
            TransmittanceLutTexture = null;

            _skyViewLutTexture?.Dispose();
            _skyViewLutTexture = null;

            _atmosphereCameraScatteringVolumeTexture?.Dispose();
            _atmosphereCameraScatteringVolumeTexture = null;

            _transmittanceLutEffect?.Dispose();
            _transmittanceLutEffect = null;

            _skyViewLutEffect?.Dispose();
            _skyViewLutEffect = null;

            _renderMultipleScatteringTextureEffect?.Dispose();
            _renderMultipleScatteringTextureEffect = null;

            _renderAtmosphereScatteringVolumeEffect?.Dispose();
            _renderAtmosphereScatteringVolumeEffect = null;

            _spriteBatch?.Dispose();
            _spriteBatch = null;
        }
Esempio n. 17
0
 public void Exit()
 {
     swapchainresource.Dispose();
     spriteBatch?.Dispose();
     SzeneTexture?.Dispose();
     SzeneShaderRessource?.Dispose();
     gol?.Dispose();
     layout?.Dispose();
     inputHandler?.Dispose();
     UI?.Dispose();
     DepthBuffer?.Dispose();
     SamplerStates.Instance.Dispose();
     States.Instance.Dispose();
     swapChain?.Dispose();
     device?.Dispose();
     renderTargetDepthStencil?.Dispose();
     MainRenderTarget?.Dispose();
     RenderForm.Close();
     Application.Exit();
 }
Esempio n. 18
0
        void DrawDebugInfo()
        {
            var spriteBatch = new SpriteBatch(GraphicsDevice);

            spriteBatch.Begin();
            var screenSize = Game.Window.ClientBounds;

            var width  = screenSize.Width;
            var height = screenSize.Height;

            spriteBatch.DrawLine(new Vector2(width / 2.0f, 0), new Vector2(width / 2.0f, height), Color.Blue);
            spriteBatch.DrawLine(new Vector2(0, height / 2.0f), new Vector2(width, height / 2.0f), Color.Blue);
            spriteBatch.End();
            spriteBatch.Dispose();

            frameCounter += 1;
            if (frameCounter > sampleFrequency)
            {
                logger.Trace("GraphicsDevice Profiling: {0}", metricsPrinter);
                frameCounter = 0;
            }
        }
Esempio n. 19
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (_sb != null)
                    {
                        _sb.Dispose();
                    }
                    if (_tempTarget != null)
                    {
                        _tempTarget.Dispose();
                    }
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Unload
        /// </summary>
        public override void UnloadContent()
        {
            if (Shader != null)
            {
                Shader.Dispose();
            }
            Shader = null;

            if (Buffer != null)
            {
                Buffer.Dispose();
            }
            Buffer = null;

            if (Texture != null)
            {
                Texture.Dispose();
            }
            Texture = null;

            if (SpriteBatch != null)
            {
                SpriteBatch.Dispose();
            }
            SpriteBatch = null;

            if (Font != null)
            {
                Font.Dispose();
            }
            Font = null;

            if (Mesh != null)
            {
                Mesh.Dispose();
            }
            Mesh = null;
        }
Esempio n. 21
0
        /// <summary>
        /// Unload contents
        /// </summary>
        public override void UnloadContent()
        {
            if (Plane != null)
            {
                Plane.Dispose();
            }
            Plane = null;

            if (Torus != null)
            {
                Torus.Dispose();
            }
            Torus = null;

            if (SceneShader != null)
            {
                SceneShader.Dispose();
            }
            SceneShader = null;

            if (Font != null)
            {
                Font.Dispose();
            }
            Font = null;

            if (SpriteBatch != null)
            {
                SpriteBatch.Dispose();
            }
            SpriteBatch = null;

            if (FrameBuffer != null)
            {
                FrameBuffer.Dispose();
            }
            FrameBuffer = null;
        }
Esempio n. 22
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (walkTimer != null)
                {
                    walkTimer.Change(Timeout.Infinite, Timeout.Infinite);
                    walkTimer.Dispose();
                }

                if (sb != null)
                {
                    sb.Dispose();
                }

                if (m_chatBubble != null)
                {
                    m_chatBubble.Dispose();
                }
            }

            base.Dispose(disposing);
        }
Esempio n. 23
0
 public override void Dispose()
 {
     foreach (Drawable drawable in drawables)
     {
         if (drawable != null)
         {
             drawable._enabled = false;
             drawable.UnloadContent();
             drawable.Dispose();
         }
     }
     CollectionUtils.Clear(drawables);
     CollectionUtils.Clear(drawablesToUpdate);
     CollectionUtils.Clear(drawablesToDraw);
     gameCollection.Clear();
     if (batch != null)
     {
         batch.Dispose();
         batch = null;
     }
     UnloadContent();
     isInit = false;
 }
Esempio n. 24
0
        protected virtual void Dispose(bool disposeManagedResources)
        {
            if (!m_disposed)
            {
                if (disposeManagedResources)
                {
                    m_spriteBatch.Dispose();
                    m_texture.Dispose();
                }

                if (m_use64BitApi)
                {
                    FreeOceanRenderer64(OceanRendererPtr);
                }
                else
                {
                    FreeOceanRenderer(OceanRendererPtr);
                }

                OceanRendererPtr = IntPtr.Zero;
                m_disposed       = true;
            }
        }
Esempio n. 25
0
        public static void cleanUp(string nameSpace = "")
        {
            if (nameSpace == "")
            {
                textures.Clear();
                return;
            }

            var resourcesToRemove = (from pair in textures
                                     where pair.Key.Contains(nameSpace)
                                     select pair.Key).ToArray();

            foreach (string key in resourcesToRemove)
            {
                textures.Remove(key);
            }

            if (_tileBatch != null)
            {
                _tileBatch.Dispose();
                _tileBatch = null;
            }
        }
Esempio n. 26
0
        public RenderTarget2D GetMapImage()
        {
            //var ticks = DateTime.Now.Ticks;
            device.SetRenderTarget(renderTarget);
            //FIXME from tutorial, check if actually required.
            device.DepthStencilState = new DepthStencilState()
            {
                DepthBufferEnable = true
            };
            device.Clear(Color.DarkGray);
            SpriteBatch batch = new SpriteBatch(device);

            batch.Begin();
            map.Draw(batch, new Rectangle(0, 0,
                                          map.Width * map.TileWidth,
                                          map.Height * map.TileHeight
                                          ), Viewport);
            batch.End();
            batch.Dispose();
            device.SetRenderTarget(null);
            //Console.WriteLine("WorldMap Draw time: {0}", DateTime.Now.Ticks - ticks);
            return(renderTarget);
        }
Esempio n. 27
0
 public static void Initialize(GraphicsDevice graphics)
 {
     if (graphicsDevice != graphics)
     {
         graphicsDevice  = graphics;
         storeIcon       = TextureManager.Get("storeicon");
         storeIconBorder = TextureManager.Get("storeiconborder");
         if (storeIconTarget != null)
         {
             storeIconTarget.Dispose();
         }
         storeIconTarget = new RenderTarget2D(graphicsDevice, storeIconBorder.Width, storeIconBorder.Height * 2);
         if (storeSpriteBatch != null)
         {
             storeSpriteBatch.Dispose();
         }
         storeSpriteBatch = new SpriteBatch(graphicsDevice);
     }
     Inventory.Initialize();
     exclamationDurationSecs = 0;
     currentExclamationTime  = 0;
     showExclamation         = false;
     cellBorderTex           = TextureManager.Get("hudcellborder");
 }
Esempio n. 28
0
        protected override void UnloadContent()
        {
            base.UnloadContent();

            if (drawBuffer != null)
            {
                drawBuffer.Dispose();
                drawBuffer = null;
            }

            if (spriteBatch != null)
            {
                spriteBatch.Dispose();
                spriteBatch = null;
            }

            Font.Dispose();

            if (contentManager != null)
            {
                contentManager.Dispose();
                contentManager = null;
            }
        }
Esempio n. 29
0
 public virtual void Dispose()
 {
     _batch.Dispose();
 }
 public void Dispose()
 {
     _spriteBatch.Dispose();
     _textTexture.Dispose();
 }