Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CD3DTexture Class Reference

#include <D3DResource.h>

Inheritance diagram for CD3DTexture:
ID3DResource

Public Member Functions

 CD3DTexture ()
 
virtual ~CD3DTexture ()
 
bool Create (UINT width, UINT height, UINT mipLevels, D3D11_USAGE usage, DXGI_FORMAT format, const void *pInitData=nullptr, unsigned int srcPitch=0)
 
void Release ()
 
bool GetDesc (D3D11_TEXTURE2D_DESC *desc) const
 
bool LockRect (UINT subresource, D3D11_MAPPED_SUBRESOURCE *res, D3D11_MAP mapType) const
 
bool UnlockRect (UINT subresource) const
 
ID3D11Texture2D * Get () const
 
ID3D11ShaderResourceView * GetShaderResource (DXGI_FORMAT format=DXGI_FORMAT_UNKNOWN)
 
ID3D11ShaderResourceView ** GetAddressOfSRV (DXGI_FORMAT format=DXGI_FORMAT_UNKNOWN)
 
ID3D11RenderTargetView * GetRenderTarget ()
 
ID3D11RenderTargetView ** GetAddressOfRTV ()
 
UINT GetWidth () const
 
UINT GetHeight () const
 
DXGI_FORMAT GetFormat () const
 
void GenerateMipmaps ()
 
void OnDestroyDevice (bool fatal) override
 
void OnCreateDevice () override
 
- Public Member Functions inherited from ID3DResource
virtual ~ID3DResource ()
 

Static Public Member Functions

static void DrawQuad (const CPoint points[4], UTILS::COLOR::Color color, CD3DTexture *texture, const CRect *texCoords, SHADER_METHOD options=SHADER_METHOD_RENDER_TEXTURE_BLEND)
 
static void DrawQuad (const CPoint points[4], UTILS::COLOR::Color color, unsigned numViews, ID3D11ShaderResourceView **view, const CRect *texCoords, SHADER_METHOD options=SHADER_METHOD_RENDER_TEXTURE_BLEND)
 
static void DrawQuad (const CRect &coords, UTILS::COLOR::Color color, CD3DTexture *texture, const CRect *texCoords, SHADER_METHOD options=SHADER_METHOD_RENDER_TEXTURE_BLEND)
 
static void DrawQuad (const CRect &coords, UTILS::COLOR::Color color, unsigned numViews, ID3D11ShaderResourceView **view, const CRect *texCoords, SHADER_METHOD options=SHADER_METHOD_RENDER_TEXTURE_BLEND)
 

Protected Member Functions

ID3D11RenderTargetView * GetRenderTargetInternal (unsigned idx=0)
 
unsigned int GetMemoryUsage (unsigned int pitch) const
 
bool CreateInternal (const void *pInitData=nullptr, unsigned int srcPitch=0)
 
void SaveTexture ()
 
void RestoreTexture ()
 
- Protected Member Functions inherited from ID3DResource
void Register ()
 
void Unregister ()
 

Protected Attributes

BYTEm_data
 
UINT m_width
 
UINT m_height
 
UINT m_mipLevels
 
UINT m_pitch
 
UINT m_bindFlags
 
UINT m_cpuFlags
 
UINT m_viewIdx
 
D3D11_USAGE m_usage
 
DXGI_FORMAT m_format
 
Microsoft::WRL::ComPtr< ID3D11Texture2D > m_texture
 
Microsoft::WRL::ComPtr< ID3D11RenderTargetView > m_renderTargets [2]
 
std::map< DXGI_FORMAT, Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > > m_views
 
- Protected Attributes inherited from ID3DResource
bool m_bRegistered = false
 

Constructor & Destructor Documentation

◆ CD3DTexture()

CD3DTexture::CD3DTexture ( )

◆ ~CD3DTexture()

CD3DTexture::~CD3DTexture ( )
virtual

Member Function Documentation

◆ Create()

bool CD3DTexture::Create ( UINT width,
UINT height,
UINT mipLevels,
D3D11_USAGE usage,
DXGI_FORMAT format,
const void * pInitData = nullptr,
unsigned int srcPitch = 0 )

◆ CreateInternal()

bool CD3DTexture::CreateInternal ( const void * pInitData = nullptr,
unsigned int srcPitch = 0 )
protected

◆ DrawQuad() [1/4]

void CD3DTexture::DrawQuad ( const CPoint points[4],
UTILS::COLOR::Color color,
CD3DTexture * texture,
const CRect * texCoords,
SHADER_METHOD options = SHADER_METHOD_RENDER_TEXTURE_BLEND )
static

