1#ifndef SDL3PP_RENDER_H_
2#define SDL3PP_RENDER_H_
4#include <SDL3/SDL_render.h>
5#include "SDL3pp_blendmode.h"
6#include "SDL3pp_events.h"
8#include "SDL3pp_pixels.h"
9#include "SDL3pp_video.h"
68#if SDL_VERSION_ATLEAST(3, 3, 6)
98#if SDL_VERSION_ATLEAST(3, 4, 0)
124 SDL_TEXTUREACCESS_STATIC;
127 SDL_TEXTUREACCESS_STREAMING;
130 SDL_TEXTUREACCESS_TARGET;
132#if SDL_VERSION_ATLEAST(3, 4, 0)
148 SDL_TEXTURE_ADDRESS_INVALID;
160 SDL_TEXTURE_ADDRESS_WRAP;
172 SDL_LOGICAL_PRESENTATION_DISABLED;
176 SDL_LOGICAL_PRESENTATION_STRETCH;
183 SDL_LOGICAL_PRESENTATION_LETTERBOX;
190 SDL_LOGICAL_PRESENTATION_OVERSCAN;
197 SDL_LOGICAL_PRESENTATION_INTEGER_SCALE;
199#if SDL_VERSION_ATLEAST(3, 4, 0)
392#if SDL_VERSION_ATLEAST(3, 4, 0)
1247 void GetScale(
float* scaleX,
float* scaleY)
const;
1630 FlipMode flip = FlipMode::SDL_FLIP_NONE);
1726 float bottom_height,
1730#if SDL_VERSION_ATLEAST(3, 4, 0)
1771 float bottom_height,
1798 std::span<const Vertex> vertices,
1799 std::span<const int> indices = {});
1836 const void* indices,
1840#if SDL_VERSION_ATLEAST(3, 4, 0)
2055 Sint64 signal_semaphore);
2158 template<
class... ARGS>
2160 std::string_view fmt,
2163#if SDL_VERSION_ATLEAST(3, 4, 0)
2268 if (
auto res =
get()) ++res->refcount;
2536 ++resource->refcount;
2558 if (
get() != other.
get()) {
2703 void GetSize(
float* w,
float* h)
const;
2720#if SDL_VERSION_ATLEAST(3, 4, 0)
3162 const Uint8* Yplane,
3164 const Uint8* Uplane,
3166 const Uint8* Vplane,
3194 const Uint8* Yplane,
3196 const Uint8* UVplane,
3371 : m_lock(std::move(other.m_lock))
3399 std::swap(m_lock, other.m_lock);
3404 constexpr operator bool()
const {
return bool(m_lock); }
3500 , m_lock(std::move(other.m_lock))
3528 std::swap(m_lock, other.m_lock);
3600 return SDL_GetRenderDriver(index);
3628 title, size.x, size.y, window_flags, window, renderer));
3654 SDL_Window* windowRaw =
nullptr;
3655 SDL_Renderer* rendererRaw =
nullptr;
3657 std::move(title), size, window_flags, &windowRaw, &rendererRaw);
3658 if (window) *window =
Window{windowRaw};
3659 if (renderer) *renderer =
Renderer{rendererRaw};
3683 SDL_Window* window =
nullptr;
3684 SDL_Renderer* renderer =
nullptr;
3686 std::move(title), size, window_flags, &window, &renderer);
3714 std::move(title), size, window_flags, &window, renderer);
3762 return Renderer(window, std::move(name));
3766 :
Renderer(SDL_CreateRenderer(window, name))
3771 :
Renderer(SDL_CreateRendererWithProperties(props))
3776 :
Renderer(SDL_CreateSoftwareRenderer(surface))
3859constexpr auto CREATE_NAME_STRING = SDL_PROP_RENDERER_CREATE_NAME_STRING;
3861constexpr auto CREATE_WINDOW_POINTER = SDL_PROP_RENDERER_CREATE_WINDOW_POINTER;
3863constexpr auto CREATE_SURFACE_POINTER =
3864 SDL_PROP_RENDERER_CREATE_SURFACE_POINTER;
3866constexpr auto CREATE_OUTPUT_COLORSPACE_NUMBER =
3867 SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER;
3869constexpr auto CREATE_PRESENT_VSYNC_NUMBER =
3870 SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER;
3872#if SDL_VERSION_ATLEAST(3, 4, 0)
3874constexpr auto CREATE_GPU_DEVICE_POINTER =
3875 SDL_PROP_RENDERER_CREATE_GPU_DEVICE_POINTER;
3877constexpr auto CREATE_GPU_SHADERS_SPIRV_BOOLEAN =
3878 SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN;
3880constexpr auto CREATE_GPU_SHADERS_DXIL_BOOLEAN =
3881 SDL_PROP_RENDERER_CREATE_GPU_SHADERS_DXIL_BOOLEAN;
3883constexpr auto CREATE_GPU_SHADERS_MSL_BOOLEAN =
3884 SDL_PROP_RENDERER_CREATE_GPU_SHADERS_MSL_BOOLEAN;
3888constexpr auto CREATE_VULKAN_INSTANCE_POINTER =
3889 SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER;
3891constexpr auto CREATE_VULKAN_SURFACE_NUMBER =
3892 SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER;
3894constexpr auto CREATE_VULKAN_PHYSICAL_DEVICE_POINTER =
3895 SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER;
3897constexpr auto CREATE_VULKAN_DEVICE_POINTER =
3898 SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER;
3900constexpr auto CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER =
3901 SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER;
3903constexpr auto CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER =
3904 SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER;
3906constexpr auto NAME_STRING = SDL_PROP_RENDERER_NAME_STRING;
3908constexpr auto WINDOW_POINTER = SDL_PROP_RENDERER_WINDOW_POINTER;
3910constexpr auto SURFACE_POINTER = SDL_PROP_RENDERER_SURFACE_POINTER;
3912constexpr auto VSYNC_NUMBER = SDL_PROP_RENDERER_VSYNC_NUMBER;
3914constexpr auto MAX_TEXTURE_SIZE_NUMBER =
3915 SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER;
3917constexpr auto TEXTURE_FORMATS_POINTER =
3918 SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER;
3920#if SDL_VERSION_ATLEAST(3, 4, 0)
3922constexpr auto TEXTURE_WRAPPING_BOOLEAN =
3923 SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN;
3927constexpr auto OUTPUT_COLORSPACE_NUMBER =
3928 SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER;
3930constexpr auto HDR_ENABLED_BOOLEAN = SDL_PROP_RENDERER_HDR_ENABLED_BOOLEAN;
3932constexpr auto SDR_WHITE_POINT_FLOAT = SDL_PROP_RENDERER_SDR_WHITE_POINT_FLOAT;
3934constexpr auto HDR_HEADROOM_FLOAT = SDL_PROP_RENDERER_HDR_HEADROOM_FLOAT;
3936constexpr auto D3D9_DEVICE_POINTER = SDL_PROP_RENDERER_D3D9_DEVICE_POINTER;
3938constexpr auto D3D11_DEVICE_POINTER = SDL_PROP_RENDERER_D3D11_DEVICE_POINTER;
3940constexpr auto D3D11_SWAPCHAIN_POINTER =
3941 SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER;
3943constexpr auto D3D12_DEVICE_POINTER = SDL_PROP_RENDERER_D3D12_DEVICE_POINTER;
3945constexpr auto D3D12_SWAPCHAIN_POINTER =
3946 SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER;
3948constexpr auto D3D12_COMMAND_QUEUE_POINTER =
3949 SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER;
3951constexpr auto VULKAN_INSTANCE_POINTER =
3952 SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTER;
3954constexpr auto VULKAN_SURFACE_NUMBER = SDL_PROP_RENDERER_VULKAN_SURFACE_NUMBER;
3956constexpr auto VULKAN_PHYSICAL_DEVICE_POINTER =
3957 SDL_PROP_RENDERER_VULKAN_PHYSICAL_DEVICE_POINTER;
3959constexpr auto VULKAN_DEVICE_POINTER = SDL_PROP_RENDERER_VULKAN_DEVICE_POINTER;
3961constexpr auto VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER =
3962 SDL_PROP_RENDERER_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER;
3964constexpr auto VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER =
3965 SDL_PROP_RENDERER_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER;
3967constexpr auto VULKAN_SWAPCHAIN_IMAGE_COUNT_NUMBER =
3968 SDL_PROP_RENDERER_VULKAN_SWAPCHAIN_IMAGE_COUNT_NUMBER;
3970constexpr auto GPU_DEVICE_POINTER = SDL_PROP_RENDERER_GPU_DEVICE_POINTER;
3974#if SDL_VERSION_ATLEAST(3, 4, 0)
4010 return SDL_CreateGPURenderer(device, window);
4026 return SDL_GetGPURendererDevice(renderer);
4078 return CheckError(SDL_GetRenderWindow(renderer));
4099 return CheckError(SDL_GetRendererName(renderer));
4194 return CheckError(SDL_GetRendererProperties(renderer));
4224 CheckError(SDL_GetRenderOutputSize(renderer, w, h));
4285 CheckError(SDL_GetCurrentRenderOutputSize(renderer, w, h));
4351 return Texture(renderer, format, access, size);
4365 :
Texture(SDL_CreateTexture(renderer, format, access, size.x, size.y))
4370 :
Texture(SDL_CreateTextureFromSurface(renderer, surface))
4375 :
Texture(SDL_CreateTextureWithProperties(renderer, props))
4407 return Texture(renderer, surface);
4539 return Texture(renderer, props);
4559constexpr auto CREATE_COLORSPACE_NUMBER =
4560 SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER;
4562constexpr auto CREATE_FORMAT_NUMBER = SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER;
4564constexpr auto CREATE_ACCESS_NUMBER = SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER;
4566constexpr auto CREATE_WIDTH_NUMBER = SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER;
4568constexpr auto CREATE_HEIGHT_NUMBER = SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER;
4570#if SDL_VERSION_ATLEAST(3, 4, 0)
4572constexpr auto CREATE_PALETTE_POINTER = SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER;
4576constexpr auto CREATE_SDR_WHITE_POINT_FLOAT =
4577 SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT;
4579constexpr auto CREATE_HDR_HEADROOM_FLOAT =
4580 SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT;
4582constexpr auto CREATE_D3D11_TEXTURE_POINTER =
4583 SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER;
4585constexpr auto CREATE_D3D11_TEXTURE_U_POINTER =
4586 SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER;
4588constexpr auto CREATE_D3D11_TEXTURE_V_POINTER =
4589 SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER;
4591constexpr auto CREATE_D3D12_TEXTURE_POINTER =
4592 SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER;
4594constexpr auto CREATE_D3D12_TEXTURE_U_POINTER =
4595 SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER;
4597constexpr auto CREATE_D3D12_TEXTURE_V_POINTER =
4598 SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER;
4600constexpr auto CREATE_METAL_PIXELBUFFER_POINTER =
4601 SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER;
4603constexpr auto CREATE_OPENGL_TEXTURE_NUMBER =
4604 SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER;
4606constexpr auto CREATE_OPENGL_TEXTURE_UV_NUMBER =
4607 SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER;
4609constexpr auto CREATE_OPENGL_TEXTURE_U_NUMBER =
4610 SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER;
4612constexpr auto CREATE_OPENGL_TEXTURE_V_NUMBER =
4613 SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER;
4615constexpr auto CREATE_OPENGLES2_TEXTURE_NUMBER =
4616 SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER;
4618constexpr auto CREATE_OPENGLES2_TEXTURE_UV_NUMBER =
4619 SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER;
4621constexpr auto CREATE_OPENGLES2_TEXTURE_U_NUMBER =
4622 SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER;
4624constexpr auto CREATE_OPENGLES2_TEXTURE_V_NUMBER =
4625 SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER;
4627constexpr auto CREATE_VULKAN_TEXTURE_NUMBER =
4628 SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER;
4630#if SDL_VERSION_ATLEAST(3, 4, 0)
4632constexpr auto CREATE_VULKAN_LAYOUT_NUMBER =
4633 SDL_PROP_TEXTURE_CREATE_VULKAN_LAYOUT_NUMBER;
4635constexpr auto CREATE_GPU_TEXTURE_POINTER =
4636 SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER;
4638constexpr auto CREATE_GPU_TEXTURE_UV_POINTER =
4639 SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_UV_POINTER;
4641constexpr auto CREATE_GPU_TEXTURE_U_POINTER =
4642 SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_U_POINTER;
4644constexpr auto CREATE_GPU_TEXTURE_V_POINTER =
4645 SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_V_POINTER;
4649constexpr auto COLORSPACE_NUMBER = SDL_PROP_TEXTURE_COLORSPACE_NUMBER;
4651constexpr auto FORMAT_NUMBER = SDL_PROP_TEXTURE_FORMAT_NUMBER;
4653constexpr auto ACCESS_NUMBER = SDL_PROP_TEXTURE_ACCESS_NUMBER;
4655constexpr auto WIDTH_NUMBER = SDL_PROP_TEXTURE_WIDTH_NUMBER;
4657constexpr auto HEIGHT_NUMBER = SDL_PROP_TEXTURE_HEIGHT_NUMBER;
4659constexpr auto SDR_WHITE_POINT_FLOAT = SDL_PROP_TEXTURE_SDR_WHITE_POINT_FLOAT;
4661constexpr auto HDR_HEADROOM_FLOAT = SDL_PROP_TEXTURE_HDR_HEADROOM_FLOAT;
4663constexpr auto D3D11_TEXTURE_POINTER = SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER;
4665constexpr auto D3D11_TEXTURE_U_POINTER =
4666 SDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTER;
4668constexpr auto D3D11_TEXTURE_V_POINTER =
4669 SDL_PROP_TEXTURE_D3D11_TEXTURE_V_POINTER;
4671constexpr auto D3D12_TEXTURE_POINTER = SDL_PROP_TEXTURE_D3D12_TEXTURE_POINTER;
4673constexpr auto D3D12_TEXTURE_U_POINTER =
4674 SDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTER;
4676constexpr auto D3D12_TEXTURE_V_POINTER =
4677 SDL_PROP_TEXTURE_D3D12_TEXTURE_V_POINTER;
4679constexpr auto OPENGL_TEXTURE_NUMBER = SDL_PROP_TEXTURE_OPENGL_TEXTURE_NUMBER;
4681constexpr auto OPENGL_TEXTURE_UV_NUMBER =
4682 SDL_PROP_TEXTURE_OPENGL_TEXTURE_UV_NUMBER;
4684constexpr auto OPENGL_TEXTURE_U_NUMBER =
4685 SDL_PROP_TEXTURE_OPENGL_TEXTURE_U_NUMBER;
4687constexpr auto OPENGL_TEXTURE_V_NUMBER =
4688 SDL_PROP_TEXTURE_OPENGL_TEXTURE_V_NUMBER;
4690constexpr auto OPENGL_TEXTURE_TARGET_NUMBER =
4691 SDL_PROP_TEXTURE_OPENGL_TEXTURE_TARGET_NUMBER;
4693constexpr auto OPENGL_TEX_W_FLOAT = SDL_PROP_TEXTURE_OPENGL_TEX_W_FLOAT;
4695constexpr auto OPENGL_TEX_H_FLOAT = SDL_PROP_TEXTURE_OPENGL_TEX_H_FLOAT;
4697constexpr auto OPENGLES2_TEXTURE_NUMBER =
4698 SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_NUMBER;
4700constexpr auto OPENGLES2_TEXTURE_UV_NUMBER =
4701 SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_UV_NUMBER;
4703constexpr auto OPENGLES2_TEXTURE_U_NUMBER =
4704 SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_U_NUMBER;
4706constexpr auto OPENGLES2_TEXTURE_V_NUMBER =
4707 SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_V_NUMBER;
4709constexpr auto OPENGLES2_TEXTURE_TARGET_NUMBER =
4710 SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_TARGET_NUMBER;
4712constexpr auto VULKAN_TEXTURE_NUMBER = SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER;
4714#if SDL_VERSION_ATLEAST(3, 4, 0)
4716constexpr auto GPU_TEXTURE_POINTER = SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER;
4718constexpr auto GPU_TEXTURE_UV_POINTER = SDL_PROP_TEXTURE_GPU_TEXTURE_UV_POINTER;
4720constexpr auto GPU_TEXTURE_U_POINTER = SDL_PROP_TEXTURE_GPU_TEXTURE_U_POINTER;
4722constexpr auto GPU_TEXTURE_V_POINTER = SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER;
4825 return CheckError(SDL_GetTextureProperties(texture));
4846 return CheckError(SDL_GetRendererFromTexture(texture));
4870 CheckError(SDL_GetTextureSize(texture, w, h));
4876 return Point(texture->w, texture->h);
4912 return texture->format;
4920#if SDL_VERSION_ATLEAST(3, 4, 0)
4943 CheckError(SDL_SetTexturePalette(texture, palette));
5001 CheckError(SDL_SetTextureColorMod(texture, r, g, b));
5040 CheckError(SDL_SetTextureColorModFloat(texture, r, g, b));
5070 CheckError(SDL_GetTextureColorMod(texture, r, g, b));
5100 CheckError(SDL_GetTextureColorModFloat(texture, r, g, b));
5133 CheckError(SDL_SetTextureAlphaMod(texture, alpha));
5166 CheckError(SDL_SetTextureAlphaModFloat(texture, alpha));
5192 CheckError(SDL_GetTextureAlphaMod(texture, &alpha));
5219 CheckError(SDL_GetTextureAlphaModFloat(texture, &alpha));
5362 CheckError(SDL_SetTextureBlendMode(texture, blendMode));
5386 CheckError(SDL_GetTextureBlendMode(texture, &blendMode));
5414 CheckError(SDL_SetTextureScaleMode(texture, scaleMode));
5438 CheckError(SDL_GetTextureScaleMode(texture, &scaleMode));
5483 CheckError(SDL_UpdateTexture(texture, rect, pixels, pitch));
5520 UpdateTexture(texture, rect, surface->pixels, surface->pitch);
5563 const Uint8* Yplane,
5565 const Uint8* Uplane,
5567 const Uint8* Vplane,
5571 texture, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch));
5575 const Uint8* Yplane,
5577 const Uint8* Uplane,
5579 const Uint8* Vplane,
5583 get(), rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch);
5612 const Uint8* Yplane,
5614 const Uint8* UVplane,
5618 SDL_UpdateNVTexture(texture, rect, Yplane, Ypitch, UVplane, UVpitch));
5622 const Uint8* Yplane,
5624 const Uint8* UVplane,
5662 CheckError(SDL_LockTexture(texture, rect, pixels, pitch));
5669 return {
TextureRef(*
this), rect, pixels, pitch};
5717 CheckError(SDL_LockTextureToSurface(texture, rect, &surface));
5758 std::move(lock).reset();
5764 std::move(lock).reset();
5769 if (!m_lock)
return;
5777 if (!m_lock)
return;
5808 CheckError(SDL_SetRenderTarget(renderer, texture));
5855 if (
auto texture = SDL_GetRenderTarget(renderer))
5912 CheckError(SDL_SetRenderLogicalPresentation(renderer, size.x, size.y, mode));
5947 CheckError(SDL_GetRenderLogicalPresentation(renderer, w, h, mode));
6018 CheckError(SDL_GetRenderLogicalPresentationRect(renderer, &rect));
6054 renderer, window_coord.x, window_coord.y, &p.x, &p.y));
6092 SDL_RenderCoordinatesToWindow(renderer, coord.x, coord.y, &p.x, &p.y));
6135 CheckError(SDL_ConvertEventToRenderCoordinates(renderer, event));
6170 CheckError(SDL_SetRenderViewport(renderer, rect));
6221 CheckError(SDL_GetRenderViewport(renderer, &rect));
6252 return SDL_RenderViewportSet(renderer);
6281 CheckError(SDL_GetRenderSafeArea(renderer, &rect));
6311 CheckError(SDL_SetRenderClipRect(renderer, rect));
6363 CheckError(SDL_GetRenderClipRect(renderer, &rect));
6391 return SDL_RenderClipEnabled(renderer);
6425 CheckError(SDL_SetRenderScale(renderer, scale.x, scale.y));
6452 CheckError(SDL_GetRenderScale(renderer, scaleX, scaleY));
6503 CheckError(SDL_SetRenderDrawColor(renderer, c.r, c.g, c.b, c.a));
6530 CheckError(SDL_SetRenderDrawColorFloat(renderer, c.r, c.g, c.b, c.a));
6565 CheckError(SDL_GetRenderDrawColor(renderer, r, g, b, a));
6626 CheckError(SDL_GetRenderDrawColorFloat(renderer, r, g, b, a));
6685 CheckError(SDL_SetRenderColorScale(renderer, scale));
6709 CheckError(SDL_GetRenderColorScale(renderer, &scale));
6735 CheckError(SDL_SetRenderDrawBlendMode(renderer, blendMode));
6759 CheckError(SDL_GetRenderDrawBlendMode(renderer, &blendMode));
6807 CheckError(SDL_RenderPoint(renderer, p.x, p.y));
6857 CheckError(SDL_RenderLine(renderer, p1.x, p1.y, p2.x, p2.y));
6956 CheckError(SDL_RenderFillRect(renderer, rect));
7013 CheckError(SDL_RenderTexture(renderer, texture, srcrect, dstrect));
7054 FlipMode flip = FlipMode::SDL_FLIP_NONE)
7057 renderer, texture, srcrect, dstrect, angle, center, flip));
7068 get(), texture, srcrect, dstrect, angle, center, flip);
7104 SDL_RenderTextureAffine(renderer, texture, srcrect, origin, right, down));
7147 SDL_RenderTextureTiled(renderer, texture, srcrect, scale, dstrect));
7196 float bottom_height,
7216 float bottom_height,
7231#if SDL_VERSION_ATLEAST(3, 4, 0)
7274 float bottom_height,
7279 CheckError(SDL_RenderTexture9GridTiled(renderer,
7296 float bottom_height,
7337 std::span<const Vertex> vertices,
7338 std::span<const int> indices = {})
7349 std::span<const Vertex> vertices,
7350 std::span<const int> indices)
7391 const void* indices,
7417 const void* indices,
7435#if SDL_VERSION_ATLEAST(3, 4, 0)
7459 CheckError(SDL_SetRenderTextureAddressMode(renderer, u_mode, v_mode));
7490 CheckError(SDL_GetRenderTextureAddressMode(renderer, u_mode, v_mode));
7529 return Surface{
CheckError(SDL_RenderReadPixels(renderer, rect))};
7623 SDL_DestroyRenderer(renderer);
7683 return SDL_GetRenderMetalLayer(renderer);
7714 return SDL_GetRenderMetalCommandEncoder(renderer);
7754 renderer, wait_stage_mask, wait_semaphore, signal_semaphore));
7762 get(), wait_stage_mask, wait_semaphore, signal_semaphore);
7789 CheckError(SDL_SetRenderVSync(renderer, vsync));
7817 CheckError(SDL_GetRenderVSync(renderer, &vsync));
7833 SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE;
7876 CheckError(SDL_RenderDebugText(renderer, p.x, p.y, str));
7908template<
class... ARGS>
7911 std::string_view fmt,
7915 renderer, p, std::vformat(fmt, std::make_format_args(args...)));
7918template<
class... ARGS>
7920 std::string_view fmt,
7926#if SDL_VERSION_ATLEAST(3, 4, 0)
7946 CheckError(SDL_SetDefaultTextureScaleMode(renderer, scale_mode));
7972 CheckError(SDL_GetDefaultTextureScaleMode(renderer, scale_mode));
8119 :
GPURenderState(SDL_CreateGPURenderState(renderer, &createinfo))
8146 SDL_SetGPURenderStateFragmentUniforms(state, slot_index, data, length));
8174 CheckError(SDL_SetGPURenderState(renderer, state));
8196 SDL_DestroyGPURenderState(state);
Optional-like shim for references.
Definition SDL3pp_optionalRef.h:20
constexpr RawPointer get() const noexcept
Definition SDL3pp_resource.h:53
constexpr RawPointer release() noexcept
Definition SDL3pp_resource.h:56
constexpr ResourceBase(RawPointer resource)
Constructs from resource pointer.
Definition SDL3pp_resource.h:29
Const reference wrapper for a given resource,.
Definition SDL3pp_resource.h:111
span-like for empty-derived structs
Definition SDL3pp_spanRef.h:24
constexpr T * data() const
Retrieves contained data.
Definition SDL3pp_spanRef.h:75
constexpr size_t size() const
Retrieves contained size.
Definition SDL3pp_spanRef.h:69
Helpers to use C++ strings parameters.
Definition SDL3pp_strings.h:43
Lock a portion of the texture for write-only pixel access.
Definition SDL3pp_render.h:3328
TextureRef resource() const
Get the reference to locked resource.
Definition SDL3pp_render.h:3426
~TextureLock()
Unlock a texture, uploading the changes to video memory, if needed.
Definition SDL3pp_render.h:3392
TextureLock & operator=(TextureLock &&other) noexcept
Assignment operator.
Definition SDL3pp_render.h:3397
TextureLock(const TextureLock &other)=delete
Copy constructor.
TextureLock(TextureLock &&other) noexcept
Move constructor.
Definition SDL3pp_render.h:3370
void release()
Releases the lock without unlocking.
Definition SDL3pp_render.h:3429
Lock a portion of the texture for write-only pixel access, and expose it as a SDL surface.
Definition SDL3pp_render.h:3455
~TextureSurfaceLock()
Unlock a texture, uploading the changes to video memory, if needed.
Definition SDL3pp_render.h:3521
TextureSurfaceLock(TextureSurfaceLock &&other) noexcept
Move constructor.
Definition SDL3pp_render.h:3498
TextureRef resource() const
Get the reference to locked resource.
Definition SDL3pp_render.h:3553
TextureSurfaceLock(const TextureSurfaceLock &other)=delete
Copy constructor.
TextureSurfaceLock & operator=(TextureSurfaceLock &&other) noexcept
Assignment operator.
Definition SDL3pp_render.h:3526
#define SDL_assert_paranoid(condition)
An assertion test that is performed only when built with paranoid settings.
Definition SDL3pp_assert.h:383
Uint32 BlendMode
A set of blend modes used in drawing operations.
Definition SDL3pp_blendmode.h:35
constexpr void CheckError(bool result)
Check and throw if returned value from SDL is an error.
Definition SDL3pp_error.h:199
SDL_Event Event
The structure for all events in SDL.
Definition SDL3pp_events.h:844
ResourceRef< GPUDevice > GPUDeviceRef
Reference for GPUDevice.
Definition SDL3pp_gpu.h:386
ResourceRef< IOStream > IOStreamRef
Reference for IOStream.
Definition SDL3pp_iostream.h:34
SDL_Color ColorRaw
Alias to raw representation for Color.
Definition SDL3pp_pixels.h:83
SDL_FColor FColorRaw
Alias to raw representation for FColor.
Definition SDL3pp_pixels.h:89
ResourceRef< Palette > PaletteRef
Reference for Palette.
Definition SDL3pp_pixels.h:108
ResourceRef< Properties > PropertiesRef
Reference for Properties.
Definition SDL3pp_properties.h:54
SDL_FRect FRectRaw
Alias to raw representation for FRect.
Definition SDL3pp_rect.h:40
SDL_FPoint FPointRaw
Alias to raw representation for FPoint.
Definition SDL3pp_rect.h:28
SDL_Point PointRaw
Alias to raw representation for Point.
Definition SDL3pp_rect.h:22
FPoint RenderCoordinatesFromWindow(RendererRef renderer, const FPointRaw &window_coord)
Get a point in render coordinates when given a point in window coordinates.
Definition SDL3pp_render.h:6049
void reset()
Unlock a texture, uploading the changes to video memory, if needed.
Definition SDL3pp_render.h:5775
void UpdateTexture(TextureRef texture, OptionalRef< const RectRaw > rect, const void *pixels, int pitch)
Update the given texture rectangle with new pixel data.
Definition SDL3pp_render.h:5478
constexpr TextureAddressMode TEXTURE_ADDRESS_AUTO
Wrapping is enabled if texture coordinates are outside [0, 1], this is the default.
Definition SDL3pp_render.h:154
void GetRenderScale(RendererRef renderer, float *scaleX, float *scaleY)
Get the drawing scale for the current target.
Definition SDL3pp_render.h:6450
void SetDrawColorFloat(const FColorRaw &c)
Set the color used for drawing operations (Rect, Line and Clear).
Definition SDL3pp_render.h:6533
constexpr int RENDERER_VSYNC_DISABLED
Constant for disabling renderer vsync.
Definition SDL3pp_render.h:7795
SDL_Vertex Vertex
Vertex structure.
Definition SDL3pp_render.h:114
void SetDrawColor(ColorRaw c)
Set the color used for drawing operations.
Definition SDL3pp_render.h:6506
void RenderTexture9Grid(RendererRef renderer, TextureRef texture, OptionalRef< const FRectRaw > srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, OptionalRef< const FRectRaw > dstrect)
Perform a scaled copy using the 9-grid algorithm to the current rendering target at subpixel precisio...
Definition SDL3pp_render.h:7190
Texture GetTarget() const
Get the current render target.
Definition SDL3pp_render.h:5860
void Destroy()
Destroy the rendering context for a window and free all associated textures.
Definition SDL3pp_render.h:7626
const char * GetName() const
Get the name of a renderer.
Definition SDL3pp_render.h:4102
void RenderRects(RendererRef renderer, SpanRef< const FRectRaw > rects)
Draw some number of rectangles on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6928
void ResetRenderViewport(RendererRef renderer)
Reset the drawing area for rendering to the entire target.
Definition SDL3pp_render.h:6194
const SDL_Texture * TextureRawConst
Alias to const raw representation for Texture.
Definition SDL3pp_render.h:56
void RenderGeometryRaw(TextureRef texture, const float *xy, int xy_stride, const FColor *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)
Render a list of triangles, optionally using a texture and indices into the vertex arrays Color and a...
Definition SDL3pp_render.h:7409
void SetFragmentUniforms(Uint32 slot_index, const void *data, Uint32 length)
Set fragment shader uniform variables in a custom GPU render state.
Definition SDL3pp_render.h:8149
GPURenderState CreateGPURenderState(const GPURenderStateCreateInfo &createinfo)
Create custom GPU render state.
Definition SDL3pp_render.h:8110
void SetPalette(PaletteRef palette)
Set the palette used by a texture.
Definition SDL3pp_render.h:4946
Texture GetRenderTarget(RendererRef renderer)
Get the current render target.
Definition SDL3pp_render.h:5853
RendererRef CreateGPURenderer(GPUDeviceRef device, WindowRef window)
Create a 2D GPU rendering context.
Definition SDL3pp_render.h:4008
void FlushRenderer(RendererRef renderer)
Force the rendering context to flush any pending commands and state.
Definition SDL3pp_render.h:7658
Point GetCurrentOutputSize() const
Get the current output size in pixels of a rendering context.
Definition SDL3pp_render.h:4319
void SetColorModFloat(float r, float g, float b)
Set an additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5043
GPURenderState CreateGPURenderState(RendererRef renderer, const GPURenderStateCreateInfo &createinfo)
Create custom GPU render state.
Definition SDL3pp_render.h:8103
void SetDefaultTextureScaleMode(RendererRef renderer, ScaleMode scale_mode)
Set default scale mode for new textures for given renderer.
Definition SDL3pp_render.h:7943
void RenderPoint(const FPointRaw &p)
Draw a point on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6810
void CreateWindowAndRenderer(StringParam title, const PointRaw &size, WindowFlags window_flags, Window *window, Renderer *renderer)
Create a window and default renderer.
Definition SDL3pp_render.h:3648
ScaleMode GetTextureScaleMode(TextureConstRef texture)
Get the scale mode used for texture scale operations.
Definition SDL3pp_render.h:5435
void * GetRenderMetalLayer(RendererRef renderer)
Get the CAMetalLayer associated with the given Metal renderer.
Definition SDL3pp_render.h:7681
void GetRenderOutputSize(RendererRef renderer, int *w, int *h)
Get the output size in pixels of a rendering context.
Definition SDL3pp_render.h:4222
BlendMode GetTextureBlendMode(TextureConstRef texture)
Get the blend mode used for texture copy operations.
Definition SDL3pp_render.h:5383
void SetRenderTextureAddressMode(RendererRef renderer, TextureAddressMode u_mode, TextureAddressMode v_mode)
Set the texture addressing mode used in Renderer.RenderGeometry().
Definition SDL3pp_render.h:7455
void CreateWindowAndRendererRaw(StringParam title, const PointRaw &size, WindowFlags window_flags, WindowRaw *window, RendererRaw *renderer)
Create a window and default renderer.
Definition SDL3pp_render.h:3621
void GetRenderTextureAddressMode(TextureAddressMode *u_mode, TextureAddressMode *v_mode)
Get the texture addressing mode used in Renderer.RenderGeometry().
Definition SDL3pp_render.h:7493
void RenderDebugText(RendererRef renderer, const FPointRaw &p, StringParam str)
Draw debug text to an Renderer.
Definition SDL3pp_render.h:7872
void SetBlendMode(BlendMode blendMode)
Set the blend mode for a texture, used by Renderer.RenderTexture().
Definition SDL3pp_render.h:5365
Palette GetPalette()
Get the palette used by a texture.
Definition SDL3pp_render.h:4969
Rect GetViewport() const
Get the drawing area for the current target.
Definition SDL3pp_render.h:6225
Point GetSize() const
Get the size of a texture.
Definition SDL3pp_render.h:4884
bool ViewportSet() const
Return whether an explicit rectangle was set as the viewport.
Definition SDL3pp_render.h:6255
void RenderFillRects(RendererRef renderer, SpanRef< const FRectRaw > rects)
Fill some number of rectangles on the current rendering target with the drawing color at subpixel pre...
Definition SDL3pp_render.h:6978
void SetDrawBlendMode(BlendMode blendMode)
Set the blend mode used for drawing operations (Fill and Line).
Definition SDL3pp_render.h:6738
Texture CreateTextureFromSurface(SurfaceRef surface)
Create a texture from an existing surface.
Definition SDL3pp_render.h:4410
FPoint GetSizeFloat() const
Get the size of a texture, as floating point values.
Definition SDL3pp_render.h:4894
ResourceConstRef< TextureRaw, TextureRawConst > TextureConstRef
Safely wrap Texture for non owning const parameters.
Definition SDL3pp_render.h:66
void SetDefaultTextureScaleMode(ScaleMode scale_mode)
Set default scale mode for new textures for given renderer.
Definition SDL3pp_render.h:7949
void GetRenderDrawColor(RendererRef renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
Get the color used for drawing operations (Rect, Line and Clear).
Definition SDL3pp_render.h:6559
void SetGPURenderState(RendererRef renderer, GPURenderStateRef state)
Set custom GPU render state.
Definition SDL3pp_render.h:8172
void SetGPURenderState(GPURenderStateRef state)
Set custom GPU render state.
Definition SDL3pp_render.h:8177
void RenderPoint(RendererRef renderer, const FPointRaw &p)
Draw a point on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6805
void SetAlphaMod(Uint8 alpha)
Set an additional alpha value multiplied into render copy operations.
Definition SDL3pp_render.h:5136
constexpr TextureAddressMode TEXTURE_ADDRESS_WRAP
The texture is repeated (tiled).
Definition SDL3pp_render.h:159
void RenderRect(RendererRef renderer, OptionalRef< const FRectRaw > rect)
Draw a rectangle on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6904
Palette GetTexturePalette(TextureRef texture)
Get the palette used by a texture.
Definition SDL3pp_render.h:4964
Texture CreateTextureWithProperties(RendererRef renderer, PropertiesRef props)
Create a texture for a rendering context with the specified properties.
Definition SDL3pp_render.h:4536
FPoint GetScale() const
Get the drawing scale for the current target.
Definition SDL3pp_render.h:6482
SDL_TextureAccess TextureAccess
The access pattern allowed for a texture.
Definition SDL3pp_render.h:121
PixelFormat GetFormat() const
Get the pixel format.
Definition SDL3pp_render.h:4915
void Destroy()
Destroy the specified texture.
Definition SDL3pp_render.h:7606
Rect GetRenderSafeArea(RendererRef renderer)
Get the safe area for rendering within the current viewport.
Definition SDL3pp_render.h:6278
bool IsClipEnabled() const
Get whether clipping is enabled on the given render target.
Definition SDL3pp_render.h:6394
constexpr int RENDERER_VSYNC_ADAPTIVE
Constant for enabling asaptive renderer vsync.
Definition SDL3pp_render.h:7798
ResourceRef< GPURenderState > GPURenderStateRef
Reference for GPURenderState.
Definition SDL3pp_render.h:81
int GetTextureWidth(TextureConstRef texture)
Get the width in pixels.
Definition SDL3pp_render.h:4900
FPoint RenderCoordinatesToWindow(const FPointRaw &coord) const
Get a point in window coordinates when given a point in render coordinates.
Definition SDL3pp_render.h:6096
PropertiesRef GetRendererProperties(RendererRef renderer)
Get the properties associated with a renderer.
Definition SDL3pp_render.h:4192
constexpr auto SOFTWARE_RENDERER
The name of the software renderer.
Definition SDL3pp_render.h:96
void SetRenderColorScale(RendererRef renderer, float scale)
Set the color scale used for render operations.
Definition SDL3pp_render.h:6683
void RenderTextureAffine(TextureRef texture, OptionalRef< const FRectRaw > srcrect, OptionalRef< const FPointRaw > origin, OptionalRef< const FPointRaw > right, OptionalRef< const FPointRaw > down)
Copy a portion of the source texture to the current rendering target, with affine transform,...
Definition SDL3pp_render.h:7107
void RenderPoints(SpanRef< const FPointRaw > points)
Draw multiple points on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6834
void GetTextureColorMod(TextureConstRef texture, Uint8 *r, Uint8 *g, Uint8 *b)
Get the additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5065
void ResetTarget()
Set target texture back to window.
Definition SDL3pp_render.h:5836
void SetRenderVSync(RendererRef renderer, int vsync)
Toggle VSync of the given renderer.
Definition SDL3pp_render.h:7787
GPUDeviceRef GetGPURendererDevice(RendererRef renderer)
Return the GPU device used by a renderer.
Definition SDL3pp_render.h:4024
TextureSurfaceLock LockToSurface(OptionalRef< const RectRaw > rect=std::nullopt)
Lock a portion of the texture for write-only pixel access, and expose it as a SDL surface.
Definition SDL3pp_render.h:5721
void GetRenderLogicalPresentation(RendererRef renderer, int *w, int *h, RendererLogicalPresentation *mode)
Get device independent resolution and presentation mode for rendering.
Definition SDL3pp_render.h:5942
void SetTextureModFloat(TextureRef texture, FColor c)
Set an additional color and alpha values multiplied into render copy operations.
Definition SDL3pp_render.h:5282
int GetHeight() const
Get the height in pixels.
Definition SDL3pp_render.h:4907
FColor GetDrawColorFloat() const
Get the color used for drawing operations (Rect, Line and Clear).
Definition SDL3pp_render.h:6658
Uint8 GetAlphaMod() const
Get the additional alpha value multiplied into render copy operations.
Definition SDL3pp_render.h:5196
SDL_GPURenderState * GPURenderStateRaw
Alias to raw representation for GPURenderState.
Definition SDL3pp_render.h:74
constexpr TextureAddressMode TEXTURE_ADDRESS_INVALID
TEXTURE_ADDRESS_INVALID.
Definition SDL3pp_render.h:147
void SetModFloat(FColor c)
Set an additional color and alpha values multiplied into render copy operations.
Definition SDL3pp_render.h:5288
void DestroyRenderer(RendererRaw renderer)
Destroy the rendering context for a window and free all associated textures.
Definition SDL3pp_render.h:7621
void Destroy()
Destroy custom GPU render state.
Definition SDL3pp_render.h:8199
void SetColorScale(float scale)
Set the color scale used for render operations.
Definition SDL3pp_render.h:6688
int GetVSync() const
Get VSync of the given renderer.
Definition SDL3pp_render.h:7821
void GetTextureSize(TextureConstRef texture, float *w, float *h)
Get the size of a texture, as floating point values.
Definition SDL3pp_render.h:4868
void SetTarget(TextureRef texture)
Set a texture as the current rendering target.
Definition SDL3pp_render.h:5811
Texture CreateTexture(RendererRef renderer, PixelFormat format, TextureAccess access, const PointRaw &size)
Create a texture for a rendering context.
Definition SDL3pp_render.h:4346
Texture CreateTextureWithProperties(PropertiesRef props)
Create a texture for a rendering context with the specified properties.
Definition SDL3pp_render.h:4542
Surface RenderReadPixels(RendererRef renderer, OptionalRef< const RectRaw > rect={})
Read pixels from the current rendering target.
Definition SDL3pp_render.h:7526
TextureSurfaceLock(TextureRef resource, OptionalRef< const RectRaw > rect=std::nullopt)
Lock a portion of the texture for write-only pixel access, and expose it as a SDL surface.
Definition SDL3pp_render.h:5727
void SetTextureScaleMode(TextureRef texture, ScaleMode scaleMode)
Set the scale mode used for texture scale operations.
Definition SDL3pp_render.h:5412
bool RenderClipEnabled(RendererRef renderer)
Get whether clipping is enabled on the given render target.
Definition SDL3pp_render.h:6389
void RenderTexture9Grid(TextureRef texture, OptionalRef< const FRectRaw > srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, OptionalRef< const FRectRaw > dstrect)
Perform a scaled copy using the 9-grid algorithm to the current rendering target at subpixel precisio...
Definition SDL3pp_render.h:7211
Point GetOutputSize() const
Get the output size in pixels of a rendering context.
Definition SDL3pp_render.h:4258
void GetColorModFloat(float *r, float *g, float *b) const
Get the additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5103
void SetColorMod(Uint8 r, Uint8 g, Uint8 b)
Set an additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5004
void SetRenderDrawColorFloat(RendererRef renderer, const FColorRaw &c)
Set the color used for drawing operations (Rect, Line and Clear).
Definition SDL3pp_render.h:6528
void Update(OptionalRef< const RectRaw > rect, const void *pixels, int pitch)
Update the given texture rectangle with new pixel data.
Definition SDL3pp_render.h:5523
void RenderRect(OptionalRef< const FRectRaw > rect)
Draw a rectangle on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6909
RendererRef GetRenderer() const
Get the renderer associated with a window.
Definition SDL3pp_render.h:4060
void Present()
Update the screen with any rendering performed since the previous call.
Definition SDL3pp_render.h:7587
void ResetViewport()
Reset the drawing area for rendering to the entire target.
Definition SDL3pp_render.h:6199
float GetRenderColorScale(RendererRef renderer)
Get the color scale used for render operations.
Definition SDL3pp_render.h:6706
BlendMode GetDrawBlendMode() const
Get the blend mode used for drawing operations.
Definition SDL3pp_render.h:6763
void RenderClear()
Clear the current rendering target with the drawing color.
Definition SDL3pp_render.h:6790
FRect GetRenderLogicalPresentationRect(RendererRef renderer)
Get the final presentation rectangle for rendering.
Definition SDL3pp_render.h:6015
FPoint GetTextureSizeFloat(TextureConstRef texture)
Get the size of a texture, as floating point values.
Definition SDL3pp_render.h:4887
RendererRef GetRendererFromTexture(TextureConstRef texture)
Get the renderer that created an Texture.
Definition SDL3pp_render.h:4844
void SetRenderDrawBlendMode(RendererRef renderer, BlendMode blendMode)
Set the blend mode used for drawing operations (Fill and Line).
Definition SDL3pp_render.h:6733
void RenderTextureRotated(RendererRef renderer, TextureRef texture, OptionalRef< const FRectRaw > srcrect, OptionalRef< const FRectRaw > dstrect, double angle, OptionalRef< const FPointRaw > center, FlipMode flip=FlipMode::SDL_FLIP_NONE)
Copy a portion of the source texture to the current rendering target, with rotation and flipping,...
Definition SDL3pp_render.h:7048
void SetMod(Color c)
Set an additional color and alpha values multiplied into render copy operations.
Definition SDL3pp_render.h:5257
void RenderTextureTiled(RendererRef renderer, TextureRef texture, OptionalRef< const FRectRaw > srcrect, float scale, OptionalRef< const FRectRaw > dstrect)
Tile a portion of the texture to the current rendering target at subpixel precision.
Definition SDL3pp_render.h:7140
void RenderLine(const FPointRaw &p1, const FPointRaw &p2)
Draw a line on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6860
Color GetMod() const
Get the additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5315
constexpr RendererLogicalPresentation LOGICAL_PRESENTATION_OVERSCAN
The rendered content is fit to the smallest dimension and the other dimension extends beyond the outp...
Definition SDL3pp_render.h:189
void GetRenderDrawColorFloat(RendererRef renderer, float *r, float *g, float *b, float *a)
Get the color used for drawing operations (Rect, Line and Clear).
Definition SDL3pp_render.h:6620
constexpr auto GPU_RENDERER
The name of the GPU renderer.
Definition SDL3pp_render.h:105
void ResetRenderClipRect(RendererRef renderer)
Reset the clip rectangle for rendering to the entire render target.
Definition SDL3pp_render.h:6335
PropertiesRef GetProperties() const
Get the properties associated with a texture.
Definition SDL3pp_render.h:4828
void RenderDebugText(const FPointRaw &p, StringParam str)
Draw debug text to an Renderer.
Definition SDL3pp_render.h:7879
void SetAlphaModFloat(float alpha)
Set an additional alpha value multiplied into render copy operations.
Definition SDL3pp_render.h:5169
void * GetRenderMetalCommandEncoder(RendererRef renderer)
Get the Metal command encoder for the current frame.
Definition SDL3pp_render.h:7712
constexpr RendererLogicalPresentation LOGICAL_PRESENTATION_DISABLED
There is no logical size in effect.
Definition SDL3pp_render.h:171
void RenderGeometry(TextureRef texture, std::span< const Vertex > vertices, std::span< const int > indices={})
Render a list of triangles, optionally using a texture and indices into the vertex array Color and al...
Definition SDL3pp_render.h:7348
void UpdateNVTexture(TextureRef texture, OptionalRef< const RectRaw > rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch)
Update a rectangle within a planar NV12 or NV21 texture with new pixels.
Definition SDL3pp_render.h:5610
Rect GetClipRect() const
Get the clip rectangle for the current target.
Definition SDL3pp_render.h:6367
void * GetRenderMetalLayer()
Get the CAMetalLayer associated with the given Metal renderer.
Definition SDL3pp_render.h:7686
void RenderDebugTextFormat(RendererRef renderer, const FPointRaw &p, std::string_view fmt, ARGS... args)
Draw debug text to an Renderer.
Definition SDL3pp_render.h:7909
constexpr TextureAccess TEXTUREACCESS_TARGET
Texture can be used as a render target.
Definition SDL3pp_render.h:129
void RenderPoints(RendererRef renderer, SpanRef< const FPointRaw > points)
Draw multiple points on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6828
FPoint RenderCoordinatesFromWindow(const FPointRaw &window_coord) const
Get a point in render coordinates when given a point in window coordinates.
Definition SDL3pp_render.h:6058
void DestroyTexture(TextureRaw texture)
Destroy the specified texture.
Definition SDL3pp_render.h:7604
FColor GetTextureModFloat(TextureConstRef texture)
Get the additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5331
Rect GetSafeArea() const
Get the safe area for rendering within the current viewport.
Definition SDL3pp_render.h:6285
void RenderFillRect(RendererRef renderer, OptionalRef< const FRectRaw > rect)
Fill a rectangle on the current rendering target with the drawing color at subpixel precision.
Definition SDL3pp_render.h:6953
void RenderClear(RendererRef renderer)
Clear the current rendering target with the drawing color.
Definition SDL3pp_render.h:6785
Renderer CreateRenderer(WindowRef window, StringParam name=nullptr)
Create a 2D rendering context for a window.
Definition SDL3pp_render.h:3760
void DestroyGPURenderState(GPURenderStateRaw state)
Destroy custom GPU render state.
Definition SDL3pp_render.h:8194
PixelFormat GetTextureFormat(TextureConstRef texture)
Get the pixel format.
Definition SDL3pp_render.h:4910
int GetWidth() const
Get the width in pixels.
Definition SDL3pp_render.h:4902
FColor GetModFloat() const
Get the additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5339
ResourceRef< Texture > TextureRef
Reference for Texture.
Definition SDL3pp_render.h:63
Renderer CreateRendererWithProperties(PropertiesRef props)
Create a 2D rendering context for a window, with the specified properties.
Definition SDL3pp_render.h:3842
void UpdateYUVTexture(TextureRef texture, OptionalRef< const RectRaw > rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch)
Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
Definition SDL3pp_render.h:5561
constexpr TextureAccess TEXTUREACCESS_STATIC
Changes rarely, not lockable.
Definition SDL3pp_render.h:123
void * GetRenderMetalCommandEncoder()
Get the Metal command encoder for the current frame.
Definition SDL3pp_render.h:7717
Rect GetRenderViewport(RendererRef renderer)
Get the drawing area for the current target.
Definition SDL3pp_render.h:6218
void SetViewport(OptionalRef< const RectRaw > rect)
Set the drawing area for rendering on the current target.
Definition SDL3pp_render.h:6173
constexpr RendererLogicalPresentation LOGICAL_PRESENTATION_INTEGER_SCALE
The rendered content is scaled up by integer multiples to fit the output resolution.
Definition SDL3pp_render.h:196
WindowRef GetWindow()
Get the window associated with a renderer.
Definition SDL3pp_render.h:4081
SDL_GPURenderStateCreateInfo GPURenderStateCreateInfo
A structure specifying the parameters of a GPU render state.
Definition SDL3pp_render.h:208
constexpr TextureAccess TEXTUREACCESS_STREAMING
Changes frequently, lockable.
Definition SDL3pp_render.h:126
void RenderTexture(TextureRef texture, OptionalRef< const FRectRaw > srcrect, OptionalRef< const FRectRaw > dstrect)
Copy a portion of the texture to the current rendering target at subpixel precision.
Definition SDL3pp_render.h:7016
BlendMode GetBlendMode() const
Get the blend mode used for texture copy operations.
Definition SDL3pp_render.h:5390
void UpdateYUV(OptionalRef< const RectRaw > rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch)
Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
Definition SDL3pp_render.h:5574
PropertiesRef GetProperties() const
Get the properties associated with a renderer.
Definition SDL3pp_render.h:4197
Rect GetRenderClipRect(RendererRef renderer)
Get the clip rectangle for the current target.
Definition SDL3pp_render.h:6360
void Flush()
Force the rendering context to flush any pending commands and state.
Definition SDL3pp_render.h:7663
void RenderLine(RendererRef renderer, const FPointRaw &p1, const FPointRaw &p2)
Draw a line on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6853
void SetRenderLogicalPresentation(RendererRef renderer, const PointRaw &size, RendererLogicalPresentation mode)
Set a device-independent resolution and presentation mode for rendering.
Definition SDL3pp_render.h:5908
GPUDeviceRef GetGPUDevice()
Return the GPU device used by a renderer.
Definition SDL3pp_render.h:4029
void reset()
Unlock a texture, uploading the changes to video memory, if needed.
Definition SDL3pp_render.h:5767
void SetTextureColorMod(TextureRef texture, Uint8 r, Uint8 g, Uint8 b)
Set an additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:4999
void GetDefaultTextureScaleMode(RendererRef renderer, ScaleMode *scale_mode)
Get default texture scale mode of the given renderer.
Definition SDL3pp_render.h:7969
void RenderTextureRotated(TextureRef texture, OptionalRef< const FRectRaw > srcrect, OptionalRef< const FRectRaw > dstrect, double angle, OptionalRef< const FPointRaw > center, FlipMode flip=FlipMode::SDL_FLIP_NONE)
Copy a portion of the source texture to the current rendering target, with rotation and flipping,...
Definition SDL3pp_render.h:7060
SDL_RendererLogicalPresentation RendererLogicalPresentation
How the logical size is mapped to the output.
Definition SDL3pp_render.h:169
SDL_TextureAddressMode TextureAddressMode
The addressing mode for a texture when used in Renderer.RenderGeometry().
Definition SDL3pp_render.h:145
FRect GetLogicalPresentationRect() const
Get the final presentation rectangle for rendering.
Definition SDL3pp_render.h:6022
void SetRenderTarget(RendererRef renderer, TextureRef texture)
Set a texture as the current rendering target.
Definition SDL3pp_render.h:5806
int GetRenderVSync(RendererRef renderer)
Get VSync of the given renderer.
Definition SDL3pp_render.h:7814
void SetClipRect(OptionalRef< const RectRaw > rect)
Set the clip rectangle for rendering on the specified target.
Definition SDL3pp_render.h:6314
constexpr int DEBUG_TEXT_FONT_CHARACTER_SIZE
The size, in pixels, of a single Renderer.RenderDebugText() character.
Definition SDL3pp_render.h:7832
BlendMode GetRenderDrawBlendMode(RendererRef renderer)
Get the blend mode used for drawing operations.
Definition SDL3pp_render.h:6756
constexpr TextureAddressMode TEXTURE_ADDRESS_CLAMP
Texture coordinates are clamped to the [0, 1] range.
Definition SDL3pp_render.h:157
PropertiesRef GetTextureProperties(TextureConstRef texture)
Get the properties associated with a texture.
Definition SDL3pp_render.h:4823
void SetRenderDrawColor(RendererRef renderer, ColorRaw c)
Set the color used for drawing operations.
Definition SDL3pp_render.h:6501
void ConvertEventToRenderCoordinates(Event *event) const
Convert the coordinates in an event to render coordinates.
Definition SDL3pp_render.h:6138
TextureLock(TextureRef resource, OptionalRef< const RectRaw > rect, void **pixels, int *pitch)
Lock a portion of the texture for write-only pixel access.
Definition SDL3pp_render.h:5672
Surface ReadPixels(OptionalRef< const RectRaw > rect={}) const
Read pixels from the current rendering target.
Definition SDL3pp_render.h:7532
void SetScale(const FPointRaw &scale)
Set the drawing scale for rendering on the current target.
Definition SDL3pp_render.h:6428
FPoint RenderCoordinatesToWindow(RendererRef renderer, const FPointRaw &coord)
Get a point in window coordinates when given a point in render coordinates.
Definition SDL3pp_render.h:6087
void RenderGeometry(RendererRef renderer, TextureRef texture, std::span< const Vertex > vertices, std::span< const int > indices={})
Render a list of triangles, optionally using a texture and indices into the vertex array Color and al...
Definition SDL3pp_render.h:7335
float GetColorScale() const
Get the color scale used for render operations.
Definition SDL3pp_render.h:6713
void RenderTexture9GridTiled(TextureRef texture, const FRectRaw &srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const FRectRaw &dstrect, float tileScale)
Perform a scaled copy using the 9-grid algorithm to the current rendering target at subpixel precisio...
Definition SDL3pp_render.h:7291
void UpdateNV(OptionalRef< const RectRaw > rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch)
Update a rectangle within a planar NV12 or NV21 texture with new pixels.
Definition SDL3pp_render.h:5621
void RenderFillRects(SpanRef< const FRectRaw > rects)
Fill some number of rectangles on the current rendering target with the drawing color at subpixel pre...
Definition SDL3pp_render.h:6984
SDL_Renderer * RendererRaw
Alias to raw representation for Renderer.
Definition SDL3pp_render.h:47
void SetTextureColorModFloat(TextureRef texture, float r, float g, float b)
Set an additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5035
Texture CreateTextureFromSurface(RendererRef renderer, SurfaceRef surface)
Create a texture from an existing surface.
Definition SDL3pp_render.h:4404
SDL_Texture * TextureRaw
Alias to raw representation for Texture.
Definition SDL3pp_render.h:53
constexpr RendererLogicalPresentation LOGICAL_PRESENTATION_LETTERBOX
The rendered content is fit to the largest dimension and the other dimension is letterboxed with the ...
Definition SDL3pp_render.h:182
void RenderLines(SpanRef< const FPointRaw > points)
Draw a series of connected lines on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6885
void SetLogicalPresentation(const PointRaw &size, RendererLogicalPresentation mode)
Set a device-independent resolution and presentation mode for rendering.
Definition SDL3pp_render.h:5915
void SetTextureAlphaModFloat(TextureRef texture, float alpha)
Set an additional alpha value multiplied into render copy operations.
Definition SDL3pp_render.h:5164
void GetLogicalPresentation(int *w, int *h, RendererLogicalPresentation *mode) const
Get device independent resolution and presentation mode for rendering.
Definition SDL3pp_render.h:5981
void RenderTexture(RendererRef renderer, TextureRef texture, OptionalRef< const FRectRaw > srcrect, OptionalRef< const FRectRaw > dstrect)
Copy a portion of the texture to the current rendering target at subpixel precision.
Definition SDL3pp_render.h:7008
void GetRenderTextureAddressMode(RendererRef renderer, TextureAddressMode *u_mode, TextureAddressMode *v_mode)
Get the texture addressing mode used in Renderer.RenderGeometry().
Definition SDL3pp_render.h:7486
Renderer CreateSoftwareRenderer(SurfaceRef surface)
Create a 2D software rendering context for a surface.
Definition SDL3pp_render.h:4055
void ConvertEventToRenderCoordinates(RendererRef renderer, Event *event)
Convert the coordinates in an event to render coordinates.
Definition SDL3pp_render.h:6133
Color GetTextureMod(TextureConstRef texture)
Get the additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5307
void RenderGeometryRaw(RendererRef renderer, TextureRef texture, const float *xy, int xy_stride, const FColor *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)
Render a list of triangles, optionally using a texture and indices into the vertex arrays Color and a...
Definition SDL3pp_render.h:7382
ScaleMode GetScaleMode() const
Get the scale mode used for texture scale operations.
Definition SDL3pp_render.h:5442
void RenderRects(SpanRef< const FRectRaw > rects)
Draw some number of rectangles on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6933
void RenderDebugTextFormat(const FPointRaw &p, std::string_view fmt, ARGS... args)
Draw debug text to an Renderer.
Definition SDL3pp_render.h:7919
void SetRenderScale(RendererRef renderer, const FPointRaw &scale)
Set the drawing scale for rendering on the current target.
Definition SDL3pp_render.h:6423
TextureLock Lock(OptionalRef< const RectRaw > rect, void **pixels, int *pitch)
Lock a portion of the texture for write-only pixel access.
Definition SDL3pp_render.h:5665
void SetRenderViewport(RendererRef renderer, OptionalRef< const RectRaw > rect)
Set the drawing area for rendering on the current target.
Definition SDL3pp_render.h:6167
void RenderPresent(RendererRef renderer)
Update the screen with any rendering performed since the previous call.
Definition SDL3pp_render.h:7582
void RenderTextureAffine(RendererRef renderer, TextureRef texture, OptionalRef< const FRectRaw > srcrect, OptionalRef< const FPointRaw > origin, OptionalRef< const FPointRaw > right, OptionalRef< const FPointRaw > down)
Copy a portion of the source texture to the current rendering target, with affine transform,...
Definition SDL3pp_render.h:7096
void UnlockTexture(TextureRef texture)
Unlock a texture, uploading the changes to video memory, if needed.
Definition SDL3pp_render.h:5753
void AddVulkanRenderSemaphores(RendererRef renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore)
Add a set of synchronization semaphores for the current frame.
Definition SDL3pp_render.h:7748
void SetRenderTextureAddressMode(TextureAddressMode u_mode, TextureAddressMode v_mode)
Set the texture addressing mode used in Renderer.RenderGeometry().
Definition SDL3pp_render.h:7462
void RenderTextureTiled(TextureRef texture, OptionalRef< const FRectRaw > srcrect, float scale, OptionalRef< const FRectRaw > dstrect)
Tile a portion of the texture to the current rendering target at subpixel precision.
Definition SDL3pp_render.h:7150
constexpr RendererLogicalPresentation LOGICAL_PRESENTATION_STRETCH
The rendered content is stretched to the output resolution.
Definition SDL3pp_render.h:175
const char * GetRendererName(RendererRef renderer)
Get the name of a renderer.
Definition SDL3pp_render.h:4097
void GetDefaultTextureScaleMode(ScaleMode *scale_mode)
Get default texture scale mode of the given renderer.
Definition SDL3pp_render.h:7975
void GetCurrentRenderOutputSize(RendererRef renderer, int *w, int *h)
Get the current output size in pixels of a rendering context.
Definition SDL3pp_render.h:4283
float GetTextureAlphaModFloat(TextureConstRef texture)
Get the additional alpha value multiplied into render copy operations.
Definition SDL3pp_render.h:5216
void RenderFillRect(OptionalRef< const FRectRaw > rect)
Fill a rectangle on the current rendering target with the drawing color at subpixel precision.
Definition SDL3pp_render.h:6959
int GetNumRenderDrivers()
Get the number of 2D rendering drivers available for the current display.
Definition SDL3pp_render.h:3574
const char * GetRenderDriver(int index)
Use this function to get the name of a built in 2D rendering driver.
Definition SDL3pp_render.h:3598
void RenderLines(RendererRef renderer, SpanRef< const FPointRaw > points)
Draw a series of connected lines on the current rendering target at subpixel precision.
Definition SDL3pp_render.h:6879
WindowRef GetRenderWindow(RendererRef renderer)
Get the window associated with a renderer.
Definition SDL3pp_render.h:4076
void Unlock(TextureLock &&lock)
Unlock a texture, uploading the changes to video memory, if needed.
Definition SDL3pp_render.h:5755
RendererRef GetRenderer() const
Get the renderer that created an Texture.
Definition SDL3pp_render.h:4849
void SetVSync(int vsync)
Toggle VSync of the given renderer.
Definition SDL3pp_render.h:7792
bool RenderViewportSet(RendererRef renderer)
Return whether an explicit rectangle was set as the viewport.
Definition SDL3pp_render.h:6250
void GetTextureColorModFloat(TextureConstRef texture, float *r, float *g, float *b)
Get the additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5095
void ResetClipRect()
Reset the clip rectangle for rendering to the entire render target.
Definition SDL3pp_render.h:6340
float GetAlphaModFloat() const
Get the additional alpha value multiplied into render copy operations.
Definition SDL3pp_render.h:5223
void SetTextureBlendMode(TextureRef texture, BlendMode blendMode)
Set the blend mode for a texture, used by Renderer.RenderTexture().
Definition SDL3pp_render.h:5360
void AddVulkanRenderSemaphores(Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore)
Add a set of synchronization semaphores for the current frame.
Definition SDL3pp_render.h:7757
Uint8 GetTextureAlphaMod(TextureConstRef texture)
Get the additional alpha value multiplied into render copy operations.
Definition SDL3pp_render.h:5189
void GetColorMod(Uint8 *r, Uint8 *g, Uint8 *b) const
Get the additional color value multiplied into render copy operations.
Definition SDL3pp_render.h:5073
void LockTexture(TextureRef texture, OptionalRef< const RectRaw > rect, void **pixels, int *pitch)
Lock a portion of the texture for write-only pixel access.
Definition SDL3pp_render.h:5657
void RenderTexture9GridTiled(RendererRef renderer, TextureRef texture, const FRectRaw &srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const FRectRaw &dstrect, float tileScale)
Perform a scaled copy using the 9-grid algorithm to the current rendering target at subpixel precisio...
Definition SDL3pp_render.h:7268
Texture CreateTexture(PixelFormat format, TextureAccess access, const PointRaw &size)
Create a texture for a rendering context.
Definition SDL3pp_render.h:4354
void SetTextureAlphaMod(TextureRef texture, Uint8 alpha)
Set an additional alpha value multiplied into render copy operations.
Definition SDL3pp_render.h:5131
void SetTexturePalette(TextureRef texture, PaletteRef palette)
Set the palette used by a texture.
Definition SDL3pp_render.h:4941
Surface LockTextureToSurface(TextureRef texture, OptionalRef< const RectRaw > rect=std::nullopt)
Lock a portion of the texture for write-only pixel access, and expose it as a SDL surface.
Definition SDL3pp_render.h:5712
void ResetRenderTarget(RendererRef renderer)
Set target texture back to window.
Definition SDL3pp_render.h:5831
void SetTextureMod(TextureRef texture, Color c)
Set an additional color and alpha values multiplied into render copy operations.
Definition SDL3pp_render.h:5251
void SetRenderClipRect(RendererRef renderer, OptionalRef< const RectRaw > rect)
Set the clip rectangle for rendering on the specified target.
Definition SDL3pp_render.h:6308
Color GetDrawColor() const
Get the color used for drawing operations (Rect, Line and Clear).
Definition SDL3pp_render.h:6594
void SetGPURenderStateFragmentUniforms(GPURenderStateRef state, Uint32 slot_index, const void *data, Uint32 length)
Set fragment shader uniform variables in a custom GPU render state.
Definition SDL3pp_render.h:8140
int GetTextureHeight(TextureConstRef texture)
Get the height in pixels.
Definition SDL3pp_render.h:4905
void SetScaleMode(ScaleMode scaleMode)
Set the scale mode used for texture scale operations.
Definition SDL3pp_render.h:5417
::Sint64 Sint64
A signed 64-bit integer type.
Definition SDL3pp_stdinc.h:305
::Uint32 Uint32
An unsigned 32-bit integer type.
Definition SDL3pp_stdinc.h:290
::Uint8 Uint8
An unsigned 8-bit integer type.
Definition SDL3pp_stdinc.h:238
SDL_FlipMode FlipMode
The flip mode.
Definition SDL3pp_surface.h:127
SDL_ScaleMode ScaleMode
The scaling mode.
Definition SDL3pp_surface.h:98
SDL_Surface * SurfaceRaw
Alias to raw representation for Surface.
Definition SDL3pp_surface.h:44
ResourceConstRef< SurfaceRaw, SurfaceRawConst > SurfaceConstRef
Safely wrap Surface for non owning const parameters.
Definition SDL3pp_surface.h:57
ResourceRef< Surface > SurfaceRef
Reference for Surface.
Definition SDL3pp_surface.h:54
ResourceRef< Window > WindowRef
Reference for Window.
Definition SDL3pp_video.h:54
Uint64 WindowFlags
The flags on a window.
Definition SDL3pp_video.h:515
SDL_Window * WindowRaw
Alias to raw representation for Window.
Definition SDL3pp_video.h:47
ResourceRef< Renderer > RendererRef
Reference for Renderer.
Definition SDL3pp_video.h:75
Properties for Renderer.
Definition SDL3pp_render.h:3857
Properties for Texture.
Definition SDL3pp_render.h:4557
Main include header for the SDL3pp library.
Sint32 narrowS32(T value)
Narrows to Sint32.
Definition SDL3pp_stdinc.h:6257
A structure that represents a color as RGBA components.
Definition SDL3pp_pixels.h:2145
The bits of this structure can be directly reinterpreted as a float-packed color which uses the PIXEL...
Definition SDL3pp_pixels.h:2318
The structure that defines a point (using floating point values).
Definition SDL3pp_rect.h:526
A rectangle stored using floating point values.
Definition SDL3pp_rect.h:1457
A custom GPU render state.
Definition SDL3pp_render.h:7993
constexpr GPURenderState & operator=(GPURenderState &&other) noexcept
Assignment operator.
Definition SDL3pp_render.h:8045
constexpr ResourceBase(RawPointer resource)
Constructs from resource pointer.
Definition SDL3pp_resource.h:29
~GPURenderState()
Destructor.
Definition SDL3pp_render.h:8042
constexpr GPURenderState(const GPURenderState &other)=delete
Copy constructor.
constexpr GPURenderState(GPURenderState &&other) noexcept
Move constructor.
Definition SDL3pp_render.h:8012
constexpr GPURenderState(GPURenderStateRaw resource) noexcept
Constructs from raw GPURenderState.
Definition SDL3pp_render.h:8003
GPURenderState & operator=(const GPURenderState &other)=delete
Assignment operator.
A set of indexed colors representing a palette.
Definition SDL3pp_pixels.h:2463
static Palette Borrow(PaletteRaw resource)
Safely borrows the from PaletteRaw.
Definition SDL3pp_pixels.h:2517
The structure that defines a point (using integers).
Definition SDL3pp_rect.h:97
A rectangle, with the origin at the upper left (using integers).
Definition SDL3pp_rect.h:859
A structure representing rendering state.
Definition SDL3pp_render.h:220
constexpr ResourceBase(RawPointer resource)
Constructs from resource pointer.
Definition SDL3pp_resource.h:29
constexpr Renderer(Renderer &&other) noexcept
Move constructor.
Definition SDL3pp_render.h:239
constexpr Renderer(RendererRaw resource) noexcept
Constructs from raw Renderer.
Definition SDL3pp_render.h:230
Renderer & operator=(const Renderer &other)=delete
Assignment operator.
constexpr Renderer & operator=(Renderer &&other) noexcept
Assignment operator.
Definition SDL3pp_render.h:369
~Renderer()
Destructor.
Definition SDL3pp_render.h:366
constexpr Renderer(const Renderer &other)=delete
Copy constructor.
A non-owning reference wrapper for a given resource.
Definition SDL3pp_resource.h:156
A collection of pixels used in software blitting.
Definition SDL3pp_surface.h:172
constexpr Surface & operator=(Surface &&other) noexcept
Assignment operator.
Definition SDL3pp_surface.h:356
constexpr Surface(SurfaceRaw resource) noexcept
Constructs from raw Surface.
Definition SDL3pp_surface.h:182
static Surface Borrow(SurfaceRaw resource)
Safely borrows the from SurfaceRaw.
Definition SDL3pp_surface.h:340
An efficient driver-specific representation of pixel data.
Definition SDL3pp_render.h:2249
constexpr Texture & operator=(Texture &&other) noexcept
Assignment operator.
Definition SDL3pp_render.h:2549
static Texture Borrow(TextureRaw resource)
Safely borrows the from TextureRaw.
Definition SDL3pp_render.h:2533
constexpr ResourceBase(RawPointer resource)
Constructs from resource pointer.
Definition SDL3pp_resource.h:29
constexpr Texture(const Texture &other)
Copy constructor.
Definition SDL3pp_render.h:2265
Texture & operator=(const Texture &other)
Assignment operator.
Definition SDL3pp_render.h:2556
~Texture()
Destructor.
Definition SDL3pp_render.h:2546
constexpr Texture(TextureRaw resource) noexcept
Constructs from raw Texture.
Definition SDL3pp_render.h:2259
constexpr Texture(Texture &&other) noexcept
Move constructor.
Definition SDL3pp_render.h:2272
The struct used as an opaque handle to a window.
Definition SDL3pp_video.h:748
constexpr Window(WindowRaw resource) noexcept
Constructs from raw Window.
Definition SDL3pp_video.h:758