Changeset 3456 in orxonox.OLD for orxonox/trunk/src/sfont/fontset.cc
- Timestamp:
- Mar 4, 2005, 10:01:43 AM (20 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/sfont/fontset.cc
r3455 r3456 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 * This file is extended to the needs of the orxonox-project. * 17 * The main difference to the version of Marius is, that textures get * 18 * loaded by orxonox Texture-class, and that the comments are set up, * 19 * in doxygen style * 20 * the Copyright of the original file is below this copyright, and we * 21 * hope not to offend Marius through this. * 22 *** 23 24 */ 25 1 26 /*************************************************************************** 2 27 cone3dfont.cpp - description … … 16 41 ***************************************************************************/ 17 42 18 #include "cone3dfont.h" 43 44 #include "fontset.h" 19 45 #include <stdarg.h> 20 46 21 47 #include "../importer/texture.h" 22 48 23 int Cone3DFont::SetSize(float x, float y) // Set the size of the font 49 /** 50 \brief initializes a new fontset 51 */ 52 FontSet::FontSet() 53 { 54 this->sizex=1.0f; 55 this->sizey=1.0f; 56 this->font = NULL; 57 } 58 59 /** 60 \brief initializes a new fontset with a texture for the font 61 \param fontFile The fontfile to load 62 */ 63 FontSet::FontSet(char* fontFile) 64 { 65 this->sizex=1.0f; 66 this->sizey=1.0f; 67 this->font = NULL; 68 69 } 70 71 /** 72 \brief deletes the Fontset by freeing all allocated space 73 and then deleting the Texture. 74 */ 75 FontSet::~FontSet() 76 { 77 killFont(); 78 // delete the texture; 79 delete font; 80 } 81 82 /** 83 \brief sets the size of the font 84 \param x the width of the font 85 \param y the height of the font 86 */ 87 int FontSet::setSize(float x, float y) 24 88 { 25 89 sizex=x; … … 29 93 } 30 94 31 int Cone3DFont::BuildFont(char *file) // Build Our Font Display List 95 /** 96 \brief builds the fontset 97 \param file the name of the file to get the fontset from. 98 */ 99 int FontSet::buildFont(char *file) 32 100 { 33 101 int loop1; 34 102 float cx, cy; 35 103 104 if (!font) 105 delete font; 36 106 font = new Texture(); 37 107 font->loadImage(file); … … 61 131 } 62 132 63 int Cone3DFont::KillFont(GLvoid) // Delete The Font From Memory 133 /** 134 \brief deletes the display lists. 135 */ 136 int FontSet::killFont(void) // Delete The Font From Memory 64 137 { 65 138 glDeleteLists(base,256); // Delete All 256 Display Lists … … 67 140 } 68 141 69 int Cone3DFont::PrintText(GLint x, GLint y, char type, char *fmt,...)// Where The Printing Happens 142 /** 143 \brief prints out some text 144 \param x most left coordinate of the text. 145 \param y the top coordinate of the text 146 \param type Type of text 147 \param fmt The text to display 148 \param ... more text 149 */ 150 int FontSet::printText(int x, int y, char type, char *fmt,...)// Where The Printing Happens 70 151 { 71 152 char text[1024]; // Holds Our String
Note: See TracChangeset
for help on using the changeset viewer.