2026-03-16 15:19:12 +01:00
|
|
|
#include <pd/drivers/gfx.hpp>
|
|
|
|
|
|
|
|
|
|
namespace PD {
|
|
|
|
|
PD_API std::unique_ptr<GfxDriver> Gfx::driver;
|
|
|
|
|
|
2026-03-17 16:47:19 +01:00
|
|
|
PD_API GfxDriver::GfxDriver(std::string_view name) : DriverInterface(name) {}
|
2026-03-16 15:19:12 +01:00
|
|
|
|
2026-03-17 16:47:19 +01:00
|
|
|
PD_API void GfxDriver::SetViewPort(const ivec2& size) {
|
2026-03-16 17:33:46 +01:00
|
|
|
ViewPort = size;
|
|
|
|
|
Projection = Mat4::Ortho(0.f, ViewPort.x, ViewPort.y, 0.f, 1.f, -1.f);
|
|
|
|
|
}
|
2026-03-17 16:47:19 +01:00
|
|
|
|
|
|
|
|
PD_API void GfxDriver::SetViewPort(int x, int y) {
|
2026-03-16 15:19:12 +01:00
|
|
|
ViewPort.x = x;
|
|
|
|
|
ViewPort.y = y;
|
2026-03-16 17:33:46 +01:00
|
|
|
Projection = Mat4::Ortho(0.f, ViewPort.x, ViewPort.y, 0.f, 1.f, -1.f);
|
2026-03-16 15:19:12 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-17 16:47:19 +01:00
|
|
|
PD_API void GfxDriver::Reset() {
|
2026-03-16 15:19:12 +01:00
|
|
|
CurrentVertex = 0;
|
|
|
|
|
CurrentIndex = 0;
|
2026-03-16 17:33:46 +01:00
|
|
|
ResetPools();
|
2026-03-16 15:19:12 +01:00
|
|
|
SysReset();
|
|
|
|
|
}
|
|
|
|
|
} // namespace PD
|