| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #pragma once
- #include "Texture.h"
- struct ID3D11Texture2D;
- struct ID3D11ShaderResourceView;
- struct ID3D11Device;
- struct ID3D11DeviceContext;
- namespace Framework
- {
- class DX11Texture : public Texture
- {
- private:
- ID3D11Texture2D* txt;
- ID3D11ShaderResourceView* view;
- ID3D11Device* device;
- ID3D11DeviceContext* context;
- bool useMips;
- Critical& deviceLock;
- ID3D11Texture2D* readAccessTexture;
- public:
- DLLEXPORT DX11Texture(ID3D11Device* device,
- ID3D11DeviceContext* context,
- Critical& deviceLock,
- TextureDirection dir);
- DLLEXPORT ~DX11Texture();
- //! Updates the texture. The pixels of the current image are copied
- //! to graphics memory
- DLLEXPORT bool updateTextur() override;
- //! Returns true if updateTextur needs to be called
- DLLEXPORT bool needsUpdate() const override;
- //! Returns the used shader resource view
- DLLEXPORT operator ID3D11ShaderResourceView*() const;
- //! Returns the used texture
- DLLEXPORT operator ID3D11Texture2D*() const;
- //! specifies if a mip map should be generated
- DLLEXPORT void setUseMips(bool useMips);
- };
- } // namespace Framework
|