Added some extra swapchain params to app
This commit is contained in:
parent
08c8b689ad
commit
7c7c01bdac
1 changed files with 7 additions and 1 deletions
|
|
@ -48,6 +48,9 @@ typedef struct Application {
|
||||||
VkQueue graphicsQueue;
|
VkQueue graphicsQueue;
|
||||||
VkQueue presentQueue;
|
VkQueue presentQueue;
|
||||||
VkSwapchainKHR swapChain;
|
VkSwapchainKHR swapChain;
|
||||||
|
VkImage *swapChainImages;
|
||||||
|
VkFormat swapChainImageFormat;
|
||||||
|
VkExtent2D swapChainExtent;
|
||||||
} Application;
|
} Application;
|
||||||
|
|
||||||
typedef struct SwapChainSupportDetails {
|
typedef struct SwapChainSupportDetails {
|
||||||
|
|
@ -562,6 +565,9 @@ void createSwapChain(Application *app) {
|
||||||
fprintf(stderr, "Failed to create swapchain!");
|
fprintf(stderr, "Failed to create swapchain!");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app->swapChainImageFormat = surfaceFormat.format;
|
||||||
|
app->swapChainExtent = extent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void initVulkan(Application *app) {
|
void initVulkan(Application *app) {
|
||||||
|
|
@ -592,7 +598,7 @@ void cleanup(Application *app) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
Application app;
|
Application app = {0};
|
||||||
|
|
||||||
initWindow(&app);
|
initWindow(&app);
|
||||||
initVulkan(&app);
|
initVulkan(&app);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue