SHARE
TWEET

Untitled

a guest Jun 18th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef FONT_H
  2. #define FONT_H
  3.  
  4. #include <glad/glad.h>
  5. #include <glm/glm.hpp>
  6. #include <map>
  7. #include <shader/shader.h>
  8.  
  9. class Font
  10. {
  11. public:
  12.     GLuint texture;
  13.     glm::ivec2 textureSize;
  14.     GLuint quadVAO, quadVBO;
  15.     GLuint faceVAO, faceVBO;
  16.     struct Character {
  17.         glm::ivec2  size;
  18.         glm::ivec2  bearing;
  19.         glm::ivec2  position;
  20.         GLuint      advance;
  21.     };
  22.     std::map<GLubyte, Character> characters;
  23.     Font(std::string fontPath, int pixels);
  24.     ~Font();
  25.     void renderBitmap(Shader & shader);
  26.     void renderText(Shader & shader, std::string text, GLfloat x, GLfloat y, GLfloat scale, glm::vec3 color);
  27. };
  28. #endif //FONT_H
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top