2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2017-04-02 03:03:37 +00:00
|
|
|
|
2019-09-29 02:22:12 +00:00
|
|
|
#include <array>
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2019-09-29 00:30:53 +00:00
|
|
|
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
2019-09-28 02:53:03 +00:00
|
|
|
|
|
|
|
#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 {
|
2019-09-29 00:30:53 +00:00
|
|
|
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 {
|
|
|
|
zeus::CVector3f pos;
|
|
|
|
zeus::CVector2f uv;
|
|
|
|
};
|
2017-04-02 03:03:37 +00:00
|
|
|
|
|
|
|
private:
|
2018-12-08 05:30:43 +00:00
|
|
|
struct Uniform {
|
|
|
|
zeus::CMatrix4f m_matrix;
|
|
|
|
zeus::CColor m_color;
|
|
|
|
};
|
|
|
|
boo::ObjToken<boo::IGraphicsBufferD> m_vbo;
|
2019-09-29 02:22:12 +00:00
|
|
|
std::array<boo::ObjToken<boo::IGraphicsBufferD>, 3> m_uniBuf;
|
|
|
|
std::array<boo::ObjToken<boo::IShaderDataBinding>, 3> m_dataBind;
|
2018-12-08 05:30:43 +00:00
|
|
|
Uniform m_uniform;
|
|
|
|
const CTexture* m_tex = nullptr;
|
|
|
|
size_t m_maxVerts = 0;
|
2017-04-02 03:03:37 +00:00
|
|
|
|
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
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);
|
2017-04-02 03:03:37 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|