コード例 #1
0
        private DrawerManager _GetDrawerManager(DrawingKit drawingKit)
        {
            DrawerManager res = new DrawerManager();

            res.AddDrawer("Phong",
                          new DefaultDrawer(drawingKit, this.Content.Load <Effect>("Shaders/PhongShader")));

            res.AddDrawer("Goraud",
                          new DefaultDrawer(drawingKit, this.Content.Load <Effect>("Shaders/GoraudShader")));

            res.AddDrawer("OldFlat",
                          new FlatDrawer(drawingKit, this.Content.Load <Effect>("Shaders/OldFlatShader")));

            res.AddDrawer("NewFlat",
                          new DefaultDrawer(drawingKit, this.Content.Load <Effect>("Shaders/NewFlatShader")));

            res.SetDrawer("Phong");

            return(res);
        }
コード例 #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            _drawingKit = new DrawingKit(
                Matrix.Identity,
                DrawingKit.GetDefaultProjectionMatrix(this.GraphicsDevice),
                Vector3.Zero,
                this.GraphicsDevice,
                new LightingInfo());

            _drawerManager = _GetDrawerManager(_drawingKit);

            _models = _GetModels();

            _scene = _GetScene();

            // TODO: use this.Content to load your game content here
        }