5#include <glm/mat4x4.hpp>
7#include "Rendering/Common.h"
8#include "Rendering/IGraphicsDevice.h"
10#include "Resources/Resources.h"
11#include "Resources/ResourceBase.h"
12#include "Rendering/IEffects.h"
14#include "Services/Variables.h"
19 class IGraphicsDevice;
48 std::vector<const LightComponent*> lights;
49 uint32_t numDirectionalShadowLights = 0;
50 uint32_t numDirectionalLights = 0;
51 uint32_t numPointShadowLights = 0;
52 uint32_t numPointLights = 0;
74 virtual void releaseResource(
Texture * texture) = 0;
75 virtual void releaseResource(
Mesh * mesh) = 0;
76 virtual void releaseResource(
Effect * effect) = 0;
77 virtual void releaseResource(
Material * material) = 0;
80 virtual std::string getReport()
const = 0;
106 struct RenderTaskContext;
108 struct EnginePermutation;
109 struct EnginePermutations;
110 struct RenderSettings;
113 struct EffectBindings;
114 struct EngineBuffers;
345 virtual COGSCORE_DLL_API
class ImguiRenderer* getGuiRenderer() = 0;
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Interface to the render resources.
Defines an extension to the renderer, capable of doing custom rendering.
virtual ~IRendererExtension()=default
Provided for destruction via pointer to base.
virtual void handleEvent(uint32_t eventId, const DrawContext *renderingContext)=0
Called when rendering events occur.
virtual void initialize(class Context *context, IGraphicsDevice *device)=0
Initialize the extension using the given context and device.
Renderer interface used by the engine to control registered renderer instances.
virtual RenderStates & getRenderStates()=0
Get the reference to the RenderStates structure.
virtual float getClearDepth()=0
Get adjusted clear depth used to render.
virtual void endFrame(uint32_t syncInterval=0, uint32_t presentFlags=Cogs::PresentFlags::None)=0
Signals the end of the current frame.
virtual glm::vec4 getBackgroundColor() const =0
Get the reference to the background color.
virtual EffectCache & getEffectCache()=0
Get the reference to the EffectCache structure.
virtual glm::mat4 getViewFromViewportMatrix(const glm::mat4 inverseProjectionMatrix)=0
Get an adjusted inverse projection matrix mainly used in post processing.
virtual unsigned getMaxLights() const =0
Get the maximum number of lights.
virtual EffectFlags::EEffectFlags getEffectFlags() const =0
Get the EffectFlags.
virtual void renderScreenshot(const ScreenshotSettings &settings, std::vector< uint8_t > &bytes, uint32_t *stride)=0
Render screenshot.
virtual void setMode(RenderMode mode)=0
Set the rendering mode the renderer should use.
virtual std::span< IRendererExtension * > getExtensions()=0
Get the list of all extensions.
virtual IGraphicsDevice * getDevice()=0
Get the graphics device used by the renderer.
virtual void beginFrame()=0
Signals the beginning of a new frame.
virtual glm::mat4 getProjectionMatrix(const glm::mat4 projectionMatrix)=0
Get an adjusted projection matrix used to render.
virtual EffectBindings & getEffectBindings()=0
Get the reference to the EffectBindings structure.
virtual EnginePermutations & getEnginePermutations()=0
Get the reference to the EnginePermutations structure.
virtual RenderMode getMode() const =0
Get the Rendering mode used by the renderer.
virtual glm::vec2 getSize() const =0
Get the output surface size of the renderer.
virtual void updatePermutation(EnginePermutation *permutation)=0
Updates the EnginePermutation.
virtual IRenderResources * getResources()=0
Get the render resources interface.
virtual float getNearDepth()=0
Get adjusted near plane depth.
virtual void render()=0
Kick off the actual rendering, allowing the renderer to produce its output.
virtual void cleanup()=0
Cleanup the renderer, releasing all resources held.
virtual EngineBuffers & getEngineBuffers()=0
Get the reference to the EngineBuffers structure.
virtual ActiveLights & getActiveLights()=0
Get the reference to the ActiveLights structure.
virtual void setBackgroundColor(const glm::vec4 &color)=0
Set the background color applied to the output surface before rendering.
virtual void registerExtension(IRendererExtension *extension)=0
Register an extension with the renderer.
virtual void unregisterExtension(IRendererExtension *extension)=0
Unregister an extension with the renderer.
virtual const RenderSettings & getSettings() const =0
Get the settings of the renderer.
virtual ~IRenderer()=default
Provided for destruction via pointer to base.
Represents a graphics device used to manage graphics resources and issue drawing commands.
RenderMode
Defines global rendering modes that can be supported by the renderer.
@ Wireframe
Wireframe rendering.
@ Box
Bounding-box rendering over regular rendering.
@ Normal
Regular shaded rendering.
ActivationResult
Defines results for resource activation.
Contains all Cogs related functionality.
Effect resources contain data to control the shader stages of the GPU pipeline.
Material instances represent a specialized Material combined with state for all its buffers and prope...
Material resources define the how of geometry rendering (the what is defined by Mesh and Texture reso...
Meshes contain streams of vertex data in addition to index data and options defining geometry used fo...
Render settings variables.
Defines rendering events.
ERenderingEvent
Rendering event enum.
@ RenderGui
Rendering GUI elements.
@ PostRender
Rendering has finished for a given rendering context.
@ PreRender
Pre rendering happening for a given rendering context.
@ RenderTransparent
Rendering transparent shapes for a given context.
@ RenderSolid
Rendering solid shapes for a given context.
Screenshot render settings.
Texture resources contain raster bitmap data to use for texturing.
EEffectFlags
Effect source flags.