Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
World3DPipeline.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <SDL3/SDL_gpu.h>
6
7#include <expected>
8#include <filesystem>
9#include <optional>
10#include <string>
11
12namespace monopoly::engine
13{
22
24 {
26 std::string detail;
27 std::optional<World3DShaderError> shaderError;
28 };
29
30 [[nodiscard]] std::optional<SDL_GPUTextureFormat>
33 {
34 public:
35 World3DPipeline() = default;
41
42 [[nodiscard]] static std::expected<World3DPipeline,
44 SDL_GPUDevice* device,
45 const std::filesystem::path& shaderDirectory,
47 bool modernPBR = false,
49
51 { return pipeline_; }
53 { return shadowPipeline_; }
55 { return doubleSidedPipeline_; }
57 { return depthFormat_; }
59 { return shaders_; }
60
61 void reset() noexcept;
62
63 private:
64 SDL_GPUDevice* device_{};
65 SDL_GPUGraphicsPipeline* pipeline_{};
66 SDL_GPUGraphicsPipeline* shadowPipeline_{};
67 SDL_GPUGraphicsPipeline* doubleSidedPipeline_{};
69 World3DShaderSet shaders_;
70 };
71}
unsigned index
CardTag other
SDL_GPUGraphicsPipeline * handle() const noexcept
World3DPipeline & operator=(const World3DPipeline &)=delete
SDL_GPUGraphicsPipeline * shadowHandle() const noexcept
World3DPipeline(const World3DPipeline &)=delete
SDL_GPUGraphicsPipeline * doubleSidedHandle() const noexcept
SDL_GPUTextureFormat depthFormat() const noexcept
const World3DShaderSet & shaders() const noexcept
static std::expected< World3DPipeline, World3DPipelineError > load(SDL_GPUDevice *device, const std::filesystem::path &shaderDirectory, SDL_GPUTextureFormat colorFormat, bool modernPBR=false, SDL_GPUSampleCount samples=SDL_GPU_SAMPLECOUNT_1)
std::optional< SDL_GPUTextureFormat > chooseWorld3DDepthFormat(SDL_GPUDevice *device) noexcept
std::optional< World3DShaderError > shaderError