From Sherman Wilcox with a little reorganisation from Robert Osfield, added

test for 0 sized subloads, ignoring them to prevent a divide by zero error occuring on some buggy drivers.
This commit is contained in:
Robert Osfield
2008-03-29 09:59:23 +00:00
parent 2c1d440444
commit 818b5230fb

View File

@@ -861,6 +861,12 @@ void Font::Glyph::subload() const
osg::notify(osg::WARN)<<"before Font::Glyph::subload(): detected OpenGL error '"<<gluErrorString(errorNo)<<std::endl;
}
if(s() <= 0 || t() <= 0)
{
osg::notify(osg::INFO)<<"Font::Glyph::subload(): texture sub-image width and/or height of 0, ignoring operation."<<std::endl;
return;
}
glPixelStorei(GL_UNPACK_ALIGNMENT,getPacking());
glTexSubImage2D(GL_TEXTURE_2D,0,