23 if (
rounded >=
static_cast<long long>(maximum))
40 if (
width >
static_cast<Uint32>(std::numeric_limits<int>::max()) ||
41 height >
static_cast<Uint32>(std::numeric_limits<int>::max()))
44 "World3D target exceeds logical viewport range", {}, {}});
45 const auto rect = world.
view()->viewport;
49 {
static_cast<double>(
rect.left),
static_cast<double>(
rect.top),
50 static_cast<double>(
rect.right -
rect.left),
51 static_cast<double>(
rect.bottom -
rect.top)});
53 static_cast<float>(pixels.y),
static_cast<float>(pixels.width),
54 static_cast<float>(pixels.height), 0, 1};
65 if (device ==
nullptr ||
window ==
nullptr)
146 if (background.
texture !=
nullptr &&
161 std::numeric_limits<int>::max()) &&
163 std::numeric_limits<int>::max()))
165 const auto transform =
167 static_cast<int>(
width),
204 blit.source.texture =
207 blit.source.mip_level = 0;
208 blit.source.layer_or_depth_plane = 0;
220 blit.destination.texture =
223 blit.destination.mip_level = 0;
224 blit.destination.layer_or_depth_plane = 0;
288 return SDL_SetError(
"World2D render: %s", result.error().c_str());
const std::optional< World3DProjectionState > & view() const noexcept
engine::World3DRect worldViewport(Viewport3D viewport) noexcept
const State & stateReadOnly()
bool present(SDL_GPUDevice *device, SDL_Window *window, World3DRenderer *renderer, const SequenceWorld3DSlot *world, World2DRenderer *overlayRenderer, const SequenceWorld2DSlot *overlay, SDL_FColor backdrop)
std::expected< World3DRenderStats, World3DRendererError > recordWorld3D(SDL_GPUCommandBuffer *command, SDL_GPUTexture *target, Uint32 width, Uint32 height, World3DRenderer &renderer, const SequenceWorld3DSlot &world)
const Texture2D & background3D()
PixelRect logicalToPixelRect(const Transform &transform, const LogicalRect &logicalRect) noexcept
Transform makeWorld3DTransform(int targetWidth, int targetHeight) noexcept
bool viewportBackgroundFillOn