CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::GPUTexture Class Referencefinal

A texture that is backed by a GPU image. These textures usually can't be serialized. More...

#include <CeresEngine/Texture/Texture.hpp>

Inheritance diagram for CeresEngine::GPUTexture:
CeresEngine::TResource< GPUTexture, Texture > CeresEngine::Texture CeresEngine::TResource< Texture > CeresEngine::Resource CeresEngine::IReflectable

Public Member Functions

 GPUTexture (const GPUImagePtr &image)
 Creates a new GPU texture from an existing GPU image.
 
const GPUImagePtrgetImage () const noexcept
 A pointer to the GPU image object.
 
Async< BitmapgetBitmap (UInt32 layer=0, UInt32 mip=0) const override
 Gets a bitmap pixel data for the given layer and mip level.
 
Async setBitmap (const Bitmap &bitmap, UInt32 layer=0, UInt32 mip=0) override
 Sets a new bitmap pixel data for the given layer and mip level.
 
- Public Member Functions inherited from CeresEngine::TResource< GPUTexture, Texture >
ResourceHandle< GPUTexturegetResourceHandle () const noexcept
 Generates a hash for the provided type.
 
SPtr< GPUTexturegetShared () noexcept
 Gets a shared pointer to the resource.
 
SPtr< const GPUTexturegetShared () const noexcept
 Gets a shared pointer to the resource.
 
const ResourceTypeInfogetResourceType () const noexcept override
 Returns the resource type information descriptor.
 
 TResource (ResourceData &data, InputStream &dataStream)
 
void serialize (OutputStream &dataStream) const override
 Serializes a resource by writing data to dataStream.
 
- Public Member Functions inherited from CeresEngine::Texture
 Texture (const TextureProperties &properties)
 Creates a new texture.
 
 Texture (ResourceData &resourceData, const TextureProperties &properties)
 Creates a new texture.
 
 ~Texture () noexcept override
 Destroys the texture object.
 
bool isStreaming () const noexcept
 Determines if the texture is a streaming texture.
 
const TexturePropertiesgetProperties () const noexcept
 A structure that describes properties of an texture.
 
const TExtent3< UInt32 > & getExtent () const noexcept
 Texture extent.
 
Format getFormat () const noexcept
 Hardware texture format. By default Format::RGBA8UNorm.
 
- Public Member Functions inherited from CeresEngine::TResource< Texture >
ResourceHandle< TexturegetResourceHandle () const noexcept
 Generates a hash for the provided type.
 
SPtr< TexturegetShared () noexcept
 Gets a shared pointer to the resource.
 
SPtr< const TexturegetShared () const noexcept
 Gets a shared pointer to the resource.
 
const ResourceTypeInfogetResourceType () const noexcept override
 Returns the resource type information descriptor.
 
 TResource (ResourceData &data, InputStream &dataStream)
 
void serialize (OutputStream &dataStream) const override
 Serializes a resource by writing data to dataStream.
 
- Public Member Functions inherited from CeresEngine::Resource
 Resource ()
 Default constructor for the Resource class.
 
 Resource (ResourceData &data)
 Creates a new Resource instance by passing a ResourceData instance.
 
virtual ~Resource () noexcept=default
 Resource virtual destructor.
 
ResourceManagergetResourceManager () const noexcept
 
HResource getResourceHandle () const noexcept
 Generates a hash for the provided type.
 
UUID getResourceID () const noexcept
 
HResource getParentResource () const noexcept
 A parent resource to which this resource is attached to.
 
SPtr< ResourceMetadatagetResourceMetadata () const noexcept
 A pointer to the user-defined resource metadata.
 
const PackagePtrgetPackage () const noexcept
 The package from which the resource was loaded from.
 
template<typename T = Resource>
SPtr< TgetShared () noexcept
 Gets a shared pointer to the resource.
 
template<typename T = Resource>
SPtr< const TgetShared () const noexcept
 Gets a shared pointer to the resource.
 
 Resource (ResourceData &data, InputStream &dataStream)
 Creates a new resource by reading data from dataStream.
 
- Public Member Functions inherited from CeresEngine::IReflectable
virtual ~IReflectable () noexcept=default
 

Private Types

using super = TResource< GPUTexture, Texture >
 

Private Attributes

GPUImagePtr mImage
 A pointer to the GPU image object.
 

Friends

class TUserTypeInfo< GPUTexture >
 

Additional Inherited Members

- Static Public Member Functions inherited from CeresEngine::Resource
template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 
- Protected Member Functions inherited from CeresEngine::Resource
HResourceStream createStream (const ResourceStreamFlags &flags=ResourceStreamFlag::Default)
 Creates a new resource stream.
 
void destroyStream (HResourceStream &stream)
 Destroys a stream.
 
void markAsDirty ()
 Marks the resource as dirty.
 
- Protected Attributes inherited from CeresEngine::Texture
TextureProperties mProperties
 A structure that describes properties of an texture.
 

Detailed Description

A texture that is backed by a GPU image. These textures usually can't be serialized.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ GPUTexture()

CeresEngine::GPUTexture::GPUTexture ( const GPUImagePtr image)
explicit

Creates a new GPU texture from an existing GPU image.

Parameters
imageThe existing GPU image to create a new GPU texture from.

Member Function Documentation

◆ getBitmap()

Async< Bitmap > CeresEngine::GPUTexture::getBitmap ( UInt32  layer = 0,
UInt32  mip = 0 
) const
overridevirtual

Gets a bitmap pixel data for the given layer and mip level.

If either the layer (or mip level) are missing, a null pixel data is returned.

Implements CeresEngine::Texture.

◆ getImage()

const GPUImagePtr & CeresEngine::GPUTexture::getImage ( ) const
inlinenoexcept

A pointer to the GPU image object.

◆ setBitmap()

Async CeresEngine::GPUTexture::setBitmap ( const Bitmap bitmap,
UInt32  layer = 0,
UInt32  mip = 0 
)
overridevirtual

Sets a new bitmap pixel data for the given layer and mip level.

Implements CeresEngine::Texture.

Friends And Related Symbol Documentation

◆ TUserTypeInfo< GPUTexture >

Member Data Documentation

◆ mImage

GPUImagePtr CeresEngine::GPUTexture::mImage
private

A pointer to the GPU image object.


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