Pyrogenesis trunk
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CRenderer Class Reference

Higher level interface on top of the whole frame rendering. More...

#include <Renderer.h>

Inheritance diagram for CRenderer:
Inheritance graph
[legend]
Collaboration diagram for CRenderer:
Collaboration graph
[legend]

Classes

class  Internals
 Struct CRendererInternals: Truly hide data that is supposed to be hidden in this structure so it won't even appear in header files. More...
 
struct  Stats
 

Public Types

enum class  ScreenShotType { NONE , DEFAULT , BIG }
 

Public Member Functions

 CRenderer (Renderer::Backend::IDevice *device)
 
 ~CRenderer ()
 
bool Open (int width, int height)
 
void Resize (int width, int height)
 
int GetWidth () const
 
int GetHeight () const
 
void RenderFrame (bool needsPresent)
 
void BeginFrame ()
 
void EndFrame ()
 
void MakeShadersDirty ()
 
StatsGetStats ()
 
CTextureManagerGetTextureManager ()
 
CVertexBufferManagerGetVertexBufferManager ()
 
CShaderManagerGetShaderManager ()
 
CFontManagerGetFontManager ()
 
CTimeManagerGetTimeManager ()
 
CPostprocManagerGetPostprocManager ()
 
CSceneRendererGetSceneRenderer ()
 
CDebugRendererGetDebugRenderer ()
 
void PreloadResourcesBeforeNextFrame ()
 Performs a complete frame without presenting to force loading all needed resources. More...
 
void MakeScreenShotOnNextFrame (ScreenShotType screenShotType)
 Makes a screenshot on the next RenderFrame according of the given screenshot type. More...
 
Renderer::Backend::IDeviceCommandContextGetDeviceCommandContext ()
 
Renderer::Backend::IVertexInputLayoutGetVertexInputLayout (const PS::span< const Renderer::Backend::SVertexAttributeFormat > attributes)
 Returns a cached vertex input layout. More...
 
- Public Member Functions inherited from Singleton< CRenderer >
 Singleton ()
 
 ~Singleton ()
 

Protected Member Functions

bool ShouldRender () const
 
void RenderFrameImpl (const bool renderGUI, const bool renderLogger)
 
void RenderFrame2D (const bool renderGUI, const bool renderLogger)
 
void RenderScreenShot (const bool needsPresent)
 
void RenderBigScreenShot (const bool needsPresent)
 
void SetRenderPath (RenderPath rp)
 
void ReloadShaders ()
 

Protected Attributes

std::unique_ptr< Internalsm
 
int m_Width = 0
 
int m_Height = 0
 
Stats m_Stats
 
bool m_ShouldPreloadResourcesBeforeNextFrame = false
 
ScreenShotType m_ScreenShotType = ScreenShotType::NONE
 

Friends

class CPatchRData
 
class CDecalRData
 
class HWLightingModelRenderer
 
class ShaderModelVertexRenderer
 
class InstancingModelRenderer
 
class CRenderingOptions
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< CRenderer >
static CRendererGetSingleton ()
 
static CRendererGetSingletonPtr ()
 
static bool IsInitialised ()
 

Detailed Description

Higher level interface on top of the whole frame rendering.

It does know what should be rendered and via which renderer but shouldn't know how to render a particular area, like UI or scene.

Member Enumeration Documentation

◆ ScreenShotType

enum class CRenderer::ScreenShotType
strong
Enumerator
NONE 
DEFAULT 
BIG 

Constructor & Destructor Documentation

◆ CRenderer()

CRenderer::CRenderer ( Renderer::Backend::IDevice device)

◆ ~CRenderer()

CRenderer::~CRenderer ( )

Member Function Documentation

◆ BeginFrame()

void CRenderer::BeginFrame ( )

◆ EndFrame()

void CRenderer::EndFrame ( )

◆ GetDebugRenderer()

CDebugRenderer & CRenderer::GetDebugRenderer ( )

◆ GetDeviceCommandContext()

Renderer::Backend::IDeviceCommandContext * CRenderer::GetDeviceCommandContext ( )

