コード例 #1
0
        public void InitializeDevice()
        {
            Form.ClientSize = new Size(Width, Height);

            _meshFactory = new MeshFactory(this);
            MeshFactory  = _meshFactory;

            effect = new BasicEffect(Device);

            // Set light
            //effect.LightingEnabled = true;
            //effect.AmbientLightColor = Color.Gray.ToVector3();
            //effect.DirectionalLight0.Enabled = true;
            //effect.DirectionalLight0.DiffuseColor = Color.LemonChiffon.ToVector3();
            effect.EnableDefaultLighting();

            if (CullingEnabled)
            {
                Device.RasterizerState = RasterizerState.CullCounterClockwise;
            }
            else
            {
                Device.RasterizerState = RasterizerState.CullNone;
            }

            OnResetDevice();
            GraphicsLibraryManager.LibraryStarted();

            Info.SetDevice(Device);
        }
コード例 #2
0
        public void InitializeDevice()
        {
            Form.ClientSize = new Size(Width, Height);

            _meshFactory = new MeshFactory(this);
            MeshFactory = _meshFactory;

            effect = new BasicEffect(Device);

            // Set light
            //effect.LightingEnabled = true;
            //effect.AmbientLightColor = Color.Gray.ToVector3();
            //effect.DirectionalLight0.Enabled = true;
            //effect.DirectionalLight0.DiffuseColor = Color.LemonChiffon.ToVector3();
            effect.EnableDefaultLighting();

            Device.RasterizerState = RasterizerState.CullNone;

            OnResetDevice();
            LibraryManager.LibraryStarted();

            Info.SetDevice(Device);
        }