- Track textures (not sure if this is done tbh) - Add lithium formatters and move TextureID, TextureFormat and TextureFilter to lithium - Only include gl-helper if any glDriver is included - Add Li::Rect for UV stuff - Add Li::Texture as Info holder (still thinking of making them to ptrs - Add Check if textures are still loaded on exit
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <pd/drivers/gfx.hpp>
|
|
|
|
namespace PD {
|
|
struct GfxDirectX9Config {
|
|
// Vertex Allocator
|
|
template <typename T>
|
|
using VertexAlloc = std::allocator<T>;
|
|
// Index Allocator
|
|
template <typename T>
|
|
using IndexAlloc = std::allocator<T>;
|
|
|
|
static constexpr size_t NumVertices = 32768; // 8192*4
|
|
static constexpr size_t NumIndices = 49152; // 8192*6
|
|
};
|
|
|
|
class GfxDirectX9 : public GfxDriverBase<GfxDirectX9Config> {
|
|
public:
|
|
GfxDirectX9(void* device = nullptr)
|
|
: GfxDriverBase("DirectX9"), pDevice(device) {}
|
|
~GfxDirectX9() {}
|
|
|
|
void SysInit() override;
|
|
void SysDeinit() override;
|
|
void Submit(size_t count, size_t start) override;
|
|
void BindTexture(TextureID id) override;
|
|
void SysReset() override;
|
|
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;
|
|
|
|
private:
|
|
struct Impl;
|
|
Impl* impl = nullptr;
|
|
void* pDevice = nullptr;
|
|
};
|
|
} // namespace PD
|