summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsTools
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-01-10 06:14:32 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-01-10 06:14:32 +0000
commit2d1b569e48c751a7bba1563deaf319affbcb18a3 (patch)
treec866c98569d3a4ee5741f1a37b2e131a9fe2a247 /Graphics/GraphicsTools
parentRenamed HIT_GROUP_BINDING_MODE_PER_ACCEL_STRUCT to HIT_GROUP_BINDING_MODE_PER... (diff)
downloadDiligentCore-2d1b569e48c751a7bba1563deaf319affbcb18a3.tar.gz
DiligentCore-2d1b569e48c751a7bba1563deaf319affbcb18a3.zip
Added IDeviceObject::SetUserData() and IDeviceObject::GetUserData() methods (API240081)
Diffstat (limited to 'Graphics/GraphicsTools')
-rw-r--r--Graphics/GraphicsTools/interface/DynamicTextureAtlas.h15
-rw-r--r--Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp12
2 files changed, 27 insertions, 0 deletions
diff --git a/Graphics/GraphicsTools/interface/DynamicTextureAtlas.h b/Graphics/GraphicsTools/interface/DynamicTextureAtlas.h
index 20a6077c..4bb96ff4 100644
--- a/Graphics/GraphicsTools/interface/DynamicTextureAtlas.h
+++ b/Graphics/GraphicsTools/interface/DynamicTextureAtlas.h
@@ -67,6 +67,21 @@ struct ITextureAtlasSuballocation : public IObject
/// Returns the pointer to the parent texture atlas.
virtual IDynamicTextureAtlas* GetAtlas() = 0;
+
+ /// Stores a pointer to the user-provided data object, which
+ /// may later be retreived through GetUserData().
+ ///
+ /// \param [in] pUserData - Pointer to the user data object to store.
+ ///
+ /// \note The method is not thread-safe and an application
+ /// must externally synchronize the access.
+ virtual void SetUserData(IObject* pUserData) = 0;
+
+ /// Returns the pointer to the user data object previously
+ /// set with SetUserData() method.
+ ///
+ /// \return Pointer to the user data object
+ virtual IObject* GetUserData() const = 0;
};
/// Dynamic texture atlas.
diff --git a/Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp b/Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp
index 05ee3586..01056a59 100644
--- a/Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp
+++ b/Graphics/GraphicsTools/src/DynamicTextureAtlas.cpp
@@ -97,6 +97,16 @@ public:
virtual IDynamicTextureAtlas* GetAtlas() override final;
+ virtual void SetUserData(IObject* pUserData) override final
+ {
+ m_pUserData = pUserData;
+ }
+
+ virtual IObject* GetUserData() const override final
+ {
+ return m_pUserData.RawPtr<IObject>();
+ }
+
private:
RefCntAutoPtr<DynamicTextureAtlasImpl> m_pParentAtlas;
@@ -104,6 +114,8 @@ private:
const Uint32 m_Slice;
const uint2 m_Size;
+
+ RefCntAutoPtr<IObject> m_pUserData;
};