Nebula
Loading...
Searching...
No Matches
Base::ShapeRendererBase Class Reference

#include <shaperendererbase.h>

Detailed Description

Base class of ShapeRenderer, can render a number of shapes, mainly for debug visualization.

TODO: Add support for appending debug shapes from multiple threads simultaneously

Inherits Core::RefCounted.

Inherited by Vulkan::VkShapeRenderer.

Public Types

enum  ShaderTypes {
  Mesh , MeshNoDepth , MeshWireframe , Primitives ,
  PrimitivesNoDepth , PrimitivesWireframeTriangles , PrimitivesWireframeLines , NumShaders
}
 

Public Member Functions

 ShapeRendererBase ()
 constructor
 
virtual ~ShapeRendererBase ()
 destructor
 
void Open ()
 open the shape renderer
 
void Close ()
 close the shape renderer
 
bool IsOpen () const
 return true if open
 
void ClearShapes ()
 delete shapes of given thread id
 
void AddShape (const CoreGraphics::RenderShape &shape)
 add a shape for deferred rendering (can be called from outside render loop)
 
void AddShapes (const Util::Array< CoreGraphics::RenderShape > &shapeArray)
 add multiple shapes
 
void AddWireFrameBox (const Math::bbox &boundingBox, const Math::vec4 &color)
 add wireframe box
 
void DrawShapes ()
 draw deferred shapes and clear deferred stack, must be called inside render loop
 
- Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
 
int GetRefCount () const
 get the current refcount
 
void AddRef ()
 increment refcount by one
 
void Release ()
 decrement refcount and destroy object if refcount is zero
 
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
 
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
 
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
 
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
 
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
 
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
 
const Util::StringGetClassName () const
 get the class name
 
Util::FourCC GetClassFourCC () const
 get the class FourCC code
 

Protected Attributes

bool isOpen
 
Util::Array< CoreGraphics::RenderShapeshapes [ShaderTypes::NumShaders]
 
Util::Array< CoreGraphics::RenderShapeprimitives [ShaderTypes::NumShaders]
 
CoreGraphics::ShaderProgramId programs [ShaderTypes::NumShaders]
 
SizeT numIndicesThisFrame
 
SizeT numVerticesThisFrame
 

Private Member Functions

 __DeclareClass (ShapeRendererBase)
 
 __DeclareSingleton (ShapeRendererBase)
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
 
- Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
 

Member Enumeration Documentation

◆ ShaderTypes

Enumerator
Mesh 
MeshNoDepth 
MeshWireframe 
Primitives 
PrimitivesNoDepth 
PrimitivesWireframeTriangles 
PrimitivesWireframeLines 
NumShaders 

Constructor & Destructor Documentation

◆ ShapeRendererBase()

Base::ShapeRendererBase::ShapeRendererBase ( )

constructor

◆ ~ShapeRendererBase()

Base::ShapeRendererBase::~ShapeRendererBase ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

Base::ShapeRendererBase::__DeclareClass ( ShapeRendererBase )
private

◆ __DeclareSingleton()

Base::ShapeRendererBase::__DeclareSingleton ( ShapeRendererBase )
private

◆ AddShape()

void Base::ShapeRendererBase::AddShape ( const CoreGraphics::RenderShape & shape)

add a shape for deferred rendering (can be called from outside render loop)

◆ AddShapes()

void Base::ShapeRendererBase::AddShapes ( const Util::Array< CoreGraphics::RenderShape > & shapeArray)

add multiple shapes

◆ AddWireFrameBox()

void Base::ShapeRendererBase::AddWireFrameBox ( const Math::bbox & boundingBox,
const Math::vec4 & color )

add wireframe box

◆ ClearShapes()

void Base::ShapeRendererBase::ClearShapes ( )

delete shapes of given thread id

◆ Close()

void Base::ShapeRendererBase::Close ( )

close the shape renderer

◆ DrawShapes()

void Base::ShapeRendererBase::DrawShapes ( )

draw deferred shapes and clear deferred stack, must be called inside render loop

◆ IsOpen()

bool Base::ShapeRendererBase::IsOpen ( ) const
inline

return true if open

◆ Open()

void Base::ShapeRendererBase::Open ( )

open the shape renderer

Member Data Documentation

◆ isOpen

bool Base::ShapeRendererBase::isOpen
protected

◆ numIndicesThisFrame

SizeT Base::ShapeRendererBase::numIndicesThisFrame
protected

◆ numVerticesThisFrame

SizeT Base::ShapeRendererBase::numVerticesThisFrame
protected

◆ primitives

Util::Array<CoreGraphics::RenderShape> Base::ShapeRendererBase::primitives[ShaderTypes::NumShaders]
protected

◆ programs

CoreGraphics::ShaderProgramId Base::ShapeRendererBase::programs[ShaderTypes::NumShaders]
protected

◆ shapes

Util::Array<CoreGraphics::RenderShape> Base::ShapeRendererBase::shapes[ShaderTypes::NumShaders]
protected

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