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::SDLRendererPixelPlotter Struct Reference

Pixel plotter adapter that writes packed MXVK colors to an SDL renderer. More...

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

Public Member Functions

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

Public Attributes

SDL_Renderer * renderer = nullptr
 SDL renderer receiving plotted pixels.

Detailed Description

Pixel plotter adapter that writes packed MXVK colors to an SDL renderer.

Definition at line 2051 of file mxvk_math.h.

Member Function Documentation

◆ operator()() [1/2]

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

Plot one pixel if the renderer is valid.

Definition at line 2056 of file mxvk_math.h.

2056 {
2057 if (renderer == nullptr) {
2058 return;
2059 }
2060 SDL_SetRenderDrawColor(renderer, color_r(color), color_g(color), color_b(color), color_a(color));
2061 SDL_RenderPoint(renderer, static_cast<float>(x), static_cast<float>(y));
2062 }
constexpr std::uint8_t color_r(MXCOLOR color)
Extract the red component from a packed ARGB color.
Definition mxvk_math.h:54
constexpr std::uint8_t color_g(MXCOLOR color)
Extract the green component from a packed ARGB color.
Definition mxvk_math.h:59
constexpr std::uint8_t color_a(MXCOLOR color)
Extract the alpha component from a packed ARGB color.
Definition mxvk_math.h:69
constexpr std::uint8_t color_b(MXCOLOR color)
Extract the blue component from a packed ARGB color.
Definition mxvk_math.h:64
SDL_Renderer * renderer
SDL renderer receiving plotted pixels.
Definition mxvk_math.h:2053

◆ operator()() [2/2]

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

Plot one pixel if the renderer is valid.

Definition at line 2069 of file mxvk_math_eigen.hpp.

2069 {
2070 if (renderer == nullptr) {
2071 return;
2072 }
2073 SDL_SetRenderDrawColor(renderer, color_r(color), color_g(color), color_b(color), color_a(color));
2074 SDL_RenderPoint(renderer, static_cast<float>(x), static_cast<float>(y));
2075 }

Member Data Documentation

◆ renderer

SDL_Renderer * mxvk::SDLRendererPixelPlotter::renderer = nullptr

SDL renderer receiving plotted pixels.

Definition at line 2053 of file mxvk_math.h.


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