44 #pragma warning(disable : 4324)
48 #if defined(_DEBUG) || defined(PROFILE)
59 throw std::exception();
65 template<UINT TNameLength>
68 #if defined(_DEBUG) || defined(PROFILE)
69 resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1,
name);
71 UNREFERENCED_PARAMETER(resource);
72 UNREFERENCED_PARAMETER(
name);
82 inline HANDLE
safe_handle( HANDLE
h ) {
return (h == INVALID_HANDLE_VALUE) ? 0 :
h; }
98 bool IsNull()
const {
return (!_pointer); }
104 void Reset(T *
p = 0) {
if ( _pointer ) { _pointer->Release(); } _pointer =
p; }
106 T*
Get()
const {
return _pointer; }
117 #if defined(_MSC_VER) && (_MSC_VER < 1610)
125 mutex() { InitializeCriticalSection(&mCriticalSection); }
126 ~mutex() { DeleteCriticalSection(&mCriticalSection); }
128 void lock() { EnterCriticalSection(&mCriticalSection); }
129 void unlock() { LeaveCriticalSection(&mCriticalSection); }
130 bool try_lock() {
return TryEnterCriticalSection(&mCriticalSection) != 0; }
133 CRITICAL_SECTION mCriticalSection;
136 mutex& operator= (mutex
const&);
140 template<
typename Mutex>
144 typedef Mutex mutex_type;
146 explicit lock_guard(mutex_type& mutex)
160 lock_guard(lock_guard
const&);
161 lock_guard& operator= (lock_guard
const&);
165 #else // _MSC_VER < 1610
T & operator*()
Definition: PlatformHelpers.h:100
void ThrowIfFailed(HRESULT hr)
Definition: PlatformHelpers.h:55
T * operator->()
Definition: PlatformHelpers.h:101
public std::unique_ptr< void, handle_closer > ScopedHandle
Definition: PlatformHelpers.h:80
Definition: PlatformHelpers.h:78
Definition: PlatformHelpers.h:85
HANDLE safe_handle(HANDLE h)
Definition: PlatformHelpers.h:82
ScopedObject(T *p=0)
Definition: PlatformHelpers.h:88
T ** operator&()
Definition: PlatformHelpers.h:102
void Reset(T *p=0)
Definition: PlatformHelpers.h:104
GLfloat GLfloat p
Definition: GLee.h:8473
int int int int int int h
Definition: GLee.h:17156
GLuint const GLchar * name
Definition: GLee.h:2259
T * Get() const
Definition: PlatformHelpers.h:106
void operator()(HANDLE h)
Definition: PlatformHelpers.h:78
bool IsNull() const
Definition: PlatformHelpers.h:98
void SetDebugObjectName(_In_ ID3D11DeviceChild *resource, _In_z_ const char(&name)[TNameLength])
Definition: PlatformHelpers.h:66
~ScopedObject()
Definition: PlatformHelpers.h:89