cae  0.0.0
Cross-API graphics engine
Loading...
Searching...
No Matches
cae::IRenderer Interface Referenceabstract

Interface for renderer. More...

#include <IRenderer.hpp>

+ Inheritance diagram for cae::IRenderer:
+ Collaboration diagram for cae::IRenderer:

Public Member Functions

 ~IRenderer () override=default
 
virtual void setVSyncEnabled (bool enabled)=0
 Enable or disable VSync.
 
virtual void setClearColor (const Color &color)=0
 Set the clear color.
 
virtual bool isVSyncEnabled () const =0
 Check if VSync is enabled.
 
virtual void initialize (const NativeWindowHandle &nativeWindowHandle, const Color &clearColor={.r=1.F,.g=1.F,.b=1.F,.a=1.F})=0
 Initialize the renderer with a native window handle and clear color.
 
virtual void createPipeline (const ShaderID &id, const ShaderIRModule &vertex, const ShaderIRModule &fragment)=0
 Create a rendering pipeline with vertex and fragment shaders.
 
virtual void draw (const WindowSize &windowSize, const ShaderID &shaderId, glm::mat4 mvp)=0
 Draw the scene using the specified shader and window size.
 
virtual void createMesh (const std::vector< float > &vertices)=0
 Create a mesh with the given vertex data.
 
- Public Member Functions inherited from utl::IPlugin
virtual ~IPlugin ()=default
 
virtual std::string getName () const =0
 Get the name of the plugin.
 
virtual PluginType getType () const =0
 Get the type of the plugin.
 
virtual PluginPlatform getPlatform () const =0
 Get the handled platform of the plugin.
 

Detailed Description

Interface for renderer.

Definition at line 35 of file IRenderer.hpp.

Constructor & Destructor Documentation

◆ ~IRenderer()

cae::IRenderer::~IRenderer ( )
overridedefault

Member Function Documentation

◆ createMesh()

virtual void cae::IRenderer::createMesh ( const std::vector< float > & vertices)
pure virtual

Create a mesh with the given vertex data.

Parameters
verticesVertex data to create the mesh

Implemented in cae::OPGL, and cae::VULKN.

◆ createPipeline()

virtual void cae::IRenderer::createPipeline ( const ShaderID & id,
const ShaderIRModule & vertex,
const ShaderIRModule & fragment )
pure virtual

Create a rendering pipeline with vertex and fragment shaders.

Parameters
idShader ID
vertexVertex shader IR module
fragmentFragment shader IR module

Implemented in cae::OPGL, and cae::VULKN.

◆ draw()

virtual void cae::IRenderer::draw ( const WindowSize & windowSize,
const ShaderID & shaderId,
glm::mat4 mvp )
pure virtual

Draw the scene using the specified shader and window size.

Parameters
windowSizeCurrent window size
shaderIdShader ID to use for drawing
mvpModel-View-Projection matrix

Implemented in cae::OPGL, and cae::VULKN.

◆ initialize()

virtual void cae::IRenderer::initialize ( const NativeWindowHandle & nativeWindowHandle,
const Color & clearColor = {.r=1.F,.g=1.F,.b=1.F,.a=1.F} )
pure virtual

Initialize the renderer with a native window handle and clear color.

Parameters
nativeWindowHandleNative window handle
clearColorClear color (default: white)

Implemented in cae::OPGL, and cae::VULKN.

References cae::Color::r.

◆ isVSyncEnabled()

virtual bool cae::IRenderer::isVSyncEnabled ( ) const
nodiscardpure virtual

Check if VSync is enabled.

Returns
Whether VSync is enabled

Implemented in cae::OPGL, and cae::VULKN.

◆ setClearColor()

virtual void cae::IRenderer::setClearColor ( const Color & color)
pure virtual

Set the clear color.

Parameters
colorClear color to set

Implemented in cae::OPGL, and cae::VULKN.

◆ setVSyncEnabled()

virtual void cae::IRenderer::setVSyncEnabled ( bool enabled)
pure virtual

Enable or disable VSync.

Parameters
enabledWhether VSync is enabled

Implemented in cae::OPGL, and cae::VULKN.


The documentation for this interface was generated from the following file: