Files
palladium/backends/include/pd_system/gfx_opengl3.hpp
T

40 lines
985 B
C++
Raw Normal View History

2026-03-16 15:19:12 +01:00
#pragma once
#include <pd/drivers/gfx.hpp>
namespace PD {
2026-03-17 16:47:19 +01:00
struct GfxOpenGL3Config {
2026-03-16 15:19:12 +01:00
// Vertex Allocator
template <typename T>
using VertexAlloc = std::allocator<T>;
// Index Allocator
template <typename T>
using IndexAlloc = std::allocator<T>;
};
2026-03-17 16:47:19 +01:00
class GfxOpenGL3 : public GfxDriverBase<GfxOpenGL3Config> {
2026-03-16 15:19:12 +01:00
public:
2026-03-17 16:47:19 +01:00
GfxOpenGL3() : GfxDriverBase("OpenGL3") {}
~GfxOpenGL3() {}
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:
u32 pShader = 0;
u32 VBO = 0;
u32 IBO = 0;
2026-03-17 16:47:19 +01:00
u32 VAO = 0;
2026-03-16 15:19:12 +01:00
int pLocTex = 0;
int pLocAlfa = 0;
int pLocProjection = 0;
};
} // namespace PD