Пример #1
0
        public Application()
        {
            DrawableSizeChanged += OnDrawableSizeChanged;

            var msaaSampleCount = GraphicsDevice.Features.MsaaRenderTargets ? 4 : 1;

            _cubeVertexBuffer = CreateCubeVertexBuffer();
            _cubeIndexBuffer  = CreateCubeIndexBuffer();
            _quadVertexBuffer = CreateQuadVertexBuffer();

            _offScreenShader        = CreateOffScreenShader();
            _offScreenPipeline      = CreateOffScreenPipeline(msaaSampleCount);
            _offScreenRenderTargets = CreateOffScreenRenderTargets(msaaSampleCount);
            _offScreenPass          = CreateOffScreenRenderPass();

            _fullScreenShader   = CreateFullScreenShader();
            _fullScreenPipeline = CreateFullScreenPipeline(msaaSampleCount);

            _debugShader   = CreateDebugShader();
            _debugPipeline = CreateDebugPipeline(msaaSampleCount);

            // Free any strings we implicitly allocated when creating resources
            // Only call this method AFTER resources are created
            GraphicsDevice.FreeStrings();
        }
Пример #2
0
 protected override void CreateResources()
 {
     _vertexBuffer = CreateVertexBuffer();
     _indexBuffer  = CreateIndexBuffer();
     _shader       = CreateShader();
     _pipeline     = CreatePipeline();
 }
Пример #3
0
        protected override void CreateResources()
        {
            _vertexBuffer = CreateVertexBuffer();
            _indexBuffer  = CreateIndexBuffer();
            _texture      = CreateTexture();
            _shader       = CreateShader();
            _pipeline     = CreatePipeline();

            ResetGameOfLife();
        }
Пример #4
0
        public Application()
        {
            _vertexBuffer = CreateVertexBuffer();
            _shader       = CreateShader();
            _pipeline     = CreatePipeline();

            // Free any strings we implicitly allocated when creating resources
            // Only call this method AFTER resources are created
            GraphicsDevice.FreeStrings();
        }
Пример #5
0
        protected override void CreateResources()
        {
            Debug.Assert(
                GraphicsDevice.Features.Instancing,
                $"instancing is not supported for your hardware with {Backend} API");

            _vertexBuffer   = CreateVertexBuffer();
            _indexBuffer    = CreateIndexBuffer();
            _instanceBuffer = CreateInstanceBuffer();
            _shader         = CreateShader();
            _pipeline       = CreatePipeline();
        }
Пример #6
0
        public Application()
        {
            DrawableSizeChanged += OnDrawableSizeChanged;

            _vertexBuffer = CreateVertexBuffer();
            _indexBuffer  = CreateIndexBuffer();
            _texture      = CreateTexture();
            _shader       = CreateShader();
            _pipeline     = CreatePipeline();

            // Free any strings we implicitly allocated when creating resources
            // Only call this method AFTER resources are created
            GraphicsDevice.FreeStrings();
        }
Пример #7
0
        protected override void CreateResources()
        {
            _vertexBuffer      = CreateVertexBuffer();
            _indexBuffer       = CreateIndexBuffer();
            _offscreenShader   = CreateOffscreenShader();
            _offscreenPipeline = CreateOffscreenPipeline();

            var(renderTarget, renderTargetDepth) = CreateOffscreenRenderTargets();
            _renderTarget        = renderTarget;
            _offscreenRenderPass = CreateOffscreenRenderPass(renderTarget, renderTargetDepth);

            _frameBufferShader   = CreateFrameBufferShader();
            _frameBufferPipeline = CreateFrameBufferPipeline();
        }
Пример #8
0
        protected override void CreateResources()
        {
            _cubeVertexBuffer = CreateCubeVertexBuffer();
            _cubeIndexBuffer  = CreateCubeIndexBuffer();
            _quadVertexBuffer = CreateQuadVertexBuffer();

            _offScreenShader        = CreateOffScreenShader();
            _offScreenPipeline      = CreateOffScreenPipeline();
            _offScreenRenderTargets = CreateOffScreenRenderTargets();
            _offScreenPass          = CreateOffScreenRenderPass();

            _fullScreenShader   = CreateFullScreenShader();
            _fullScreenPipeline = CreateFullScreenPipeline();

            _debugShader   = CreateDebugShader();
            _debugPipeline = CreateDebugPipeline();
        }
Пример #9
0
        public Application()
        {
            DrawableSizeChanged += OnDrawableSizeChanged;

            _vertexBuffer      = CreateVertexBuffer();
            _indexBuffer       = CreateIndexBuffer();
            _offscreenShader   = CreateOffscreenShader();
            _offscreenPipeline = CreateOffscreenPipeline();

            var(renderTarget, renderTargetDepth) = CreateOffscreenRenderTargets();
            _renderTarget        = renderTarget;
            _offscreenRenderPass = CreateOffscreenRenderPass(renderTarget, renderTargetDepth);

            _frameBufferShader   = CreateFrameBufferShader();
            _frameBufferPipeline = CreateFrameBufferPipeline();

            // Free any strings we implicitly allocated when creating resources
            // Only call this method AFTER resources are created
            GraphicsDevice.FreeStrings();
        }
Пример #10
0
        public Application()
        {
            Debug.Assert(
                GraphicsDevice.IsValid(),
                "sokol_gfx should be initialized");
            Debug.Assert(
                GraphicsDevice.Features.Instancing,
                $"instancing is not supported for your hardware with {Backend} API");

            DrawableSizeChanged += OnDrawableSizeChanged;

            _vertexBuffer   = CreateVertexBuffer();
            _indexBuffer    = CreateIndexBuffer();
            _instanceBuffer = CreateInstanceBuffer();
            _shader         = CreateShader();
            _pipeline       = CreatePipeline();

            // Free any strings we implicitly allocated when creating resources
            // Only call this method AFTER resources are created
            GraphicsDevice.FreeStrings();
        }