Exemple #1
0
def setup_swapchain_image_views():
    global swapchain_images, swapchain_image_views

    # Fetch swapchain images
    swapchain_images = hvk.swapchain_images(api, device, swapchain)

    # Create the swapchain images view
    swapchain_image_views = []
    for image in swapchain_images:
        view = hvk.create_image_view(
            api, device,
            hvk.image_view_create_info(image=image,
                                       format=swapchain_image_format))
        swapchain_image_views.append(view)
def setup_swapchain_image_views(recreate=False):
    global swapchain_images, swapchain_image_views

    if recreate:
        for view in swapchain_image_views:
            hvk.destroy_image_view(api, device, view)

    # Fetch swapchain images
    swapchain_images = hvk.swapchain_images(api, device, swapchain)

    # Create the swapchain images view
    swapchain_image_views = []
    for image in swapchain_images:
        view = hvk.create_image_view(
            api, device,
            hvk.image_view_create_info(image=image,
                                       format=swapchain_image_format))
        swapchain_image_views.append(view)
Exemple #3
0
    def _setup_swapchain_images(self):
        engine, api, device = self.ctx
        swapchain = engine.swapchain

        if len(self.swapchain_images) > 0:
            for (_, view) in self.swapchain_images:
                hvk.destroy_image_view(api, device, view)

        # Fetch swapchain images
        swapchain_images = hvk.swapchain_images(api, device, swapchain)
        swapchain_fmt = engine.info["swapchain_format"]

        # Create the swapchain images view
        self.swapchain_images = []
        for image in swapchain_images:
            view = hvk.create_image_view(
                api, device,
                hvk.image_view_create_info(image=image, format=swapchain_fmt))

            self.swapchain_images.append(ImageAndView(image=image, view=view))