| 137 | }; |
| 138 | |
| 139 | class HelloTriangleApplication { |
| 140 | public: |
| 141 | void run() { |
| 142 | initWindow(); |
| 143 | initVulkan(); |
| 144 | mainLoop(); |
| 145 | cleanup(); |
| 146 | } |
| 147 | |
| 148 | private: |
| 149 | GLFWwindow* window; |
| 150 | |
| 151 | VkInstance instance; |
| 152 | VkDebugUtilsMessengerEXT debugMessenger; |
| 153 | VkSurfaceKHR surface; |
| 154 | |
| 155 | VkPhysicalDevice physicalDevice = VK_NULL_HANDLE; |
| 156 | VkSampleCountFlagBits msaaSamples = VK_SAMPLE_COUNT_1_BIT; |
| 157 | VkDevice device; |
| 158 | |
| 159 | VkQueue graphicsQueue; |
| 160 | VkQueue presentQueue; |
| 161 | |
| 162 | VkSwapchainKHR swapChain; |
| 163 | std::vector<VkImage> swapChainImages; |
| 164 | VkFormat swapChainImageFormat; |
| 165 | VkExtent2D swapChainExtent; |
| 166 | std::vector<VkImageView> swapChainImageViews; |
| 167 | std::vector<VkFramebuffer> swapChainFramebuffers; |
| 168 | |
| 169 | VkRenderPass renderPass; |
| 170 | VkDescriptorSetLayout descriptorSetLayout; |
| 171 | VkPipelineLayout pipelineLayout; |
| 172 | VkPipeline graphicsPipeline; |
| 173 | |
| 174 | VkCommandPool commandPool; |
| 175 | |
| 176 | VkImage colorImage; |
| 177 | VkDeviceMemory colorImageMemory; |
| 178 | VkImageView colorImageView; |
| 179 | |
| 180 | VkImage depthImage; |
| 181 | VkDeviceMemory depthImageMemory; |
| 182 | VkImageView depthImageView; |
| 183 | |
| 184 | uint32_t mipLevels; |
| 185 | VkImage textureImage; |
| 186 | VkDeviceMemory textureImageMemory; |
| 187 | VkImageView textureImageView; |
| 188 | VkSampler textureSampler; |
| 189 | |
| 190 | std::vector<Vertex> vertices; |
| 191 | std::vector<uint32_t> indices; |
| 192 | VkBuffer vertexBuffer; |
| 193 | VkDeviceMemory vertexBufferMemory; |
| 194 | VkBuffer indexBuffer; |
| 195 | VkDeviceMemory indexBufferMemory; |
| 196 |
nothing calls this directly
no outgoing calls
no test coverage detected