metaforce/Runtime/Graphics/Shaders/CEnergyBarShader.hpp

40 lines
913 B
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2017-04-02 03:03:37 +00:00
#include <array>
#include <vector>
#include "zeus/CColor.hpp"
#include "zeus/CMatrix4f.hpp"
#include "zeus/CVector2f.hpp"
#include "zeus/CVector3f.hpp"
2017-04-02 03:03:37 +00:00
2018-12-08 05:30:43 +00:00
namespace urde {
class CTexture;
2017-04-02 03:03:37 +00:00
2018-12-08 05:30:43 +00:00
class CEnergyBarShader {
2017-04-02 03:03:37 +00:00
public:
2018-12-08 05:30:43 +00:00
struct Vertex {
hsh::float3 pos;
hsh::float2 uv;
2018-12-08 05:30:43 +00:00
};
struct Uniform {
hsh::float4x4 m_matrix;
hsh::float4 m_color;
2018-12-08 05:30:43 +00:00
};
private:
hsh::dynamic_owner<hsh::vertex_buffer<Vertex>> m_vbo;
std::array<hsh::dynamic_owner<hsh::uniform_buffer<Uniform>>, 3> m_uniBuf;
std::array<hsh::binding, 3> m_dataBind;
2018-12-08 05:30:43 +00:00
Uniform m_uniform;
size_t m_maxVerts = 0;
2017-04-02 03:03:37 +00:00
public:
2018-12-08 05:30:43 +00:00
void updateModelMatrix();
void draw(const zeus::CColor& color0, const std::vector<Vertex>& verts0, const zeus::CColor& color1,
const std::vector<Vertex>& verts1, const zeus::CColor& color2, const std::vector<Vertex>& verts2,
hsh::texture2d tex);
2017-04-02 03:03:37 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace urde