Beispiel #1
0
        public WaveDemo(IntPtr hInstance) : base(hInstance) {
            _theta = 1.5f * MathF.PI;
            _phi = 0.1f * MathF.PI;
            _radius = 200.0f;
            
            MainWindowCaption = "Waves Demo";
            
            _lastMousePos = new Point(0,0);

            _gridWorld = Matrix.Identity;
            _wavesWorld = Matrix.Translation(0, -2.0f, 0);
            _view = Matrix.Identity;
            _proj = Matrix.Identity;

            _waves = new Waves();
        }
Beispiel #2
0
        public override bool Init() {
            if (!base.Init()) {
                return false;
            }

            _waves = new Waves();
            _waves.Init(160, 160, 1.0f, 0.03f, 3.25f, 0.4f);

            BuildLandGeometryBuffers();
            BuildWaveGeometryBuffers();
            BuildFX();
            BuildVertexLayout();

            return true;
        }
Beispiel #3
0
        public override bool Init() {
            if (! base.Init()) return false;

            _waves = new Waves();
            _waves.Init(160, 160, 1.0f, 0.03f, 3.25f, 0.4f);

            Effects.InitAll(Device);
            InputLayouts.InitAll(Device);

            _grassMapSRV = ShaderResourceView.FromFile(Device, "Textures/grass.dds");
            _wavesMapSRV = ShaderResourceView.FromFile(Device, "Textures/water2.dds");

            BuildLandGeometryBuffers();
            BuildWaveGeometryBuffers();

            return true;
        }
Beispiel #4
0
        public override bool Init() {
            if (! base.Init()) return false;

            _waves = new Waves();
            _waves.Init(160, 160, 1.0f, 0.03f, 5.0f, 0.3f);

            Effects.InitAll(Device);
            InputLayouts.InitAll(Device);
            RenderStates.InitAll(Device);

            _grassMapSRV = ShaderResourceView.FromFile(Device, "Textures/grass.dds");
            _wavesMapSRV = ShaderResourceView.FromFile(Device, "Textures/water2.dds");
            _boxMapSRV = ShaderResourceView.FromFile(Device, "Textures/WireFence.dds");

            var filenames = new []{"Textures/tree0.dds", "Textures/tree1.dds", "Textures/tree2.dds", "Textures/tree3.dds"};

            _treeTextureMapArraySRV = Util.CreateTexture2DArraySRV(Device, ImmediateContext, filenames, Format.R8G8B8A8_UNorm);

            BuildLandGeometryBuffers();
            BuildWaveGeometryBuffers();
            BuildCrateGeometryBuffers();
            BuildTreeSpritesBuffers();

            Window.KeyDown += SwitchRenderState;

            return true;

        }
Beispiel #5
0
        public override bool Init() {
            if (!base.Init()) return false;

            _waves = new Waves();
            _waves.Init(160, 160, 1.0f, 0.03f, 5.0f, 0.3f);

            Effects.InitAll(Device);
            InputLayouts.InitAll(Device);
            RenderStates.InitAll(Device);

            _grassMapSRV = ShaderResourceView.FromFile(Device, "Textures/grass.dds");
            _wavesMapSRV = ShaderResourceView.FromFile(Device, "Textures/water2.dds");
            _boxMapSRV = ShaderResourceView.FromFile(Device, "Textures/WireFence.dds");

            BuildLandGeometryBuffers();
            BuildWaveGeometryBuffers();
            BuildCrateGeometryBuffers();

            Window.KeyDown += SwitchRenderState;

            return true;
        }