Ocular Engine
Ocular::Graphics::Texture Class Referenceabstract

Base class for all texture objects. More...

#include <Texture.hpp>

Inheritance diagram for Ocular::Graphics::Texture:
Ocular::Core::Resource Ocular::Graphics::Texture2D Ocular::Graphics::D3D11Texture2D Ocular::Graphics::DepthTexture Ocular::Graphics::NoiseTexture2D Ocular::Graphics::RenderTexture Ocular::Graphics::D3D11DepthTexture Ocular::Graphics::D3D11RenderTexture

Public Member Functions

 Texture (TextureDescriptor const &descriptor)
 
virtual void unload ()=0
 
virtual void apply ()=0
 
virtual void refresh ()=0
 
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)
 

Protected Attributes

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
 

Detailed Description

Base class for all texture objects.

Constructor & Destructor Documentation

Ocular::Graphics::Texture::Texture ( TextureDescriptor const &  descriptor)
Parameters
[in]descriptor

Member Function Documentation

virtual void Ocular::Graphics::Texture::apply ( )
pure virtual

Applies any manually made pixel changes of the texture to the GPU. Textures will not be updated (i.e. changes rendered) until this method is called.

Note
Texture CPU access must be set to TextureAccess::WriteOnly or TextureAccess::ReadWrite in order to modify a texture at runtime.

Implemented in Ocular::Graphics::D3D11RenderTexture, Ocular::Graphics::Texture2D, Ocular::Graphics::D3D11DepthTexture, Ocular::Graphics::DepthTexture, Ocular::Graphics::RenderTexture, and Ocular::Graphics::D3D11Texture2D.

TextureDescriptor Ocular::Graphics::Texture::getDescriptor ( ) const

Returns a copy of the texture descriptor that defines this texture resource.

virtual void Ocular::Graphics::Texture::refresh ( )
pure virtual

Refreshes the CPU texture data with any data stored on the GPU. This action can overwrite pre-existing CPU data.

Note
Texture CPU access must be set to TextureAccess::ReadOnly or TextureAccess::ReadWrite in order to refresh the CPU data at runtime.

Implemented in Ocular::Graphics::D3D11RenderTexture, Ocular::Graphics::Texture2D, Ocular::Graphics::D3D11DepthTexture, Ocular::Graphics::DepthTexture, Ocular::Graphics::RenderTexture, and Ocular::Graphics::D3D11Texture2D.

virtual void Ocular::Graphics::Texture::unload ( )
pure virtual

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