mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 12:18:30 +09:00
[Feat] (MG_Util): Versioning for BindingSlot.
This commit is contained in:
@@ -145,17 +145,18 @@ namespace MobileGL {
|
||||
using TargetEnum = typename ObjectType::TargetEnum;
|
||||
|
||||
BindingSlot() : m_target((TargetEnum)0), m_boundObject(nullptr) {}
|
||||
|
||||
explicit BindingSlot(TargetEnum target) : m_target(target), m_boundObject(nullptr) {}
|
||||
|
||||
void Bind(SharedPtr<ObjectType> object) { m_boundObject = object; }
|
||||
|
||||
void Bind(SharedPtr<ObjectType> object) {
|
||||
m_boundObject = object;
|
||||
++m_version;
|
||||
}
|
||||
SharedPtr<ObjectType> GetBoundObject() const { return m_boundObject; }
|
||||
|
||||
TargetEnum GetTarget() const { return m_target; }
|
||||
Uint16 GetVersion() const { return m_version; }
|
||||
|
||||
private:
|
||||
TargetEnum m_target;
|
||||
Uint16 m_version = 0;
|
||||
SharedPtr<ObjectType> m_boundObject;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user