2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 20:31:21 +00:00
metaforce/Runtime/Graphics/Shaders/CEnergyBarShader.hpp
Lioncash 136a229a1a Graphics/Shaders: Use std::array where applicable
Makes the arrays strongly typed and impervious to array->pointer decay.
This also allows simplifying some operations (such as being able to call
fill() instead of needing to use std::fill, etc).
2019-11-09 20:22:16 -05:00

45 lines
1.0 KiB
C++

#pragma once
#include <array>
#include <vector>
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
#include <zeus/CColor.hpp>
#include <zeus/CMatrix4f.hpp>
#include <zeus/CVector2f.hpp>
#include <zeus/CVector3f.hpp>
namespace urde {
class CTexture;
class CEnergyBarShader {
public:
struct Vertex {
zeus::CVector3f pos;
zeus::CVector2f uv;
};
private:
struct Uniform {
zeus::CMatrix4f m_matrix;
zeus::CColor m_color;
};
boo::ObjToken<boo::IGraphicsBufferD> m_vbo;
std::array<boo::ObjToken<boo::IGraphicsBufferD>, 3> m_uniBuf;
std::array<boo::ObjToken<boo::IShaderDataBinding>, 3> m_dataBind;
Uniform m_uniform;
const CTexture* m_tex = nullptr;
size_t m_maxVerts = 0;
public:
static void Initialize();
static void Shutdown();
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,
const CTexture* tex);
};
} // namespace urde