Browse Source

libobs: Add copy constructor for ComQIPtr

derrod 2 years ago
parent
commit
f9cce334d2
1 changed files with 6 additions and 0 deletions
  1. 6 0
      libobs/util/windows/ComPtr.hpp

+ 6 - 0
libobs/util/windows/ComPtr.hpp

@@ -165,6 +165,12 @@ public:
 		unk->QueryInterface(__uuidof(T), (void **)&this->ptr);
 	}
 
+	template<class U> inline ComQIPtr(const ComPtr<U> &c)
+	{
+		this->ptr = nullptr;
+		c->QueryInterface(__uuidof(T), (void **)&this->ptr);
+	}
+
 	inline ComPtr<T> &operator=(IUnknown *unk)
 	{
 		ComPtr<T>::Clear();