Castor3D
..
|
The overlay renderer. More...
Classes | |
struct | OverlayGeometryBuffers |
Holds the two geometry buffers used to render overlays. More... | |
Public Member Functions | |
C3D_API | OverlayRenderer (RenderSystem &p_renderSystem) |
Constructor. More... | |
C3D_API | ~OverlayRenderer () |
Destructor. More... | |
C3D_API void | Initialise () |
Initialises the buffers. More... | |
C3D_API void | Cleanup () |
Flushes the renderer. More... | |
C3D_API void | DrawPanel (PanelOverlay &p_pPanelOverlay) |
Function to draw a PanelOverlay. More... | |
C3D_API void | DrawBorderPanel (BorderPanelOverlay &p_pBorderPanelOverlay) |
Function to draw a BorderPanelOverlay. More... | |
C3D_API void | DrawText (TextOverlay &p_pTextPanelOverlay) |
Function to draw a TextOverlay. More... | |
C3D_API void | BeginRender (Castor::Size const &p_size) |
Begins the overlays rendering. More... | |
C3D_API void | EndRender () |
Ends the overlays rendering. More... | |
Castor::Size const & | GetSize () const |
Retrieves the current render target size. More... | |
bool | IsSizeChanged () const |
Protected Member Functions | |
C3D_API RenderNode & | DoGetPanelProgram (Pass &p_pass) |
Retrieves a panel program compiled using given pass. More... | |
C3D_API RenderNode & | DoGetTextProgram (Pass &p_pass) |
Retrieves a text program compiled using given pass. More... | |
C3D_API ShaderProgramSPtr | DoGetPanelProgram (uint32_t p_flags) |
Retrieves a panel program compiled using given texture flags. More... | |
C3D_API ShaderProgramSPtr | DoGetTextProgram (uint32_t p_flags) |
Retrieves a text program compiled using given texture flags. More... | |
C3D_API ShaderProgramSPtr | DoGetProgram (uint32_t p_flags) |
Retrieves a program compiled using given flags. More... | |
C3D_API OverlayGeometryBuffers | DoCreateTextGeometryBuffers () |
Creates a GeometryBuffers that can contain 1000 characters. More... | |
C3D_API void | DoDrawItem (Material &p_material, OverlayGeometryBuffers const &p_geometryBuffers, uint32_t p_count) |
Function to draw an overlay. More... | |
C3D_API void | DoDrawItem (Pass &p_pass, GeometryBuffers const &p_geometryBuffers, uint32_t p_count) |
Function to draw an overlay. More... | |
C3D_API void | DoDrawItem (Pass &p_pass, GeometryBuffers const &p_geometryBuffers, Texture const &p_texture, Sampler const &p_sampler, uint32_t p_count) |
Function to draw a text overlay. More... | |
C3D_API OverlayGeometryBuffers | DoFillTextPart (int32_t p_count, TextOverlay::VertexArray::const_iterator &p_it, uint32_t &p_index) |
Fills a GeometryBuffers from a part of a text vertex array. More... | |
C3D_API ShaderProgramSPtr | DoCreateOverlayProgram (uint32_t p_flags) |
Creates a shader program for overlays rendering use. More... | |
Protected Attributes | |
VertexBufferUPtr | m_panelVertexBuffer |
Vertex buffers for panels. More... | |
VertexBufferUPtr | m_borderVertexBuffer |
Vertex buffers for borders. More... | |
std::vector< VertexBufferUPtr > | m_textsVertexBuffers |
The Vertex buffers used to render texts. More... | |
OverlayGeometryBuffers | m_panelGeometryBuffers |
Geometry buffers for panels. More... | |
OverlayGeometryBuffers | m_borderGeometryBuffers |
Geometry buffers for borders. More... | |
std::vector< OverlayGeometryBuffers > | m_textsGeometryBuffers |
The GeometryBuffers used to render texts. More... | |
BufferDeclaration | m_declaration |
The buffer elements declaration. More... | |
BufferDeclaration | m_textDeclaration |
The text overlay buffer elements declaration. More... | |
Castor::Size | m_size |
The current render target size. More... | |
std::map< Pass *, RenderNode > | m_mapPanelPrograms |
The shader programs used to render a panel (used for borders too) More... | |
std::map< Pass *, RenderNode > | m_mapTextPrograms |
The shader programs used to render texts. More... | |
std::map< uint32_t, ShaderProgramSPtr > | m_programs |
The shader programs. More... | |
OneIntFrameVariableSPtr | m_mapText |
Text texture sampler. More... | |
int | m_previousBorderZIndex |
The previously rendered BorderPanelOverlay z-index. More... | |
int | m_previousPanelZIndex |
The previously rendered PanelOverlay z-index. More... | |
int | m_previousTextZIndex |
The previously rendered TextOverlay z-index. More... | |
Castor::String | m_previousCaption |
The previously rendered text. More... | |
std::array< Castor3D::BufferElementGroupSPtr, 6 > | m_panelVertex |
Panel overlays vertex array (quad definition) More... | |
std::array< Castor3D::BufferElementGroupSPtr, 8 *6 > | m_borderVertex |
Border panel overlays vertex array (quad definition) More... | |
bool | m_sizeChanged |
Tells if the render size has changed. More... | |
BlendStateWPtr | m_wpBlendState |
The overlays blend state. More... | |
DepthStencilStateWPtr | m_wpDepthStencilState |
The overlays depth stencil state. More... | |
RasteriserStateWPtr | m_wpRasteriserState |
The overlays rasteriser state. More... | |
The overlay renderer.
C3D_API Castor3D::OverlayRenderer::OverlayRenderer | ( | RenderSystem & | p_renderSystem | ) |
Constructor.
C3D_API Castor3D::OverlayRenderer::~OverlayRenderer | ( | ) |
Destructor.
C3D_API void Castor3D::OverlayRenderer::BeginRender | ( | Castor::Size const & | p_size | ) |
Begins the overlays rendering.
[in] | p_size | The render window size |
C3D_API void Castor3D::OverlayRenderer::Cleanup | ( | ) |
Flushes the renderer.
|
protected |
Creates a shader program for overlays rendering use.
|
protected |
Creates a GeometryBuffers that can contain 1000 characters.
|
protected |
Function to draw an overlay.
[in] | p_material | The material. |
[in] | p_geometryBuffers | The overlay geometry buffers. |
[in] | p_count | The vertex count. |
|
protected |
Function to draw an overlay.
[in] | p_pass | The pass. |
[in] | p_geometryBuffers | The overlay geometry buffers. |
[in] | p_count | The vertex count. |
|
protected |
Function to draw a text overlay.
[in] | p_pass | The pass. |
[in] | p_geometryBuffers | The overlay geometry buffers. |
[in] | p_texture | The font texture. |
[in] | p_sampler | The texture sampler. |
[in] | p_count | The vertex count. |
|
protected |
Fills a GeometryBuffers from a part of a text vertex array.
[in] | p_count | The number of vertex to copy in the GeometryBuffers |
[in] | p_it | The beginning of the vertex array |
[in] | p_index | The current index in the text GeometryBuffers array |
|
protected |
Retrieves a panel program compiled using given pass.
[in] | p_pass | The pass. |
|
protected |
Retrieves a panel program compiled using given texture flags.
[in] | p_flags | Bitwise ORed eTEXTURE_CHANNEL. |
|
protected |
Retrieves a program compiled using given flags.
[in] | p_flags | Bitwise ORed eTEXTURE_CHANNEL. |
|
protected |
Retrieves a text program compiled using given pass.
[in] | p_pass | Bitwise ORed eTEXTURE_CHANNEL. |
|
protected |
Retrieves a text program compiled using given texture flags.
[in] | p_flags | Bitwise ORed eTEXTURE_CHANNEL. |
C3D_API void Castor3D::OverlayRenderer::DrawBorderPanel | ( | BorderPanelOverlay & | p_pBorderPanelOverlay | ) |
Function to draw a BorderPanelOverlay.
C3D_API void Castor3D::OverlayRenderer::DrawPanel | ( | PanelOverlay & | p_pPanelOverlay | ) |
Function to draw a PanelOverlay.
C3D_API void Castor3D::OverlayRenderer::DrawText | ( | TextOverlay & | p_pTextPanelOverlay | ) |
Function to draw a TextOverlay.
C3D_API void Castor3D::OverlayRenderer::EndRender | ( | ) |
Ends the overlays rendering.
|
inline |
Retrieves the current render target size.
References m_size.
C3D_API void Castor3D::OverlayRenderer::Initialise | ( | ) |
Initialises the buffers.
|
inline |
References m_sizeChanged.
|
protected |
Geometry buffers for borders.
|
protected |
Border panel overlays vertex array (quad definition)
|
protected |
Vertex buffers for borders.
|
protected |
The buffer elements declaration.
|
protected |
The shader programs used to render a panel (used for borders too)
|
protected |
Text texture sampler.
|
protected |
The shader programs used to render texts.
|
protected |
Geometry buffers for panels.
|
protected |
Panel overlays vertex array (quad definition)
|
protected |
Vertex buffers for panels.
|
protected |
The previously rendered BorderPanelOverlay z-index.
|
protected |
The previously rendered text.
|
protected |
The previously rendered PanelOverlay z-index.
|
protected |
The previously rendered TextOverlay z-index.
|
protected |
The shader programs.
|
protected |
The current render target size.
Referenced by GetSize().
|
protected |
Tells if the render size has changed.
Referenced by IsSizeChanged().
|
protected |
The text overlay buffer elements declaration.
|
protected |
The GeometryBuffers used to render texts.
|
protected |
The Vertex buffers used to render texts.
|
protected |
The overlays blend state.
|
protected |
The overlays depth stencil state.
|
protected |
The overlays rasteriser state.