GlistEngine
Loading...
Searching...
No Matches
gVKSwapchain.h
Go to the documentation of this file.
1/*
2 * gVKSwapchain.h
3 *
4 * Swapchain, its image views and the resize path of the Vulkan backend.
5 * Created by: Veysel Burak Eroglu.
6 */
7
8#pragma once
9
10#ifndef CORE_GVKSWAPCHAIN_H
11#define CORE_GVKSWAPCHAIN_H
12
13#include "gVKContext.h"
14
15#ifdef GVK_VULKAN
16
17class gBaseWindow;
18
19/*
20 * Creates the swapchain together with its images and image views, and fills in
21 * ctx.swapchainformat and ctx.swapchainextent. Present mode is FIFO, which the
22 * specification guarantees on every driver.
23 */
24bool gvkCreateSwapchain(gVKContext& ctx, gBaseWindow* window);
25
26/*
27 * Destroys the image views and the swapchain itself. Safe to call twice.
28 */
29void gvkDestroySwapchain(gVKContext& ctx);
30
31/*
32 * Rebuilds everything that depends on the window size after a resize or after the
33 * swapchain went out of date. Returns false when the window is minimised, in which
34 * case nothing is rebuilt and the caller has to skip the frame.
35 */
36bool gvkRecreateSwapchain(gVKContext& ctx, gBaseWindow* window);
37
38// Rebuilds the presentation surface and everything that hangs off it. Needed when
39// the platform replaces the native window the surface was created from - Android
40// does this on rotation and when the activity returns to the foreground - or when
41// the driver reports the surface lost. Returns false when there is nothing to
42// build onto yet, in which case the caller skips the frame and tries again.
43bool gvkRecreateSurface(gVKContext& ctx, gBaseWindow* window);
44
45#endif /* GVK_VULKAN */
46
47#endif /* CORE_GVKSWAPCHAIN_H */
Definition gBaseWindow.h:29