Ejemplo n.º 1
0
        /// <summary>
        /// Load graphics resources content.
        /// </summary>
        public override void LoadContent()
        {
            int block1 = -1;

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyMinerGame::LoadContent", ref block1);
            base.LoadContent();

            DefaultSurface           = MyMinerGame.Static.GraphicsDevice.GetRenderTarget(0);
            DefaultSurface.DebugName = "DefaultSurface";
            DefaultDepth             = MyMinerGame.Static.GraphicsDevice.DepthStencilSurface;
            DefaultDepth.DebugName   = "DefaultDepth";

            MyMwcLog.WriteLine("MyMinerGame.LoadContent() - START");
            MyMwcLog.IncreaseIndent();

            MyVideoModeManager.UpdateScreenSize();

            System.Drawing.Font systemfont = new System.Drawing.Font("Tahoma", 12f, FontStyle.Regular);
            m_debugFont = new SharpDX.Direct3D9.Font(GraphicsDevice, systemfont);

            // GUI
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyGuiManager.LoadContent()");
            MyGuiManager.LoadContent();

            // Models
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartNextBlock("MyModels.LoadContent()");
            MyModels.LoadContent();

            // Render
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartNextBlock("MyRender.LoadContent();");
            MyRender.LoadContent();

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartNextBlock("MyDebugDraw.LoadContent();");
            MyDebugDraw.LoadContent();

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartNextBlock("MyDebugDrawCachedLines.LoadContent()");
            MyDebugDrawCachedLines.LoadContent();


            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartNextBlock("MySunGlare.LoadContent()");
            MySunGlare.LoadContent();
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock();

            MyMwcLog.DecreaseIndent();
            MyMwcLog.WriteLine("MyMinerGame.LoadContent() - END");

            GC.Collect();

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock(block1);
        }