Exemplo n.º 1
0
        public Program()
        {
            _app                   = new GrasshopperApp().UseSharpDX();
            _graphics              = _app.Graphics.CreateContext(enableDebugMode: true);
            _renderTarget          = _graphics.RenderTargetFactory.CreateWindow();
            _constantBufferManager = _graphics.ConstantBufferManagerFactory.Create <Matrix4x4>();
            _meshBufferManager     = new MeshBufferManager <Vertex>(_graphics);

            _renderTarget.Window.Title   = "Simple Cube";
            _renderTarget.Window.Visible = true;
        }
Exemplo n.º 2
0
        public Program()
        {
            _app = new GrasshopperApp().UseSharpDX();
            _graphics = _app.Graphics.CreateContext(enableDebugMode: true);
            _renderTarget = _graphics.RenderTargetFactory.CreateWindow();
            _constantBufferManager = _graphics.ConstantBufferManagerFactory.Create<Matrix4x4>();
            _meshBufferManager = new MeshBufferManager<Vertex>(_graphics);

            _renderTarget.Window.Title = "Simple Cube";
            _renderTarget.Window.Visible = true;
        }
Exemplo n.º 3
0
        public Program()
        {
            _app                   = new GrasshopperApp().UseSharpDX();
            _graphics              = _app.Graphics.CreateContext(enableDebugMode: true);
            _renderTarget          = _graphics.RenderTargetFactory.CreateWindow();
            _constantBufferManager = _graphics.ConstantBufferManagerFactory.Create <SceneData>();
            _meshBufferManager     = new MeshBufferManager <Vertex>(_graphics);
            _instanceBufferManager = _graphics.VertexBufferManagerFactory.Create <CubeInstance>();

            _renderTarget.Window.Title   = "Many Cubes";
            _renderTarget.Window.Visible = true;
        }
Exemplo n.º 4
0
        public void InitializeResources()
        {
            _gfx = Graphics.CreateContext(true);
            _renderTarget = _gfx.RenderTargetFactory.CreateWindow();
            _sceneDataConstantBuffers = _gfx.ConstantBufferManagerFactory.Create<SceneData>();
            _cubeInstanceBuffers = _gfx.MeshInstanceBufferManagerFactory.Create<CubeInstance>();

            InitializeWindow();

            CreateAndActivateMaterial();
            CreateAndActivateCubeMeshBuffer();
            CreateAndActivateCubeInstances();
            CreateAndActivateSceneDataConstantBuffer();

            _gfx.TextureResourceManager.CreateArray("rabbit");
        }
Exemplo n.º 5
0
        public void InitializeResources()
        {
            _gfx                      = Graphics.CreateContext(true);
            _renderTarget             = _gfx.RenderTargetFactory.CreateWindow();
            _sceneDataConstantBuffers = _gfx.ConstantBufferManagerFactory.Create <SceneData>();
            _cubeInstanceBuffers      = _gfx.MeshInstanceBufferManagerFactory.Create <CubeInstance>();

            InitializeWindow();

            CreateAndActivateMaterial();
            CreateAndActivateCubeMeshBuffer();
            CreateAndActivateCubeInstances();
            CreateAndActivateSceneDataConstantBuffer();

            _gfx.TextureResourceManager.CreateArray("rabbit");
        }
Exemplo n.º 6
0
        public Program()
        {
            _app = new GrasshopperApp()
                   .UseSharpDX()
                   .UseWindowsFileSystem();

            _graphics              = _app.Graphics.CreateContext(enableDebugMode: true);
            _renderTarget          = _graphics.RenderTargetFactory.CreateWindow();
            _constantBufferManager = _graphics.ConstantBufferManagerFactory.Create <SceneData>();
            _meshBufferManager     = new MeshBufferManager <Vertex>(_graphics);
            _instanceBufferManager = _graphics.VertexBufferManagerFactory.Create <CubeInstance>();

            _renderTarget.Window.Title   = "Flying Through Cubes";
            _renderTarget.Window.Visible = true;
            _renderTarget.Window.SetFullScreen();
            _renderTarget.Window.SizeChanged += UpdateAspectRatio;

            UpdateAspectRatio(_renderTarget.Window);
        }
Exemplo n.º 7
0
        public Program()
        {
            _app = new GrasshopperApp()
                .UseSharpDX()
                .UseWindowsFileSystem();

            _graphics = _app.Graphics.CreateContext(enableDebugMode: true);
            _renderTarget = _graphics.RenderTargetFactory.CreateWindow();
            _constantBufferManager = _graphics.ConstantBufferManagerFactory.Create<SceneData>();
            _meshBufferManager = new MeshBufferManager<Vertex>(_graphics);
            _instanceBufferManager = _graphics.VertexBufferManagerFactory.Create<CubeInstance>();

            _renderTarget.Window.Title = "Flying Through Cubes";
            _renderTarget.Window.Visible = true;
            _renderTarget.Window.SetFullScreen();
            _renderTarget.Window.SizeChanged += UpdateAspectRatio;

            UpdateAspectRatio(_renderTarget.Window);
        }
Exemplo n.º 8
0
        public Program()
        {
            _app = new GrasshopperApp()
                .UseSharpDX()
                .UseWindowsFileSystem();
            _graphics = _app.Graphics.CreateContext(enableDebugMode: true);
            _renderTarget = _graphics.RenderTargetFactory.CreateWindow();
            _constantBufferManager = _graphics.ConstantBufferManagerFactory.Create<SceneData>();
            _meshBufferManager = new MeshBufferManager<Vertex>(_graphics);
            _instanceBufferManager = _graphics.VertexBufferManagerFactory.Create<CubeInstance>();

            _renderTarget.Window.Title = "Many Textured Cubes";
            _renderTarget.Window.Visible = true;
        }