Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::Renderer Class Referenceabstract

Abstract base class for rendering backends. More...

#include <aeongames/Renderer.hpp>

Inheritance diagram for AeonGames::Renderer:
Inheritance graph
Collaboration diagram for AeonGames::Renderer:
Collaboration graph

Public Member Functions

virtual DLL ~Renderer ()=0
 Virtual destructor.
Renderer specific resource functions
virtual void LoadMesh (const Mesh &aMesh)=0
 Loads mesh data into GPU memory.
virtual void UnloadMesh (const Mesh &aMesh)=0
 Unloads mesh data from GPU memory.
virtual void LoadPipeline (const Pipeline &aPipeline)=0
 Loads a rendering pipeline (shaders and state) into the renderer.
virtual void UnloadPipeline (const Pipeline &aPipeline)=0
 Unloads a rendering pipeline from the renderer.
virtual void LoadMaterial (const Material &aMaterial)=0
 Loads material data into the renderer.
virtual void UnloadMaterial (const Material &aMaterial)=0
 Unloads material data from the renderer.
virtual void LoadTexture (const Texture &aTexture)=0
 Loads a texture into GPU memory.
virtual void UnloadTexture (const Texture &aTexture)=0
 Unloads a texture from GPU memory.
Window surface related functions
virtual void AttachWindow (void *aWindowId)=0
 Attach a Window as a rendering surface.
virtual void DetachWindow (void *aWindowId)=0
 Detach a Window as a rendering surface.
virtual void SetProjectionMatrix (void *aWindowId, const Matrix4x4 &aMatrix)=0
 Sets the projection matrix for a specific window surface.
virtual void SetViewMatrix (void *aWindowId, const Matrix4x4 &aMatrix)=0
 Sets the view matrix for a specific window surface.
virtual void SetClearColor (void *aWindowId, float R, float G, float B, float A)=0
 Sets the color to be used to clear the window background.
virtual void ResizeViewport (void *aWindowId, int32_t aX, int32_t aY, uint32_t aWidth, uint32_t aHeight)=0
 Resizes the specific window surface's viewport.
virtual void BeginRender (void *aWindowId)=0
 Begins a render pass for the given window surface.
virtual void EndRender (void *aWindowId)=0
 Ends the current render pass for the given window surface.
virtual void Render (void *aWindowId, const Matrix4x4 &aModelMatrix, const Mesh &aMesh, const Pipeline &aPipeline, const Material *aMaterial=nullptr, const BufferAccessor *aSkeleton=nullptr, Topology aTopology=Topology::TRIANGLE_LIST, uint32_t aVertexStart=0, uint32_t aVertexCount=0xffffffff, uint32_t aInstanceCount=1, uint32_t aFirstInstance=0) const =0
 Issues a draw call for a mesh with the given pipeline and optional material.
virtual const FrustumGetFrustum (void *aWindowId) const =0
 Returns the view frustum for the given window surface.
virtual BufferAccessor AllocateSingleFrameUniformMemory (void *aWindowId, size_t aSize)=0
 Allocates uniform buffer memory that is valid for a single frame.

Detailed Description

Abstract base class for rendering backends.

Defines the interface for loading and unloading GPU resources, managing window surfaces, and issuing draw calls. Concrete implementations provide API-specific logic (e.g., Vulkan, OpenGL).

Definition at line 43 of file Renderer.hpp.

Member Function Documentation

◆ AllocateSingleFrameUniformMemory()

virtual BufferAccessor AeonGames::Renderer::AllocateSingleFrameUniformMemory ( void * aWindowId,
size_t aSize )
pure virtual

Allocates uniform buffer memory that is valid for a single frame.

Parameters
aWindowIdPlatform dependent window handle.
aSizeSize in bytes of the requested allocation.
Returns
A BufferAccessor to the allocated memory.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ AttachWindow()

virtual void AeonGames::Renderer::AttachWindow ( void * aWindowId)
pure virtual

Attach a Window as a rendering surface.

Parameters
aWindowIdPlatform depended window handle.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ BeginRender()

virtual void AeonGames::Renderer::BeginRender ( void * aWindowId)
pure virtual

Begins a render pass for the given window surface.

Parameters
aWindowIdPlatform dependent window handle.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ DetachWindow()

virtual void AeonGames::Renderer::DetachWindow ( void * aWindowId)
pure virtual

Detach a Window as a rendering surface.

Parameters
aWindowIdPlatform depended window handle.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ EndRender()

virtual void AeonGames::Renderer::EndRender ( void * aWindowId)
pure virtual

Ends the current render pass for the given window surface.

Parameters
aWindowIdPlatform dependent window handle.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ GetFrustum()

