mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-05 05:42:18 +00:00
initial commit. This is icculus version 5542b94cae02a6333845854bbbd1abe0a259f1a4
This commit is contained in:
commit
3096eaf5e2
2519 changed files with 816064 additions and 0 deletions
101
ExternalLibs/FTGL/include/FTGlyph.h
Normal file
101
ExternalLibs/FTGL/include/FTGlyph.h
Normal file
|
@ -0,0 +1,101 @@
|
|||
#ifndef __FTGlyph__
|
||||
#define __FTGlyph__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
#include "FTBBox.h"
|
||||
#include "FTPoint.h"
|
||||
#include "FTGL.h"
|
||||
|
||||
|
||||
/**
|
||||
* FTGlyph is the base class for FTGL glyphs.
|
||||
*
|
||||
* It provides the interface between Freetype glyphs and their openGL
|
||||
* renderable counterparts. This is an abstract class and derived classes
|
||||
* must implement the <code>render</code> function.
|
||||
*
|
||||
* @see FTGlyphContainer
|
||||
* @see FTBBox
|
||||
* @see FTPoint
|
||||
*
|
||||
*/
|
||||
class FTGL_EXPORT FTGlyph
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param glyph The Freetype glyph to be processed
|
||||
* @param useDisplayList Enable or disable the use of Display Lists for this glyph
|
||||
* <code>true</code> turns ON display lists.
|
||||
* <code>false</code> turns OFF display lists.
|
||||
*/
|
||||
FTGlyph( FT_GlyphSlot glyph, bool useDisplayList = true);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~FTGlyph();
|
||||
|
||||
/**
|
||||
* Renders this glyph at the current pen position.
|
||||
*
|
||||
* @param pen The current pen position.
|
||||
* @return The advance distance for this glyph.
|
||||
*/
|
||||
virtual const FTPoint& Render( const FTPoint& pen) = 0;
|
||||
|
||||
/**
|
||||
* Return the advance width for this glyph.
|
||||
*
|
||||
* @return advance width.
|
||||
*/
|
||||
const FTPoint& Advance() const { return advance;}
|
||||
|
||||
/**
|
||||
* Return the bounding box for this glyph.
|
||||
*
|
||||
* @return bounding box.
|
||||
*/
|
||||
const FTBBox& BBox() const { return bBox;}
|
||||
|
||||
/**
|
||||
* Queries for errors.
|
||||
*
|
||||
* @return The current error code.
|
||||
*/
|
||||
FT_Error Error() const { return err;}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* The advance distance for this glyph
|
||||
*/
|
||||
FTPoint advance;
|
||||
|
||||
/**
|
||||
* The bounding box of this glyph.
|
||||
*/
|
||||
FTBBox bBox;
|
||||
|
||||
/**
|
||||
* Flag to enable or disable the use of Display Lists inside FTGL
|
||||
* <code>true</code> turns ON display lists.
|
||||
* <code>false</code> turns OFF display lists.
|
||||
*/
|
||||
bool useDisplayList;
|
||||
|
||||
/**
|
||||
* Current error code. Zero means no error.
|
||||
*/
|
||||
FT_Error err;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __FTGlyph__
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue