示例#1
0
        // unload all content
        public void UnloadContent()
        {
            textureBackground = null;
            if (blurManager != null)
            {
                blurManager.Dispose();
                blurManager = null;
            }

            if (colorRT != null)
            {
                colorRT.Dispose();
                colorRT = null;
            }
            if (glowRT1 != null)
            {
                glowRT1.Dispose();
                glowRT1 = null;
            }
            if (glowRT2 != null)
            {
                glowRT2.Dispose();
                glowRT2 = null;
            }
        }
示例#2
0
        // load all content
        public void LoadContent(GraphicsDevice gd,
                                ContentManager content)
        {
            if (gd == null)
            {
                throw new ArgumentNullException("gd");
            }

            contentManager    = content;
            textureBackground = content.Load <Texture2D>("screens/intro_bg");
            // create blur manager
            blurManager = new BlurManager(gd,
                                          content.Load <Effect>("shaders/Blur"),
                                          GameOptions.GlowResolution, GameOptions.GlowResolution);

            int width  = gd.Viewport.Width;
            int height = gd.Viewport.Height;


            // create render targets
            colorRT = new RenderTarget2D(gd, width, height,
                                         true, SurfaceFormat.Color, DepthFormat.Depth24);
            glowRT1 = new RenderTarget2D(gd, GameOptions.GlowResolution, GameOptions.GlowResolution,
                                         true, SurfaceFormat.Color, DepthFormat.Depth24);
            glowRT2 = new RenderTarget2D(gd, GameOptions.GlowResolution, GameOptions.GlowResolution,
                                         true, SurfaceFormat.Color, DepthFormat.Depth24);
        }
示例#3
0
        // unload all content
        public void UnloadContent()
        {
            textureBackground = null;
            if (blurManager != null)
            {
                blurManager.Dispose();
                blurManager = null;
            }

            if (colorRT != null)
            {
                colorRT.Dispose();
                colorRT = null;
            }
            if (glowRT1 != null)
            {
                glowRT1.Dispose();
                glowRT1 = null;
            }
            if (glowRT2 != null)
            {
                glowRT2.Dispose();
                glowRT2 = null;
            }
        }
示例#4
0
        // load all content
        public void LoadContent(GraphicsDevice gd,
            ContentManager content)
        {
            if (gd == null)
            {
                throw new ArgumentNullException("gd");
            }

            contentManager = content;
            textureBackground = content.Load<Texture2D>("screens/intro_bg");
            // create blur manager
            blurManager = new BlurManager(gd,
                content.Load<Effect>("shaders/Blur"),
                GameOptions.GlowResolution, GameOptions.GlowResolution);

            int width = gd.Viewport.Width;
            int height = gd.Viewport.Height;


            // create render targets
            colorRT = new RenderTarget2D(gd,width, height,
                true, SurfaceFormat.Color, DepthFormat.Depth24);
            glowRT1 = new RenderTarget2D(gd, GameOptions.GlowResolution, GameOptions.GlowResolution,
                true, SurfaceFormat.Color, DepthFormat.Depth24);
            glowRT2 = new RenderTarget2D(gd, GameOptions.GlowResolution, GameOptions.GlowResolution,
                true, SurfaceFormat.Color, DepthFormat.Depth24);

        }