MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk::VKSpritePixelPlotter Struct Reference

Pixel plotter adapter that draws square pixels into a VK_Sprite. More...

#include <mxvk/include/mxvk/mxvk_math.h>

Public Member Functions

void operator() (int x, int y, MXCOLOR) const
 Plot one square pixel if the sprite is valid.
void operator() (int x, int y, MXCOLOR) const
 Plot one square pixel if the sprite is valid.

Public Attributes

int size = 1
 Square pixel size in sprite coordinates.
VK_Sprite * sprite = nullptr
 Sprite receiving plotted pixels.

Detailed Description

Pixel plotter adapter that draws square pixels into a VK_Sprite.

Definition at line 1916 of file mxvk_math.h.

Member Function Documentation

◆ operator()() [1/2]

void mxvk::VKSpritePixelPlotter::operator() ( int x,
int y,
MXCOLOR  ) const
inline

Plot one square pixel if the sprite is valid.

Definition at line 1924 of file mxvk_math.h.

1924 {
1925 if (sprite != nullptr) {
1926 sprite->drawSpriteRect(x, y, std::max(1, size), std::max(1, size));
1927 }
1928 }
void drawSpriteRect(int x, int y, int w, int h)
Queue a draw into an explicit destination rectangle.
int size
Square pixel size in sprite coordinates.
Definition mxvk_math.h:1921
VK_Sprite * sprite
Sprite receiving plotted pixels.
Definition mxvk_math.h:1918

◆ operator()() [2/2]

void mxvk::VKSpritePixelPlotter::operator() ( int x,
int y,
MXCOLOR  ) const
inline

Plot one square pixel if the sprite is valid.

Definition at line 1889 of file mxvk_math_eigen.hpp.

1889 {
1890 if (sprite != nullptr) {
1891 sprite->drawSpriteRect(x, y, std::max(1, size), std::max(1, size));
1892 }
1893 }

Member Data Documentation

◆ size

int mxvk::VKSpritePixelPlotter::size = 1

Square pixel size in sprite coordinates.

Definition at line 1921 of file mxvk_math.h.

◆ sprite

VK_Sprite * mxvk::VKSpritePixelPlotter::sprite = nullptr

Sprite receiving plotted pixels.

Definition at line 1918 of file mxvk_math.h.


The documentation for this struct was generated from the following files: