GteDX11Texture2.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.1(2016/11/13)
7 
8 #pragma once
9 
10 #include <Graphics/GteTexture2.h>
12 
13 namespace gte
14 {
15 
17 {
18 public:
19  // Construction.
20  DX11Texture2(ID3D11Device* device, Texture2 const* texture);
21  DX11Texture2(ID3D11Device* device, DX11Texture2 const* dxSharedTexture);
22 
23  // Create a texture with already known ID3D11Texture2 and
24  // ID3D11ShaderResourceView interfaces. TODO: For now, this allows
25  // creation of DDS textures to be used only as shader resource views,
26  // not as unordered access views, and there is no associated staging
27  // texture.
28  DX11Texture2(Texture2 const* texture, ID3D11Texture2D* dxTexture,
29  ID3D11ShaderResourceView* dxSRView);
30 
31  static std::shared_ptr<GEObject> Create(void* device, GraphicsObject const* object);
32 
33 protected:
34  // Constructors for DX11TextureRT and DX11TextureDS.
35  DX11Texture2(Texture2 const* texture);
36 
37 public:
38  // Member access.
39  inline Texture2* GetTexture() const;
40  inline ID3D11Texture2D* GetDXTexture() const;
41 
42 protected:
43  // Support for construction.
44  ID3D11Texture2D* CreateSharedDXObject(ID3D11Device* device) const;
45  void CreateStaging(ID3D11Device* device, D3D11_TEXTURE2D_DESC const& tx);
46  void CreateSRView(ID3D11Device* device, D3D11_TEXTURE2D_DESC const& tx);
47  void CreateUAView(ID3D11Device* device, D3D11_TEXTURE2D_DESC const& tx);
48 };
49 
51 {
52  return static_cast<Texture2*>(mGTObject);
53 }
54 
55 inline ID3D11Texture2D* DX11Texture2::GetDXTexture() const
56 {
57  return static_cast<ID3D11Texture2D*>(mDXObject);
58 }
59 
60 }
Texture2 * GetTexture() const
ID3D11Texture2D * GetDXTexture() const
GLuint texture
Definition: glcorearb.h:410
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59