Ocular Engine
Ocular::Graphics::D3D11RenderTexture Class Reference
Inheritance diagram for Ocular::Graphics::D3D11RenderTexture:
Ocular::Graphics::RenderTexture Ocular::Graphics::D3D11Texture Ocular::Graphics::Texture2D Ocular::Graphics::Texture Ocular::Core::Resource

Public Member Functions

 D3D11RenderTexture (TextureDescriptor const &descriptor, ID3D11Device *device)
 
 D3D11RenderTexture (TextureDescriptor const &descriptor, ID3D11Device *device, IDXGISwapChain *swapchain)
 
ID3D11RenderTargetView * getD3DRenderTargetView ()
 
virtual void unload () override
 
virtual void apply () override
 
virtual void refresh () override
 
- Public Member Functions inherited from Ocular::Graphics::RenderTexture
 RenderTexture (TextureDescriptor const &descriptor)
 
- Public Member Functions inherited from Ocular::Graphics::Texture2D
 Texture2D (TextureDescriptor const &descriptor)
 
Core::Color getPixel (uint32_t x, uint32_t y) const
 
bool setPixel (uint32_t x, uint32_t y, Core::Color const &color)
 
bool getPixels (std::vector< Core::Color > &pixels, uint32_t startX=0, uint32_t startY=0, uint32_t width=0, uint32_t height=0) const
 
bool setPixels (std::vector< Core::Color > const &pixels, uint32_t startX=0, uint32_t startY=0, uint32_t width=0, uint32_t height=0)
 
unsigned getWidth () const
 
void setWidth (uint32_t const &width)
 
unsigned getHeight () const
 
void setHeight (uint32_t const &height)
 
- Public Member Functions inherited from Ocular::Graphics::Texture
 Texture (TextureDescriptor const &descriptor)
 
TextureDescriptor getDescriptor () const
 
- Public Member Functions inherited from Ocular::Core::Resource
 Resource (File const &source)
 
virtual void forceLoad ()
 
File getSourceFile () const
 
void setSourceFile (File const &file)
 
void setIsInMemory (bool inMemory)
 
bool isInMemory () const
 
void setSize (uint64_t size)
 
uint64_t getSize () const
 
ResourceType getResourceType () const
 
void setName (std::string const &name)
 
std::string const & getName () const
 
std::string const & getMappingName () const
 
void setMappingName (std::string const &name)
 
ResourceMetadatagetMetadata () const
 
void setMetadata (ResourceMetadata *metadata)
 
- Public Member Functions inherited from Ocular::Graphics::D3D11Texture
 D3D11Texture (ID3D11Device *device)
 
ID3D11Texture2D * getD3DTexture2D ()
 
ID3D11ShaderResourceView * getD3DShaderResource ()
 

Protected Member Functions

bool createD3DResources ()
 
bool createD3DRenderTarget ()
 
virtual bool createD3DTexture2D (TextureDescriptor const &descriptor) override
 
- Protected Member Functions inherited from Ocular::Graphics::Texture2D
void getTrueDimensions (uint32_t startX, uint32_t startY, uint32_t &trueWidth, uint32_t &trueHeight) const
 
- Protected Member Functions inherited from Ocular::Graphics::D3D11Texture
virtual bool createD3DShaderResource (TextureDescriptor const &descriptor)
 
void refresh (std::vector< Core::Color > &pixels, Graphics::TextureDescriptor const &descriptor)
 

Protected Attributes

ID3D11RenderTargetView * m_D3DRenderTargetView
 
IDXGISwapChain * m_D3DSwapChain
 Optional for when creating as a backbuffer.
 
- Protected Attributes inherited from Ocular::Graphics::Texture2D
std::vector< Core::Colorm_Pixels
 
- Protected Attributes inherited from Ocular::Graphics::Texture
TextureDescriptor m_Descriptor
 
- Protected Attributes inherited from Ocular::Core::Resource
ResourceType m_Type
 
ResourceMetadatam_Metadata
 
File m_SourceFile
 
bool m_IsInMemory
 
uint64_t m_SizeInMemory
 
std::string m_Name
 
std::string m_MappingName
 
- Protected Attributes inherited from Ocular::Graphics::D3D11Texture
ID3D11Device * m_D3DDevice
 
ID3D11Texture2D * m_D3DTexture
 
ID3D11ShaderResourceView * m_D3DShaderResourceView
 
DXGI_FORMAT m_D3DFormat
 

Constructor & Destructor Documentation

Ocular::Graphics::D3D11RenderTexture::D3D11RenderTexture ( TextureDescriptor const &  descriptor,
ID3D11Device *  device 
)
Parameters
[in]descriptorTextureDescriptor for this RenderTexture
[in]deviceThe D3D11 device
Ocular::Graphics::D3D11RenderTexture::D3D11RenderTexture ( TextureDescriptor const &  descriptor,
ID3D11Device *  device,
IDXGISwapChain *  swapchain 
)

Constructor for use when creating a backbuffer RenderTexture

Parameters
[in]descriptorTextureDescriptor for this RenderTexture
[in]deviceThe D3D11 device
[in]swapchainThe SwapChain that owns the backbuffer texture

Member Function Documentation

void Ocular::Graphics::D3D11RenderTexture::apply ( )
overridevirtual

Uploads all CPU related changes to the GPU (CPU to GPU upload)

Note
The texture must have been created with CPU access of TextureAccess::WriteOnly or TextureAccess::ReadWrite.
Todo:
Apply CPU changes to RTV

Reimplemented from Ocular::Graphics::RenderTexture.

ID3D11RenderTargetView * Ocular::Graphics::D3D11RenderTexture::getD3DRenderTargetView ( )
Returns
The ID3D11RenderTargetView associated with this RenderTexture
void Ocular::Graphics::D3D11RenderTexture::refresh ( )
overridevirtual

Refreshes the CPU data with any GPU changes (GPU to CPU download)

Note
The texture must have been created with CPU access of TextureAccess::ReadOnly or TextureAccess::ReadWrite.

Reimplemented from Ocular::Graphics::RenderTexture.

void Ocular::Graphics::D3D11RenderTexture::unload ( )
overridevirtual

Frees all CPU and GPU related data for this RenderTexture.

Reimplemented from Ocular::Graphics::RenderTexture.


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