From 2b64f003622ee7871fd7aec041622427dd2fc88f Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 19 Aug 2016 23:35:47 -0700 Subject: Updated to Diligent Engine 2.0 --- Common/interface/AdvancedMath.h | 2 +- Common/interface/BasicMath.h | 2 +- Common/interface/ComPtr.h | 43 ---------------------------------- Common/interface/DataBlob.h | 2 +- Common/interface/FileStream.h | 2 +- Common/interface/MemoryAllocator.h | 45 ++++++++++++++++++++++++++++++++++++ Common/interface/Object.h | 2 +- Common/interface/ReferenceCounters.h | 2 +- 8 files changed, 51 insertions(+), 49 deletions(-) delete mode 100644 Common/interface/ComPtr.h create mode 100644 Common/interface/MemoryAllocator.h (limited to 'Common/interface') diff --git a/Common/interface/AdvancedMath.h b/Common/interface/AdvancedMath.h index c4af54ad..d6623875 100644 --- a/Common/interface/AdvancedMath.h +++ b/Common/interface/AdvancedMath.h @@ -1,4 +1,4 @@ -/* Copyright 2015 Egor Yusov +/* Copyright 2015-2016 Egor Yusov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Common/interface/BasicMath.h b/Common/interface/BasicMath.h index 95b35974..19d54ec2 100644 --- a/Common/interface/BasicMath.h +++ b/Common/interface/BasicMath.h @@ -1,4 +1,4 @@ -/* Copyright 2015 Egor Yusov +/* Copyright 2015-2016 Egor Yusov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Common/interface/ComPtr.h b/Common/interface/ComPtr.h deleted file mode 100644 index 94e4b1f2..00000000 --- a/Common/interface/ComPtr.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2015 Egor Yusov - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. - * - * In no event and under no legal theory, whether in tort (including negligence), - * contract, or otherwise, unless required by applicable law (such as deliberate - * and grossly negligent acts) or agreed to in writing, shall any Contributor be - * liable for any damages, including any direct, indirect, special, incidental, - * or consequential damages of any character arising as a result of this License or - * out of the use or inability to use the software (including but not limited to damages - * for loss of goodwill, work stoppage, computer failure or malfunction, or any and - * all other commercial damages or losses), even if such Contributor has been advised - * of the possibility of such damages. - */ - -#pragma once - -/// \file -/// Defines Diligent::CComPtr - -#include "RefCntAutoPtr.h" - -namespace Diligent -{ - template - class BlockAddRefReleaseCOM : public T - { - private: - virtual decltype( reinterpret_cast(nullptr)->AddRef() ) STDMETHODCALLTYPE AddRef()override = 0; - virtual decltype( reinterpret_cast(nullptr)->Release() ) STDMETHODCALLTYPE Release()override = 0; - }; - - template - using CComPtr = Diligent::RefCntAutoPtr; -} diff --git a/Common/interface/DataBlob.h b/Common/interface/DataBlob.h index 2940f1d3..abc60215 100644 --- a/Common/interface/DataBlob.h +++ b/Common/interface/DataBlob.h @@ -1,4 +1,4 @@ -/* Copyright 2015 Egor Yusov +/* Copyright 2015-2016 Egor Yusov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Common/interface/FileStream.h b/Common/interface/FileStream.h index 1263ef42..75aba909 100644 --- a/Common/interface/FileStream.h +++ b/Common/interface/FileStream.h @@ -1,4 +1,4 @@ -/* Copyright 2015 Egor Yusov +/* Copyright 2015-2016 Egor Yusov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Common/interface/MemoryAllocator.h b/Common/interface/MemoryAllocator.h new file mode 100644 index 00000000..d7e3289e --- /dev/null +++ b/Common/interface/MemoryAllocator.h @@ -0,0 +1,45 @@ +/* Copyright 2015-2016 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +/// \file +/// Defines Diligent::IMemoryAllocator interface + +#include "BasicTypes.h" + +namespace Diligent +{ + +/// Base interface for a raw memory allocator +class IMemoryAllocator +{ +public: + /// Allocates block of memory + virtual void* Allocate( size_t Size, const Char* dbgDescription, const char* dbgFileName, const Int32 dbgLineNumber) = 0; + + /// Releases memory + virtual void Free(void *Ptr) = 0; +}; + +} diff --git a/Common/interface/Object.h b/Common/interface/Object.h index b404889e..b8153c1e 100644 --- a/Common/interface/Object.h +++ b/Common/interface/Object.h @@ -1,4 +1,4 @@ -/* Copyright 2015 Egor Yusov +/* Copyright 2015-2016 Egor Yusov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Common/interface/ReferenceCounters.h b/Common/interface/ReferenceCounters.h index ffef91d5..64ced644 100644 --- a/Common/interface/ReferenceCounters.h +++ b/Common/interface/ReferenceCounters.h @@ -1,4 +1,4 @@ -/* Copyright 2015 Egor Yusov +/* Copyright 2015-2016 Egor Yusov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. -- cgit v1.2.3