Ocular Engine
D3D11UniformBuffer.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_D3D11_SHADER_UNIFORM_BUFFER__H__
19 #define __H__OCULAR_D3D11_SHADER_UNIFORM_BUFFER__H__
20 
21 #include "Graphics/Shader/Uniform/UniformBuffer.hpp"
22 #include <d3d11.h>
23 
24 //------------------------------------------------------------------------------------------
25 
30 namespace Ocular
31 {
36  namespace Graphics
37  {
43  {
44  public:
45 
46  D3D11UniformBuffer(UniformBufferType type, ID3D11Device* device, ID3D11DeviceContext* context);
47  virtual ~D3D11UniformBuffer();
48 
52  virtual void bind() override;
53  virtual void unbind() override;
54 
55  protected:
56 
57  void packUniformData();
58  void packDynamicUniformData();
59  void packFixedUniformData();
60 
61  void buildD3DBuffer();
62  void updateD3DBuffer();
63 
64  //------------------------------------------------------------
65 
66  ID3D11Device* m_D3DDevice;
67  ID3D11DeviceContext* m_D3DDeviceContext;
68  ID3D11Buffer* m_D3DBuffer;
69 
70  private:
71 
72  };
73  }
77 }
82 //------------------------------------------------------------------------------------------
83 
84 #endif
D3D11 implementation of a UniformBuffer (ie Shader Constant Buffer)
Definition: D3D11UniformBuffer.hpp:42
virtual void bind() override
Definition: D3D11UniformBuffer.cpp:68
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
void packUniformData()
Definition: D3D11UniformBuffer.cpp:177
Generic buffer for storing and binding of shader uniforms.
Definition: UniformBuffer.hpp:73