scop
a small 3D object loader
|
#include <VulkanApp.hpp>
Public Member Functions | |
void | run (const std::string &objFile1) |
Private Types | |
enum | ColorMode { RED , GREEN , BLUE , DARK , BLACK , NONE } |
Private Member Functions | |
void | initWindow () |
void | initVulkan () |
void | mainLoop () |
bool | checkValidationLayerSupport () |
std::vector< const char * > | getRequiredExtensions () |
void | createInstance () |
void | createSurface () |
bool | checkDeviceExtensionSupport (VkPhysicalDevice device) |
bool | isDeviceSuitable (VkPhysicalDevice device) |
void | pickPhysicalDevice () |
void | createLogicalDevice () |
VkPresentModeKHR | chooseSwapPresentMode (const std::vector< VkPresentModeKHR > &availablePresentModes) |
VkExtent2D | chooseSwapExtent (const VkSurfaceCapabilitiesKHR &capabilities) |
SwapChainSupportDetails | querySwapChainSupport (VkPhysicalDevice device) |
void | createSwapChain () |
void | recreateSwapChain () |
void | cleanup () |
void | cleanupSwapChain () |
void | cleanupVertexBuffer () |
void | populateDebugMessengerCreateInfo (VkDebugUtilsMessengerCreateInfoEXT &createInfo) |
void | setupDebugMessenger () |
void | createRenderPass () |
VkShaderModule | createShaderModule (const std::vector< char > &code) |
void | createGraphicsPipeline () |
void | createDescriptorSetLayout () |
void | createUniformBuffers () |
void | updateUniformBuffer (uint32_t currentImage) |
void | createDescriptorPool () |
void | createDescriptorSets () |
void | createFramebuffers () |
void | createCommandPool () |
void | createCommandBuffers () |
void | recordCommandBuffer (VkCommandBuffer commandBuffer, uint32_t imageIndex) |
void | createSyncObjects () |
void | drawFrame () |
VkCommandBuffer | beginSingleTimeCommands () |
void | endSingleTimeCommands (VkCommandBuffer commandBuffer) |
void | createColorResources () |
void | createDepthResources () |
void | createVertexBuffer () |
void | updateVertexBuffer () |
uint32_t | findMemoryType (uint32_t typeFilter, VkMemoryPropertyFlags properties) |
void | createBuffer (VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer &buffer, VkDeviceMemory &bufferMemory) |
void | copyBuffer (VkBuffer srcBuffer, VkBuffer dstBuffer, VkDeviceSize size) |
void | createIndexBuffer () |
void | createTextureImage () |
void | generateMipmaps (VkImage image, VkFormat imageFormat, int32_t texWidth, int32_t texHeight, uint32_t mipLevels) |
void | createImage (uint32_t width, uint32_t height, uint32_t mipLevels, VkSampleCountFlagBits numSamples, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage &image, VkDeviceMemory &imageMemory) |
void | transitionImageLayout (VkImage image, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout, uint32_t mipLevels) |
void | copyBufferToImage (VkBuffer buffer, VkImage image, uint32_t width, uint32_t height) |
void | createImageViews () |
VkSampleCountFlagBits | getMaxUsableSampleCount () |
void | createTextureImageView () |
VkImageView | createImageView (VkImage image, VkFormat format, VkImageAspectFlags aspectFlags, uint32_t mipLevels) |
void | createTextureSampler () |
VkFormat | findSupportedFormat (const std::vector< VkFormat > &candidates, VkImageTiling tiling, VkFormatFeatureFlags features) |
VkFormat | findDepthFormat () |
bool | hasStencilComponent (VkFormat format) |
void | parseObjFile (const std::string &filename) |
void | parseMtlFile (const std::string &objFilePath, const std::string &mtlFilename) |
QueueFamilyIndices | findQueueFamilies (VkPhysicalDevice device) |
void | transitionTextures () |
void | enableDarkMode () |
Static Private Member Functions | |
static std::vector< char > | readFile (const std::string &filename) |
static void | keyCallback (GLFWwindow *window, int key, int scancode, int action, int mods) |
static void | mouseButtonCallback (GLFWwindow *window, int button, int action, int mods) |
static void | cursorPosCallback (GLFWwindow *window, double xpos, double ypos) |
static VKAPI_ATTR VkBool32 VKAPI_CALL | debugCallback (VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, void *pUserData) |
static void | framebufferResizeCallback (GLFWwindow *window, int width, int height) |
Private Attributes | |
GLFWwindow * | window |
Camera | cameraView |
vec3 | positionModel |
vec3 | rotationModel {0, 0, 1} |
vec3 | modelCentroid |
double | lastMouseX = 0.0 |
double | lastMouseY = 0.0 |
bool | mouseDrag = false |
bool | disable_textures = false |
bool | transition_over = true |
ColorMode | colorMode = NONE |
std::vector< Vertex > | vertices |
std::vector< uint32_t > | indices |
VkInstance | instance |
VkDebugUtilsMessengerEXT | debugMessenger |
VkSurfaceKHR | surface |
VkPhysicalDevice | physicalDevice = VK_NULL_HANDLE |
VkSampleCountFlagBits | msaaSamples = VK_SAMPLE_COUNT_1_BIT |
VkDevice | device |
VkQueue | graphicsQueue |
VkQueue | presentQueue |
VkSwapchainKHR | swapChain |
std::vector< VkImage > | swapChainImages |
VkFormat | swapChainImageFormat |
VkExtent2D | swapChainExtent |
std::vector< VkImageView > | swapChainImageViews |
std::vector< VkFramebuffer > | swapChainFramebuffers |
VkRenderPass | renderPass |
VkDescriptorSetLayout | descriptorSetLayout |
VkPipelineLayout | pipelineLayout |
VkPipeline | graphicsPipeline |
VkImage | depthImage |
VkDeviceMemory | depthImageMemory |
VkImageView | depthImageView |
uint32_t | mipLevels |
VkImage | textureImage |
VkDeviceMemory | textureImageMemory |
VkImageView | textureImageView |
VkSampler | textureSampler |
VkBuffer | vertexBuffer |
VkDeviceMemory | vertexBufferMemory |
VkBuffer | indexBuffer |
VkDeviceMemory | indexBufferMemory |
std::vector< VkBuffer > | uniformBuffers |
std::vector< VkDeviceMemory > | uniformBuffersMemory |
std::vector< void * > | uniformBuffersMapped |
VkDescriptorPool | descriptorPool |
std::vector< VkDescriptorSet > | descriptorSets |
VkCommandPool | commandPool |
std::vector< VkCommandBuffer > | commandBuffers |
VkImage | colorImage |
VkDeviceMemory | colorImageMemory |
VkImageView | colorImageView |
std::vector< VkSemaphore > | imageAvailableSemaphores |
std::vector< VkSemaphore > | renderFinishedSemaphores |
std::vector< VkFence > | inFlightFences |
size_t | currentFrame = 0 |
bool | framebufferResized = false |
VkPrimitiveTopology | topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST |
Definition at line 192 of file VulkanApp.hpp.
|
private |
Enumerator | |
---|---|
RED | |
GREEN | |
BLUE | |
DARK | |
BLACK | |
NONE |
Definition at line 217 of file VulkanApp.hpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 15 of file VulkanClean.cpp.
|
private |
|
private |
Definition at line 85 of file VulkanClean.cpp.
|
private |
Definition at line 98 of file VulkanVertex.cpp.
|
private |
Definition at line 222 of file VulkanTexture.cpp.
|
private |
Definition at line 71 of file VulkanVertex.cpp.
|
private |
Definition at line 243 of file VulkanRender.cpp.
|
private |
|
private |
Definition at line 40 of file VulkanRender.cpp.
|
private |
Definition at line 250 of file VulkanRender.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 102 of file VulkanPipeline.cpp.
|
private |
Definition at line 138 of file VulkanTexture.cpp.
|
private |
|
private |
Definition at line 245 of file VulkanTexture.cpp.
|
private |
Definition at line 15 of file VulkanIndex.cpp.
|
private |
Definition at line 133 of file VulkanInit.cpp.
|
private |
Definition at line 242 of file VulkanInit.cpp.
|
private |
Definition at line 15 of file VulkanPipeline.cpp.
|
private |
|
private |
|
private |
Definition at line 351 of file VulkanInit.cpp.
|
private |
|
private |
Definition at line 15 of file VulkanTexture.cpp.
|
private |
Definition at line 268 of file VulkanTexture.cpp.
|
private |
|
private |
Definition at line 263 of file VulkanPipeline.cpp.
|
private |
Definition at line 15 of file VulkanVertex.cpp.
|
inlinestaticprivate |
|
inlinestaticprivate |
|
private |
Definition at line 146 of file VulkanRender.cpp.
|
private |
|
private |
|
private |
Definition at line 334 of file VulkanTexture.cpp.
|
private |
|
inlineprivate |
|
private |
|
inlinestaticprivate |
|
private |
Definition at line 51 of file VulkanTexture.cpp.
|
private |
|
private |
|
private |
Definition at line 342 of file VulkanTexture.cpp.
|
private |
Definition at line 60 of file VulkanInit.cpp.
|
private |
Definition at line 23 of file VulkanInit.cpp.
|
private |
Definition at line 201 of file VulkanInit.cpp.
|
inlinestaticprivate |
|
private |
Definition at line 36 of file VulkanInit.cpp.
|
inlinestaticprivate |
|
private |
|
private |
Definition at line 15 of file Parsing.cpp.
|
private |
Definition at line 218 of file VulkanInit.cpp.
|
private |
Definition at line 42 of file VulkanDebug.cpp.
|
private |
|
staticprivate |
|
private |
|
private |
Definition at line 404 of file VulkanInit.cpp.
void VulkanApp::run | ( | const std::string & | objFile1 | ) |
Definition at line 15 of file VulkanInit.cpp.
|
private |
Definition at line 31 of file VulkanDebug.cpp.
|
private |
Definition at line 173 of file VulkanTexture.cpp.
|
private |
Definition at line 346 of file VulkanTexture.cpp.
|
private |
Definition at line 277 of file VulkanPipeline.cpp.
|
private |
Definition at line 38 of file VulkanVertex.cpp.
|
private |
Definition at line 199 of file VulkanApp.hpp.
|
private |
Definition at line 279 of file VulkanApp.hpp.
|
private |
Definition at line 280 of file VulkanApp.hpp.
|
private |
Definition at line 281 of file VulkanApp.hpp.
Definition at line 226 of file VulkanApp.hpp.
|
private |
Definition at line 277 of file VulkanApp.hpp.
|
private |
Definition at line 276 of file VulkanApp.hpp.
|
private |
Definition at line 286 of file VulkanApp.hpp.
|
private |
Definition at line 232 of file VulkanApp.hpp.
|
private |
Definition at line 254 of file VulkanApp.hpp.
|
private |
Definition at line 255 of file VulkanApp.hpp.
|
private |
Definition at line 256 of file VulkanApp.hpp.
|
private |
Definition at line 273 of file VulkanApp.hpp.
|
private |
Definition at line 250 of file VulkanApp.hpp.
|
private |
Definition at line 274 of file VulkanApp.hpp.
|
private |
Definition at line 237 of file VulkanApp.hpp.
|
private |
Definition at line 214 of file VulkanApp.hpp.
|
private |
Definition at line 288 of file VulkanApp.hpp.
|
private |
Definition at line 252 of file VulkanApp.hpp.
|
private |
Definition at line 239 of file VulkanApp.hpp.
|
private |
Definition at line 283 of file VulkanApp.hpp.
|
private |
Definition at line 266 of file VulkanApp.hpp.
|
private |
Definition at line 267 of file VulkanApp.hpp.
|
private |
Definition at line 229 of file VulkanApp.hpp.
|
private |
Definition at line 285 of file VulkanApp.hpp.
|
private |
Definition at line 231 of file VulkanApp.hpp.
|
private |
Definition at line 211 of file VulkanApp.hpp.
|
private |
Definition at line 212 of file VulkanApp.hpp.
|
private |
Definition at line 258 of file VulkanApp.hpp.
|
private |
Definition at line 209 of file VulkanApp.hpp.
|
private |
Definition at line 213 of file VulkanApp.hpp.
|
private |
Definition at line 236 of file VulkanApp.hpp.
|
private |
Definition at line 235 of file VulkanApp.hpp.
|
private |
Definition at line 251 of file VulkanApp.hpp.
|
private |
Definition at line 205 of file VulkanApp.hpp.
|
private |
Definition at line 240 of file VulkanApp.hpp.
|
private |
Definition at line 284 of file VulkanApp.hpp.
|
private |
Definition at line 249 of file VulkanApp.hpp.
|
private |
Definition at line 206 of file VulkanApp.hpp.
|
private |
Definition at line 233 of file VulkanApp.hpp.
|
private |
Definition at line 242 of file VulkanApp.hpp.
|
private |
Definition at line 245 of file VulkanApp.hpp.
|
private |
Definition at line 247 of file VulkanApp.hpp.
|
private |
Definition at line 244 of file VulkanApp.hpp.
|
private |
Definition at line 243 of file VulkanApp.hpp.
|
private |
Definition at line 246 of file VulkanApp.hpp.
|
private |
Definition at line 259 of file VulkanApp.hpp.
|
private |
Definition at line 260 of file VulkanApp.hpp.
|
private |
Definition at line 261 of file VulkanApp.hpp.
|
private |
Definition at line 262 of file VulkanApp.hpp.
|
private |
Definition at line 290 of file VulkanApp.hpp.
|
private |
Definition at line 215 of file VulkanApp.hpp.
|
private |
Definition at line 269 of file VulkanApp.hpp.
|
private |
Definition at line 271 of file VulkanApp.hpp.
|
private |
Definition at line 270 of file VulkanApp.hpp.
|
private |
Definition at line 264 of file VulkanApp.hpp.
|
private |
Definition at line 265 of file VulkanApp.hpp.
|
private |
Definition at line 228 of file VulkanApp.hpp.
|
private |
Definition at line 197 of file VulkanApp.hpp.