-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDrawUtils.h
30 lines (26 loc) · 1.02 KB
/
DrawUtils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef _COMMON_DRAWUTILS_H
#define _COMMON_DRAWUTILS_H
#include <gr/Context.h>
#include <game/Sprite.h>
class DrawUtils :
public lang::Object
{
private:
lang::Ptr<gr::Shader> m_invertedMultiplyTextureShader;
lang::Ptr<gr::Shader> m_multiplyTextureShader;
lang::Ptr<gr::Shader> m_fillTextureShader;
game::Resources *m_resources;
gr::Context *m_context;
bool m_platformSupportsShaders;
public:
DrawUtils(gr::Context* context, game::Resources* resources);
virtual ~DrawUtils();
void customGlyphRenderer(gr::Context* context, game::Sprite* sprite, float x, float y, math::float4 color, gr::Shader* shader);
void drawThemeSpriteTinted(game::Sprite* spr, float x, float y, const math::float2& scale, const math::float4& color);
void drawThemeSpriteTinted(const std::string& spriteId, float x, float y, const math::float2& scale, const math::float4& color);
bool platformSupportsShaders() const;
gr::Shader* getInvertedMultiplyTextureShader();
gr::Shader* getMultiplyTextureShader();
gr::Shader* getFillTextureShader();
};
#endif