![]()  | 
  
    PeriDyno 1.2.1
    
   | 
 
#include <VkApp.h>

Classes | |
| struct | Settings | 
| Example settings that can be changed e.g. by command line arguments.  More... | |
Public Member Functions | |
| VkApp (bool enableValidation=false) | |
| virtual | ~VkApp () | 
| bool | initVulkan () | 
| Setup the vulkan instance, enable required extensions and connect to the physical device (GPU)   | |
| virtual void | render () | 
| (Pure virtual) Render function to be implemented by the sample application   | |
| virtual void | viewChanged () | 
| (Virtual) Called when the camera view has changed   | |
| virtual void | keyPressed (uint32_t) | 
| (Virtual) Called after a key was pressed, can be used to do custom key handling   | |
| virtual void | mouseMoved (double x, double y, bool &handled) | 
| (Virtual) Called after the mouse cursor moved and before internal events (like camera rotation) is handled   | |
| virtual void | windowResized () | 
| (Virtual) Called when the window has been resized, can be used by the sample application to recreate resources   | |
| virtual void | buildCommandBuffers () | 
| (Virtual) Called when resources have been recreated that require a rebuild of the command buffers (e.g. frame buffer), to be implemented by the sample application   | |
| virtual void | setupDepthStencil () | 
| (Virtual) Setup default depth and stencil views   | |
| virtual void | setupFrameBuffer () | 
| (Virtual) Setup default framebuffers for all requested swapchain images   | |
| virtual void | setupRenderPass () | 
| (Virtual) Setup a default renderpass   | |
| virtual void | getEnabledFeatures () | 
| (Virtual) Called after the physical device features have been read, can be used to set features to enable on the device   | |
| virtual void | prepare () | 
| Prepares all Vulkan resources and functions required to run the sample.   | |
| VkPipelineShaderStageCreateInfo | loadShader (std::string fileName, VkShaderStageFlagBits stage) | 
| Loads a SPIR-V shader file for the given shader stage.   | |
| void | renderLoop () | 
| Entry point for the main render loop.   | |
| void | drawUI (const VkCommandBuffer commandBuffer) | 
| Adds the drawing commands for the ImGui overlay to the given command buffer.   | |
| void | prepareFrame () | 
| void | submitFrame () | 
| Presents the current image to the swap chain.   | |
| virtual void | renderFrame () | 
| (Virtual) Default image acquire + submission and command buffer submission function   | |
| virtual void | OnUpdateUIOverlay (vks::UIOverlay *overlay) | 
| (Virtual) Called when the UI overlay is updating, can be used to add custom elements to the overlay   | |
| void | buildCustomCommandBuffer (VkCommandBuffer commandBuffer) | 
| void | prepare (VkRenderPass renderPass) | 
| void | setWindowTitle (std::string name) | 
| void | setSceneGraph (std::shared_ptr< dyno::SceneGraph > scn) | 
Public Attributes | ||
| bool | swapChainCleaned = false | |
| bool | prepared = false | |
| bool | resized = false | |
| uint32_t | width = 1280 | |
| uint32_t | height = 720 | |
| vks::UIOverlay | UIOverlay | |
| float | frameTimer = 1.0f | |
| Last frame time measured using a high performance timer (if available)   | ||
| dyno::VkContext * | ctx | |
| struct VkApp::Settings | settings | |
| VkClearColorValue | defaultClearColor = { { 0.025f, 0.025f, 0.025f, 1.0f } } | |
| float | timer = 0.0f | |
| float | timerSpeed = 0.25f | |
| bool | paused = false | |
| Camera | camera | |
| glm::vec2 | mousePos | |
| std::string | title = "Vulkan Example" | |
| std::string | name = "vulkanExample" | |
| uint32_t | apiVersion = VK_API_VERSION_1_0 | |
| struct { | ||
| VkImage image | ||
| VkDeviceMemory mem | ||
| VkImageView view | ||
| } | depthStencil | |
| struct { | ||
| glm::vec2 axisLeft = glm::vec2(0.0f) | ||
| glm::vec2 axisRight = glm::vec2(0.0f) | ||
| } | gamePadState | |
| struct { | ||
| bool left = false | ||
| bool right = false | ||
| bool middle = false | ||
| } | mouseButtons | |
Static Public Attributes | |
| static std::vector< const char * > | args | 
Protected Member Functions | |
| std::string | getShadersPath () const | 
Protected Attributes | ||
| uint32_t | frameCounter = 0 | |
| uint32_t | lastFPS = 0 | |
| std::chrono::time_point< std::chrono::high_resolution_clock > | lastTimestamp | |
| std::vector< const char * > | enabledDeviceExtensions | |
| Set of device extensions to be enabled for this example (must be set in the derived constructor)   | ||
| std::vector< const char * > | enabledInstanceExtensions | |
| void * | deviceCreatepNextChain = nullptr | |
| Optional pNext structure for passing extension structures to device creation.   | ||
| VkFormat | depthFormat | |
| Logical device, application's view of the physical device (GPU)   | ||
| VkCommandPool | cmdPool | |
| VkPipelineStageFlags | submitPipelineStages = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | |
| Pipeline stages used to wait at for graphics queue submissions.   | ||
| VkSubmitInfo | submitInfo | |
| std::vector< VkCommandBuffer > | drawCmdBuffers | |
| VkRenderPass | renderPass | |
| std::vector< VkFramebuffer > | frameBuffers | |
| uint32_t | currentBuffer = 0 | |
| VkDescriptorPool | descriptorPool = VK_NULL_HANDLE | |
| std::vector< VkShaderModule > | shaderModules | |
| VulkanSwapChain | swapChain | |
| struct { | ||
| VkSemaphore presentComplete | ||
| VkSemaphore renderComplete | ||
| } | semaphores | |
| std::vector< VkFence > | waitFences | |
Private Member Functions | |
| std::string | getWindowTitle () | 
| void | windowResize () | 
| void | handleMouseMove (int32_t x, int32_t y) | 
| void | nextFrame () | 
| void | updateOverlay () | 
| void | createCommandPool () | 
| void | createSynchronizationPrimitives () | 
| void | initSwapchain () | 
| void | setupSwapChain () | 
| void | createCommandBuffers () | 
| void | destroyCommandBuffers () | 
Private Attributes | |
| bool | viewUpdated = false | 
| uint32_t | destWidth | 
| uint32_t | destHeight | 
| bool | resizing = false | 
| std::string | shaderDir = "glsl" | 
| VkApp::VkApp | ( | bool | enableValidation = false | ) | 
      
  | 
  virtual | 
      
  | 
  virtual | 