virtual const Frustum & AeonGames::Renderer::GetFrustum ( void * aWindowId) const
pure virtual

Returns the view frustum for the given window surface.

Parameters
aWindowIdPlatform dependent window handle.
Returns
A const reference to the current view frustum.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ LoadMaterial()

virtual void AeonGames::Renderer::LoadMaterial ( const Material & aMaterial)
pure virtual

Loads material data into the renderer.

Parameters
aMaterialThe material to load.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ LoadMesh()

virtual void AeonGames::Renderer::LoadMesh ( const Mesh & aMesh)
pure virtual

Loads mesh data into GPU memory.

Parameters
aMeshThe mesh to load.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ LoadPipeline()

virtual void AeonGames::Renderer::LoadPipeline ( const Pipeline & aPipeline)
pure virtual

Loads a rendering pipeline (shaders and state) into the renderer.

Parameters
aPipelineThe pipeline to load.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ LoadTexture()

virtual void AeonGames::Renderer::LoadTexture ( const Texture & aTexture)
pure virtual

Loads a texture into GPU memory.

Parameters
aTextureThe texture to load.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ Render()

virtual void AeonGames::Renderer::Render ( void * aWindowId,
const Matrix4x4 & aModelMatrix,
const Mesh & aMesh,
const Pipeline & aPipeline,
const Material * aMaterial = nullptr,
const BufferAccessor * aSkeleton = nullptr,
Topology aTopology = Topology::TRIANGLE_LIST,
uint32_t aVertexStart = 0,
uint32_t aVertexCount = 0xffffffff,
uint32_t aInstanceCount = 1,
uint32_t aFirstInstance = 0 ) const
pure virtual

Issues a draw call for a mesh with the given pipeline and optional material.

Parameters
aWindowIdPlatform dependent window handle.
aModelMatrixModel transformation matrix.
aMeshMesh to render.
aPipelinePipeline (shaders/state) to use.
aMaterialOptional material to bind.
aSkeletonOptional skeleton buffer for skinned meshes.
aTopologyPrimitive topology (default: TRIANGLE_LIST).
aVertexStartFirst vertex index.
aVertexCountNumber of vertices to draw (default: all).
aInstanceCountNumber of instances to draw.
aFirstInstanceIndex of the first instance.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ ResizeViewport()

virtual void AeonGames::Renderer::ResizeViewport ( void * aWindowId,
int32_t aX,
int32_t aY,
uint32_t aWidth,
uint32_t aHeight )
pure virtual

Resizes the specific window surface's viewport.

Parameters
aWindowIdPlatform dependent window handle.
aXX coordinate of the viewport.
aYY coordinate of the viewport.
aWidthWidth of the viewport.
aHeightHeight of the viewport.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ SetClearColor()

virtual void AeonGames::Renderer::SetClearColor ( void * aWindowId,
float R,
float G,
float B,
float A )
pure virtual

Sets the color to be used to clear the window background.

Parameters
aWindowIdPlatform depended window handle.
RRed component of the clear color.
GGreen component of the clear color.
BBlue component of the clear color.
AAlpha component of the clear color.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ SetProjectionMatrix()

virtual void AeonGames::Renderer::SetProjectionMatrix ( void * aWindowId,
const Matrix4x4 & aMatrix )
pure virtual

Sets the projection matrix for a specific window surface.

Parameters
aWindowIdPlatform depended window handle.
aMatrixThe projection matrix.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ SetViewMatrix()

virtual void AeonGames::Renderer::SetViewMatrix ( void * aWindowId,
const Matrix4x4 & aMatrix )
pure virtual

Sets the view matrix for a specific window surface.

Parameters
aWindowIdPlatform depended window handle.
aMatrixThe view matrix.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ UnloadMaterial()

virtual void AeonGames::Renderer::UnloadMaterial ( const Material & aMaterial)
pure virtual

Unloads material data from the renderer.

Parameters
aMaterialThe material to unload.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ UnloadMesh()

virtual void AeonGames::Renderer::UnloadMesh ( const Mesh & aMesh)
pure virtual

Unloads mesh data from GPU memory.

Parameters
aMeshThe mesh to unload.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ UnloadPipeline()

virtual void AeonGames::Renderer::UnloadPipeline ( const Pipeline & aPipeline)
pure virtual

Unloads a rendering pipeline from the renderer.

Parameters
aPipelineThe pipeline to unload.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.

◆ UnloadTexture()

virtual void AeonGames::Renderer::UnloadTexture ( const Texture & aTexture)
pure virtual

Unloads a texture from GPU memory.

Parameters
aTextureThe texture to unload.

Implemented in AeonGames::OpenGLRenderer, and AeonGames::VulkanRenderer.


The documentation for this class was generated from the following files: