rename PDBackendFlags to PDGfxBackendFlags

This commit is contained in:
2026-04-03 12:52:30 +02:00
parent a776addf11
commit 8215baac99
3 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ void GfxCitro3D::SysInit() {
if (impl) return; if (impl) return;
PDLOG("GfxCitro3D::SysInit();"); PDLOG("GfxCitro3D::SysInit();");
impl = new Impl(); impl = new Impl();
Flags |= PDBackendFlags_FlipUV_Y; Flags |= PDGfxBackendFlags_FlipUV_Y;
impl->pShaderRaw = Pica::AssembleCode(LIShaderCTR); impl->pShaderRaw = Pica::AssembleCode(LIShaderCTR);
impl->pCode = DVLB_ParseFile((uint32_t*)impl->pShaderRaw.data(), impl->pCode = DVLB_ParseFile((uint32_t*)impl->pShaderRaw.data(),
impl->pShaderRaw.size()); impl->pShaderRaw.size());
+8 -8
View File
@@ -6,11 +6,11 @@
#include <pd/lithium/pools.hpp> #include <pd/lithium/pools.hpp>
#include <pd/lithium/texture.hpp> #include <pd/lithium/texture.hpp>
using PDBackendFlags = PD::u32; using PDGfxBackendFlags = PD::u32;
enum PDBackendFlags_ { enum PDGfxBackendFlags_ {
PDBackendFlags_None = 0, PDGfxBackendFlags_None = 0,
PDBackendFlags_FlipUV_Y = 1 << 0, // Essential for font loading PDGfxBackendFlags_FlipUV_Y = 1 << 0, // Essential for font loading
PDBackendFlags_WindingCW = 1 << 0, // Use CW instead of CCW winding PDGfxBackendFlags_WindingCW = 1 << 0, // Use CW instead of CCW winding
}; };
namespace PD { namespace PD {
@@ -40,7 +40,7 @@ class PD_API GfxDriver : public DriverInterface {
virtual void DeleteTexture(const Li::Texture& tex) {} virtual void DeleteTexture(const Li::Texture& tex) {}
virtual void Draw(const Pool<Li::Command>& commands) {} virtual void Draw(const Pool<Li::Command>& commands) {}
Li::Texture::Ptr GetWhiteTexture() { return &pWhite; } Li::Texture::Ptr GetWhiteTexture() { return &pWhite; }
PDBackendFlags GetFlags() { return Flags; } PDGfxBackendFlags GetFlags() { return Flags; }
size_t GetNumVertices() const { return CountVertices; } size_t GetNumVertices() const { return CountVertices; }
size_t GetNumIndices() const { return CountIndices; } size_t GetNumIndices() const { return CountIndices; }
@@ -70,7 +70,7 @@ class PD_API GfxDriver : public DriverInterface {
ivec2 ViewPort; ivec2 ViewPort;
std::unordered_map<TextureID, Li::Texture> pTextureRegestry; std::unordered_map<TextureID, Li::Texture> pTextureRegestry;
Li::Texture pWhite; Li::Texture pWhite;
PDBackendFlags Flags = 0; PDGfxBackendFlags Flags = 0;
}; };
struct DefaultGfxConfig { struct DefaultGfxConfig {
@@ -174,7 +174,7 @@ class PD_API Gfx {
return driver->GetWhiteTexture(); return driver->GetWhiteTexture();
} }
static PDBackendFlags GetFlags() { return driver->GetFlags(); } static PDGfxBackendFlags GetFlags() { return driver->GetFlags(); }
static const char* GetDriverName() { return driver->GetName(); } static const char* GetDriverName() { return driver->GetName(); }
+1 -1
View File
@@ -103,7 +103,7 @@ PD_API void Font::LoadTTF(const std::vector<u8>& data, int px_height) {
uvs.z = (off.x + w) / static_cast<float>(texszs); uvs.z = (off.x + w) / static_cast<float>(texszs);
uvs.w = (off.y + h) / static_cast<float>(texszs); uvs.w = (off.y + h) / static_cast<float>(texszs);
// Flip if needed // Flip if needed
if (PD::Gfx::GetFlags() & PDBackendFlags_FlipUV_Y) { if (PD::Gfx::GetFlags() & PDGfxBackendFlags_FlipUV_Y) {
uvs.y = 1.f - uvs.y; uvs.y = 1.f - uvs.y;
uvs.w = 1.f - uvs.w; uvs.w = 1.f - uvs.w;
} }