Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/fontdata/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

orxonox/trunk: Preparing for FONT-DATA

File size: 1.3 KB
Line 
1/*
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
16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
17
18#include "font_data.h"
19
20#include "debug.h"
21#include "compiler.h"
22
23#include "sdlincl.h"
24
25/**
26 * @brief creates a new Font Data.
27 */
28FontData::FontData()
29{
30  this->fontTTF = NULL;
31  this->glyphArray = NULL;
32}
33
34
35/**
36 * @brief Destructor of a Font
37 *
38 *  Frees Data, and deletes the fonts from GL
39 */
40FontData::~FontData()
41{
42  // deleting all Glyphs
43  if (this->glyphArray != NULL)
44  {
45    for (int i = 0; i < FONT_HIGHEST_KNOWN_CHAR; i++)
46    {
47      if (this->glyphArray[i] != NULL)
48        delete this->glyphArray[i];
49    }
50    delete[] this->glyphArray;
51  }
52
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);
57
58  // erease this font out of the memory.
59  if (likely(this->fontTTF != NULL))
60    TTF_CloseFont(this->fontTTF);
61}
62
63
Note: See TracBrowser for help on using the repository browser.