◆ GetFontManager()

CFontManager & CRenderer::GetFontManager ( )

◆ GetHeight()

int CRenderer::GetHeight ( ) const
inline

◆ GetPostprocManager()

CPostprocManager & CRenderer::GetPostprocManager ( )

◆ GetSceneRenderer()

CSceneRenderer & CRenderer::GetSceneRenderer ( )

◆ GetShaderManager()

CShaderManager & CRenderer::GetShaderManager ( )

◆ GetStats()

Stats & CRenderer::GetStats ( )
inline

◆ GetTextureManager()

CTextureManager & CRenderer::GetTextureManager ( )

◆ GetTimeManager()

CTimeManager & CRenderer::GetTimeManager ( )

◆ GetVertexBufferManager()

CVertexBufferManager & CRenderer::GetVertexBufferManager ( )

◆ GetVertexInputLayout()

Renderer::Backend::IVertexInputLayout * CRenderer::GetVertexInputLayout ( const PS::span< const Renderer::Backend::SVertexAttributeFormat attributes)

Returns a cached vertex input layout.

The renderer owns the layout to be able to share it between different clients. As backend should have as few different layouts as possible. The function isn't cheap so it should be called as rarely as possible. TODO: we need to make VertexArray less error prone by passing layout.

◆ GetWidth()

int CRenderer::GetWidth ( ) const
inline

◆ MakeScreenShotOnNextFrame()

void CRenderer::MakeScreenShotOnNextFrame ( ScreenShotType  screenShotType)

Makes a screenshot on the next RenderFrame according of the given screenshot type.

◆ MakeShadersDirty()

void CRenderer::MakeShadersDirty ( )

◆ Open()

bool CRenderer::Open ( int  width,
int  height 
)

◆ PreloadResourcesBeforeNextFrame()

void CRenderer::PreloadResourcesBeforeNextFrame ( )

Performs a complete frame without presenting to force loading all needed resources.

It's used for the first frame on a game start. TODO: It might be better to preload resources without a complete frame rendering.

◆ ReloadShaders()

void CRenderer::ReloadShaders ( )
protected

◆ RenderBigScreenShot()

void CRenderer::RenderBigScreenShot ( const bool  needsPresent)
protected

◆ RenderFrame()

void CRenderer::RenderFrame ( bool  needsPresent)

◆ RenderFrame2D()

void CRenderer::RenderFrame2D ( const bool  renderGUI,
const bool  renderLogger 
)
protected

◆ RenderFrameImpl()

void CRenderer::RenderFrameImpl ( const bool  renderGUI,
const bool  renderLogger 
)
protected

◆ RenderScreenShot()

void CRenderer::RenderScreenShot ( const bool  needsPresent)
protected

◆ Resize()

void CRenderer::Resize ( int  width,
int  height 
)

◆ SetRenderPath()

void CRenderer::SetRenderPath ( RenderPath  rp)
protected

◆ ShouldRender()

bool CRenderer::ShouldRender ( ) const
protected

Friends And Related Function Documentation

◆ CDecalRData

friend class CDecalRData
friend

◆ CPatchRData

friend class CPatchRData
friend

◆ CRenderingOptions

friend class CRenderingOptions
friend

◆ HWLightingModelRenderer

friend class HWLightingModelRenderer
friend

◆ InstancingModelRenderer

friend class InstancingModelRenderer
friend

◆ ShaderModelVertexRenderer

friend class ShaderModelVertexRenderer
friend

Member Data Documentation

◆ m

std::unique_ptr<Internals> CRenderer::m
protected

◆ m_Height

int CRenderer::m_Height = 0
protected

◆ m_ScreenShotType

ScreenShotType CRenderer::m_ScreenShotType = ScreenShotType::NONE
protected

◆ m_ShouldPreloadResourcesBeforeNextFrame

bool CRenderer::m_ShouldPreloadResourcesBeforeNextFrame = false
protected

◆ m_Stats

Stats CRenderer::m_Stats
protected

◆ m_Width

int CRenderer::m_Width = 0
protected

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