10ImageDataGpu::ImageDataGpu(std::string path,
IRenderer* renderer)
17 mImageData = std::make_unique<ImageData>(path);
23 mRenderer{ renderer },
24 mImageData{ nullptr },
27 mImageData = std::make_unique<ImageData>(fileBytes);
33 mRenderer{ renderer },
34 mImageData{ nullptr },
37 mImageData = std::make_unique<ImageData>(imageData);
53 if (mGpuHandle->IsTextureLoadedInGPU())
63 mGpuHandle->LoadToGPU(*mImageData);
77 mGpuHandle->ReleaseFromGPU();
88 return mGpuHandle->IsTextureLoadedInGPU();
98 return mImageData->GetSizeInBytes();
108 return mGpuHandle->GetSizeInGPUBytes();
123 return mGpuHandle.get();
Defines an abstract interface for rendering backends.
virtual ITextureRenderResources * ProvideTextureRenderResources() const =0
Provides access to texture-related GPU resources.
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.