17 mImageData = std::make_unique<ImageData>(path);
23 mRenderer{ renderer },
24 mImageData{ nullptr },
27 mImageData = std::make_unique<ImageData>(fileBytes);
43 if (mGpuHandle->IsTextureLoadedInGPU())
48 mGpuHandle = std::unique_ptr<ITextureRenderResources>(mRenderer->ProvideTextureRenderResources());
53 mGpuHandle->LoadToGPU(*mImageData);
67 mGpuHandle->ReleaseFromGPU();
78 mGpuHandle->IsTextureLoadedInGPU();
88 return mImageData->GetSizeInBytes();
98 return mGpuHandle->GetSizeInGPUBytes();
113 return mGpuHandle.get();
Defines an abstract interface for rendering backends.
Interface for backend-specific GPU texture resource management.
bool IsOnGPU() const
Checks whether the texture is currently loaded in GPU memory.
size_t GetSizeInRAM() const
Gets the size of the texture in RAM (in bytes).
ITextureRenderResources * GetTextureRenderResources() const
Returns a pointer to the GPU texture resource interface.
~ImageDataGpu()
Destructor. Frees GPU memory if allocated.
size_t GetSizeInGPU() const
Gets the size of the texture in GPU memory (in bytes).
void UploadToGPU()
Uploads the texture data to GPU if not already uploaded.
ImageData const & GetCpuImageData() const
Returns a const reference to the CPU-side image data.
void ReleaseFromGPU()
Releases the GPU resources (image, sampler, view).
ImageDataGpu(std::string path, IRenderer *renderer)
Constructs an ImageDataGpu object from an image file path.
Represents raw 2D image data stored in memory.