From 6b2ccd6735a6c8f5dcea376e1e6b5c35aa52e386 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Tue, 30 Dec 2025 10:13:55 -0600 Subject: [PATCH] feat(ui): add CSimpleTexture::SetShader --- src/ui/simple/CSimpleTexture.cpp | 9 +++++++++ src/ui/simple/CSimpleTexture.hpp | 1 + 2 files changed, 10 insertions(+) diff --git a/src/ui/simple/CSimpleTexture.cpp b/src/ui/simple/CSimpleTexture.cpp index c7db1d2..873929d 100644 --- a/src/ui/simple/CSimpleTexture.cpp +++ b/src/ui/simple/CSimpleTexture.cpp @@ -479,6 +479,15 @@ void CSimpleTexture::SetPosition(const CRect& rect, C3Vector* position) { position[3] = { rect.maxX, rect.minY, this->m_layoutDepth }; } +void CSimpleTexture::SetShader(CGxShader* shader) { + if (this->m_shader == shader) { + return; + } + + this->m_shader = shader; + this->OnRegionChanged(); +} + void CSimpleTexture::SetTexCoord(const CRect& texRect) { this->m_texCoord[0] = { texRect.minX, texRect.minY }; this->m_texCoord[1] = { texRect.minX, texRect.maxY }; diff --git a/src/ui/simple/CSimpleTexture.hpp b/src/ui/simple/CSimpleTexture.hpp index 4d998e0..e3433b1 100644 --- a/src/ui/simple/CSimpleTexture.hpp +++ b/src/ui/simple/CSimpleTexture.hpp @@ -55,6 +55,7 @@ class CSimpleTexture : public CSimpleRegion { void SetAlpha(float alpha); void SetBlendMode(EGxBlend blend); void SetPosition(const CRect& rect, C3Vector* position); + void SetShader(CGxShader* shader); void SetTexCoord(const CRect& texRect); void SetTexCoord(const C2Vector* texCoord); int32_t SetTexture(const char* fileName, bool wrapU, bool wrapV, EGxTexFilter filter, TextureImageMode mode);