コード例 #1
0
        /// <summary>
        /// Configure the render for rendering.
        /// </summary>
        public override void ConfigureRendering()
        {
            base.ConfigureRendering();

            // - Initialize the swap chain
            Swapchain.Initialize(PhysicalDevice.DrawingSurface, TargetSurface.SurfaceSize);

            // - Initialzie the swapchain images
            Swapchain.CreateImageViews();

            // - Configure the default render pass
            DefaultRenderPass.Initialize((Format)Swapchain.CurrentFormat.Format);

            // - Load shaders
            ShaderManager.CreateShaders();

            // - Gets default shaders
            var defaultShader = ShaderManager[typeof(DefaultShader)] as VKShaderInstance;

            Pipeline.Shader = defaultShader;

            // - Initialize pipeline
            Pipeline.Initialize(TargetSurface.SurfaceSize);

            // - Build swapchain framebuffers
            Swapchain.CreateFrameBuffers(DefaultRenderPass);

            for (int i = 0; i < Swapchain.Images.Count(); ++i)
            {
                ImagesInFlight.Add(null);
            }
        }