From c68c5adc0d3753ebbad5e8b35dc0b80ed66dba3e Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Wed, 2 Nov 2022 17:51:07 +0800 Subject: [PATCH] Added GetTextureHandle() to SHGraphicsSystem --- .../MiddleEnd/Interface/SHGraphicsSystem.cpp | 5 +++++ .../MiddleEnd/Interface/SHGraphicsSystem.h | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index 97380fa3..bccece68 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -655,6 +655,11 @@ namespace SHADE ); } + Handle SHGraphicsSystem::GetTextureHandle(SHTexture::Index textureId) const + { + return texLibrary.GetTextureHandle(textureId); + } + #pragma endregion ADD_REMOVE #pragma region ROUTINES diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.h b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.h index 3f899446..d5ac64dc 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.h @@ -262,6 +262,21 @@ namespace SHADE */ /***************************************************************************/ void BuildTextures(); + /***************************************************************************/ + /*! + * + \brief + Retrieves the texture handle at the specified texture index. + + \param textureId + Index of the texture to look for. + + \returns + Handle to the texture + + */ + /***************************************************************************/ + Handle GetTextureHandle(SHTexture::Index textureId) const; void PrepareResize(uint32_t newWidth, uint32_t newHeight) noexcept; void HandleResize(void) noexcept;