28 lines
534 B
C++
28 lines
534 B
C++
#ifndef GLYPH_H
|
|
#define GLYPH_H
|
|
|
|
#include <ft2build.h>
|
|
#include FT_FREETYPE_H
|
|
#include "glcxx.hpp"
|
|
|
|
class Glyph
|
|
{
|
|
public:
|
|
bool load(FT_Face face, FT_ULong char_code);
|
|
int get_advance() { return m_advance; }
|
|
void render()
|
|
{
|
|
m_array->bind();
|
|
m_texture->bind(GL_TEXTURE_2D);
|
|
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
|
}
|
|
|
|
protected:
|
|
int m_advance;
|
|
std::shared_ptr<glcxx::Texture> m_texture;
|
|
std::shared_ptr<glcxx::Buffer> m_buffer;
|
|
std::shared_ptr<glcxx::Array> m_array;
|
|
};
|
|
|
|
#endif
|