Public Types | |
| enum class | PresentModePreference { LowLatency , Vsync } |
Public Member Functions | |
| VK_Sprite * | attachPostProcessingShader (const std::string &fragmentShaderPath, float p1=0.0f, float p2=0.0f, float p3=0.0f, float p4=0.0f) |
| Attach a full-screen post-processing fragment shader. | |
| std::vector< VK_Sprite * > | attachPostProcessingShaders (const std::vector< PostProcessingEffect > &effects) |
| void | clearTextQueue () |
| Clear all queued text draw calls for the current frame. | |
| VulkanContext | context () const |
| VK_Sprite * | createSprite (const std::string &pngPath, const std::string &vertexShaderPath="", const std::string &fragmentShaderPath="") |
| Create a sprite from a PNG file and register it with this window. | |
| VK_Sprite * | createSprite (int width, int height, const std::string &vertexShaderPath, const std::string &fragmentShaderPath, uint32_t spectrumBinCount, uint32_t spectrumHistoryLayerCount) |
| Create a blank sprite with live FFT and FFT-history descriptors. | |
| VK_Sprite * | createSprite (int width, int height, const std::string &vertexShaderPath="", const std::string &fragmentShaderPath="", uint32_t spectrumBinCount=0) |
| Create a blank sprite texture and register it with this window. | |
| VK_Sprite * | createSprite (SDL_Surface *surface, const std::string &vertexShaderPath="", const std::string &fragmentShaderPath="") |
| Create a sprite from an SDL surface and register it with this window. | |
| VK_Sprite3D * | createSprite3D (const std::string &pngPath, const std::string &vertexShaderPath="", const std::string &fragmentShaderPath="") |
| Create a world-space billboard sprite from a PNG file. | |
| VK_Sprite3D * | createSprite3D (SDL_Surface *surface, const std::string &vertexShaderPath="", const std::string &fragmentShaderPath="") |
| Create a world-space billboard sprite from an SDL surface. | |
| void | detachPostProcessingShader () |
| Detach the current post-processing shader and return to direct swapchain rendering. | |
| void | enablePostProcessing (VK_Sprite *sprite) |
| bool | ensureRenderResources () |
| Ensure deferred render resources are initialized. | |
| void | event (SDL_Event &e) override |
| Handle one SDL event. | |
| void | event (SDL_Event &e) override |
| Handle one SDL event. | |
| VkCommandPool | getCommandPool () const noexcept |
| Get the command pool used for graphics/upload work. | |
| VkFormat | getDepthFormat () const noexcept |
| Get the depth format used for dynamic rendering attachments. | |
| VkDevice | getDevice () const noexcept |
| Get the Vulkan logical device handle. | |
| VkQueue | getGraphicsQueue () const noexcept |
| Get the graphics queue handle. | |
| VkPhysicalDevice | getPhysicalDevice () const noexcept |
| Get the Vulkan physical device handle. | |
| VkPipelineCache | getPipelineCache () const noexcept |
| Get the persistent Vulkan pipeline cache used by framework pipelines. | |
| VkExtent2D | getRenderExtent () const noexcept |
| Get the active scene/post-processing extent. | |
| SDL_Window * | getSDLWindow () const noexcept |
| Get the underlying SDL window handle. | |
| VkExtent2D | getSwapchainExtent () const noexcept |
| Get the current swapchain extent. | |
| VkFormat | getSwapchainFormat () const noexcept |
| Get the swapchain color format. | |
| size_t | getSwapchainImageCount () const noexcept |
| Get the number of swapchain images currently allocated. | |
| bool | getTextDimensions (const std::string &text, int &width, int &height) |
| Measure text dimensions in pixels. | |
| bool | getTextDimensions (const std::string &text, int &width, int &height, const Font &font) |
| bool | getTextDimensions (const std::string &text, int &width, int &height, TTF_Font *font) |
| virtual bool | initVulkan (bool validiation) |
| Initialize Vulkan state. | |
| void | loop () |
| Run the main event/render loop. | |
| MasterPieceWindow (const std::string &path, int width, int height, bool fullscreen, bool enable_vsync) | |
| MasterPieceWindow (const std::string &path, int width, int height, bool fullscreen, bool enable_vsync, const FramebufferDimensions &framebuffer) | |
| virtual void | onPrepareFrameRendering (VkCommandBuffer cmd, uint32_t image_index) |
| Record resource transitions that must happen before dynamic rendering begins. | |
| void | printPreviewText (const std::string &text, int x, int y, const SDL_Color &col) |
| Queue preview-only text after frame readback. | |
| void | printPreviewText (const std::string &text, int x, int y, const SDL_Color &col, const Font &font) |
| void | printText (const std::string &text, int x, int y, const SDL_Color &col) |
| Queue a text string for rendering during the current frame. | |
| void | printText (const std::string &text, int x, int y, const SDL_Color &col, const Font &font) |
| void | printText (const std::string &text, int x, int y, const SDL_Color &col, TTF_Font *font) |
| void | proc () override |
| Execute one processing/update step. | |
| void | proc () override |
| Execute one processing/update step. | |
| void | release () |
| Release Vulkan and SDL resources. | |
| virtual void | render () |
| Render one frame. | |
| void | saveSnapshot (const std::string &path) |
| Save the most recently rendered window contents as a PNG file. | |
| bool | screenshotEnabled () const noexcept |
| Check whether F10 screenshot capture is enabled. | |
| void | setClearColor (float r, float g, float b, float a=1.0f) |
| Set the per-frame color attachment clear color. | |
| void | setEnableScreenshot (bool enabled) noexcept |
| Enable or disable F10 screenshot capture. | |
| void | setFont (const std::string &fontPath, int fontSize=24) |
| Set the active text-render font. | |
| void | setFrameReadbackEnabled (bool enabled) noexcept |
| Enable or disable readback of each rendered swapchain frame. | |
| void | setPostProcessingEnabled (bool enabled) |
| void | setPostProcessingShaderParams (float p1=0.0f, float p2=0.0f, float p3=0.0f, float p4=0.0f) |
| Set the post-processing shader params passed as a vec4 push constant. | |
| void | setPostProcessingShaderParams (size_t effectIndex, float p1=0.0f, float p2=0.0f, float p3=0.0f, float p4=0.0f) |
| void | setPostProcessingShaderTimeEnabled (bool enabled) |
| Keep shader param 1 updated with elapsed render time in seconds. | |
| void | setPostProcessingShaderTimeEnabled (size_t effectIndex, bool enabled) |
| void | setPostProcessingTextureConsumerEnabled (bool enabled) noexcept |
| Route the completed effect chain to a derived renderer as a sampled texture. | |
| void | setPreviewFont (const std::string &fontPath, int fontSize=24) |
| Set the preview-only HUD font independently of output text. | |
| void | setRenderExtent (uint32_t width, uint32_t height) |
| Render post-processing at a fixed extent independent of the preview window. | |
| void | showCursor (bool on) |
| void | trimMemory () |
| Return transient Vulkan command-pool allocations to the driver when supported. | |
| bool | validationEnabled () const |
| Check whether Vulkan validation layers are currently enabled. | |
| ~MasterPieceWindow () override | |
| ~MasterPieceWindow () override | |
Static Public Member Functions | |
| static VkBool32 | debugCallback (VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT type, const VkDebugUtilsMessengerCallbackDataEXT *callback_data, void *user_data) |
Protected Member Functions | |
| void | captureSnapshotPixels (std::vector< std::uint8_t > &rgba_pixels, uint32_t &width, uint32_t &height) |
| Capture the most recently presented swapchain image as tightly packed RGBA8 pixels. | |
| void | createDevice () |
| Create final device resources. | |
| void | createLogicalDevice () |
| Create a logical Vulkan device from the selected physical device. | |
| void | destroyFrameReadbackResources () |
| void | dispatchFrameReadback (FrameReadbackSlot &slot) |
| void | ensureFrameReadbackResources () |
| void | exit () |
| Request loop termination. | |
| void | flushFrameReadbacks () |
| Wait for and deliver all pending pipelined frame readbacks. | |
| bool | initWindow (const std::string &title, int width, int height, SDL_WindowFlags flags) |
| Initialize SDL window resources. | |
| virtual void | onConfigureDepthStencilAttachments (VkRenderingAttachmentInfo &depth_attachment, VkRenderingAttachmentInfo &stencil_attachment, uint32_t image_index) |
| Allow derived classes to customize depth/stencil attachments for the main dynamic rendering pass. | |
| virtual void | onFrameReadback (std::vector< std::uint8_t > &rgba_pixels, uint32_t width, uint32_t height) |
| Receive one tightly packed RGBA8 copy of the rendered frame. | |
| virtual void | onFrameReadbackScheduled () |
| Called after a presented frame has scheduled a readback. | |
| virtual void | onRecordCustomRendering (VkCommandBuffer cmd, uint32_t image_index) |
| Optional hook for derived classes to record extra draw commands. | |
| virtual void | onRecordPostProcessingTexture (VkCommandBuffer cmd, uint32_t image_index, VkImageView texture_view, VkExtent2D texture_extent) |
| Render a completed post-processing chain as custom scene input. | |
| virtual void | onSwapchainAboutToRecreate () |
| Called right before swapchain-dependent resources are recreated. | |
| virtual void | onSwapchainRecreated () |
| Called after swapchain and render resources are recreated. | |
| void | pickDevice () |
| Pick a suitable Vulkan physical device. | |
| void | renderStandaloneSprite (VK_Sprite &sprite, VkCommandBuffer cmd) |
| Render one standalone sprite using the window's shared sprite pipeline. | |
| void | renderStandaloneSprite (VK_Sprite &sprite, VkCommandBuffer cmd, VkExtent2D extent) |
Static Protected Member Functions | |
| static VkShaderModule | createShaderModule (VkDevice device, const std::vector< char > &spv_bytes) |
| Create a shader module from SPIR-V bytecode. | |
| static std::vector< char > | loadSpv (const std::string &path) |
| Load a SPIR-V file from disk. | |
Protected Attributes | |
| bool | active = false |
| VkClearColorValue | clear_color {{0.0f, 0.0f, 0.0f, 1.0f}} |
| std::vector< VkCommandBuffer > | command_buffers {} |
| VkCommandPool | command_pool = VK_NULL_HANDLE |
| uint32_t | current_frame = 0 |
| VkDebugUtilsMessengerEXT | debug_messenger = VK_NULL_HANDLE |
| VkFormat | depth_format = VK_FORMAT_UNDEFINED |
| std::vector< bool > | depth_image_initialized {} |
| std::vector< VkDeviceMemory > | depth_image_memories {} |
| std::vector< VkImageView > | depth_image_views {} |
| std::vector< VkImage > | depth_images {} |
| VkDevice | device = VK_NULL_HANDLE |
| bool | font_configured = false |
| std::string | font_path {} |
| int | font_size = 24 |
| bool | force_swapchain_recreate = false |
| bool | fps_counter_enabled = false |
| Font | fps_counter_font {} |
| bool | fps_counter_font_ready = false |
| uint32_t | fps_counter_frame_count = 0 |
| std::chrono::steady_clock::time_point | fps_counter_sample_time {} |
| std::string | fps_counter_text = "FPS: --" |
| bool | frame_readback_enabled = false |
| std::array< FrameReadbackSlot, max_frames_in_flight > | frame_readback_slots {} |
| bool | framebuffer_resized = false |
| VkQueue | graphics_queue = VK_NULL_HANDLE |
| uint32_t | graphics_queue_family = invalid_queue_index |
| std::array< VkSemaphore, max_frames_in_flight > | image_available {} |
| std::vector< VkFence > | image_fences {} |
| std::array< VkFence, max_frames_in_flight > | in_flight_fences {} |
| VkInstance | instance = VK_NULL_HANDLE |
| std::chrono::steady_clock::time_point | last_memory_trim_time = std::chrono::steady_clock::now() |
| uint32_t | last_presented_image_index = invalid_queue_index |
| uint64_t | last_resize_event_ms = 0 |
| uint32_t | latest_frame_readback_height = 0 |
| std::vector< std::uint8_t > | latest_frame_readback_rgba {} |
| uint32_t | latest_frame_readback_width = 0 |
| VK_Sprite * | owned_post_process_sprite = nullptr |
| std::vector< VK_Sprite * > | owned_post_process_sprites {} |
| VkPhysicalDevice | physical_device = VK_NULL_HANDLE |
| VkPipelineCache | pipeline_cache = VK_NULL_HANDLE |
| VK_Sprite * | post_process_composite_sprite = nullptr |
| std::vector< std::array< float, 4 > > | post_process_effect_params {} |
| std::vector< ShaderStage > | post_process_effect_stages {} |
| std::vector< std::chrono::steady_clock::time_point > | post_process_effect_start_times {} |
| std::vector< bool > | post_process_effect_time_enabled {} |
| bool | post_process_enabled = true |
| std::vector< std::vector< VkImage > > | post_process_images {} |
| std::vector< std::vector< bool > > | post_process_initialized {} |
| std::vector< std::vector< VkDeviceMemory > > | post_process_memories {} |
| std::array< float, 4 > | post_process_params {} |
| VK_Sprite * | post_process_present_sprite = nullptr |
| VK_Sprite * | post_process_sprite = nullptr |
| std::vector< VK_Sprite * > | post_process_sprites {} |
| std::chrono::steady_clock::time_point | post_process_start_time = std::chrono::steady_clock::now() |
| bool | post_process_texture_consumer_enabled = false |
| bool | post_process_time_enabled = false |
| std::vector< std::vector< VkImageView > > | post_process_views {} |
| PresentModePreference | present_mode_preference = PresentModePreference::LowLatency |
| VkQueue | present_queue = VK_NULL_HANDLE |
| uint32_t | present_queue_family = invalid_queue_index |
| bool | preview_text_queued = false |
| std::unique_ptr< VK_Text > | preview_text_renderer {} |
| VkExtent2D | render_extent_override {} |
| std::vector< VkSemaphore > | render_finished {} |
| std::vector< VkSwapchainKHR > | retired_swapchains |
| bool | screenshot_enabled = defaultEnableScreenshot() |
| uint32_t | screenshot_index = 0 |
| std::string | screenshot_prefix = defaultExecutableName() |
| std::condition_variable | screenshot_queue_cv |
| std::mutex | screenshot_queue_mutex |
| std::deque< ScreenshotSaveTask > | screenshot_save_queue |
| std::thread | screenshot_worker |
| bool | screenshot_worker_stop = false |
| bool | sdl_initialized = false |
| VkDescriptorSetLayout | sprite_descriptor_set_layout = VK_NULL_HANDLE |
| VkPipeline | sprite_pipeline = VK_NULL_HANDLE |
| VkPipelineLayout | sprite_pipeline_layout = VK_NULL_HANDLE |
| bool | sprite_state_dirty = false |
| std::vector< std::unique_ptr< VK_Sprite > > | sprites {} |
| std::vector< std::unique_ptr< VK_Sprite3D > > | sprites3d {} |
| VkSurfaceKHR | surface = VK_NULL_HANDLE |
| VkSwapchainKHR | swapchain = VK_NULL_HANDLE |
| VkExtent2D | swapchain_extent {} |
| VkFormat | swapchain_format = VK_FORMAT_UNDEFINED |
| std::vector< bool > | swapchain_image_initialized {} |
| std::vector< VkImageView > | swapchain_image_views {} |
| std::vector< VkImage > | swapchain_images {} |
| bool | swapchain_supports_transfer_src = false |
| VkDescriptorSetLayout | text_descriptor_set_layout = VK_NULL_HANDLE |
| VkPipeline | text_pipeline = VK_NULL_HANDLE |
| VkPipelineLayout | text_pipeline_layout = VK_NULL_HANDLE |
| std::unique_ptr< VK_Text > | text_renderer {} |
| bool | text_state_dirty = false |
| bool | validation_enabled = false |
| bool | vulkan_library_loaded = false |
| std::unique_ptr< SDL_Window, SDLWindowDeleter > | window {} |
Static Protected Attributes | |
| static constexpr std::chrono::seconds | MEMORY_TRIM_INTERVAL {30} |
| static constexpr VkFormat | post_process_compute_format |
| static constexpr uint64_t | resize_settle_delay_ms = 150 |
|
stronginherited |
|
inline |
Definition at line 300 of file main.cpp.
|
inlineoverride |
|
inline |
Definition at line 247 of file main.cpp.
|
inlineoverride |
|
inherited |
Attach a full-screen post-processing fragment shader.
The window renders the normal scene into an offscreen color target, then draws that target through the supplied sprite-compatible fragment shader into the swapchain. Shader params are passed through the existing sprite push-constant vec4.
| fragmentShaderPath | Post-process fragment shader SPIR-V path. |
| p1 | First shader parameter. |
| p2 | Second shader parameter. |
| p3 | Third shader parameter. |
| p4 | Fourth shader parameter. |
Definition at line 1499 of file mxvk.cpp.
|
inherited |
Definition at line 1504 of file mxvk.cpp.
|
protectedinherited |
Capture the most recently presented swapchain image as tightly packed RGBA8 pixels.
This performs a synchronous GPU readback and may briefly stall rendering.
Definition at line 827 of file mxvk.cpp.
|
inherited |
Clear all queued text draw calls for the current frame.
Definition at line 4096 of file mxvk.cpp.
|
inherited |
Definition at line 59 of file mxvk.cpp.
|
protectedinherited |
Create final device resources.
Definition at line 2086 of file mxvk.cpp.
|
protectedinherited |
Create a logical Vulkan device from the selected physical device.
Definition at line 1955 of file mxvk.cpp.
|
staticprotectedinherited |
Create a shader module from SPIR-V bytecode.
| device | Logical Vulkan device used to create the module. |
| spv_bytes | SPIR-V bytecode payload. |
| mxvk::Exception | when inputs are invalid or module creation fails. |
Definition at line 145 of file mxvk.cpp.
|
inherited |
Create a sprite from a PNG file and register it with this window.
| pngPath | Path to the PNG file. |
| vertexShaderPath | Optional custom vertex shader SPIR-V path. |
| fragmentShaderPath | Optional custom fragment shader SPIR-V path. |
Definition at line 4608 of file mxvk.cpp.
|
inherited |
Create a blank sprite with live FFT and FFT-history descriptors.
| width | Texture width in pixels. |
| height | Texture height in pixels. |
| vertexShaderPath | Optional custom vertex shader SPIR-V path. |
| fragmentShaderPath | Optional custom fragment shader SPIR-V path. |
| spectrumBinCount | Binding-3 1-D spectrum size. |
| spectrumHistoryLayerCount | Requested binding-4 history depth. |
Definition at line 4685 of file mxvk.cpp.
|
inherited |
Create a blank sprite texture and register it with this window.
| width | Texture width in pixels. |
| height | Texture height in pixels. |
| vertexShaderPath | Optional custom vertex shader SPIR-V path. |
| fragmentShaderPath | Optional custom fragment shader SPIR-V path. |
| spectrumBinCount | Optional binding-3 1-D spectrum size to create before the pipeline. |
Definition at line 4680 of file mxvk.cpp.
|
inherited |
Create a sprite from an SDL surface and register it with this window.
| surface | Source surface pointer. |
| vertexShaderPath | Optional custom vertex shader SPIR-V path. |
| fragmentShaderPath | Optional custom fragment shader SPIR-V path. |
Definition at line 4641 of file mxvk.cpp.
|
inherited |
Create a world-space billboard sprite from a PNG file.
| pngPath | Path to the PNG file. |
| vertexShaderPath | Optional custom vertex shader SPIR-V path. |
| fragmentShaderPath | Optional custom fragment shader SPIR-V path. |
Definition at line 4735 of file mxvk.cpp.
|
inherited |
Create a world-space billboard sprite from an SDL surface.
| surface | Source surface pointer. |
| vertexShaderPath | Optional custom vertex shader SPIR-V path. |
| fragmentShaderPath | Optional custom fragment shader SPIR-V path. |
Definition at line 4761 of file mxvk.cpp.
|
staticinherited |
Definition at line 44 of file mxvk.cpp.
|
protectedinherited |
Definition at line 1301 of file mxvk.cpp.
|
inherited |
Detach the current post-processing shader and return to direct swapchain rendering.
Definition at line 1592 of file mxvk.cpp.
|
protectedinherited |
Definition at line 1122 of file mxvk.cpp.
|
inherited |
Definition at line 1668 of file mxvk.cpp.
|
protectedinherited |
Definition at line 1183 of file mxvk.cpp.
|
inherited |
Ensure deferred render resources are initialized.
Definition at line 1847 of file mxvk.cpp.
|
inlineoverridevirtual |
Handle one SDL event.
| e | SDL event to process. |
Reimplemented from mxvk::VK_Window.
Definition at line 325 of file main.cpp.
|
inlineoverridevirtual |
Handle one SDL event.
| e | SDL event to process. |
Reimplemented from mxvk::VK_Window.
Definition at line 269 of file main.cpp.
|
protectedinherited |
Request loop termination.
|
protectedinherited |
Wait for and deliver all pending pipelined frame readbacks.
Derived recorders should call this before closing their output writer.
Definition at line 1159 of file mxvk.cpp.
|
inlinenodiscardnoexceptinherited |
|
inlinenodiscardnoexceptinherited |
|
inlinenodiscardnoexceptinherited |
|
inlinenodiscardnoexceptinherited |
|
inlinenodiscardnoexceptinherited |
|
inlinenodiscardnoexceptinherited |
|
nodiscardnoexceptinherited |
Get the active scene/post-processing extent.
Definition at line 1492 of file mxvk.cpp.
|
inlinenodiscardnoexceptinherited |
Get the underlying SDL window handle.
Definition at line 189 of file mxvk.hpp.
|
inlinenodiscardnoexceptinherited |
|
inlinenodiscardnoexceptinherited |
|
inlinenodiscardnoexceptinherited |
|
nodiscardinherited |
Measure text dimensions in pixels.
| text | Text string to measure. |
| width | Output width in pixels. |
| height | Output height in pixels. |
Definition at line 4142 of file mxvk.cpp.
|
nodiscardinherited |
|
nodiscardinherited |
|
virtualinherited |
Initialize Vulkan state.
| validiation | Enables validation-related behavior when true. |
Definition at line 334 of file mxvk.cpp.
|
protectedinherited |
Initialize SDL window resources.
| title | Window title string. |
| width | Window width in pixels. |
| height | Window height in pixels. |
| flags | Additional SDL window creation flags. |
Definition at line 1348 of file mxvk.cpp.
|
staticprotectedinherited |
Load a SPIR-V file from disk.
| path | Absolute or relative path to a .spv file. |
| mxvk::Exception | when the file cannot be opened, is empty, or is not 4-byte aligned. |
|
inherited |
Run the main event/render loop.
Definition at line 627 of file mxvk.cpp.
|
protectedvirtualinherited |
Allow derived classes to customize depth/stencil attachments for the main dynamic rendering pass.
Override this when custom rendering needs hardware stencil testing or a custom depth/stencil image. The callback is invoked immediately before vkCmdBeginRendering.
Reimplemented in example::StencilWindow.
Definition at line 1447 of file mxvk.cpp.
|
protectedvirtualinherited |
|
protectedvirtualinherited |
Called after a presented frame has scheduled a readback.
Derived classes can use this hook to queue frame-specific metadata that must remain associated with the later onFrameReadback() callback.
Definition at line 1119 of file mxvk.cpp.
|
virtualinherited |
Record resource transitions that must happen before dynamic rendering begins.
This callback is invoked after the command buffer begins recording and before vkCmdBeginRendering. Override this for resources that need per-frame image transitions or uploads before they are sampled by custom rendering.
| cmd | Active command buffer in recording state, outside a rendering scope. |
| image_index | Current swapchain image index. |
Reimplemented in defender::DefenderWindow, example::StencilWindow, and example::WaterWindow.
Definition at line 1437 of file mxvk.cpp.
|
protectedvirtualinherited |
Optional hook for derived classes to record extra draw commands.
This callback is invoked inside the dynamic-rendering scope started by the window, after viewport/scissor are configured and before rendering ends.
| cmd | Active command buffer in recording state. |
| image_index | Current swapchain image index. |
Reimplemented in anonymous_namespace{breakout.cpp}::BreakoutWindow, anonymous_namespace{pong.cpp}::PongWindow, anonymous_namespace{puzzle_drop.cpp}::PuzzleDropWindow, anonymous_namespace{tetris.cpp}::TetrisWindow, ComputeWindow, defender::DefenderWindow, demo::PoolWindow, example::BinaryMatrixWindow, example::DarkWindow, example::ExampleWindow, example::ExampleWindow, example::ExampleWindow, example::FireworksWindow, example::FractalWindow, example::GlitchCubeWindow, example::ModelWindow, example::ModelWindow, example::MoonWindow, example::OpenCVModelWindow, example::PlanetWindow, example::PointSpriteWindow, example::StarfieldWindow, example::StarshipWindow, example::StaticWindow, example::StencilWindow, example::WaterWindow, space::Asteroids3DWindow, space::Asteroids3DWindow, viewer::ModelViewerWindow, walk::WalkWindow, and walk::WalkWindow.
Definition at line 1439 of file mxvk.cpp.
|
protectedvirtualinherited |
|
protectedvirtualinherited |
Called right before swapchain-dependent resources are recreated.
Derived classes can release swapchain-dependent resources here.
Reimplemented in anonymous_namespace{pong.cpp}::PongWindow, example::ExampleWindow, example::FractalWindow, example::PlanetWindow, example::StaticWindow, example::StencilWindow, and example::WaterWindow.
Definition at line 1433 of file mxvk.cpp.
|
protectedvirtualinherited |
Called after swapchain and render resources are recreated.
Derived classes can rebuild swapchain-dependent resources here.
Reimplemented in anonymous_namespace{breakout.cpp}::BreakoutWindow, anonymous_namespace{pong.cpp}::PongWindow, anonymous_namespace{puzzle_drop.cpp}::PuzzleDropWindow, anonymous_namespace{tetris.cpp}::TetrisWindow, ComputeWindow, defender::DefenderWindow, demo::PoolWindow, example::BinaryMatrixWindow, example::DarkWindow, example::ExampleWindow, example::ExampleWindow, example::ExampleWindow, example::FireworksWindow, example::FractalWindow, example::GlitchCubeWindow, example::MatrixWindow, example::ModelWindow, example::ModelWindow, example::MoonWindow, example::OpenCVModelWindow, example::PlanetWindow, example::PointSpriteWindow, example::StarfieldWindow, example::StarshipWindow, space::Asteroids3DWindow, space::Asteroids3DWindow, surface::SurfaceWindow, surface::SurfaceWindow, viewer::ModelViewerWindow, walk::WalkWindow, and walk::WalkWindow.
Definition at line 1435 of file mxvk.cpp.
|
protectedinherited |
Pick a suitable Vulkan physical device.
Definition at line 1868 of file mxvk.cpp.
|
inherited |
Queue preview-only text after frame readback.
Unlike printText(), this text is visible in the presentation window but excluded from screenshots and frame-readback consumers.
Definition at line 4106 of file mxvk.cpp.
|
inherited |
Definition at line 4124 of file mxvk.cpp.
|
inherited |
Queue a text string for rendering during the current frame.
| text | UTF-8 text. |
| x | Pixel X coordinate. |
| y | Pixel Y coordinate. |
| col | Text color. |
Definition at line 4051 of file mxvk.cpp.
|
inherited |
Definition at line 4080 of file mxvk.cpp.
|
inherited |
Definition at line 4064 of file mxvk.cpp.
|
inlineoverridevirtual |
Execute one processing/update step.
Reimplemented from mxvk::VK_Window.
Definition at line 382 of file main.cpp.
|
inlineoverridevirtual |
Execute one processing/update step.
Reimplemented from mxvk::VK_Window.
Definition at line 326 of file main.cpp.
|
inherited |
Release Vulkan and SDL resources.
Safe to call multiple times.
Definition at line 218 of file mxvk.cpp.
|
virtualinherited |
Render one frame.
Reimplemented in example::FractalWindow, and viewer::ModelViewerWindow.
Definition at line 805 of file mxvk.cpp.
|
protectedinherited |
Render one standalone sprite using the window's shared sprite pipeline.
This is intended for derived classes that want to draw a sprite before or after their own scene content without registering it in the window-managed sprite list.
Definition at line 1451 of file mxvk.cpp.
|
protectedinherited |
Definition at line 1455 of file mxvk.cpp.
|
inherited |
Save the most recently rendered window contents as a PNG file.
| path | Destination PNG path. |
This performs a synchronous GPU readback and may briefly stall rendering.
Definition at line 809 of file mxvk.cpp.
|
inlinenodiscardnoexceptinherited |
|
inherited |
Set the per-frame color attachment clear color.
| r | Red channel [0, 1]. |
| g | Green channel [0, 1]. |
| b | Blue channel [0, 1]. |
| a | Alpha channel [0, 1]. |
Definition at line 613 of file mxvk.cpp.
|
noexceptinherited |
Enable or disable F10 screenshot capture.
|
inherited |
Set the active text-render font.
| fontPath | Path to a TTF font file. |
| fontSize | Font point size. |
Definition at line 4002 of file mxvk.cpp.
|
inlinenoexceptinherited |
Enable or disable readback of each rendered swapchain frame.
Readback is recorded while the swapchain image is acquired and delivered through onFrameReadback() after the corresponding frame-in-flight fence completes. Readbacks are pipelined so recording does not add a same-frame GPU wait.
Definition at line 186 of file mxvk.hpp.
|
inlineinherited |
Definition at line 339 of file mxvk.hpp.
|
inherited |
Set the post-processing shader params passed as a vec4 push constant.
Definition at line 1624 of file mxvk.cpp.
|
inherited |
Definition at line 1632 of file mxvk.cpp.
|
inherited |
Keep shader param 1 updated with elapsed render time in seconds.
Definition at line 1645 of file mxvk.cpp.
|
inherited |
Definition at line 1654 of file mxvk.cpp.
|
inlinenoexceptinherited |
Route the completed effect chain to a derived renderer as a sampled texture.
Definition at line 342 of file mxvk.hpp.
|
inherited |
Set the preview-only HUD font independently of output text.
Definition at line 4032 of file mxvk.cpp.
|
inherited |
Render post-processing at a fixed extent independent of the preview window.
The final source-sized image is read back before a fitted copy is presented to the swapchain. Pass zero dimensions to return to swapchain-sized rendering.
Definition at line 1468 of file mxvk.cpp.
|
inherited |
|
inherited |
Return transient Vulkan command-pool allocations to the driver when supported.
MXVK currently uses direct Vulkan memory allocations rather than VMA, so VMA defragmentation is not applicable. This hook schedules the available Vulkan memory maintenance operation and is safe to call during idle/loading points.
Definition at line 1330 of file mxvk.cpp.
|
nodiscardinherited |
Check whether Vulkan validation layers are currently enabled.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
staticconstexprprotectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
staticconstexprprotectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
staticconstexprprotectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |