15 #define OSGTEXT_GLYPH 1
22 #include <osg/Texture2D>
23 #include <osg/StateSet>
24 #include <osg/Geometry>
27 #include <osgText/Export>
28 #include <osgText/KerningType>
29 #include <osgText/Style>
31 #include <OpenThreads/Mutex>
34 #if defined(OSG_GL3_AVAILABLE) && !defined(OSG_GL2_AVAILABLE) && !defined(OSG_GL1_AVAILABLE)
35 #define OSGTEXT_GLYPH_FORMAT GL_RED
36 #define OSGTEXT_GLYPH_INTERNALFORMAT GL_R8
38 #define OSGTEXT_GLYPH_FORMAT GL_ALPHA
39 #define OSGTEXT_GLYPH_INTERNALFORMAT GL_ALPHA
54 Glyph(
Font* font,
unsigned int glyphCode);
67 void setHorizontalBearing(
const osg::Vec2& bearing);
68 const osg::Vec2& getHorizontalBearing()
const;
70 void setHorizontalAdvance(
float advance);
71 float getHorizontalAdvance()
const;
73 void setVerticalBearing(
const osg::Vec2& bearing);
74 const osg::Vec2& getVerticalBearing()
const;
76 void setVerticalAdvance(
float advance);
77 float getVerticalAdvance()
const;
83 void setTexturePosition(
int posX,
int posY);
84 int getTexturePositionX()
const;
85 int getTexturePositionY()
const;
87 void setMinTexCoord(
const osg::Vec2& coord);
90 void setMaxTexCoord(
const osg::Vec2& coord);
130 bool match(
const Style* style)
const;
153 virtual void setThreadSafeRefUnref(
bool threadSafe);
203 virtual void setThreadSafeRefUnref(
bool threadSafe);
251 const char*
className()
const {
return "GlyphTexture"; }
263 bool getSpaceForGlyph(
Glyph* glyph,
int& posX,
int& posY);
265 void addGlyph(
Glyph* glyph,
int posX,
int posY);
270 virtual void setThreadSafeRefUnref(
bool threadSafe);
273 virtual void resizeGLObjectBuffers(
unsigned int maxSize);
void setRawVertexArray(osg::Vec3Array *vertices)
const osg::Vec2 & getHorizontalBearing() const
std::vector< ref_ptr< PrimitiveSet > > PrimitiveSetList
osg::Vec3Array * getNormalArray() const
float getHorizontalAdvance() const
osg::ref_ptr< osg::Vec3Array > _rawVertexArray
This class provides an object-oriented thread mutex interface.
void setBoundingBox(osg::BoundingBox &bb)
osg::buffered_value< GLuint > GLObjectList
osg::Vec2 _horizontalBearing
osg::Geometry * getGeometry() const
osg::Geometry::PrimitiveSetList & getWallPrimitiveSetList()
osg::Geometry::PrimitiveSetList & getFrontPrimitiveSetList()
const osg::Geometry::PrimitiveSetList & getRawFacePrimitiveSetList() const
void setNormalArray(osg::Vec3Array *na)
const osg::Vec3Array * getRawVertexArray() const
osg::Geode * getGeode() const
void setHorizontalBearing(const osg::Vec2 &bearing)
osg::ref_ptr< osg::Vec3Array > _vertices
void setVerticalAdvance(float advance)
GlyphBuffer _glyphsToSubload
const char * className() const
void setWidth(float width)
unsigned int getGlyphImageMargin() const
osg::Vec2 _verticalBearing
unsigned int getGlyphCode() const
void setHeight(float height)
std::vector< osg::ref_ptr< Glyph > > GlyphRefList
std::list< osg::ref_ptr< GlyphGeometry > > GlyphGeometries
void setGlyphImageMargin(unsigned int margin)
const osg::BoundingBox & getBoundingBox() const
float getGlyphImageMarginRatio() const
osg::ref_ptr< osg::Vec3Array > _normals
osg::Vec2 _verticalBearing
osg::Geometry::PrimitiveSetList _wallPrimitiveSetList
GLint GLenum GLsizei width
OpenThreads::Mutex _mutex
osg::ref_ptr< osg::Geometry > _geometry
unsigned int getGlyphCode() const
const osg::Vec2 & getVerticalBearing() const
void setHorizontalAdvance(float advance)
osg::Vec2 _horizontalBearing
osg::buffered_object< GlyphPtrList > GlyphBuffer
osg::ref_ptr< Style > _style
GLint GLenum GLsizei GLsizei height
osg::ref_ptr< osg::Geode > _geode
void setGlyphImageMarginRatio(float margin)
std::vector< const Glyph * > GlyphPtrList
osg::Geometry::PrimitiveSetList _rawFacePrimitiveSetList
osg::Vec3Array * getRawVertexArray()
const Font * getFont() const
void setVerticalBearing(const osg::Vec2 &bearing)
void setHeight(float height)
osg::Geometry::PrimitiveSetList _backPrimitiveSetList
osg::Geometry::PrimitiveSetList _frontPrimitiveSetList
void setVertexArray(osg::Vec3Array *va)
osg::Geometry::PrimitiveSetList & getBackPrimitiveSetList()
osg::Geometry::PrimitiveSetList & getRawFacePrimitiveSetList()
const Font * getFont() const
void setWidth(float width)
osg::Vec3Array * getVertexArray() const
float getVerticalAdvance() const
GlyphGeometries _glyphGeometries