Add Os Bridge into test framework

This commit is contained in:
2026-03-21 14:43:16 +01:00
parent a86c13b9a3
commit baad2ce15c
10 changed files with 357 additions and 242 deletions
+32
View File
@@ -0,0 +1,32 @@
#pragma once
#include <palladium>
enum class Driver {
Unknown = 0,
OpenGL2 = 1,
OpenGL3 = 2,
DirectX9 = 3,
Citro3D = 4,
};
namespace PD {
class OsCtx {
public:
OsCtx(Driver d) : pDriver(d) {}
virtual ~OsCtx() {}
virtual void Init() {}
virtual void Deinit() {}
virtual bool Mainloop() { return false; }
virtual void ClearViewPort() {}
virtual void SwapBuffers() {}
PD::fvec2 SizeTranslate(PD::fvec2 in) {
return fvec2(in.x * pViewPort.x, in.y * pViewPort.y);
}
protected:
PD::ivec2 pViewPort;
const Driver pDriver;
};
} // namespace PD
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include <os-ctx.hpp>
namespace PD {
class DesktopOS : public PD::OsCtx {
public:
DesktopOS(Driver d = Driver::OpenGL3) : PD::OsCtx(d) {}
~DesktopOS() {}
void Init() override;
void Deinit() override;
bool Mainloop() override;
void ClearViewPort() override;
void SwapBuffers() override;
private:
struct Impl;
Impl* impl = nullptr;
};
} // namespace PD
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include <os-ctx.hpp>
namespace PD {
class HorizonCtr : public PD::OsCtx {
public:
HorizonCtr(Driver d = Driver::Citro3D) : PD::OsCtx(d) {}
~HorizonCtr() {}
void Init() override;
void Deinit() override;
bool Mainloop() override;
void ClearViewPort() override;
void SwapBuffers() override;
private:
struct Impl;
Impl* impl = nullptr;
};
} // namespace PD
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include <os-ctx.hpp>
namespace PD {
class HorizonNX : public PD::OsCtx {
public:
HorizonNX(Driver d = Driver::OpenGL3) : PD::OsCtx(d) {}
~HorizonNX() {}
void Init() override;
void Deinit() override;
bool Mainloop() override;
void ClearViewPort() override;
void SwapBuffers() override;
private:
struct Impl;
Impl* impl = nullptr;
};
} // namespace PD