- Renamed GfxOpenGL to GfxOPenGL2 - Added GfxOpenGL3 backend for OpenGL 3.3+ - Added WIP DirectX9 backend - Added structure for Citro3D - Added linear Allocator
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <pd/drivers/gfx.hpp>
|
|
#include <pd_system/ctr-linear-allocator.hpp>
|
|
|
|
namespace PD {
|
|
struct GfxCitro3DConfig {
|
|
// Vertex Allocator
|
|
template <typename T>
|
|
using VertexAlloc = LinearAllocator<T>;
|
|
// Index Allocator
|
|
template <typename T>
|
|
using IndexAlloc = LinearAllocator<T>;
|
|
|
|
static constexpr size_t NumVertices = 32768; // 8192*4
|
|
static constexpr size_t NumIndices = 49152; // 8192*6
|
|
};
|
|
|
|
class GfxCitro3D : public GfxDriverBase<GfxCitro3DConfig> {
|
|
public:
|
|
GfxCitro3D() : GfxDriverBase("Citro3D") {}
|
|
~GfxCitro3D() {}
|
|
|
|
void SysInit() override;
|
|
void SysDeinit() override;
|
|
void Submit(size_t count, size_t start) override;
|
|
void BindTexture(TextureID id) override;
|
|
void SysReset() override;
|
|
TextureID LoadTexture(const std::vector<PD::u8>& pixels, int w, int h,
|
|
TextureFormat type = TextureFormat::RGBA32,
|
|
TextureFilter filter = TextureFilter::Linear) override;
|
|
void DeleteTexture(const TextureID& tex) override;
|
|
|
|
private:
|
|
struct Impl;
|
|
Impl* impl = nullptr;
|
|
};
|
|
} // namespace PD
|