113 explicit Rasterizer(PolygonMode polygon_mode, CullMode cull_mode, CullOrder cull_order,
float line_width,
const DepthStencilState& depth_stencil_state)
noexcept;
122 [[nodiscard]] PolygonMode polygonMode()
const noexcept override;
125 [[nodiscard]] CullMode cullMode()
const noexcept override;
128 [[nodiscard]] CullOrder cullOrder()
const noexcept override;
131 [[nodiscard]]
float lineWidth()
const noexcept override;
134 [[nodiscard]]
const DepthStencilState& depthStencilState()
const noexcept override;
138 [[nodiscard]]
float& lineWidth()
noexcept;
142 std::unique_ptr<Impl> m_impl;
147struct std::formatter<spark::render::PolygonMode> : std::formatter<std::string_view>
149 static constexpr auto parse(format_parse_context& ctx) {
return ctx.begin(); }
151 static constexpr auto format(
const spark::render::PolygonMode polygon_mode,
auto& ctx)
153 switch (polygon_mode)
155 case spark::render::PolygonMode::Solid:
156 return std::format_to(ctx.out(),
"Solid");
157 case spark::render::PolygonMode::WireFrame:
158 return std::format_to(ctx.out(),
"WireFrame");
159 case spark::render::PolygonMode::Point:
160 return std::format_to(ctx.out(),
"Point");
163 return std::format_to(ctx.out(),
"Unknown");
168struct std::formatter<spark::render::CullMode> : std::formatter<std::string_view>
170 static constexpr auto parse(format_parse_context& ctx) {
return ctx.begin(); }
172 static constexpr auto format(
const spark::render::CullMode cull_mode,
auto& ctx)
176 case spark::render::CullMode::FrontFaces:
177 return std::format_to(ctx.out(),
"FrontFaces");
178 case spark::render::CullMode::BackFaces:
179 return std::format_to(ctx.out(),
"BackFaces");
180 case spark::render::CullMode::Both:
181 return std::format_to(ctx.out(),
"Both");
182 case spark::render::CullMode::Disabled:
183 return std::format_to(ctx.out(),
"Disabled");
186 return std::format_to(ctx.out(),
"Unknown");
191struct std::formatter<spark::render::CullOrder> : std::formatter<std::string_view>
193 static constexpr auto parse(format_parse_context& ctx) {
return ctx.begin(); }
195 static constexpr auto format(
const spark::render::CullOrder cull_order,
auto& ctx)
199 case spark::render::CullOrder::ClockWise:
200 return std::format_to(ctx.out(),
"ClockWise");
201 case spark::render::CullOrder::CounterClockWise:
202 return std::format_to(ctx.out(),
"CounterClockWise");
205 return std::format_to(ctx.out(),
"Unknown");