| 1 | #pragma once |
| 2 | |
| 3 | #include <nn/gfx/detail/gfx_Texture-api.nvn.8.h> |
| 4 | #include <nn/gfx/gfx_Common.h> |
| 5 | |
| 6 | namespace nn::gfx { |
| 7 | |
| 8 | template <class TTarget> |
| 9 | class TTexture : public detail::TextureImpl<TTarget> { |
| 10 | NN_NO_COPY(TTexture); |
| 11 | |
| 12 | public: |
| 13 | typedef TextureInfo InfoType; |
| 14 | |
| 15 | static const bool IsMemoryPoolRequired = true; |
| 16 | |
| 17 | static size_t CalculateMipDataAlignment(TDevice<TTarget>*, const InfoType&); |
| 18 | static size_t CalculateMipDataSize(TDevice<TTarget>*, const InfoType&); |
| 19 | static void CalculateMipDataOffsets(ptrdiff_t*, TDevice<TTarget>*, const InfoType&); |
| 20 | static size_t GetRowPitch(TDevice<TTarget>*, const InfoType&); |
| 21 | void Initialize(TDevice<TTarget>*, const InfoType&, TMemoryPool<TTarget>*, ptrdiff_t, size_t); |
| 22 | |
| 23 | TTexture(); |
| 24 | void Finalize(TDevice<TTarget>*); |
| 25 | void SetUserPtr(void*); |
| 26 | void* GetUserPtr(); |
| 27 | const void* GetUserPtr() const; |
| 28 | }; |
| 29 | |
| 30 | template <class TTarget> |
| 31 | class TTextureView : public detail::TextureViewImpl<TTarget> { |
| 32 | NN_NO_COPY(TTextureView); |
| 33 | |
| 34 | public: |
| 35 | typedef TextureViewInfo InfoType; |
| 36 | |
| 37 | TTextureView(); |
| 38 | void Initialize(TDevice<TTarget>*, const InfoType&); |
| 39 | void Finalize(TDevice<TTarget>*); |
| 40 | void SetUserPtr(void*); |
| 41 | void* GetUserPtr(); |
| 42 | const void* GetUserPtr() const; |
| 43 | }; |
| 44 | |
| 45 | template <class TTarget> |
| 46 | class TColorTargetView : public detail::ColorTargetViewImpl<TTarget> { |
| 47 | NN_NO_COPY(TColorTargetView); |
| 48 | |
| 49 | public: |
| 50 | typedef ColorTargetViewInfo InfoType; |
| 51 | |
| 52 | TColorTargetView(); |
| 53 | void Initialize(TDevice<TTarget>*, const InfoType&); |
| 54 | void Finalize(TDevice<TTarget>*); |
| 55 | void SetUserPtr(void*); |
| 56 | void* GetUserPtr(); |
| 57 | const void* GetUserPtr() const; |
| 58 | }; |
| 59 | |
| 60 | template <class TTarget> |
| 61 | class TDepthStencilView : public detail::DepthStencilViewImpl<TTarget> { |
| 62 | NN_NO_COPY(TDepthStencilView); |
| 63 | |
| 64 | public: |
| 65 | typedef DepthStencilViewInfo InfoType; |
| 66 | |
| 67 | TDepthStencilView(); |
| 68 | void Initialize(TDevice<TTarget>*, const InfoType&); |
| 69 | void Finalize(TDevice<TTarget>*); |
| 70 | void SetUserPtr(void*); |
| 71 | void* GetUserPtr(); |
| 72 | const void* GetUserPtr() const; |
| 73 | }; |
| 74 | |
| 75 | } // namespace nn::gfx |