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-2013 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
Ogre::D3D11Device::ThreadInfo::ThreadInfo
ThreadInfo(ID3D11DeviceContextN *context)
Definition: OgreD3D11Device.h:51
Ogre::D3D11Device::D3D_WARNING
@ D3D_WARNING
Definition: OgreD3D11Device.h:119
Ogre::D3D11Device::getExceptionsErrorLevel
static const eExceptionsErrorLevel getExceptionsErrorLevel()
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::D3D11Device::mInfoQueue
ID3D11InfoQueue * mInfoQueue
Definition: OgreD3D11Device.h:41
Ogre::D3D11Device::eExceptionsErrorLevel
eExceptionsErrorLevel
Definition: OgreD3D11Device.h:114
Ogre::D3D11Device::mClassLinkage
ID3D11ClassLinkage * mClassLinkage
Definition: OgreD3D11Device.h:44
Ogre::D3D11Device::mImmediateContext
ID3D11DeviceContextN * mImmediateContext
Definition: OgreD3D11Device.h:40
Ogre::D3D11Device::mExceptionsErrorLevel
static eExceptionsErrorLevel mExceptionsErrorLevel
Definition: OgreD3D11Device.h:123
Ogre::D3D11Device::ThreadInfo::~ThreadInfo
~ThreadInfo()
Definition: OgreD3D11Device.h:58
Ogre::D3D11Device::ThreadInfo::mContext
ID3D11DeviceContextN * mContext
Definition: OgreD3D11Device.h:48
Ogre::D3D11Device::~D3D11Device
~D3D11Device()
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::D3D11Device::isError
const bool isError() const
Definition: OgreD3D11Device.h:100
Ogre::ID3D11DeviceN
ID3D11Device ID3D11DeviceN
Definition: OgreD3D11Prerequisites.h:81
Ogre::D3D11Device::operator=
ID3D11DeviceN * operator=(ID3D11DeviceN *device)
Ogre::D3D11Device::isNull
const bool isNull()
Ogre::D3D11Device::ThreadInfo::mEventHandle
void * mEventHandle
Definition: OgreD3D11Device.h:49
Ogre::D3D11Device
Definition: OgreD3D11Device.h:36
Ogre::D3D11Device::release
void release()
OgreD3D11Prerequisites.h
Ogre::D3D11Device::GetClassLinkage
ID3D11ClassLinkage * GetClassLinkage()
Definition: OgreD3D11Device.h:79
Ogre::D3D11Device::D3D11Device
D3D11Device()
Ogre::D3D11Device::GetImmediateContext
ID3D11DeviceContextN * GetImmediateContext()
Definition: OgreD3D11Device.h:74
Ogre::D3D11Device::get
ID3D11DeviceN * get()
Ogre::D3D11Device::ThreadInfo
Definition: OgreD3D11Device.h:46
Ogre::ID3D11DeviceContextN
ID3D11DeviceContext ID3D11DeviceContextN
Definition: OgreD3D11Prerequisites.h:82
Ogre::D3D11Device::clearStoredErrorMessages
const void clearStoredErrorMessages() const
Ogre::D3D11Device::D3D_NO_EXCEPTION
@ D3D_NO_EXCEPTION
Definition: OgreD3D11Device.h:116
Ogre::D3D11Device::operator->
ID3D11DeviceN * operator->() const
Definition: OgreD3D11Device.h:84
Ogre::D3D11Device::mD3D11Device
ID3D11DeviceN * mD3D11Device
Definition: OgreD3D11Device.h:39
Ogre::D3D11Device::D3D_CORRUPTION
@ D3D_CORRUPTION
Definition: OgreD3D11Device.h:117
Ogre::D3D11Device::D3D_INFO
@ D3D_INFO
Definition: OgreD3D11Device.h:120
Ogre::D3D11Device::getErrorDescription
const String getErrorDescription(const HRESULT hr=NO_ERROR) const
Ogre::D3D11Device::_getErrorsFromQueue
const bool _getErrorsFromQueue() const
Ogre::D3D11Device::setExceptionsErrorLevel
static void setExceptionsErrorLevel(const eExceptionsErrorLevel exceptionsErrorLevel)
Ogre::D3D11Device::D3D_ERROR
@ D3D_ERROR
Definition: OgreD3D11Device.h:118
SAFE_RELEASE
#define SAFE_RELEASE(p)
Definition: OgreD3D11Prerequisites.h:58

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15