Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
Loading...
Searching...
No Matches
i_texture_render_resources.hpp
Go to the documentation of this file.
1// This file is part of the Rendering Engine project.
2// Author: Alexander Obzherin <alexanderobzherin@gmail.com>
3// Copyright (c) 2025 Alexander Obzherin
4// Distributed under the terms of the zlib License. See LICENSE.md for details.
5
6#pragma once
7
8#include <stdint.h>
9#include <stddef.h>
10
11namespace rendering_engine
12{
13class ImageData;
14
15/**
16 * @class ITextureRenderResources
17 * @brief Interface for backend-specific GPU texture resource management.
18 *
19 * This interface defines the core functions required to manage the lifecycle
20 * of texture data uploaded to the GPU. It enables backends like Vulkan, OpenGL,
21 * or DirectX to implement their specific logic while staying abstracted from higher-level code.
22 */
24{
25public:
26 /**
27 * @brief Virtual destructor.
28 */
29 virtual ~ITextureRenderResources() = default;
30
31 /**
32 * @brief Uploads texture data from CPU to GPU memory.
33 *
34 * @param data Reference to the CPU-resident image data.
35 */
36 virtual void LoadToGPU(const ImageData& data) = 0;
37
38 /**
39 * @brief Releases texture memory from the GPU.
40 */
41 virtual void ReleaseFromGPU() = 0;
42
43 /**
44 * @brief Checks whether the texture is currently loaded in GPU memory.
45 *
46 * @return true if the texture is loaded, false otherwise.
47 */
48 virtual bool IsTextureLoadedInGPU() = 0;
49
50 /**
51 * @brief Returns the memory footprint of the texture on the GPU.
52 *
53 * @return Size of the texture data in GPU memory in bytes.
54 */
55 virtual size_t GetSizeInGPUBytes() const = 0;
56};
57} // namespace rendering_engine
Interface for backend-specific GPU texture resource management.
virtual bool IsTextureLoadedInGPU()=0
Checks whether the texture is currently loaded in GPU memory.
virtual void LoadToGPU(const ImageData &data)=0
Uploads texture data from CPU to GPU memory.
virtual ~ITextureRenderResources()=default
Virtual destructor.
virtual size_t GetSizeInGPUBytes() const =0
Returns the memory footprint of the texture on the GPU.
virtual void ReleaseFromGPU()=0
Releases texture memory from the GPU.
Represents raw 2D image data stored in memory.