~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to extern/bFTGL/include/FTTextureGlyph.h

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef     __FTTextureGlyph__
 
2
#define     __FTTextureGlyph__
 
3
 
 
4
 
 
5
#include <ft2build.h>
 
6
#include FT_FREETYPE_H
 
7
#include FT_GLYPH_H
 
8
 
 
9
#include "FTGL.h"
 
10
#include "FTGlyph.h"
 
11
 
 
12
 
 
13
/**
 
14
 * FTTextureGlyph is a specialisation of FTGlyph for creating texture
 
15
 * glyphs.
 
16
 * 
 
17
 * @see FTGlyphContainer
 
18
 *
 
19
 */
 
20
class FTGL_EXPORT FTTextureGlyph : public FTGlyph
 
21
{
 
22
    public:
 
23
        /**
 
24
         * Constructor
 
25
         *
 
26
         * @param glyph     The Freetype glyph to be processed
 
27
         * @param id        The id of the texture that this glyph will be
 
28
         *                  drawn in
 
29
         * @param xOffset   The x offset into the parent texture to draw
 
30
         *                  this glyph
 
31
         * @param yOffset   The y offset into the parent texture to draw
 
32
         *                  this glyph
 
33
         * @param width     The width of the parent texture
 
34
         * @param height    The height (number of rows) of the parent texture
 
35
         */
 
36
        FTTextureGlyph( FT_GlyphSlot glyph, int id, int xOffset, int yOffset, GLsizei width, GLsizei height);
 
37
 
 
38
        /**
 
39
         * Destructor
 
40
         */
 
41
        virtual ~FTTextureGlyph();
 
42
 
 
43
        /**
 
44
         * Renders this glyph at the current pen position.
 
45
         *
 
46
         * @param pen   The current pen position.
 
47
         * @return      The advance distance for this glyph.
 
48
         */
 
49
        virtual float Render( const FTPoint& pen);
 
50
        
 
51
    private:
 
52
        /**
 
53
         * The width of the glyph 'image'
 
54
         */
 
55
        int destWidth;
 
56
 
 
57
        /**
 
58
         * The height of the glyph 'image'
 
59
         */
 
60
        int destHeight;
 
61
 
 
62
        /**
 
63
         * Vector from the pen position to the topleft corner of the pixmap
 
64
         */
 
65
        FTPoint pos;
 
66
        
 
67
        /**
 
68
         * The texture co-ords of this glyph within the texture.
 
69
         */
 
70
        FTPoint uv[2];
 
71
        
 
72
        /**
 
73
         * The texture index that this glyph is contained in.
 
74
         */
 
75
        int glTextureID;
 
76
 
 
77
        /**
 
78
         * The texture index of the currently active texture
 
79
         *
 
80
         * We call glGetIntegerv( GL_TEXTURE_2D_BINDING, activeTextureID);
 
81
         * to get the currently active texture to try to reduce the number
 
82
         * of texture bind operations
 
83
         */
 
84
        GLint activeTextureID;
 
85
        
 
86
};
 
87
 
 
88
 
 
89
#endif  //  __FTTextureGlyph__