|
libmx2 2.2.1
C++20 multimedia and game-engine library (SDL2 / OpenGL / Vulkan)
|
Primary Vulkan rendering window and device management class. More...
#include <vk.hpp>
Public Member Functions | |
| VKWindow ()=default | |
| VKWindow (const std::string &title, int width, int height, bool full=false, bool valid=true) | |
| Create and fully initialise the Vulkan window. | |
| virtual | ~VKWindow () |
| Virtual destructor — subclasses should call cleanup(). | |
| VKWindow (const VKWindow &)=delete | |
| VKWindow & | operator= (const VKWindow &)=delete |
| VKWindow (VKWindow &&)=delete | |
| VKWindow & | operator= (VKWindow &&)=delete |
| void | initWindow (const std::string &title, int width, int height, bool full=false) |
| Open the SDL2 window (called automatically by constructor). | |
| void | setFont (const std::string &font, const int size=24) |
| Set the font used for printText(). | |
| virtual void | initVulkan () |
| Initialise all Vulkan objects (overridable). | |
| void | createVertexBuffer () |
| Create and upload the vertex buffer. | |
| void | setPath (const std::string &path) |
| Set the asset root directory. | |
| void | loop () |
| Run the blocking event/render loop. | |
| virtual void | proc () |
| Process one event/render iteration (overridable). | |
| virtual void | cleanup () |
| Free all Vulkan resources (overridable). | |
| virtual void | event (SDL_Event &e)=0 |
| Handle an SDL event (pure virtual). | |
| virtual void | draw () |
| Record rendering commands for the current frame (overridable). | |
| virtual void | onResize () |
| Called when the window is resized (optional override). | |
| virtual bool | shouldRender3D () |
| Control whether 3-D geometry is rendered this frame. | |
| void | createGraphicsPipeline () |
| (Re)create the graphics pipeline. | |
| VkShaderModule | createShaderModule (const std::vector< char > &code) |
| Compile a SPIR-V shader module. | |
| void | quit () |
| Post a quit event to stop the loop. | |
| void | setFullScreen (const bool full) |
| Toggle fullscreen mode. | |
| void | updateTexture (SDL_Surface *newSurface) |
| Replace the primary texture from an SDL_Surface. | |
| void | updateTexture (void *pixels, VkDeviceSize imageSize) |
| Replace the primary texture from a raw pixel buffer. | |
| void | printText (const std::string &text, int x, int y, const SDL_Color &col) |
| Queue a text string for rendering at a screen position. | |
| void | clearTextQueue () |
| Clear all pending text-render entries. | |
| bool | getTextDimensions (const std::string &text, int &width, int &height) |
| Measure a text string without rendering it. | |
| VKSprite * | createSprite (const std::string &pngPath, const std::string &vertexShader, const std::string &fragmentShaderPath="") |
| Create a sprite from a PNG file. | |
| VKSprite * | createSprite (SDL_Surface *surface, const std::string &vertexShader, const std::string &fragmentShaderPath="") |
| Create a sprite from an SDL_Surface. | |
| VKSprite * | createSprite (int width, int height, const std::string &vertexShader="", const std::string &fragmentShaderPath="") |
| Create a blank sprite of the given dimensions. | |
| int | getWidth () const |
| int | getHeight () const |
| void | resizeWindow (int width, int height) |
| Resize the SDL window and recreate the swapchain. | |
| bool | enableControllerInput () |
| Enable joystick and game controller subsystems on demand. | |
| bool | controllerInputEnabled () const |
| void | setWireFrame (bool enable) |
| Enable or disable wireframe rendering. | |
| bool | getWireFrame () const |
| VkPhysicalDevice | getPhysicalDevice () const |
| VkDevice | getDevice () const |
| VkQueue | getGraphicsQueue () const |
| VkCommandPool | getCommandPool () const |
Public Attributes | |
| int | w = 0 |
| Current window width. | |
| int | h = 0 |
| Current window height. | |
| mxUtil | util |
| Asset path and utility helpers. | |
Protected Member Functions | |
| void | createDescriptorSetLayout () |
| Create the main descriptor set layout (UBO + sampler). | |
| void | createDepthResources () |
| Create depth buffer image, memory, and view. | |
| VkFormat | findSupportedFormat (const std::vector< VkFormat > &candidates, VkImageTiling tiling, VkFormatFeatureFlags features) |
| Find a supported VkFormat from the candidate list. | |
| VkFormat | findDepthFormat () |
| Select a depth buffer format supported by the physical device. | |
| void | createInstance () |
| Create the Vulkan instance and enable extensions/layers. | |
| void | createSurface () |
| Create the Vulkan surface from the SDL window. | |
| void | pickPhysicalDevice () |
| Enumerate GPUs and select the most suitable physical device. | |
| void | createLogicalDevice () |
| Create the logical device and retrieve queue handles. | |
| void | createUniformBuffers () |
| Allocate per-frame uniform buffers and map them persistently. | |
| virtual void | createSwapChain () |
| Create (or recreate) the swapchain and associated images (overridable). | |
| void | createImageViews () |
| Create image views for every swapchain image. | |
| void | createRenderPass () |
| Create the main render pass with colour and depth attachments. | |
| void | createFramebuffers () |
| Create framebuffers for each swapchain image view. | |
| void | createCommandPool () |
| Create the graphics command pool. | |
| void | createCommandBuffers () |
| Allocate per-frame command buffers from the command pool. | |
| void | createSyncObjects () |
| Create semaphores and fences for frame synchronisation. | |
| virtual void | cleanupSwapChain () |
| Destroy swapchain-dependent resources before recreation (overridable). | |
| QueueFamilyIndices | findQueueFamilies (VkPhysicalDevice device) |
| Find queue families supporting graphics and presentation. | |
| VkSurfaceFormatKHR | chooseSwapSurfaceFormat (const std::vector< VkSurfaceFormatKHR > &availableFormats) |
| Choose the best surface format from available options. | |
| VkPresentModeKHR | chooseSwapPresentMode (const std::vector< VkPresentModeKHR > &availablePresentModes) |
| Choose the best present mode (prefers mailbox, falls back to FIFO). | |
| VkExtent2D | chooseSwapExtent (const VkSurfaceCapabilitiesKHR &capabilities) |
| Determine the swapchain image extent from surface capabilities. | |
| bool | isDeviceSuitable (VkPhysicalDevice device) |
| Check whether a physical device meets all application requirements. | |
| SwapChainSupportDetails | querySwapChainSupport (VkPhysicalDevice device) |
| Query swapchain support details for a physical device. | |
| void | createBuffer (VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer &buffer, VkDeviceMemory &bufferMemory) |
| Allocate a Vulkan buffer with the given usage and memory properties. | |
| uint32_t | findMemoryType (uint32_t typeFilter, VkMemoryPropertyFlags properties) |
| Find a device memory type matching the filter and property flags. | |
| void | copyBuffer (VkBuffer srcBuffer, VkBuffer dstBuffer, VkDeviceSize size) |
| Copy data between two Vulkan buffers via a one-shot command. | |
| void | createTextureImage (SDL_Surface *surfacex) |
| Create a Vulkan texture image from an SDL surface. | |
| void | createImage (uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage &image, VkDeviceMemory &imageMemory) |
| Create a Vulkan image with the specified parameters. | |
| void | transitionImageLayout (VkImage image, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout) |
| Transition an image between two layouts using a pipeline barrier. | |
| void | copyBufferToImage (VkBuffer buffer, VkImage image, uint32_t width, uint32_t height) |
| Copy a staging buffer into a Vulkan image. | |
| VkCommandBuffer | beginSingleTimeCommands () |
| Begin a one-shot command buffer for transfer operations. | |
| void | endSingleTimeCommands (VkCommandBuffer commandBuffer) |
| End and submit a one-shot command buffer, then wait for completion. | |
| void | createTextureImageView () |
| Create the image view for the primary texture. | |
| VkImageView | createImageView (VkImage image, VkFormat format, VkImageAspectFlags aspectFlags) |
| Create an image view with specified format and aspect flags. | |
| void | createTextureSampler () |
| Create the texture sampler with default filter/addressing modes. | |
| void | createDescriptorPool () |
| Create the main descriptor pool. | |
| void | createDescriptorSets () |
| Allocate main descriptor sets from the pool. | |
| void | updateDescriptorSets () |
| Write updated bindings into existing descriptor sets. | |
| void | recreateSwapChain () |
| Tear down and rebuild the swapchain and all dependent resources. | |
| void | setupTextureImage (uint32_t w, uint32_t h) |
| Allocate a blank texture image of the given dimensions. | |
| void | createTextDescriptorSetLayout () |
| Create the descriptor set layout for text rendering. | |
| void | createTextPipeline () |
| Create the pipeline for text rendering. | |
| void | createTextDescriptorPool () |
| Create the descriptor pool for text rendering. | |
| void | createSpriteDescriptorSetLayout () |
| Create the descriptor set layout for sprite rendering. | |
| void | createSpritePipeline () |
| Create the pipeline for sprite rendering. | |
| void | createSpriteDescriptorPool () |
| Create the descriptor pool for sprite rendering. | |
Protected Attributes | |
| bool | active = true |
true while the event loop should keep running. | |
| bool | inputControllersInitialized = false |
| Whether joystick/controller input is enabled. | |
| bool | enableValidation = true |
| Enable Vulkan validation layers. | |
| std::string | font = "font.ttf" |
| Path to the current TTF font. | |
| int | font_size = 24 |
| Current font point size. | |
| VkInstance | instance = VK_NULL_HANDLE |
| Vulkan instance. | |
| VkSurfaceKHR | surface = VK_NULL_HANDLE |
| Window surface. | |
| VkPhysicalDevice | physicalDevice = VK_NULL_HANDLE |
| Selected GPU. | |
| VkDevice | device = VK_NULL_HANDLE |
| Logical device. | |
| VkQueue | graphicsQueue = VK_NULL_HANDLE |
| Graphics submission queue. | |
| VkQueue | presentQueue = VK_NULL_HANDLE |
| Presentation queue. | |
| VkDescriptorSetLayout | descriptorSetLayout |
| Main descriptor set layout. | |
| VkSwapchainKHR | swapChain = VK_NULL_HANDLE |
| Active swapchain. | |
| std::vector< VkImage > | swapChainImages |
| Swapchain image handles. | |
| VkFormat | swapChainImageFormat |
| Colour format of swapchain images. | |
| VkExtent2D | swapChainExtent |
| Swapchain pixel dimensions. | |
| std::vector< VkImageView > | swapChainImageViews |
| Image views into swapchain images. | |
| std::vector< VkBuffer > | uniformBuffers |
| Per-frame uniform buffers. | |
| std::vector< VkDeviceMemory > | uniformBuffersMemory |
| Memory for per-frame UBOs. | |
| std::vector< void * > | uniformBuffersMapped |
| Persistently mapped UBO pointers. | |
| VkRenderPass | renderPass = VK_NULL_HANDLE |
| Main render pass. | |
| VkPipelineLayout | pipelineLayout = VK_NULL_HANDLE |
| Pipeline layout for the main pass. | |
| VkPipeline | graphicsPipeline = VK_NULL_HANDLE |
| Filled-polygon graphics pipeline. | |
| VkPipeline | graphicsPipelineMatrix = VK_NULL_HANDLE |
| 3-D matrix-enabled graphics pipeline. | |
| VkPolygonMode | currentPolygonMode = VK_POLYGON_MODE_FILL |
| Current polygon fill mode. | |
| bool | useWireFrame = false |
| Wireframe rendering toggle. | |
| bool | supportsWireFrame = false |
| Whether the device supports wireframe. | |
| std::vector< VkFramebuffer > | swapChainFramebuffers |
| Framebuffers for each swapchain image. | |
| VkCommandPool | commandPool = VK_NULL_HANDLE |
| Command pool for graphics commands. | |
| std::vector< VkCommandBuffer > | commandBuffers |
| Per-frame command buffers. | |
| VkSemaphore | imageAvailableSemaphore = VK_NULL_HANDLE |
| Signals when a swapchain image is acquired. | |
| VkSemaphore | renderFinishedSemaphore = VK_NULL_HANDLE |
| Signals when rendering is complete. | |
| VkFence | inFlightFence = VK_NULL_HANDLE |
| CPU–GPU frame synchronisation fence. | |
| VkBuffer | vertexBuffer = VK_NULL_HANDLE |
| Full-screen quad vertex buffer. | |
| VkDeviceMemory | vertexBufferMemory = VK_NULL_HANDLE |
| Memory for the vertex buffer. | |
| VkBuffer | indexBuffer = VK_NULL_HANDLE |
| Full-screen quad index buffer. | |
| VkDeviceMemory | indexBufferMemory = VK_NULL_HANDLE |
| Memory for the index buffer. | |
| uint32_t | indexCount = 0 |
| Number of indices in the quad. | |
| VkImage | textureImage = VK_NULL_HANDLE |
| Primary texture image. | |
| VkDeviceMemory | textureImageMemory = VK_NULL_HANDLE |
| Memory for the primary texture. | |
| VkImageView | textureImageView = VK_NULL_HANDLE |
| View into the primary texture. | |
| VkImageLayout | textureImageLayout = VK_IMAGE_LAYOUT_UNDEFINED |
| Current layout of the primary texture. | |
| VkSampler | textureSampler = VK_NULL_HANDLE |
| Sampler for the primary texture. | |
| VkDescriptorPool | descriptorPool = VK_NULL_HANDLE |
| Main descriptor pool. | |
| std::vector< VkDescriptorSet > | descriptorSets |
| Per-frame descriptor sets. | |
| VkImage | depthImage = VK_NULL_HANDLE |
| Depth/stencil image. | |
| VkDeviceMemory | depthImageMemory = VK_NULL_HANDLE |
| Memory for the depth image. | |
| VkImageView | depthImageView = VK_NULL_HANDLE |
| View into the depth image. | |
| VkFormat | depthFormat = VK_FORMAT_D32_SFLOAT |
| Format used for the depth buffer. | |
| float | cameraDistance = 3.0f |
| Default camera distance from origin. | |
| std::unique_ptr< VKText > | textRenderer |
| Text rendering subsystem. | |
| VkPipeline | textPipeline = VK_NULL_HANDLE |
| Pipeline for text rendering. | |
| VkPipelineLayout | textPipelineLayout = VK_NULL_HANDLE |
| Pipeline layout for text rendering. | |
| VkDescriptorPool | textDescriptorPool = VK_NULL_HANDLE |
| Descriptor pool for text. | |
| VkDescriptorSetLayout | textDescriptorSetLayout = VK_NULL_HANDLE |
| Descriptor layout for text. | |
| std::vector< std::unique_ptr< VKSprite > > | sprites |
| Owned sprite instances. | |
| VkPipeline | spritePipeline = VK_NULL_HANDLE |
| Pipeline for sprite rendering. | |
| VkPipelineLayout | spritePipelineLayout = VK_NULL_HANDLE |
| Pipeline layout for sprites. | |
| VkDescriptorPool | spriteDescriptorPool = VK_NULL_HANDLE |
| Descriptor pool for sprites. | |
| VkDescriptorSetLayout | spriteDescriptorSetLayout = VK_NULL_HANDLE |
| Descriptor layout for sprites. | |
| VkDebugUtilsMessengerEXT | debugMessenger = VK_NULL_HANDLE |
| Vulkan debug messenger (validation layers). | |
| uint32_t | width |
| uint32_t | height |
| Internal width/height tracking. | |
| SDL_Window * | window = nullptr |
| SDL window handle. | |
| SDL_Surface * | surface_img = nullptr |
| Cached SDL surface for texture uploads. | |
Friends | |
| class | VKAbstractModel |
Primary Vulkan rendering window and device management class.
Encapsulates the full Vulkan initialisation sequence: instance, surface, physical and logical device selection, swap chain creation, render pass, descriptor sets, command buffers, and synchronisation. Derived classes implement event() and optionally override draw(), initVulkan(), and cleanup() to add application-specific rendering.
Built-in support for:
|
default |
Referenced by operator=(), operator=(), VKWindow(), and VKWindow().
| mx::VKWindow::VKWindow | ( | const std::string & | title, |
| int | width, | ||
| int | height, | ||
| bool | full = false, | ||
| bool | valid = true ) |
Create and fully initialise the Vulkan window.
| title | Window title string. |
| width | Width in pixels. |
| height | Height in pixels. |
| full | Start fullscreen if true. |
| valid | Enable Vulkan validation layers if true. |
Definition at line 10 of file vk.cpp.
References enableValidation, height, initWindow(), and width.
|
inlinevirtual |
|
delete |
References VKWindow().
|
delete |
References VKWindow().
|
protected |
Begin a one-shot command buffer for transfer operations.
Definition at line 1147 of file vk.cpp.
References commandPool, device, and VK_CHECK_RESULT.
Referenced by copyBufferToImage(), and transitionImageLayout().
|
protected |
Determine the swapchain image extent from surface capabilities.
| capabilities | Current surface capabilities. |
Definition at line 221 of file vk.cpp.
Referenced by createSwapChain().
|
protected |
Choose the best present mode (prefers mailbox, falls back to FIFO).
| availablePresentModes | Candidate modes. |
Definition at line 212 of file vk.cpp.
Referenced by createSwapChain().
|
protected |
Choose the best surface format from available options.
| availableFormats | Candidate formats. |
Definition at line 199 of file vk.cpp.
Referenced by createSwapChain().
|
virtual |
Free all Vulkan resources (overridable).
Definition at line 1672 of file vk.cpp.
References cleanupSwapChain(), commandPool, debugMessenger, descriptorPool, descriptorSetLayout, device, enableValidation, imageAvailableSemaphore, indexBuffer, indexBufferMemory, inFlightFence, inputControllersInitialized, instance, pipelineLayout, renderFinishedSemaphore, spriteDescriptorPool, spriteDescriptorSetLayout, spritePipeline, spritePipelineLayout, sprites, surface, textDescriptorPool, textDescriptorSetLayout, textPipeline, textPipelineLayout, textRenderer, textureImage, textureImageMemory, textureImageView, textureSampler, uniformBuffers, uniformBuffersMapped, uniformBuffersMemory, vertexBuffer, vertexBufferMemory, and window.
|
protectedvirtual |
Destroy swapchain-dependent resources before recreation (overridable).
Definition at line 704 of file vk.cpp.
References commandBuffers, commandPool, depthImage, depthImageMemory, depthImageView, device, graphicsPipeline, graphicsPipelineMatrix, pipelineLayout, renderPass, swapChain, swapChainFramebuffers, and swapChainImageViews.
Referenced by cleanup(), and recreateSwapChain().
| void mx::VKWindow::clearTextQueue | ( | ) |
Clear all pending text-render entries.
Definition at line 2086 of file vk.cpp.
References textRenderer.
Referenced by draw().
|
inline |
true if controller input subsystem was enabled. Definition at line 313 of file vk.hpp.
References inputControllersInitialized.
|
protected |
Copy data between two Vulkan buffers via a one-shot command.
| srcBuffer | Source buffer. |
| dstBuffer | Destination buffer. |
| size | Number of bytes to copy. |
Definition at line 904 of file vk.cpp.
References commandPool, device, graphicsQueue, and VK_CHECK_RESULT.
Referenced by createVertexBuffer().
|
protected |
Copy a staging buffer into a Vulkan image.
Definition at line 1117 of file vk.cpp.
References beginSingleTimeCommands(), endSingleTimeCommands(), height, and width.
Referenced by createTextureImage(), mx::VKAbstractModel::loadModelTextures(), mx::VKAbstractModel::loadModelTexturesFromMTL(), and updateTexture().
|
protected |
Allocate a Vulkan buffer with the given usage and memory properties.
| size | Buffer size in bytes. |
| usage | Vulkan buffer usage flags. |
| properties | Required memory property flags. |
| buffer | Output buffer handle. |
| bufferMemory | Output device memory handle. |
Definition at line 872 of file vk.cpp.
References device, and findMemoryType().
Referenced by createTextureImage(), createUniformBuffers(), createVertexBuffer(), mx::VKAbstractModel::load(), mx::VKAbstractModel::loadInstance(), mx::VKAbstractModel::loadModelTextures(), mx::VKAbstractModel::loadModelTexturesFromMTL(), mx::VKAbstractModel::resize(), and updateTexture().
|
protected |
Allocate per-frame command buffers from the command pool.
Definition at line 674 of file vk.cpp.
References commandBuffers, commandPool, device, and swapChainFramebuffers.
Referenced by initVulkan(), and recreateSwapChain().
|
protected |
Create the graphics command pool.
Definition at line 663 of file vk.cpp.
References commandPool, device, findQueueFamilies(), mx::QueueFamilyIndices::graphicsFamily, and physicalDevice.
Referenced by initVulkan().
|
protected |
Create depth buffer image, memory, and view.
Definition at line 792 of file vk.cpp.
References createImage(), createImageView(), depthFormat, depthImage, depthImageMemory, depthImageView, findDepthFormat(), and swapChainExtent.
Referenced by initVulkan(), and recreateSwapChain().
|
protected |
Create the main descriptor pool.
Definition at line 1228 of file vk.cpp.
References descriptorPool, device, instance, and swapChainImages.
Referenced by initVulkan().
|
protected |
Create the main descriptor set layout (UBO + sampler).
Definition at line 101 of file vk.cpp.
References descriptorSetLayout, and device.
Referenced by initVulkan().
|
protected |
Allocate main descriptor sets from the pool.
Definition at line 1254 of file vk.cpp.
References descriptorPool, descriptorSetLayout, descriptorSets, device, instance, swapChainImages, textureImageView, textureSampler, and uniformBuffers.
Referenced by initVulkan().
|
protected |
Create framebuffers for each swapchain image view.
Definition at line 642 of file vk.cpp.
References depthImageView, device, renderPass, swapChainExtent, swapChainFramebuffers, and swapChainImageViews.
Referenced by initVulkan(), and recreateSwapChain().
| void mx::VKWindow::createGraphicsPipeline | ( | ) |
(Re)create the graphics pipeline.
Definition at line 1351 of file vk.cpp.
References createShaderModule(), descriptorSetLayout, device, graphicsPipeline, graphicsPipelineMatrix, pipelineLayout, mx::readFile(), renderPass, supportsWireFrame, swapChainExtent, mx::Exception::text(), and util.
Referenced by initVulkan(), and recreateSwapChain().
|
protected |
Create a Vulkan image with the specified parameters.
| width | Image width in pixels. |
| height | Image height in pixels. |
| format | Pixel format. |
| tiling | Tiling arrangement. |
| usage | Image usage flags. |
| properties | Memory property flags. |
| image | Output image handle. |
| imageMemory | Output device memory handle. |
Definition at line 995 of file vk.cpp.
References device, findMemoryType(), height, and width.
Referenced by createDepthResources(), createTextureImage(), mx::VKAbstractModel::loadModelTextures(), mx::VKAbstractModel::loadModelTexturesFromMTL(), and setupTextureImage().
|
protected |
Create an image view with specified format and aspect flags.
| image | Source image. |
| format | View format. |
| aspectFlags | Aspect mask (colour, depth, etc.). |
Definition at line 1184 of file vk.cpp.
References device.
Referenced by createDepthResources(), createTextureImageView(), mx::VKAbstractModel::loadModelTextures(), and mx::VKAbstractModel::loadModelTexturesFromMTL().
|
protected |
Create image views for every swapchain image.
Definition at line 559 of file vk.cpp.
References device, swapChainImageFormat, swapChainImages, and swapChainImageViews.
Referenced by initVulkan(), and recreateSwapChain().
|
protected |
Create the Vulkan instance and enable extensions/layers.
Definition at line 260 of file vk.cpp.
References mx::debugCallback(), debugMessenger, enableValidation, instance, VK_CHECK_RESULT, and window.
Referenced by initVulkan().
|
protected |
Create the logical device and retrieve queue handles.
Definition at line 435 of file vk.cpp.
References device, findQueueFamilies(), mx::QueueFamilyIndices::graphicsFamily, graphicsQueue, physicalDevice, mx::QueueFamilyIndices::presentFamily, presentQueue, and supportsWireFrame.
Referenced by initVulkan().
|
protected |
Create the main render pass with colour and depth attachments.
Definition at line 582 of file vk.cpp.
References depthFormat, device, renderPass, and swapChainImageFormat.
Referenced by initVulkan(), and recreateSwapChain().
| VkShaderModule mx::VKWindow::createShaderModule | ( | const std::vector< char > & | code | ) |
Compile a SPIR-V shader module.
| code | Byte vector of SPIR-V code. |
Definition at line 162 of file vk.cpp.
References device.
Referenced by createGraphicsPipeline(), mx::VKAbstractModel::createModelPipeline(), createSpritePipeline(), and createTextPipeline().
| VKSprite * mx::VKWindow::createSprite | ( | const std::string & | pngPath, |
| const std::string & | vertexShader, | ||
| const std::string & | fragmentShaderPath = "" ) |
Create a sprite from a PNG file.
| pngPath | Path to the PNG image. |
| vertexShader | Vertex shader file path. |
| fragmentShaderPath | Fragment shader file path (empty = default). |
Definition at line 1840 of file vk.cpp.
References commandPool, createSpriteDescriptorPool(), createSpriteDescriptorSetLayout(), createSpritePipeline(), device, graphicsQueue, physicalDevice, renderPass, spriteDescriptorSetLayout, spritePipeline, and sprites.
| VKSprite * mx::VKWindow::createSprite | ( | int | width, |
| int | height, | ||
| const std::string & | vertexShader = "", | ||
| const std::string & | fragmentShaderPath = "" ) |
Create a blank sprite of the given dimensions.
| width | Pixel width. |
| height | Pixel height. |
| vertexShader | Vertex shader file path. |
| fragmentShaderPath | Fragment shader file path. |
Definition at line 1881 of file vk.cpp.
References commandPool, createSpriteDescriptorPool(), createSpriteDescriptorSetLayout(), createSpritePipeline(), device, graphicsQueue, height, physicalDevice, renderPass, spriteDescriptorSetLayout, spritePipeline, sprites, and width.
| VKSprite * mx::VKWindow::createSprite | ( | SDL_Surface * | surface, |
| const std::string & | vertexShader, | ||
| const std::string & | fragmentShaderPath = "" ) |
Create a sprite from an SDL_Surface.
| surface | Source surface. |
| vertexShader | Vertex shader file path. |
| fragmentShaderPath | Fragment shader file path. |
Definition at line 1861 of file vk.cpp.
References commandPool, createSpriteDescriptorPool(), createSpriteDescriptorSetLayout(), createSpritePipeline(), device, graphicsQueue, physicalDevice, renderPass, spriteDescriptorSetLayout, spritePipeline, sprites, and surface.
|
protected |
Create the descriptor pool for sprite rendering.
Definition at line 2065 of file vk.cpp.
References device, spriteDescriptorPool, and VK_CHECK_RESULT.
Referenced by createSprite(), createSprite(), and createSprite().
|
protected |
Create the descriptor set layout for sprite rendering.
Definition at line 1901 of file vk.cpp.
References device, spriteDescriptorSetLayout, and VK_CHECK_RESULT.
Referenced by createSprite(), createSprite(), and createSprite().
|
protected |
Create the pipeline for sprite rendering.
Definition at line 1917 of file vk.cpp.
References createShaderModule(), device, mx::readFile(), renderPass, spriteDescriptorSetLayout, spritePipeline, spritePipelineLayout, util, and VK_CHECK_RESULT.
Referenced by createSprite(), createSprite(), createSprite(), and recreateSwapChain().
|
protected |
|
protectedvirtual |
Create (or recreate) the swapchain and associated images (overridable).
Definition at line 505 of file vk.cpp.
References mx::SwapChainSupportDetails::capabilities, chooseSwapExtent(), chooseSwapPresentMode(), chooseSwapSurfaceFormat(), device, findQueueFamilies(), mx::SwapChainSupportDetails::formats, mx::QueueFamilyIndices::graphicsFamily, h, physicalDevice, mx::QueueFamilyIndices::presentFamily, mx::SwapChainSupportDetails::presentModes, querySwapChainSupport(), surface, swapChain, swapChainExtent, swapChainImageFormat, swapChainImages, and w.
Referenced by initVulkan(), and recreateSwapChain().
|
protected |
Create semaphores and fences for frame synchronisation.
Definition at line 689 of file vk.cpp.
References device, imageAvailableSemaphore, inFlightFence, and renderFinishedSemaphore.
Referenced by initVulkan().
|
protected |
Create the descriptor pool for text rendering.
Definition at line 2283 of file vk.cpp.
References device, swapChainImages, textDescriptorPool, and VK_CHECK_RESULT.
Referenced by initVulkan().
|
protected |
Create the descriptor set layout for text rendering.
Definition at line 2101 of file vk.cpp.
References device, textDescriptorSetLayout, and VK_CHECK_RESULT.
Referenced by initVulkan().
|
protected |
Create the pipeline for text rendering.
Definition at line 2117 of file vk.cpp.
References createShaderModule(), device, mx::readFile(), renderPass, swapChainExtent, textDescriptorSetLayout, textPipeline, textPipelineLayout, util, and VK_CHECK_RESULT.
Referenced by initVulkan(), and recreateSwapChain().
|
protected |
Create a Vulkan texture image from an SDL surface.
| surfacex | Source surface (RGBA). |
Definition at line 937 of file vk.cpp.
References copyBufferToImage(), createBuffer(), createImage(), device, height, surface, textureImage, textureImageLayout, textureImageMemory, textureImageView, transitionImageLayout(), VK_CHECK_RESULT, and width.
|
protected |
Create the image view for the primary texture.
Definition at line 1180 of file vk.cpp.
References createImageView(), textureImage, and textureImageView.
Referenced by initVulkan().
|
protected |
Create the texture sampler with default filter/addressing modes.
Definition at line 1207 of file vk.cpp.
References device, and textureSampler.
Referenced by initVulkan().
|
protected |
Allocate per-frame uniform buffers and map them persistently.
Definition at line 1333 of file vk.cpp.
References createBuffer(), device, swapChainImages, uniformBuffers, uniformBuffersMapped, uniformBuffersMemory, and VK_CHECK_RESULT.
Referenced by initVulkan().
| void mx::VKWindow::createVertexBuffer | ( | ) |
Create and upload the vertex buffer.
Definition at line 811 of file vk.cpp.
References copyBuffer(), createBuffer(), device, indexBuffer, indexBufferMemory, indexCount, vertexBuffer, and vertexBufferMemory.
Referenced by initVulkan(), and recreateSwapChain().
|
virtual |
Record rendering commands for the current frame (overridable).
The default implementation draws the main textured quad and updates the uniform buffer.
Definition at line 1531 of file vk.cpp.
References clearTextQueue(), commandBuffers, device, graphicsQueue, imageAvailableSemaphore, presentQueue, recreateSwapChain(), renderFinishedSemaphore, renderPass, spritePipeline, spritePipelineLayout, sprites, swapChain, swapChainExtent, swapChainFramebuffers, textPipeline, textPipelineLayout, textRenderer, and VK_CHECK_RESULT.
Referenced by loop().
| bool mx::VKWindow::enableControllerInput | ( | ) |
Enable joystick and game controller subsystems on demand.
true if controller input is ready, false on failure. Definition at line 43 of file vk.cpp.
References inputControllersInitialized.
|
protected |
End and submit a one-shot command buffer, then wait for completion.
Definition at line 1166 of file vk.cpp.
References commandPool, device, graphicsQueue, and VK_CHECK_RESULT.
Referenced by copyBufferToImage(), and transitionImageLayout().
|
pure virtual |
|
protected |
Select a depth buffer format supported by the physical device.
Definition at line 784 of file vk.cpp.
References findSupportedFormat().
Referenced by createDepthResources().
|
protected |
Find a device memory type matching the filter and property flags.
| typeFilter | Bit mask of acceptable memory types. |
| properties | Required memory property flags. |
Definition at line 893 of file vk.cpp.
References physicalDevice.
Referenced by createBuffer(), and createImage().
|
protected |
Find queue families supporting graphics and presentation.
| device | Physical device to query. |
Definition at line 174 of file vk.cpp.
References device, mx::QueueFamilyIndices::graphicsFamily, mx::QueueFamilyIndices::isComplete(), mx::QueueFamilyIndices::presentFamily, and surface.
Referenced by createCommandPool(), createLogicalDevice(), createSwapChain(), and isDeviceSuitable().
|
protected |
Find a supported VkFormat from the candidate list.
| candidates | Ordered list of preferred formats. |
| tiling | Required tiling mode. |
| features | Required format feature flags. |
Definition at line 771 of file vk.cpp.
References physicalDevice.
Referenced by findDepthFormat().
|
inline |
Definition at line 329 of file vk.hpp.
References commandPool.
Referenced by mx::VKAbstractModel::load().
|
inline |
Definition at line 325 of file vk.hpp.
References device.
Referenced by mx::VKAbstractModel::cleanup(), mx::VKAbstractModel::cleanupInstanceResources(), mx::VKAbstractModel::createModelDescriptorPool(), mx::VKAbstractModel::createModelDescriptorSets(), mx::VKAbstractModel::createModelPipeline(), mx::VKAbstractModel::load(), mx::VKAbstractModel::loadInstance(), mx::VKAbstractModel::loadModelTextures(), mx::VKAbstractModel::loadModelTexturesFromMTL(), mx::VKAbstractModel::resize(), and mx::VKAbstractModel::setShaders().
|
inline |
Definition at line 327 of file vk.hpp.
References graphicsQueue.
Referenced by mx::VKAbstractModel::load().
|
inline |
|
inline |
Definition at line 323 of file vk.hpp.
References physicalDevice.
Referenced by mx::VKAbstractModel::load().
| bool mx::VKWindow::getTextDimensions | ( | const std::string & | text, |
| int & | width, | ||
| int & | height ) |
|
inline |
|
inline |
true if wireframe mode is active. Definition at line 321 of file vk.hpp.
References useWireFrame.
|
virtual |
Initialise all Vulkan objects (overridable).
Definition at line 60 of file vk.cpp.
References commandPool, createCommandBuffers(), createCommandPool(), createDepthResources(), createDescriptorPool(), createDescriptorSetLayout(), createDescriptorSets(), createFramebuffers(), createGraphicsPipeline(), createImageViews(), createInstance(), createLogicalDevice(), createRenderPass(), createSurface(), createSwapChain(), createSyncObjects(), createTextDescriptorPool(), createTextDescriptorSetLayout(), createTextPipeline(), createTextureImageView(), createTextureSampler(), createUniformBuffers(), createVertexBuffer(), device, font, font_size, graphicsQueue, physicalDevice, pickPhysicalDevice(), setupTextureImage(), textDescriptorSetLayout, textRenderer, and util.
| void mx::VKWindow::initWindow | ( | const std::string & | title, |
| int | width, | ||
| int | height, | ||
| bool | full = false ) |
|
protected |
Check whether a physical device meets all application requirements.
| device | Candidate physical device. |
true if the device is suitable. Definition at line 134 of file vk.cpp.
References device, findQueueFamilies(), mx::SwapChainSupportDetails::formats, mx::QueueFamilyIndices::isComplete(), mx::SwapChainSupportDetails::presentModes, and querySwapChainSupport().
Referenced by pickPhysicalDevice().
| void mx::VKWindow::loop | ( | ) |
|
inlinevirtual |
Called when the window is resized (optional override).
Definition at line 201 of file vk.hpp.
Referenced by recreateSwapChain().
References VKWindow().
References VKWindow().
|
protected |
Enumerate GPUs and select the most suitable physical device.
Definition at line 391 of file vk.cpp.
References instance, isDeviceSuitable(), and physicalDevice.
Referenced by initVulkan().
| void mx::VKWindow::printText | ( | const std::string & | text, |
| int | x, | ||
| int | y, | ||
| const SDL_Color & | col ) |
Queue a text string for rendering at a screen position.
| text | String to display. |
| x | X position in pixels. |
| y | Y position in pixels. |
| col | Text colour. |
Definition at line 2080 of file vk.cpp.
References textRenderer.
|
virtual |
|
protected |
Query swapchain support details for a physical device.
| device | Physical device to query. |
Definition at line 371 of file vk.cpp.
References mx::SwapChainSupportDetails::capabilities, device, mx::SwapChainSupportDetails::formats, mx::SwapChainSupportDetails::presentModes, and surface.
Referenced by createSwapChain(), and isDeviceSuitable().
| void mx::VKWindow::quit | ( | ) |
|
protected |
Tear down and rebuild the swapchain and all dependent resources.
Definition at line 1798 of file vk.cpp.
References cleanupSwapChain(), createCommandBuffers(), createDepthResources(), createFramebuffers(), createGraphicsPipeline(), createImageViews(), createRenderPass(), createSpritePipeline(), createSwapChain(), createTextPipeline(), createVertexBuffer(), device, h, onResize(), renderPass, spriteDescriptorSetLayout, spritePipeline, spritePipelineLayout, sprites, w, and window.
Referenced by draw(), resizeWindow(), and setFullScreen().
| void mx::VKWindow::resizeWindow | ( | int | width, |
| int | height ) |
| void mx::VKWindow::setFont | ( | const std::string & | font, |
| const int | size = 24 ) |
Set the font used for printText().
| font | Path to the TTF font file. |
| size | Point size. |
Definition at line 35 of file vk.cpp.
References font, font_size, textRenderer, and util.
| void mx::VKWindow::setFullScreen | ( | const bool | full | ) |
| void mx::VKWindow::setPath | ( | const std::string & | path | ) |
|
protected |
Allocate a blank texture image of the given dimensions.
Definition at line 1075 of file vk.cpp.
References createImage(), device, h, height, textureImage, textureImageLayout, textureImageMemory, transitionImageLayout(), w, and width.
Referenced by initVulkan().
|
inline |
Enable or disable wireframe rendering.
| enable | true to draw in wireframe. |
Definition at line 319 of file vk.hpp.
References useWireFrame.
|
inlinevirtual |
|
protected |
Transition an image between two layouts using a pipeline barrier.
| image | Target image. |
| format | Image format (used for aspect flag selection). |
| oldLayout | Current layout. |
| newLayout | Desired layout. |
Definition at line 1026 of file vk.cpp.
References beginSingleTimeCommands(), and endSingleTimeCommands().
Referenced by createTextureImage(), mx::VKAbstractModel::loadModelTextures(), mx::VKAbstractModel::loadModelTexturesFromMTL(), setupTextureImage(), and updateTexture().
|
protected |
Write updated bindings into existing descriptor sets.
Definition at line 1313 of file vk.cpp.
References descriptorSets, device, swapChainImages, textureImageView, and textureSampler.
| void mx::VKWindow::updateTexture | ( | SDL_Surface * | newSurface | ) |
Replace the primary texture from an SDL_Surface.
| newSurface | Source surface (not consumed). |
Definition at line 96 of file vk.cpp.
References updateTexture().
Referenced by updateTexture().
| void mx::VKWindow::updateTexture | ( | void * | pixels, |
| VkDeviceSize | imageSize ) |
Replace the primary texture from a raw pixel buffer.
| pixels | Pointer to RGBA data. |
| imageSize | Size of the data in bytes. |
Definition at line 1092 of file vk.cpp.
References copyBufferToImage(), createBuffer(), device, height, textureImage, textureImageLayout, transitionImageLayout(), VK_CHECK_RESULT, and width.
|
friend |
Definition at line 147 of file vk.hpp.
References font, height, VKAbstractModel, and width.
Referenced by VKAbstractModel.
|
protected |
|
protected |
|
protected |
Per-frame command buffers.
Definition at line 363 of file vk.hpp.
Referenced by cleanupSwapChain(), createCommandBuffers(), and draw().
|
protected |
Command pool for graphics commands.
Definition at line 362 of file vk.hpp.
Referenced by beginSingleTimeCommands(), cleanup(), cleanupSwapChain(), copyBuffer(), createCommandBuffers(), createCommandPool(), createSprite(), createSprite(), createSprite(), endSingleTimeCommands(), getCommandPool(), and initVulkan().
|
protected |
|
protected |
Vulkan debug messenger (validation layers).
Definition at line 402 of file vk.hpp.
Referenced by cleanup(), and createInstance().
|
protected |
Format used for the depth buffer.
Definition at line 387 of file vk.hpp.
Referenced by createDepthResources(), and createRenderPass().
|
protected |
Depth/stencil image.
Definition at line 384 of file vk.hpp.
Referenced by cleanupSwapChain(), and createDepthResources().
|
protected |
Memory for the depth image.
Definition at line 385 of file vk.hpp.
Referenced by cleanupSwapChain(), and createDepthResources().
|
protected |
View into the depth image.
Definition at line 386 of file vk.hpp.
Referenced by cleanupSwapChain(), createDepthResources(), and createFramebuffers().
|
protected |
Main descriptor pool.
Definition at line 381 of file vk.hpp.
Referenced by cleanup(), createDescriptorPool(), and createDescriptorSets().
|
protected |
Main descriptor set layout.
Definition at line 342 of file vk.hpp.
Referenced by cleanup(), createDescriptorSetLayout(), createDescriptorSets(), createGraphicsPipeline(), and mx::VKAbstractModel::createModelDescriptorSets().
|
protected |
Per-frame descriptor sets.
Definition at line 382 of file vk.hpp.
Referenced by createDescriptorSets(), and updateDescriptorSets().
|
protected |
Logical device.
Definition at line 339 of file vk.hpp.
Referenced by beginSingleTimeCommands(), cleanup(), cleanupSwapChain(), copyBuffer(), createBuffer(), createCommandBuffers(), createCommandPool(), createDescriptorPool(), createDescriptorSetLayout(), createDescriptorSets(), createFramebuffers(), createGraphicsPipeline(), createImage(), createImageView(), createImageViews(), createLogicalDevice(), createRenderPass(), createShaderModule(), createSprite(), createSprite(), createSprite(), createSpriteDescriptorPool(), createSpriteDescriptorSetLayout(), createSpritePipeline(), createSwapChain(), createSyncObjects(), createTextDescriptorPool(), createTextDescriptorSetLayout(), createTextPipeline(), createTextureImage(), createTextureSampler(), createUniformBuffers(), createVertexBuffer(), draw(), endSingleTimeCommands(), findQueueFamilies(), getDevice(), initVulkan(), isDeviceSuitable(), querySwapChainSupport(), recreateSwapChain(), resizeWindow(), setFullScreen(), setupTextureImage(), updateDescriptorSets(), and updateTexture().
|
protected |
Enable Vulkan validation layers.
Definition at line 333 of file vk.hpp.
Referenced by cleanup(), createInstance(), and VKWindow().
|
protected |
Path to the current TTF font.
Definition at line 334 of file vk.hpp.
Referenced by initVulkan(), setFont(), and VKAbstractModel.
|
protected |
Current font point size.
Definition at line 335 of file vk.hpp.
Referenced by initVulkan(), and setFont().
|
protected |
Filled-polygon graphics pipeline.
Definition at line 355 of file vk.hpp.
Referenced by cleanupSwapChain(), and createGraphicsPipeline().
|
protected |
3-D matrix-enabled graphics pipeline.
Definition at line 356 of file vk.hpp.
Referenced by cleanupSwapChain(), and createGraphicsPipeline().
|
protected |
Graphics submission queue.
Definition at line 340 of file vk.hpp.
Referenced by copyBuffer(), createLogicalDevice(), createSprite(), createSprite(), createSprite(), draw(), endSingleTimeCommands(), getGraphicsQueue(), and initVulkan().
| int mx::VKWindow::h = 0 |
Current window height.
Definition at line 220 of file vk.hpp.
Referenced by chooseSwapExtent(), createSwapChain(), getHeight(), initWindow(), recreateSwapChain(), resizeWindow(), setFullScreen(), and setupTextureImage().
|
protected |
Internal width/height tracking.
Definition at line 403 of file vk.hpp.
Referenced by copyBufferToImage(), createImage(), createSprite(), createTextureImage(), getTextDimensions(), initWindow(), resizeWindow(), setupTextureImage(), updateTexture(), VKAbstractModel, VKWindow(), and VKWindow().
|
protected |
Signals when a swapchain image is acquired.
Definition at line 365 of file vk.hpp.
Referenced by cleanup(), createSyncObjects(), and draw().
|
protected |
Full-screen quad index buffer.
Definition at line 371 of file vk.hpp.
Referenced by cleanup(), and createVertexBuffer().
|
protected |
Memory for the index buffer.
Definition at line 372 of file vk.hpp.
Referenced by cleanup(), and createVertexBuffer().
|
protected |
Number of indices in the quad.
Definition at line 373 of file vk.hpp.
Referenced by createVertexBuffer().
|
protected |
CPU–GPU frame synchronisation fence.
Definition at line 367 of file vk.hpp.
Referenced by cleanup(), and createSyncObjects().
|
protected |
Whether joystick/controller input is enabled.
Definition at line 332 of file vk.hpp.
Referenced by cleanup(), controllerInputEnabled(), and enableControllerInput().
|
protected |
Vulkan instance.
Definition at line 336 of file vk.hpp.
Referenced by cleanup(), createDescriptorPool(), createDescriptorSets(), createInstance(), createSurface(), and pickPhysicalDevice().
|
protected |
Selected GPU.
Definition at line 338 of file vk.hpp.
Referenced by createCommandPool(), createLogicalDevice(), createSprite(), createSprite(), createSprite(), createSwapChain(), findMemoryType(), findSupportedFormat(), getPhysicalDevice(), initVulkan(), and pickPhysicalDevice().
|
protected |
Pipeline layout for the main pass.
Definition at line 354 of file vk.hpp.
Referenced by cleanup(), cleanupSwapChain(), createGraphicsPipeline(), and mx::VKAbstractModel::createModelPipeline().
|
protected |
Presentation queue.
Definition at line 341 of file vk.hpp.
Referenced by createLogicalDevice(), and draw().
|
protected |
Signals when rendering is complete.
Definition at line 366 of file vk.hpp.
Referenced by cleanup(), createSyncObjects(), and draw().
|
protected |
Main render pass.
Definition at line 353 of file vk.hpp.
Referenced by cleanupSwapChain(), createFramebuffers(), createGraphicsPipeline(), mx::VKAbstractModel::createModelPipeline(), createRenderPass(), createSprite(), createSprite(), createSprite(), createSpritePipeline(), createTextPipeline(), draw(), and recreateSwapChain().
|
protected |
Descriptor pool for sprites.
Definition at line 400 of file vk.hpp.
Referenced by cleanup(), and createSpriteDescriptorPool().
|
protected |
Descriptor layout for sprites.
Definition at line 401 of file vk.hpp.
Referenced by cleanup(), createSprite(), createSprite(), createSprite(), createSpriteDescriptorSetLayout(), createSpritePipeline(), and recreateSwapChain().
|
protected |
Pipeline for sprite rendering.
Definition at line 398 of file vk.hpp.
Referenced by cleanup(), createSprite(), createSprite(), createSprite(), createSpritePipeline(), draw(), and recreateSwapChain().
|
protected |
Pipeline layout for sprites.
Definition at line 399 of file vk.hpp.
Referenced by cleanup(), createSpritePipeline(), draw(), and recreateSwapChain().
|
protected |
Owned sprite instances.
Definition at line 397 of file vk.hpp.
Referenced by cleanup(), createSprite(), createSprite(), createSprite(), draw(), and recreateSwapChain().
|
protected |
Whether the device supports wireframe.
Definition at line 359 of file vk.hpp.
Referenced by createGraphicsPipeline(), and createLogicalDevice().
|
protected |
Window surface.
Definition at line 337 of file vk.hpp.
Referenced by cleanup(), createSprite(), createSurface(), createSwapChain(), createTextureImage(), findQueueFamilies(), and querySwapChainSupport().
|
protected |
|
protected |
Active swapchain.
Definition at line 344 of file vk.hpp.
Referenced by cleanupSwapChain(), createSwapChain(), and draw().
|
protected |
Swapchain pixel dimensions.
Definition at line 347 of file vk.hpp.
Referenced by createDepthResources(), createFramebuffers(), createGraphicsPipeline(), createSwapChain(), createTextPipeline(), and draw().
|
protected |
Framebuffers for each swapchain image.
Definition at line 360 of file vk.hpp.
Referenced by cleanupSwapChain(), createCommandBuffers(), createFramebuffers(), and draw().
|
protected |
Colour format of swapchain images.
Definition at line 346 of file vk.hpp.
Referenced by createImageViews(), createRenderPass(), and createSwapChain().
|
protected |
Swapchain image handles.
Definition at line 345 of file vk.hpp.
Referenced by createDescriptorPool(), createDescriptorSets(), createImageViews(), mx::VKAbstractModel::createModelDescriptorPool(), mx::VKAbstractModel::createModelDescriptorSets(), createSwapChain(), createTextDescriptorPool(), createUniformBuffers(), mx::VKAbstractModel::load(), mx::VKAbstractModel::loadInstance(), mx::VKAbstractModel::resize(), and updateDescriptorSets().
|
protected |
Image views into swapchain images.
Definition at line 348 of file vk.hpp.
Referenced by cleanupSwapChain(), createFramebuffers(), and createImageViews().
|
protected |
Descriptor pool for text.
Definition at line 394 of file vk.hpp.
Referenced by cleanup(), and createTextDescriptorPool().
|
protected |
Descriptor layout for text.
Definition at line 395 of file vk.hpp.
Referenced by cleanup(), createTextDescriptorSetLayout(), createTextPipeline(), and initVulkan().
|
protected |
Pipeline for text rendering.
Definition at line 392 of file vk.hpp.
Referenced by cleanup(), createTextPipeline(), and draw().
|
protected |
Pipeline layout for text rendering.
Definition at line 393 of file vk.hpp.
Referenced by cleanup(), createTextPipeline(), and draw().
|
protected |
Text rendering subsystem.
Definition at line 391 of file vk.hpp.
Referenced by cleanup(), clearTextQueue(), draw(), getTextDimensions(), initVulkan(), printText(), and setFont().
|
protected |
Primary texture image.
Definition at line 375 of file vk.hpp.
Referenced by cleanup(), createTextureImage(), createTextureImageView(), setupTextureImage(), and updateTexture().
|
protected |
Current layout of the primary texture.
Definition at line 378 of file vk.hpp.
Referenced by createTextureImage(), setupTextureImage(), and updateTexture().
|
protected |
Memory for the primary texture.
Definition at line 376 of file vk.hpp.
Referenced by cleanup(), createTextureImage(), and setupTextureImage().
|
protected |
View into the primary texture.
Definition at line 377 of file vk.hpp.
Referenced by cleanup(), createDescriptorSets(), createTextureImage(), createTextureImageView(), and updateDescriptorSets().
|
protected |
Sampler for the primary texture.
Definition at line 379 of file vk.hpp.
Referenced by cleanup(), createDescriptorSets(), mx::VKAbstractModel::createModelDescriptorSets(), createTextureSampler(), and updateDescriptorSets().
|
protected |
Per-frame uniform buffers.
Definition at line 349 of file vk.hpp.
Referenced by cleanup(), createDescriptorSets(), and createUniformBuffers().
|
protected |
Persistently mapped UBO pointers.
Definition at line 351 of file vk.hpp.
Referenced by cleanup(), and createUniformBuffers().
|
protected |
Memory for per-frame UBOs.
Definition at line 350 of file vk.hpp.
Referenced by cleanup(), and createUniformBuffers().
|
protected |
Wireframe rendering toggle.
Definition at line 358 of file vk.hpp.
Referenced by getWireFrame(), and setWireFrame().
| mxUtil mx::VKWindow::util |
Asset path and utility helpers.
Definition at line 221 of file vk.hpp.
Referenced by createGraphicsPipeline(), createSpritePipeline(), createTextPipeline(), initVulkan(), setFont(), and setPath().
|
protected |
Full-screen quad vertex buffer.
Definition at line 369 of file vk.hpp.
Referenced by cleanup(), and createVertexBuffer().
|
protected |
Memory for the vertex buffer.
Definition at line 370 of file vk.hpp.
Referenced by cleanup(), and createVertexBuffer().
| int mx::VKWindow::w = 0 |
Current window width.
Definition at line 219 of file vk.hpp.
Referenced by chooseSwapExtent(), createSwapChain(), getWidth(), initWindow(), recreateSwapChain(), resizeWindow(), setFullScreen(), and setupTextureImage().
|
protected |
Definition at line 403 of file vk.hpp.
Referenced by copyBufferToImage(), createImage(), createSprite(), createTextureImage(), getTextDimensions(), initWindow(), resizeWindow(), setupTextureImage(), updateTexture(), VKAbstractModel, VKWindow(), and VKWindow().
|
protected |
SDL window handle.
Definition at line 418 of file vk.hpp.
Referenced by cleanup(), createInstance(), createSurface(), initWindow(), recreateSwapChain(), resizeWindow(), and setFullScreen().