| 223 | OpenGLText::~OpenGLText() { } |
| 224 | |
| 225 | void OpenGLText::SetFont(std::string const& face, int size, bool bold, bool italics) { |
| 226 | // No change required |
| 227 | if (size == fontSize && face == fontFace && bold == fontBold && italics == fontItalics) return; |
| 228 | |
| 229 | // Set font |
| 230 | fontFace = face; |
| 231 | fontSize = size; |
| 232 | fontBold = bold; |
| 233 | fontItalics = italics; |
| 234 | font.SetFaceName(to_wx(fontFace)); |
| 235 | font.SetPointSize(size); |
| 236 | font.SetWeight(bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL); |
| 237 | |
| 238 | // Delete all old data |
| 239 | textures.clear(); |
| 240 | glyphs.clear(); |
| 241 | } |
| 242 | |
| 243 | void OpenGLText::SetColour(agi::Color col) { |
| 244 | r = col.r / 255.f; |
no test coverage detected