Make ViewBlock structure public

This commit is contained in:
Jack Andersen 2016-03-07 12:48:39 -10:00
parent 94717100c0
commit 13ab709c76
1 changed files with 13 additions and 12 deletions

View File

@ -91,6 +91,18 @@ public:
zeus::CVector3f m_pos; zeus::CVector3f m_pos;
zeus::CVector2f m_uv; zeus::CVector2f m_uv;
}; };
struct ViewBlock
{
zeus::CMatrix4f m_mv;
zeus::CColor m_color = zeus::CColor::skWhite;
void setViewRect(const boo::SWindowRect& root, const boo::SWindowRect& sub)
{
m_mv[0][0] = 2.0f / root.size[0];
m_mv[1][1] = 2.0f / root.size[1];
m_mv[3][0] = sub.location[0] * m_mv[0][0] - 1.0f;
m_mv[3][1] = sub.location[1] * m_mv[1][1] - 1.0f;
}
};
struct VertexBufferBinding struct VertexBufferBinding
{ {
@ -117,18 +129,7 @@ private:
View(ViewResources& res); View(ViewResources& res);
protected: protected:
struct ViewBlock ViewBlock m_viewVertBlock;
{
zeus::CMatrix4f m_mv;
zeus::CColor m_color = zeus::CColor::skWhite;
void setViewRect(const boo::SWindowRect& root, const boo::SWindowRect& sub)
{
m_mv[0][0] = 2.0f / root.size[0];
m_mv[1][1] = 2.0f / root.size[1];
m_mv[3][0] = sub.location[0] * m_mv[0][0] - 1.0f;
m_mv[3][1] = sub.location[1] * m_mv[1][1] - 1.0f;
}
} m_viewVertBlock;
#define SPECTER_GLSL_VIEW_VERT_BLOCK\ #define SPECTER_GLSL_VIEW_VERT_BLOCK\
"UBINDING0 uniform SpecterViewBlock\n"\ "UBINDING0 uniform SpecterViewBlock\n"\
"{\n"\ "{\n"\