Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
release.h
1 #pragma once
2 
3 #include "util/assert.h"
4 
5 #ifdef _DEBUG
6 #define BLOWBOX_RELEASE(object) { if (object != nullptr) { object->Release(); object = nullptr; } }
7 #define BLOWBOX_RELEASE_GUARANTEE(object) { if (object != nullptr) { object->Release(); object == nullptr; } else { BLOWBOX_ASSERT(false); } }
8 #else
9 #define BLOWBOX_RELEASE(object) { if (object != nullptr) { object->Release(); object = nullptr; } }
10 #define BLOWBOX_RELEASE_GUARANTEE(object) { if (object != nullptr) { object->Release(); object = nullptr; } }
11 #endif