OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreD3D11Device.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __D3D11DEVICE_H__
29 #define __D3D11DEVICE_H__
30 
31 
32 #include "OgreD3D11Prerequisites.h"
33 
34 namespace Ogre
35 {
37  {
38  private:
41  ID3D11InfoQueue * mInfoQueue;
42 
43  // Storing class linkage
44  ID3D11ClassLinkage* mClassLinkage;
45 
46  struct ThreadInfo
47  {
49  void* mEventHandle;
50 
52  : mContext(context)
53  , mEventHandle(0)
54  {
55  mEventHandle = CreateEventEx(0, TEXT("ThreadContextEvent"), 0, EVENT_ALL_ACCESS);
56  }
57 
59  {
61 
62  CloseHandle(mEventHandle);
63  }
64  };
65 
66  D3D11Device();
67  public:
68 
69 
70  D3D11Device(ID3D11DeviceN * device);
71 
72  ~D3D11Device();
73 
75  {
76  return mImmediateContext;
77  }
78 
79  inline ID3D11ClassLinkage* GetClassLinkage()
80  {
81  return mClassLinkage;
82  }
83 
84  inline ID3D11DeviceN * operator->() const
85  {
86  assert(mD3D11Device);
88  {
90  }
91  return mD3D11Device;
92  }
93 
94  const void clearStoredErrorMessages( ) const;
95 
97  const bool isNull();
98  const String getErrorDescription(const HRESULT hr = NO_ERROR) const;
99 
100  inline const bool isError( ) const
101  {
103  {
104  return false;
105  }
106 
107  return _getErrorsFromQueue();
108  }
109 
110  const bool _getErrorsFromQueue() const;
111  void release();
112  ID3D11DeviceN * get();
113 
115  {
121  };
122 
124  static void setExceptionsErrorLevel(const eExceptionsErrorLevel exceptionsErrorLevel);
126 
127 
128  };
129 }
130 #endif
const bool isError() const
ID3D11DeviceContextN * GetImmediateContext()
static void setExceptionsErrorLevel(const eExceptionsErrorLevel exceptionsErrorLevel)
const String getErrorDescription(const HRESULT hr=NO_ERROR) const
const bool isNull()
static const eExceptionsErrorLevel getExceptionsErrorLevel()
ID3D11ClassLinkage * mClassLinkage
ID3D11DeviceContext ID3D11DeviceContextN
static eExceptionsErrorLevel mExceptionsErrorLevel
ThreadInfo(ID3D11DeviceContextN *context)
ID3D11Device ID3D11DeviceN
ID3D11DeviceContextN * mContext
const bool _getErrorsFromQueue() const
ID3D11ClassLinkage * GetClassLinkage()
ID3D11InfoQueue * mInfoQueue
ID3D11DeviceContextN * mImmediateContext
_StringBase String
ID3D11DeviceN * operator->() const
ID3D11DeviceN * operator=(ID3D11DeviceN *device)
#define SAFE_RELEASE(p)
const void clearStoredErrorMessages() const
ID3D11DeviceN * mD3D11Device