Nebula
Loading...
Searching...
No Matches
shaperendererbase.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
15#include "core/refcounted.h"
16#include "core/singleton.h"
17#include "math/mat4.h"
18#include "math/vec4.h"
19#include "math/bbox.h"
22#include "coregraphics/shader.h"
24#include "threading/threadid.h"
25
26//------------------------------------------------------------------------------
27namespace Base
28{
83
84//------------------------------------------------------------------------------
87inline bool
89{
90 return this->isOpen;
91}
92
93} // namespace Base
94//------------------------------------------------------------------------------
95
96
Base class of ShapeRenderer, can render a number of shapes, mainly for debug visualization.
Definition shaperendererbase.h:30
Util::Array< CoreGraphics::RenderShape > shapes[ShaderTypes::NumShaders]
Definition shaperendererbase.h:75
void AddShape(const CoreGraphics::RenderShape &shape)
add a shape for deferred rendering (can be called from outside render loop)
Definition shaperendererbase.cc:84
ShapeRendererBase()
constructor
Definition shaperendererbase.cc:23
void Close()
close the shape renderer
Definition shaperendererbase.cc:54
__DeclareClass(ShapeRendererBase)
SizeT numVerticesThisFrame
Definition shaperendererbase.h:81
void DrawShapes()
draw deferred shapes and clear deferred stack, must be called inside render loop
Definition shaperendererbase.cc:190
ShaderTypes
Definition shaperendererbase.h:60
@ PrimitivesWireframeTriangles
Definition shaperendererbase.h:67
@ MeshNoDepth
Definition shaperendererbase.h:62
@ MeshWireframe
Definition shaperendererbase.h:63
@ Mesh
Definition shaperendererbase.h:61
@ PrimitivesNoDepth
Definition shaperendererbase.h:66
@ PrimitivesWireframeLines
Definition shaperendererbase.h:68
@ Primitives
Definition shaperendererbase.h:65
@ NumShaders
Definition shaperendererbase.h:70
CoreGraphics::ShaderProgramId programs[ShaderTypes::NumShaders]
Definition shaperendererbase.h:77
bool IsOpen() const
return true if open
Definition shaperendererbase.h:88
__DeclareSingleton(ShapeRendererBase)
virtual ~ShapeRendererBase()
destructor
Definition shaperendererbase.cc:34
bool isOpen
Definition shaperendererbase.h:74
SizeT numIndicesThisFrame
Definition shaperendererbase.h:80
void ClearShapes()
delete shapes of given thread id
Definition shaperendererbase.cc:69
Util::Array< CoreGraphics::RenderShape > primitives[ShaderTypes::NumShaders]
Definition shaperendererbase.h:76
void AddShapes(const Util::Array< CoreGraphics::RenderShape > &shapeArray)
add multiple shapes
Definition shaperendererbase.cc:169
void AddWireFrameBox(const Math::bbox &boundingBox, const Math::vec4 &color)
add wireframe box
Definition shaperendererbase.cc:200
void Open()
open the shape renderer
Definition shaperendererbase.cc:44
The common base class of Nebula.
Definition refcounted.h:38
Describes a shape which is rendered through the ShapeRenderer singleton.
Definition rendershape.h:32
Nebula's bounding box class.
Definition bbox.h:24
Nebula's dynamic array class.
Definition array.h:60
Definition gamecontentserverbase.cc:10
A shader represents an entire shader resource, containing several stages and programs.
A 4D vector.
Definition vec4.h:24
int SizeT
Definition types.h:49