| void VkApp::buildCustomCommandBuffer | ( | VkCommandBuffer | commandBuffer | ) | 
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
| void VkApp::drawUI | ( | const VkCommandBuffer | commandBuffer | ) | 
      
  | 
  virtual | 
      
  | 
  protected | 
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
| bool VkApp::initVulkan | ( | ) | 
      
  | 
  virtual | 
| VkPipelineShaderStageCreateInfo VkApp::loadShader | ( | std::string | fileName, | 
| VkShaderStageFlagBits | stage ) | 
      
  | 
  virtual | 
      
  | 
  private | 
      
  | 
  virtual | 
      
  | 
  virtual | 
| void VkApp::prepare | ( | VkRenderPass | renderPass | ) | 
| void VkApp::prepareFrame | ( | ) | 
      
  | 
  virtual | 
      
  | 
  virtual | 
| void VkApp::renderLoop | ( | ) | 
| void VkApp::setSceneGraph | ( | std::shared_ptr< dyno::SceneGraph > | scn | ) | 
      
  | 
  virtual | 
      
  | 
  virtual | 
      
  | 
  virtual | 
      
  | 
  private | 
| void VkApp::submitFrame | ( | ) | 
      
  | 
  private | 
      
  | 
  virtual | 
      
  | 
  private | 
      
  | 
  virtual | 
| dyno::VkContext* VkApp::ctx | 
| VkClearColorValue VkApp::defaultClearColor = { { 0.025f, 0.025f, 0.025f, 1.0f } } | 
      
  | 
  protected | 
| struct { ... } VkApp::depthStencil | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
| float VkApp::frameTimer = 1.0f | 
| struct { ... } VkApp::gamePadState | 
      
  | 
  protected | 
| struct { ... } VkApp::mouseButtons | 
| struct { ... } VkApp::semaphores | 
| struct VkApp::Settings VkApp::settings | 
      
  | 
  protected | 
      
  | 
  protected | 
| vks::UIOverlay VkApp::UIOverlay |