Ejemplo n.º 1
0
        /// <summary>
        /// Loads the resources for this scene.
        /// </summary>
        public override void Load()
        {
            var container = new GraphicStreamContainer();
            var positions = container.Create(GraphicStreamUsage.Position, CreatePositions());
            var colors = container.Create(GraphicStreamUsage.Color, CreateColors());

            IBufferService bufferService = new SlimDXBufferService(RenderWindow.Device);

            var bufferBindings = new[]
            {
                bufferService.CreateFor(positions),
                bufferService.CreateFor(colors)
            };

            mEffect = new SlimDXEffectCompiler(RenderWindow.Device).Compile("MyShader10.fx");

            mRenderer = new SlimDXObjectRenderer(RenderWindow.Device,
                mEffect, bufferBindings);

            mWorldViewProjectionParameter = new SlimDXMatrixEffectParameter("WorldViewProjection");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads the resources for this scene.
        /// </summary>
        public override void Load()
        {
            var container = new GraphicStreamContainer();
            var positions = container.Create(GraphicStreamUsage.Position, CreatePositions());
            var colors = container.Create(GraphicStreamUsage.Color, CreateColors());

            IBufferService bufferService = new SlimDXBufferService(RenderWindow.Device);

            var bufferBindings = new[]
            {
                bufferService.CreateFor(colors),
                bufferService.CreateFor(positions),
            };

            mEffect = new SlimDXEffectCompiler(RenderWindow.Device).Compile("MyShader10.fx");
            mRenderer = new SlimDXObjectRenderer(RenderWindow.Device, mEffect, bufferBindings);

            mWorldViewProjectionParameter = new SlimDXMatrixEffectParameter("WorldViewProjection");

            mCamera = new Camera(new Stand(), new PerspectiveProjectionLense());
            mCamera.Stand.Position = new Vector3(0, 0, 3);

            SetupKeysAndActions();
        }