2017-02-12 07:27:26 +00:00
|
|
|
#ifndef TEXTDRAWER_H
|
|
|
|
#define TEXTDRAWER_H
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include "Graphics/ShaderProgram.h"
|
|
|
|
#include "Graphics/FramebufferTextureFormats.h"
|
|
|
|
|
|
|
|
struct Atlas;
|
|
|
|
|
|
|
|
class TextDrawer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void init();
|
|
|
|
|
|
|
|
void destroy();
|
|
|
|
|
|
|
|
void drawText(const char *_pText, float x, float y) const;
|
|
|
|
|
|
|
|
void getTextSize(const char *_pText, float & _w, float & _h) const;
|
|
|
|
|
2017-05-26 09:00:01 +00:00
|
|
|
void setTextColor(float * _color);
|
|
|
|
|
2017-02-12 07:27:26 +00:00
|
|
|
private:
|
|
|
|
std::unique_ptr<Atlas> m_atlas;
|
2017-05-26 09:00:01 +00:00
|
|
|
std::unique_ptr<graphics::TextDrawerShaderProgram> m_program;
|
2017-02-12 07:27:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern TextDrawer g_textDrawer;
|
|
|
|
|
|
|
|
#endif // TEXTDRAWER_H
|