16#ifndef AEONGAMES_RENDERER_H
17#define AEONGAMES_RENDERER_H
24#include "aeongames/Pipeline.hpp"
113 virtual void SetClearColor (
void* aWindowId,
float R,
float G,
float B,
float A ) = 0;
121 virtual void ResizeViewport (
void* aWindowId, int32_t aX, int32_t aY, uint32_t aWidth, uint32_t aHeight ) = 0;
147 const Material* aMaterial =
nullptr,
150 uint32_t aVertexStart = 0,
151 uint32_t aVertexCount = 0xffffffff,
152 uint32_t aInstanceCount = 1,
153 uint32_t aFirstInstance = 0 )
const = 0;
180 DLL std::unique_ptr<Renderer>
ConstructRenderer (
const std::string& aIdentifier,
void* aWindow );
Header for 4x4 matrix class.
Provides access to a region within a memory pool buffer.
Abstract interface for GPU/memory buffer operations.
View frustum defined by six clipping planes, extracted from a projection (or view-projection) matrix.
Represents a surface material with uniform properties and texture samplers.
4 by 4 matrix in colum mayor order.
Represents a polygon mesh with vertex attributes and index data.
Rendering pipeline resource.
Abstract base class for rendering backends.
virtual void UnloadPipeline(const Pipeline &aPipeline)=0
Unloads a rendering pipeline from the renderer.
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 LoadPipeline(const Pipeline &aPipeline)=0
Loads a rendering pipeline (shaders and state) into the renderer.
virtual DLL ~Renderer()=0
Virtual destructor.
virtual void UnloadMaterial(const Material &aMaterial)=0
Unloads material data from the renderer.
virtual void DetachWindow(void *aWindowId)=0
Detach a Window as a rendering surface.
virtual const Frustum & GetFrustum(void *aWindowId) const =0
Returns the view frustum for the given window surface.
virtual void AttachWindow(void *aWindowId)=0
Attach 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 LoadTexture(const Texture &aTexture)=0
Loads a texture into GPU memory.
virtual void SetViewMatrix(void *aWindowId, const Matrix4x4 &aMatrix)=0
Sets the view matrix for a specific window surface.
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 EndRender(void *aWindowId)=0
Ends the current render pass for the given window surface.
virtual void UnloadTexture(const Texture &aTexture)=0
Unloads a texture from GPU memory.
virtual void LoadMaterial(const Material &aMaterial)=0
Loads material data into the renderer.
virtual void BeginRender(void *aWindowId)=0
Begins a 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 void LoadMesh(const Mesh &aMesh)=0
Loads mesh data into GPU memory.
virtual BufferAccessor AllocateSingleFrameUniformMemory(void *aWindowId, size_t aSize)=0
Allocates uniform buffer memory that is valid for a single frame.
virtual void UnloadMesh(const Mesh &aMesh)=0
Unloads mesh data from GPU memory.
CRC-based compile-time string identifier.
Represents a 2D texture image resource.
<- This is here just for the literals
DLL bool RegisterRendererConstructor(const StringId &aIdentifier, const std::function< std::unique_ptr< Renderer >(void *) > &aConstructor)
Registers a Renderer loader for a specific identifier.
DLL std::unique_ptr< Renderer > ConstructRenderer(uint32_t aIdentifier, void *aWindow)
Constructs a Renderer identified by a numeric identifier.
DLL void EnumerateRendererConstructors(const std::function< bool(const StringId &) > &aEnumerator)
Enumerates Renderer loader identifiers via an enumerator functor.
DLL std::vector< std::string > GetRendererConstructorNames()
Returns the names of all registered Renderer constructors.
DLL bool UnregisterRendererConstructor(const StringId &aIdentifier)
Unregisters a Renderer loader for a specific identifier.
Topology
Primitive topology types for rendering.
@ TRIANGLE_LIST
Independent triangles.