2016-02-18 02:42:32 +00:00
|
|
|
#ifndef __PSHAG_CLINERENDERER_HPP__
|
|
|
|
#define __PSHAG_CLINERENDERER_HPP__
|
|
|
|
|
|
|
|
#include "RetroTypes.hpp"
|
2016-03-04 23:04:53 +00:00
|
|
|
#include "zeus/CVector3f.hpp"
|
|
|
|
#include "zeus/CColor.hpp"
|
2016-02-18 02:42:32 +00:00
|
|
|
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2016-02-18 02:42:32 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
class CLineRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum class EPrimitiveMode
|
|
|
|
{
|
|
|
|
Lines,
|
|
|
|
LineStrip,
|
|
|
|
LineLoop
|
|
|
|
};
|
|
|
|
|
2016-02-18 07:56:14 +00:00
|
|
|
private:
|
2016-02-18 02:42:32 +00:00
|
|
|
EPrimitiveMode m_mode;
|
|
|
|
u32 m_maxVerts;
|
|
|
|
u32 m_nextVert = 0;
|
|
|
|
bool m_final = false;
|
|
|
|
bool m_textured;
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
zeus::CVector3f m_firstPos;
|
|
|
|
zeus::CVector3f m_secondPos;
|
|
|
|
zeus::CVector2f m_firstUV;
|
|
|
|
zeus::CColor m_firstColor;
|
2016-02-18 02:42:32 +00:00
|
|
|
float m_firstWidth;
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
zeus::CVector3f m_lastPos;
|
|
|
|
zeus::CVector3f m_lastPos2;
|
|
|
|
zeus::CVector2f m_lastUV;
|
|
|
|
zeus::CColor m_lastColor;
|
2016-02-18 02:42:32 +00:00
|
|
|
float m_lastWidth;
|
|
|
|
|
|
|
|
public:
|
|
|
|
boo::GraphicsDataToken m_gfxToken;
|
|
|
|
boo::IGraphicsBufferD* m_vertBuf;
|
|
|
|
boo::IGraphicsBufferD* m_uniformBuf;
|
|
|
|
boo::IShaderDataBinding* m_shaderBind = nullptr;
|
|
|
|
|
|
|
|
CLineRenderer(EPrimitiveMode mode, u32 maxVerts, boo::ITexture* texture, bool additive);
|
|
|
|
|
|
|
|
void Reset();
|
2016-03-04 23:04:53 +00:00
|
|
|
void AddVertex(const zeus::CVector3f& position, const zeus::CColor& color, float width,
|
|
|
|
const zeus::CVector2f& uv=zeus::CVector2f::skZero);
|
|
|
|
void Render(const zeus::CColor& moduColor=zeus::CColor::skWhite);
|
2016-02-18 02:42:32 +00:00
|
|
|
|
|
|
|
static void Initialize();
|
|
|
|
static void Shutdown();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __PSHAG_CLINERENDERER_HPP__
|