Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rendertext.h
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
3 #include <sstream>
4 
5 class RText
6 {
7 private:
8 //text rendering
9  struct cline
10  {
11  cline()
12  {
13  outtime = 0;
14  }
15  cline( const cline &in )
16  {
17  if (in.cref.size() > 0)
18  cref.append( in.cref );
19  outtime = in.outtime;
20  }
21  std::string cref;
22  int outtime;
23  };
24  std::vector< cline >conlines;
25  std::vector< std::string >vhistory;
26  int ndraw;
27  int WORDWRAP;
28  int conskip;
29  int histpos;
30  std::string commandbuf;
31 public: RText();
32  virtual ~RText();
33  std::string getcurcommand();
34  int text_width( char *str ); //set the text width?
35  void draw_text( std::string &str, float left, float top, int gl_num ); //creates textplane object
36  void renderconsole(); //renders the text in the console
37  void conline( std::string &sf, bool highlight ); //add a line to
38 //the console
39  void conoutf( char* );
40  virtual void conoutf( std::string &s, int a = 0, int b = 0, int c = 0 );
41 //add a line to the console(Use this one.)
42  void saycommand( const char *init ); //actually does the appending of
43 //the string to the commandbuf, and seperates entries
44  void ConsoleKeyboardI( int code, bool isdown );
45 //interpret keyboard input to the console
46  void conoutn( std::string &in, int a, int b, int c );
47 };
48