source:
orxonox.OLD/trunk/src/lib/graphics/text_engine/font_data.cc
@
8754
Last change on this file since 8754 was 8751, checked in by bensch, 18 years ago | |
---|---|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[4662] | 1 | /* |
[3341] | 2 | orxonox - the future of 3D-vertical-scrollers |
3 | ||
4 | Copyright (C) 2004 orx | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2, or (at your option) | |
9 | any later version. | |
10 | ||
11 | ### File Specific: | |
12 | main-programmer: Benjamin Grauer | |
13 | co-programmer: ... | |
14 | */ | |
15 | ||
[3590] | 16 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER |
17 | ||
[8751] | 18 | #include "font_data.h" |
[3341] | 19 | |
[4357] | 20 | #include "debug.h" |
[6139] | 21 | #include "compiler.h" |
[3622] | 22 | |
[8363] | 23 | #include "sdlincl.h" |
[8293] | 24 | |
[8363] | 25 | /** |
[8751] | 26 | * @brief creates a new Font Data. |
[8293] | 27 | */ |
[8751] | 28 | FontData::FontData() |
[3655] | 29 | { |
[8751] | 30 | this->fontTTF = NULL; |
31 | this->glyphArray = NULL; | |
[7785] | 32 | } |
[5754] | 33 | |
[7785] | 34 | |
35 | /** | |
[8751] | 36 | * @brief Destructor of a Font |
[7785] | 37 | * |
[8751] | 38 | * Frees Data, and deletes the fonts from GL |
[7785] | 39 | */ |
[8751] | 40 | FontData::~FontData() |
[7785] | 41 | { |
[8751] | 42 | // deleting all Glyphs |
43 | if (this->glyphArray != NULL) | |
[7785] | 44 | { |
[8751] | 45 | for (int i = 0; i < FONT_HIGHEST_KNOWN_CHAR; i++) |
[7785] | 46 | { |
[8751] | 47 | if (this->glyphArray[i] != NULL) |
48 | delete this->glyphArray[i]; | |
[7785] | 49 | } |
[8751] | 50 | delete[] this->glyphArray; |
[7785] | 51 | } |
52 | ||
[8751] | 53 | //! @todo check if we really do not need to delete the fastTextureID here. |
54 | // if (this->fastTextureID != 0) | |
55 | // if(glIsTexture(this->fastTextureID)) | |
56 | // glDeleteTextures(1, &this->fastTextureID); | |
[7785] | 57 | |
[8751] | 58 | // erease this font out of the memory. |
59 | if (likely(this->fontTTF != NULL)) | |
60 | TTF_CloseFont(this->fontTTF); | |
[7785] | 61 | } |
62 | ||
63 |
Note: See TracBrowser
for help on using the repository browser.