refactor font code into classes

This commit is contained in:
2017-02-06 21:08:41 +00:00
parent 7f8cbd0981
commit fd7f62693e
5 changed files with 131 additions and 78 deletions

View File

@@ -4,23 +4,16 @@
#include "shape.h"
#include "texture.h"
#include "layout.h"
#include "font.h"
class App
{
Sampler sampler;
Texture2D tex;
LayoutManager layout;
stbtt_fontinfo font;
Texture2D font_tex;
std::vector<stbtt_bakedchar> chars;
Plane plane;
GLuint font_array;
int font_array_count = 0;
GLuint font_buffers[2];
const int w = 512;
const int h = 512;
const int num_chars = 96;
const int start_char = 32;
Font font;
TextMesh text;
public:
static App I;
float width;