Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef FONT_H
- #define FONT_H
- #include <glad/glad.h>
- #include <glm/glm.hpp>
- #include <map>
- #include <shader/shader.h>
- class Font
- {
- public:
- GLuint texture;
- glm::ivec2 textureSize;
- GLuint quadVAO, quadVBO;
- GLuint faceVAO, faceVBO;
- struct Character {
- glm::ivec2 size;
- glm::ivec2 bearing;
- glm::ivec2 position;
- GLuint advance;
- };
- std::map<GLubyte, Character> characters;
- Font(std::string fontPath, int pixels);
- ~Font();
- void renderBitmap(Shader & shader);
- void renderText(Shader & shader, std::string text, GLfloat x, GLfloat y, GLfloat scale, glm::vec3 color);
- };
- #endif //FONT_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement