示例#1
0
        private void SetupProjection()
        {
            _Screen screen = _Screen.GetInstance();

            this.projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4,
                                                                  screen.GetWidth() / (float)screen.GetHeight(), 0.001f, 1000);
        }
示例#2
0
        protected override void Initialize()
        {
            this.screen = _Screen.GetInstance();
            this.screen.SetWidth(graphics.PreferredBackBufferWidth);
            this.screen.SetHeight(graphics.PreferredBackBufferHeight);

            this.camera = new _Camera();

            this.grassTexture     = Content.Load <Texture2D>(@"Textures\grass-texture");
            this.grayPaintTexture = Content.Load <Texture2D>(@"Textures\gray-paint-texture");
            this.redPaintTexture  = Content.Load <Texture2D>(@"Textures\red-paint-texture");
            this.woodTexture      = Content.Load <Texture2D>(@"Textures\wood-texture");
            this.treeTexture      = Content.Load <Texture2D>(@"Textures\tree-texture");

            this.snowGrassTexture     = Content.Load <Texture2D>(@"Textures\snow-grass-texture");
            this.snowGrayPaintTexture = Content.Load <Texture2D>(@"Textures\snow-gray-paint-texture");
            this.snowRedPaintTexture  = Content.Load <Texture2D>(@"Textures\snow-red-paint-texture");
            this.snowWoodTexture      = Content.Load <Texture2D>(@"Textures\snow-wood-texture");
            this.snowTreeTexture      = Content.Load <Texture2D>(@"Textures\snow-tree-texture");

            this.heightMapTexture = Content.Load <Texture2D>(@"Textures\HeightMap\HMGround-texture");
            this.seaTexture       = Content.Load <Texture2D>(@"Textures\sea-texture");

            this.snowEffect = Content.Load <Effect>(@"Effects\snow-effect");
            seaEffect       = Content.Load <Effect>(@"Effects\sea-effect");
            add             = 0.001f;

            GraphicsDevice.RasterizerState = RasterizerState.CullNone;

            base.Initialize();
        }
示例#3
0
        public static _Screen GetInstance()
        {
            if (instance == null)
            {
                instance = new _Screen();
            }

            return(instance);
        }