Exemple #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();
        }
Exemple #2
0
 protected override void CreateResources()
 {
     _vertexBuffer = CreateVertexBuffer();
     _indexBuffer  = CreateIndexBuffer();
     _shader       = CreateShader();
     _pipeline     = CreatePipeline();
 }
Exemple #3
0
        protected override void CreateResources()
        {
            _vertexBuffer = CreateVertexBuffer();
            _indexBuffer  = CreateIndexBuffer();
            _texture      = CreateTexture();
            _shader       = CreateShader();
            _pipeline     = CreatePipeline();

            ResetGameOfLife();
        }
Exemple #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();
        }
Exemple #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();
        }
Exemple #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();
        }
Exemple #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();
        }
Exemple #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();
        }
Exemple #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();
        }
Exemple #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();
        }