Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
txt.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef TXT_H
20#define TXT_H
21
22class FontClass;
23class ConvertClass;
24class TextureClass;
26 public:
27 TextTextureClass(void);
29
30 // function to rebuild the texture with the new parameters
31 bool Build_Texture(FontClass &font, const char *str, int fore, int back, ConvertClass &conv);
32
33 // returns a pointer to the texture that we created
34 TextureClass *Get_Texture(void) {return Texture;}
35
36 // accessor method for the size of the texture we created
37 int Get_Texture_Size(void) {return TextureSize;}
38 private:
39 // function to determine if the texture needs to be rebuilt based on its parameters
40 bool Is_Texture_Valid(FontClass &font, const char *str, int fore, int back, ConvertClass &conv);
41
42 // all the parameters we need to remember to deterimine if the texture is changing
43 // (changing any of these means the texture needs to be rebuilt)
44 char *TextureString;
45 FontClass *Font;
46 ConvertClass *Convert;
47 int ForegroundColor;
48 int BackgroundColor;
49
50 // pointer to the created texture if we have created it so far
51 TextureClass *Texture;
52
53 // the size of the texture we created (created textures are square)
54 int TextureSize;
55
56};
57
58#endif
TextureClass * Get_Texture(void)
Definition txt.h:34
TextTextureClass(void)
Definition txt.cpp:28
~TextTextureClass(void)
Definition txt.cpp:39
bool Build_Texture(FontClass &font, const char *str, int fore, int back, ConvertClass &conv)
Definition txt.cpp:61
int Get_Texture_Size(void)
Definition txt.h:37