Rendering Engine 0.2.9
Modular Graphics Rendering Engine | v0.2.9
i_renderer.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) 2026 Alexander Obzherin
4// Distributed under the terms of the zlib License. See LICENSE.md for details.
5
6#pragma once
7
8namespace rendering_engine
9{
10class IRenderResources;
11class ITextureRenderResources;
12class IMaterialRenderResources;
13class IMeshRenderResources;
14class IRenderResources;
15class IRendererObserver;
16
17/**
18 * @class IRenderer
19 * @brief Defines an abstract interface for rendering backends.
20 *
21 * Provides a unified API for initializing, executing, and shutting down
22 * the rendering system. Specific graphics backends implement this interface
23 * to handle platform-dependent operations.
24 *
25 * @see IRenderResources
26 * @see IRendererObserver
27 */
29{
30public:
31 /** @brief Initializes all rendering subsystems and GPU resources. */
32 virtual void InitializeRenderer() = 0;
33 /** @brief Executes a full frame rendering cycle. */
34 virtual void DrawFrame() = 0;
35 /** @brief Begins frame rendering operations. @return True if the frame can proceed. */
36 virtual bool BeginFrame() = 0;
37 /** @brief Begins the active render pass for the current frame. */
38 virtual void BeginRenderPass() = 0;
39 /** @brief Ends the active render pass. */
40 virtual void EndRenderPass() = 0;
41 /** @brief Completes the current frame rendering and presents the result. */
42 virtual void EndFrame() = 0;
43 /** @brief Waits until the GPU has finished all pending rendering operations. */
44 virtual void WaitIdle() = 0;
45 /** @brief Destroys and cleans up all rendering resources. */
46 virtual void ShutdownRenderer() = 0;
47 /**
48 * @brief Registers an observer for rendering events.
49 * @param notifier Pointer to the observer to register.
50 */
51 virtual void RegisterObserver(IRendererObserver* notifier) = 0;
52 /**
53 * @brief Unregisters a previously registered observer.
54 * @param notifier Pointer to the observer to remove.
55 */
56 virtual void UnregisterObserver(IRendererObserver* notifier) = 0;
57 /**
58 * @brief Provides access to the general rendering resource manager.
59 * @return Pointer to the IRenderResources interface.
60 */
62 /**
63 * @brief Provides access to texture-related GPU resources.
64 * @return Pointer to the ITextureRenderResources interface.
65 */
67 /**
68 * @brief Provides access to material-related GPU resources.
69 * @return Pointer to the IMaterialRenderResources interface.
70 */
72 /**
73 * @brief Provides access to mesh-related GPU resources.
74 * @return Pointer to the IMeshRenderResources interface.
75 */
77 /** @brief Virtual destructor for safe polymorphic deletion. */
78 virtual ~IRenderer() = default;
79 /**
80 * @brief Sets the renderer clear color.
81 *
82 * @param r Red channel (linear space, [0.0–1.0])
83 * @param g Green channel (linear space, [0.0–1.0])
84 * @param b Blue channel (linear space, [0.0–1.0])
85 */
86 virtual void SetDefaultColor(float r, float g, float b) = 0;
87};
88
89} //rendering_engine
Interface for backend-specific material GPU resources.
Interface for GPU mesh resource management.
Interface for rendering backend resource aggregation and submission.
Interface for observing renderer resource lifecycle events.
Defines an abstract interface for rendering backends.
Definition: i_renderer.hpp:29
virtual void SetDefaultColor(float r, float g, float b)=0
Sets the renderer clear color.
virtual void WaitIdle()=0
Waits until the GPU has finished all pending rendering operations.
virtual void ShutdownRenderer()=0
Destroys and cleans up all rendering resources.
virtual void EndFrame()=0
Completes the current frame rendering and presents the result.
virtual void RegisterObserver(IRendererObserver *notifier)=0
Registers an observer for rendering events.
virtual void UnregisterObserver(IRendererObserver *notifier)=0
Unregisters a previously registered observer.
virtual void BeginRenderPass()=0
Begins the active render pass for the current frame.
virtual void DrawFrame()=0
Executes a full frame rendering cycle.
virtual IMeshRenderResources * ProvideMeshRenderResources() const =0
Provides access to mesh-related GPU resources.
virtual IMaterialRenderResources * ProvideMaterialRenderResources() const =0
Provides access to material-related GPU resources.
virtual bool BeginFrame()=0
Begins frame rendering operations.
virtual IRenderResources * ProvideRenderResources() const =0
Provides access to the general rendering resource manager.
virtual void EndRenderPass()=0
Ends the active render pass.
virtual ITextureRenderResources * ProvideTextureRenderResources() const =0
Provides access to texture-related GPU resources.
virtual void InitializeRenderer()=0
Initializes all rendering subsystems and GPU resources.
virtual ~IRenderer()=default
Virtual destructor for safe polymorphic deletion.
Interface for backend-specific GPU texture resource management.