File: Text.h

package info (click to toggle)
openscenegraph 1.2.0-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 26,924 kB
  • ctags: 25,229
  • sloc: cpp: 239,326; ansic: 2,178; sh: 1,990; yacc: 548; perl: 237; makefile: 227; lex: 151
file content (59 lines) | stat: -rw-r--r-- 1,294 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* -*-c++-*- Producer - Copyright (C) 2001-2004  Don Burns
 *
 * This library is open source and may be redistributed and/or modified under
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * OpenSceneGraph Public License for more details.
 */

#ifndef BMV_TEXT_H
#define BMV_TEXT_H

#ifdef WIN32

#include <windows.h>

#endif

#include <string>
#include <map>

#include <GL/gl.h>


class Text {
    public:
	enum Font {
	    BitmapFont,
	    FilledFont,
	    OutlineFont,
	    StrokeFont,
		LastFont
	};	
	Text();
	void drawString( Font, std::string );
	static Text *getSingleton();
	void *operator new( size_t size );

    protected:

	static Text *theText;

    private :

	GLuint fontmap[LastFont];
	GLuint loadFont(Font font);

	bool createStrokeFont( GLuint fontBase );
	bool createOutlineFont( GLuint fontBase );
	bool createFilledFont( GLuint fontBase );
	bool createBitmapFont( GLuint fontBase );

};

#endif