Moved most everything to vulkan_wrapper
This commit is contained in:
parent
4da333d7f6
commit
5ce5da188a
3 changed files with 1183 additions and 1168 deletions
1169
src/main.c
1169
src/main.c
File diff suppressed because it is too large
Load diff
1141
src/vulkan_wrapper.c
1141
src/vulkan_wrapper.c
File diff suppressed because it is too large
Load diff
|
|
@ -1 +1,42 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <vulkan/vulkan_core.h>
|
||||||
|
|
||||||
|
#define GLFW_INCLUDE_VULKAN
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
|
#define MAX_FRAMES_IN_FLIGHT 2
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
GLFWwindow *window;
|
||||||
|
VkInstance instance;
|
||||||
|
VkDebugUtilsMessengerEXT debugMessenger;
|
||||||
|
VkSurfaceKHR surface;
|
||||||
|
VkPhysicalDevice physicalDevice;
|
||||||
|
VkDevice device;
|
||||||
|
VkQueue graphicsQueue;
|
||||||
|
VkQueue presentQueue;
|
||||||
|
VkSwapchainKHR swapChain;
|
||||||
|
VkImage *swapChainImages;
|
||||||
|
uint32_t swapChainImageCount;
|
||||||
|
VkFormat swapChainImageFormat;
|
||||||
|
VkExtent2D swapChainExtent;
|
||||||
|
VkImageView *swapChainImageViews;
|
||||||
|
uint32_t swapChainImageViewCount;
|
||||||
|
VkRenderPass renderPass;
|
||||||
|
VkPipelineLayout pipelineLayout;
|
||||||
|
VkPipeline graphicsPipeline;
|
||||||
|
VkFramebuffer *swapChainFramebuffers;
|
||||||
|
uint32_t swapChainFramebufferCount;
|
||||||
|
VkCommandPool commandPool;
|
||||||
|
VkCommandBuffer commandBuffers[MAX_FRAMES_IN_FLIGHT];
|
||||||
|
VkSemaphore imageAvailableSemaphores[MAX_FRAMES_IN_FLIGHT];
|
||||||
|
VkSemaphore renderFinishedSemaphore[MAX_FRAMES_IN_FLIGHT];
|
||||||
|
VkFence inFlightFences[MAX_FRAMES_IN_FLIGHT];
|
||||||
|
uint32_t currentFrame; // initialised to 0
|
||||||
|
} Application;
|
||||||
|
|
||||||
|
void initWindow(Application *app);
|
||||||
|
void initVulkan(Application *app);
|
||||||
|
void mainLoop(Application *app);
|
||||||
|
void cleanup(Application *app);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue