Bullet Collision Detection & Physics Library
btSoftBodySolverVertexBuffer_DX11.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15 
16 #ifndef BT_SOFT_BODY_SOLVER_VERTEX_BUFFER_DX11_H
17 #define BT_SOFT_BODY_SOLVER_VERTEX_BUFFER_DX11_H
18 
19 
21 
22 #include <windows.h>
23 #include <crtdbg.h>
24 #include <d3d11.h>
25 #include <d3dx11.h>
26 #include <d3dcompiler.h>
27 
29 {
30 protected:
32  ID3D11DeviceContext* m_context;
34  ID3D11Buffer* m_vertexBuffer;
36  ID3D11UnorderedAccessView* m_vertexBufferUAV;
37 
38 
39 public:
46  btDX11VertexBufferDescriptor( ID3D11DeviceContext* context, ID3D11Buffer* buffer, ID3D11UnorderedAccessView *UAV, int vertexOffset, int vertexStride )
47  {
48  m_context = context;
49  m_vertexBuffer = buffer;
50  m_vertexBufferUAV = UAV;
51  m_vertexOffset = vertexOffset;
52  m_vertexStride = vertexStride;
53  m_hasVertexPositions = true;
54  }
55 
64  btDX11VertexBufferDescriptor( ID3D11DeviceContext* context, ID3D11Buffer* buffer, ID3D11UnorderedAccessView *UAV, int vertexOffset, int vertexStride, int normalOffset, int normalStride )
65  {
66  m_context = context;
67  m_vertexBuffer = buffer;
68  m_vertexBufferUAV = UAV;
69  m_vertexOffset = vertexOffset;
70  m_vertexStride = vertexStride;
71  m_hasVertexPositions = true;
72 
73  m_normalOffset = normalOffset;
74  m_normalStride = normalStride;
75  m_hasNormals = true;
76  }
77 
79  {
80 
81  }
82 
86  virtual BufferTypes getBufferType() const
87  {
88  return DX11_BUFFER;
89  }
90 
91  virtual ID3D11DeviceContext* getContext() const
92  {
93  return m_context;
94  }
95 
96  virtual ID3D11Buffer* getbtDX11Buffer() const
97  {
98  return m_vertexBuffer;
99  }
100 
101  virtual ID3D11UnorderedAccessView* getDX11UAV() const
102  {
103  return m_vertexBufferUAV;
104  }
105 };
106 
107 #endif // #ifndef BT_SOFT_BODY_SOLVER_VERTEX_BUFFER_DX11_H
virtual ID3D11DeviceContext * getContext() const
virtual ID3D11Buffer * getbtDX11Buffer() const
btDX11VertexBufferDescriptor(ID3D11DeviceContext *context, ID3D11Buffer *buffer, ID3D11UnorderedAccessView *UAV, int vertexOffset, int vertexStride, int normalOffset, int normalStride)
buffer is a pointer to the DX11 buffer to place the vertex data in.
virtual BufferTypes getBufferType() const
Return the type of the vertex buffer descriptor.
ID3D11Buffer * m_vertexBuffer
DX11 vertex buffer.
virtual ID3D11UnorderedAccessView * getDX11UAV() const
ID3D11DeviceContext * m_context
Context of the DX11 device on which the vertex buffer is stored.
ID3D11UnorderedAccessView * m_vertexBufferUAV
UAV for DX11 buffer.
btDX11VertexBufferDescriptor(ID3D11DeviceContext *context, ID3D11Buffer *buffer, ID3D11UnorderedAccessView *UAV, int vertexOffset, int vertexStride)
buffer is a pointer to the DX11 buffer to place the vertex data in.