Exemplo n.º 1
0
 public MeshBuffer(string id, IVertexBufferManager <T> vertexBufferManager, IIndexBufferManager indexBufferManager, IEnumerable <Mesh <T> > meshes)
     : base(id)
 {
     _vertexBufferManager = vertexBufferManager;
     _indexBufferManager  = indexBufferManager;
     Meshes = meshes;
 }
Exemplo n.º 2
0
        public Program()
        {
            _app = new GrasshopperApp().UseSharpDX();
            _graphics = _app.Graphics.CreateContext(enableDebugMode: true);
            _renderTarget = _graphics.RenderTargetFactory.CreateWindow();
            _vertexBufferManager = _graphics.VertexBufferManagerFactory.Create<Vertex>();

            _renderTarget.Window.Title = "Simple Quad";
            _renderTarget.Window.Visible = true;
        }
Exemplo n.º 3
0
        public Program()
        {
            _app                 = new GrasshopperApp().UseSharpDX();
            _graphics            = _app.Graphics.CreateContext(enableDebugMode: true);
            _renderTarget        = _graphics.RenderTargetFactory.CreateWindow();
            _vertexBufferManager = _graphics.VertexBufferManagerFactory.Create <Vertex>();

            _renderTarget.Window.Title   = "Dynamic Texture";
            _renderTarget.Window.Visible = true;
        }
Exemplo n.º 4
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.º 5
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.º 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 = "Many Textured Cubes";
            _renderTarget.Window.Visible = true;
        }
Exemplo n.º 8
0
 public MeshBufferManager(IGraphicsContext graphicsContext)
 {
     _vertexBufferManager = graphicsContext.VertexBufferManagerFactory.Create <T>();
     _indexBufferManager  = graphicsContext.IndexBufferManagerFactory.Create();
     Disposed            += OnDisposed;
 }