◆ DrawQuad() [2/4]

void CD3DTexture::DrawQuad ( const CPoint points[4],
UTILS::COLOR::Color color,
unsigned numViews,
ID3D11ShaderResourceView ** view,
const CRect * texCoords,
SHADER_METHOD options = SHADER_METHOD_RENDER_TEXTURE_BLEND )
static

◆ DrawQuad() [3/4]

void CD3DTexture::DrawQuad ( const CRect & coords,
UTILS::COLOR::Color color,
CD3DTexture * texture,
const CRect * texCoords,
SHADER_METHOD options = SHADER_METHOD_RENDER_TEXTURE_BLEND )
static

◆ DrawQuad() [4/4]

void CD3DTexture::DrawQuad ( const CRect & coords,
UTILS::COLOR::Color color,
unsigned numViews,
ID3D11ShaderResourceView ** view,
const CRect * texCoords,
SHADER_METHOD options = SHADER_METHOD_RENDER_TEXTURE_BLEND )
static

◆ GenerateMipmaps()

void CD3DTexture::GenerateMipmaps ( )

◆ Get()

ID3D11Texture2D * CD3DTexture::Get ( ) const
inline

◆ GetAddressOfRTV()

ID3D11RenderTargetView ** CD3DTexture::GetAddressOfRTV ( )

◆ GetAddressOfSRV()

ID3D11ShaderResourceView ** CD3DTexture::GetAddressOfSRV ( DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN)

◆ GetDesc()

bool CD3DTexture::GetDesc ( D3D11_TEXTURE2D_DESC * desc) const

◆ GetFormat()

DXGI_FORMAT CD3DTexture::GetFormat ( ) const
inline

◆ GetHeight()

UINT CD3DTexture::GetHeight ( ) const
inline

◆ GetMemoryUsage()

unsigned int CD3DTexture::GetMemoryUsage ( unsigned int pitch) const
protected

◆ GetRenderTarget()

ID3D11RenderTargetView * CD3DTexture::GetRenderTarget ( )

◆ GetRenderTargetInternal()

ID3D11RenderTargetView * CD3DTexture::GetRenderTargetInternal ( unsigned idx = 0)
protected

◆ GetShaderResource()

ID3D11ShaderResourceView * CD3DTexture::GetShaderResource ( DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN)

◆ GetWidth()

UINT CD3DTexture::GetWidth ( ) const
inline

◆ LockRect()

bool CD3DTexture::LockRect ( UINT subresource,
D3D11_MAPPED_SUBRESOURCE * res,
D3D11_MAP mapType ) const

◆ OnCreateDevice()

void CD3DTexture::OnCreateDevice ( void )
overridevirtual

Implements ID3DResource.

◆ OnDestroyDevice()

void CD3DTexture::OnDestroyDevice ( bool fatal)
overridevirtual

Implements ID3DResource.

◆ Release()

void CD3DTexture::Release ( )

◆ RestoreTexture()

void CD3DTexture::RestoreTexture ( )
protected

◆ SaveTexture()

void CD3DTexture::SaveTexture ( )
protected

◆ UnlockRect()

bool CD3DTexture::UnlockRect ( UINT subresource) const

Member Data Documentation

◆ m_bindFlags

UINT CD3DTexture::m_bindFlags
protected

◆ m_cpuFlags

UINT CD3DTexture::m_cpuFlags
protected

◆ m_data

BYTE* CD3DTexture::m_data
protected

◆ m_format

DXGI_FORMAT CD3DTexture::m_format
protected

◆ m_height

UINT CD3DTexture::m_height
protected

◆ m_mipLevels

UINT CD3DTexture::m_mipLevels
protected

◆ m_pitch

UINT CD3DTexture::m_pitch
protected

◆ m_renderTargets

Microsoft::WRL::ComPtr<ID3D11RenderTargetView> CD3DTexture::m_renderTargets[2]
protected

◆ m_texture

Microsoft::WRL::ComPtr<ID3D11Texture2D> CD3DTexture::m_texture
protected

◆ m_usage

D3D11_USAGE CD3DTexture::m_usage
protected

◆ m_viewIdx

UINT CD3DTexture::m_viewIdx
protected

◆ m_views

std::map<DXGI_FORMAT, Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> > CD3DTexture::m_views
protected

◆ m_width

UINT CD3DTexture::m_width
protected

The documentation for this class was generated from the following files: