Hi (Robert :)

I've tried a lot of things to get osgText working on MacOSX with VAO. GL3 on 
OSX Core Profile requires VAOs.

osgText doesn't setup the VAO path correctly on MacOSX. I can show glyphs when 
I use a osg::Geometry as a Wrapper to draw geometries from text glyphs like so:


Code:
    
class ExtText : public Text {
    friend class VAOText;
};

class VAOText : public osg::Geometry
{
private:
    osg::ref_ptr<ExtText> _t;

...
    void redraw()
    {
        unsigned int contextID = 0; // renderInfo.getState()->getContextID();
        
        if ( !_t->_textureGlyphQuadMap.empty() )
        {
            const ExtText::GlyphQuads& glyphquad = 
(_t->_textureGlyphQuadMap.begin())->second;
            if (!glyphquad._transformedCoords[contextID].valid() || 
glyphquad._transformedCoords[contextID]->empty() )
            {
                _t->computePositions(contextID);
            }
        }
        
        for(ExtText::TextureGlyphQuadMap::iterator 
titr=_t->_textureGlyphQuadMap.begin();
            titr!=_t->_textureGlyphQuadMap.end();
            ++titr)
        {
            const ExtText::GlyphQuads& glyphquad = titr->second;
            const ExtText::GlyphQuads::Coords3& transformedCoords = 
glyphquad._transformedCoords[contextID];
            if (transformedCoords.valid() && !transformedCoords->empty())
            {
                
                setVertexArray(transformedCoords.get());
                setTexCoordArray(0, glyphquad._texcoords.get());
                
                getOrCreateStateSet()->setTextureAttributeAndModes(0, 
titr->first.get(),osg::StateAttribute::ON);
                addPrimitiveSet(glyphquad._quadIndices);
            }
        }
    }




But it doesn't work with plain osgText. So something is wrong in osgText / VAO.

Cheers,
Remo

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70061#70061





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to