| 228 | } |
| 229 | |
| 230 | void font_impl::destroyGLResources() |
| 231 | { |
| 232 | for (auto it = mVAOMap.begin(); it!=mVAOMap.end(); ++it) { |
| 233 | GLuint vao = it->second; |
| 234 | glDeleteVertexArrays(1, &vao); |
| 235 | } |
| 236 | mVAOMap.clear(); |
| 237 | |
| 238 | if (mVBO) |
| 239 | glDeleteBuffers(1, &mVBO); |
| 240 | /* remove all glyph structures from heap */ |
| 241 | for (auto it: mGlyphLists) { |
| 242 | /* for each font size glyph list */ |
| 243 | for (auto& m : it) { |
| 244 | delete m; /* delete Glyph structure */ |
| 245 | } |
| 246 | it.clear(); |
| 247 | } |
| 248 | /* clear list */ |
| 249 | mGlyphLists.clear(); |
| 250 | } |
| 251 | |
| 252 | font_impl::font_impl() |
| 253 | : mTTFfile(""), mIsFontLoaded(false), mAtlas(new FontAtlas(512, 512, 1)), mVBO(0), |