shaders to 3d
This commit is contained in:
@@ -6,13 +6,10 @@ namespace td {
|
||||
namespace shader {
|
||||
|
||||
class EntityShader : public ShaderProgram {
|
||||
|
||||
private:
|
||||
unsigned int m_LocationCam = 0;
|
||||
unsigned int m_LocationZoom = 0;
|
||||
unsigned int m_LocationAspectRatio = 0;
|
||||
unsigned int m_LocationTranslation = 0;
|
||||
unsigned int m_LocationViewtype = 0;
|
||||
unsigned int m_LocationProjectionMatrix = 0;
|
||||
unsigned int m_LocationViewMatrix = 0;
|
||||
unsigned int m_LocationPosition = 0;
|
||||
unsigned int m_LocationColorEffect = 0;
|
||||
protected:
|
||||
virtual void GetAllUniformLocation();
|
||||
@@ -20,12 +17,11 @@ public:
|
||||
EntityShader();
|
||||
|
||||
void LoadShader();
|
||||
void SetCamPos(const Vec2f& camPos);
|
||||
void SetZoom(float zoom);
|
||||
void SetAspectRatio(float aspectRatio);
|
||||
void SetModelPos(const Vec2f& modelPos);
|
||||
void SetIsometricView(float isometric);
|
||||
|
||||
void SetColorEffect(const Vec3f& color);
|
||||
void SetProjectionMatrix(const maths::Mat4f& proj) const;
|
||||
void SetViewMatrix(const maths::Mat4f& view) const;
|
||||
void SetModelPos(const Vec2f& pos) const;
|
||||
};
|
||||
|
||||
} // namespace shader
|
||||
|
||||
@@ -7,16 +7,15 @@ namespace shader {
|
||||
|
||||
class WorldShader : public ShaderProgram {
|
||||
private:
|
||||
unsigned int m_LocationCam = 0, m_LocationZoom = 0, m_LocationAspectRatio = 0, m_LocationViewtype = 0;
|
||||
unsigned int m_LocationProjection = 0, m_LocationView = 0;
|
||||
protected:
|
||||
void GetAllUniformLocation();
|
||||
public:
|
||||
WorldShader();
|
||||
void LoadShader();
|
||||
void SetCamPos(const Vec2f& camPos);
|
||||
void SetZoom(float zoom);
|
||||
void SetAspectRatio(float aspectRatio);
|
||||
void SetIsometricView(float isometric);
|
||||
|
||||
void SetProjectionMatrix(const maths::Mat4f& proj) const;
|
||||
void SetViewMatrix(const maths::Mat4f& view) const;
|
||||
};
|
||||
|
||||
} // namespace shader
|
||||
|
||||
Reference in New Issue
Block a user