2026-03-16 15:19:12 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <pd/drivers/gfx.hpp>
|
2026-03-17 16:47:19 +01:00
|
|
|
#include <pd_system/ctr-linear-allocator.hpp>
|
2026-03-16 15:19:12 +01:00
|
|
|
|
|
|
|
|
namespace PD {
|
2026-03-17 16:47:19 +01:00
|
|
|
struct GfxCitro3DConfig {
|
2026-03-16 15:19:12 +01:00
|
|
|
// Vertex Allocator
|
|
|
|
|
template <typename T>
|
2026-03-17 16:47:19 +01:00
|
|
|
using VertexAlloc = LinearAllocator<T>;
|
2026-03-16 15:19:12 +01:00
|
|
|
// Index Allocator
|
|
|
|
|
template <typename T>
|
2026-03-17 16:47:19 +01:00
|
|
|
using IndexAlloc = LinearAllocator<T>;
|
2026-03-16 15:19:12 +01:00
|
|
|
|
|
|
|
|
static constexpr size_t NumVertices = 32768; // 8192*4
|
|
|
|
|
static constexpr size_t NumIndices = 49152; // 8192*6
|
|
|
|
|
};
|
2026-03-17 16:47:19 +01:00
|
|
|
|
|
|
|
|
class GfxCitro3D : public GfxDriverBase<GfxCitro3DConfig> {
|
2026-03-16 15:19:12 +01:00
|
|
|
public:
|
2026-03-17 16:47:19 +01:00
|
|
|
GfxCitro3D() : GfxDriverBase("Citro3D") {}
|
|
|
|
|
~GfxCitro3D() {}
|
2026-03-16 15:19:12 +01:00
|
|
|
|
|
|
|
|
void SysInit() override;
|
|
|
|
|
void SysDeinit() override;
|
|
|
|
|
void Submit(size_t count, size_t start) override;
|
|
|
|
|
void BindTexture(TextureID id) override;
|
|
|
|
|
void SysReset() override;
|
2026-03-18 09:31:47 +01:00
|
|
|
Li::Texture LoadTexture(
|
|
|
|
|
const std::vector<PD::u8>& pixels, int w, int h,
|
|
|
|
|
TextureFormat type = TextureFormat::RGBA32,
|
|
|
|
|
TextureFilter filter = TextureFilter::Linear) override;
|
|
|
|
|
void DeleteTexture(const Li::Texture& tex) override;
|
2026-03-16 15:19:12 +01:00
|
|
|
|
|
|
|
|
private:
|
2026-03-17 16:47:19 +01:00
|
|
|
struct Impl;
|
|
|
|
|
Impl* impl = nullptr;
|
2026-03-16 15:19:12 +01:00
|
|
|
};
|
|
|
|
|
} // namespace PD
|