MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk_sprite.hpp File Reference

Vulkan 2-D sprite renderer with optional custom shaders and instancing. More...

#include <volk/volk.h>
#include <SDL3/SDL.h>
#include "mxvk_exception.hpp"
#include <array>
#include <cstdlib>
#include <cstring>
#include <format>
#include <fstream>
#include <glm/glm.hpp>
#include <iostream>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Classes

class  mxvk::VK_Sprite

Namespaces

namespace  mxvk
 Utilities for loading and saving PNG images.

Macros

#define VK_CHECK_RESULT(f)

Detailed Description

Vulkan 2-D sprite renderer with optional custom shaders and instancing.

VKSprite manages a Vulkan texture, a screen-space quad, and an optional custom graphics pipeline. It supports:

  • Loading images from PNG files or SDL_Surface objects.
  • Drawing at arbitrary positions, scales, and rotations.
  • GPU instancing for large batches of identical sprites.
  • Extended UBO with mouse state and four custom vec4 uniforms.

Definition in file mxvk_sprite.hpp.

Macro Definition Documentation

◆ VK_CHECK_RESULT

#define VK_CHECK_RESULT ( f)
Value:
{ \
VkResult res = (f); \
if (res != VK_SUCCESS) { \
throw mxvk::Exception(std::format("Fatal : VkResult is \"{}\" in {} at line {}", static_cast<int>(res), __FILE__, __LINE__)); \
} \
}

Definition at line 36 of file mxvk_sprite.hpp.

36#define VK_CHECK_RESULT(f) \
37 { \
38 VkResult res = (f); \
39 if (res != VK_SUCCESS) { \
40 throw mxvk::Exception(std::format("Fatal : VkResult is \"{}\" in {} at line {}", static_cast<int>(res), __FILE__, __LINE__)); \
41 } \
42 }