From 2cd6a174d22fab03f7d484b239b807c91e1ff853 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 9 May 2007 10:41:56 +0000 Subject: [PATCH] Added GL_MAX_TEXTURE_SIZE check and use of OSG_MAX_TEXTURE_SIZE env var to help hint to osgText that the native OpenGL implementation only supports textures up to a given size. --- src/osgText/Font.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/osgText/Font.cpp b/src/osgText/Font.cpp index 99c56f114..4837c6e43 100644 --- a/src/osgText/Font.cpp +++ b/src/osgText/Font.cpp @@ -135,8 +135,8 @@ Font::Font(FontImplementation* implementation): _height(16), _margin(1), _marginRatio(0.02), - _textureWidthHint(1024), - _textureHeightHint(1024), + _textureWidthHint(8000), + _textureHeightHint(8000), _minFilterHint(osg::Texture::LINEAR_MIPMAP_LINEAR), _magFilterHint(osg::Texture::LINEAR) { @@ -514,6 +514,15 @@ void Font::GlyphTexture::apply(osg::State& state) const if (newTextureObject) { + GLint maxTextureSize = 256; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); + if (maxTextureSize < getTextureWidth() || maxTextureSize < getTextureHeight()) + { + osg::notify(osg::WARN)<<"Warning: osgText::Font texture size of ("<