|
CeresEngine 0.2.0
A game development framework
|
A texture that is usable by the renderer and the GPU. More...
#include <CeresEngine/Renderer/Resources/RendererTexture.hpp>
Public Member Functions | |
| RendererTexture (RendererTextureManager &manager, const TexturePtr &engineImage) | |
| Creates a new renderer texture instance. | |
| ~RendererTexture () | |
| Destroys the renderer texture instance. | |
| RendererTextureFlags | getFlags () const noexcept |
| A set of flags for the renderer texture. | |
| bool | isCompressed () const noexcept |
| bool | isConverted () const noexcept |
| RendererTextureState | getState () const noexcept |
| The state the renderer texture is currently in. | |
| bool | isPending () const noexcept |
| The texture is not uploaded to the GPU and the upload process hasn't started yet. | |
| bool | isUploading () const noexcept |
| The texture is in the process of being uploaded to the GPU, but the asynchronous upload operation hasn't finished yet. | |
| bool | isRelocating () const noexcept |
| The texture is uploaded to the GPU but is in the process of being relocated to another image. | |
| bool | isUploaded () const noexcept |
| The texture is uploaded to the GPU and is ready to be used by the renderer. | |
| RendererTextureType | getType () const noexcept |
| The type of renderer texture. | |
| bool | is2D () const noexcept |
| The texture represents a regular 2D texture. | |
| bool | isCubeMap () const noexcept |
| The texture represents a cube map texture with 6 faces. | |
| bool | isReady () const noexcept |
| Checks if the texture is ready to be used by the renderer. | |
| operator bool () const noexcept | |
| Checks if the texture is ready to be used by the renderer. | |
| const SPtr< Texture > & | getResource () const noexcept |
| A pointer to the image resource object that will be uploaded to the GPU. | |
| const GPUImagePtr & | getImage () const noexcept |
| The current image instance as allocated by the texture manager. | |
| Async | uploadPixelData () |
Public Member Functions inherited from CeresEngine::RefCounted< RendererTexture > | |
| RefCounted (Args &&... args) | |
Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it. | |
| void | retain () noexcept |
| Retains the object by increment it's reference count by one. | |
| bool | release () noexcept |
| Relases the object by decrementing it's reference count by one. | |
Static Public Member Functions | |
| static const GPUImagePtr & | getImage (const RendererTexture &texture) |
| The current image instance as allocated by the texture manager. | |
| static GPUImagePtr | getImage (const RendererTexture *const texture) |
| The current image instance as allocated by the texture manager. | |
| static GPUImagePtr | getImage (const RendererTexturePtr &texture) |
| The current image instance as allocated by the texture manager. | |
Public Attributes | |
| Event< void()> | didChangeImage |
| An event triggered internally in the renderer whenever the GPU image for the texture has changed. | |
Private Member Functions | |
| void | setFlags (RendererTextureFlags flags) |
| A set of flags for the renderer texture. | |
| void | setState (RendererTextureState state) |
| The state the renderer texture is currently in. | |
| void | setImage (GPUImagePtr &&image) |
| The current image instance as allocated by the texture manager. | |
Private Attributes | |
| RendererTextureManager & | mManager |
| The texture manager that owns and manages this texture instance. | |
| UInt32 | mID |
| A ID that uniquely identifies the texture in the renderer. | |
| RendererTextureFlags | mFlags |
| A set of flags for the renderer texture. | |
| RendererTextureState | mState = RendererTextureState::Pending |
| The state the renderer texture is currently in. | |
| RendererTextureType | mType = RendererTextureType::Texture2D |
| The type of renderer texture. | |
| TexturePtr | mResource |
| A pointer to the image resource object that will be uploaded to the GPU. | |
| GPUImagePtr | mImage |
| The current image instance as allocated by the texture manager. | |
Friends | |
| class | RendererTextureManager |
A texture that is usable by the renderer and the GPU.
A renderer texture is allocated by a RendererTextureManager, which is responsible for taking an Image instance, uploading it to the GPU in an appropriate Image.
The manager is free to relocate the GPU image into another image at any time. Whenever the manager relocates data, the user can be notified of changes by subscribing to the onImageChanged event.
The renderer might also require to perform conversions on the image format before uploading data to the GPU, in case the native image format is not supported by the GPU.
|
explicit |
Creates a new renderer texture instance.
| CeresEngine::RendererTexture::~RendererTexture | ( | ) |
Destroys the renderer texture instance.
Since this object is reference counted, the destructor is usually called automatically when the reference count reaches zero.
|
inlinenoexcept |
A set of flags for the renderer texture.
|
inlinenoexcept |
The current image instance as allocated by the texture manager.
The manager is free to relocate this image into another location if it can prove that relocating it will yield in faster rendering or better memory re-utilization.
|
inlinestatic |
The current image instance as allocated by the texture manager.
The manager is free to relocate this image into another location if it can prove that relocating it will yield in faster rendering or better memory re-utilization.
|
inlinestatic |
The current image instance as allocated by the texture manager.
The manager is free to relocate this image into another location if it can prove that relocating it will yield in faster rendering or better memory re-utilization.
|
inlinestatic |
The current image instance as allocated by the texture manager.
The manager is free to relocate this image into another location if it can prove that relocating it will yield in faster rendering or better memory re-utilization.
A pointer to the image resource object that will be uploaded to the GPU.
|
inlinenoexcept |
The state the renderer texture is currently in.
|
inlinenoexcept |
The type of renderer texture.
|
inlinenoexcept |
The texture represents a regular 2D texture.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
The texture represents a cube map texture with 6 faces.
|
inlinenoexcept |
The texture is not uploaded to the GPU and the upload process hasn't started yet.
|
inlinenoexcept |
Checks if the texture is ready to be used by the renderer.
|
inlinenoexcept |
The texture is uploaded to the GPU but is in the process of being relocated to another image.
The current image is still valid, but will be replaced soon as soon as the GPU finishes coping the data.
|
inlinenoexcept |
The texture is uploaded to the GPU and is ready to be used by the renderer.
|
inlinenoexcept |
The texture is in the process of being uploaded to the GPU, but the asynchronous upload operation hasn't finished yet.
|
inlineexplicitnoexcept |
Checks if the texture is ready to be used by the renderer.
|
private |
A set of flags for the renderer texture.
|
private |
The current image instance as allocated by the texture manager.
The manager is free to relocate this image into another location if it can prove that relocating it will yield in faster rendering or better memory re-utilization.
|
private |
The state the renderer texture is currently in.
| Async CeresEngine::RendererTexture::uploadPixelData | ( | ) |
|
friend |
An event triggered internally in the renderer whenever the GPU image for the texture has changed.
Users of the renderer texture can subscribe to this event to be notified when the manager relocates the GPU image to a different GPU image.
|
private |
A set of flags for the renderer texture.
|
private |
A ID that uniquely identifies the texture in the renderer.
Can be used to index the texture from bindless buffers.
|
private |
The current image instance as allocated by the texture manager.
The manager is free to relocate this image into another location if it can prove that relocating it will yield in faster rendering or better memory re-utilization.
|
private |
The texture manager that owns and manages this texture instance.
|
private |
A pointer to the image resource object that will be uploaded to the GPU.
|
private |
The state the renderer texture is currently in.
|
private |
The type of renderer texture.