From 7b313eef3478647fcfc53031ef927bb9e6eb0def Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 3 Aug 2006 13:12:14 +0000 Subject: [PATCH] Added OSG_TEXT_INCREMENTAL_SUBLOADING ON/OFF env var check to osgText::Font to optional disable the incremental subloading. --- src/osgText/Font.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/osgText/Font.cpp b/src/osgText/Font.cpp index ee292422f..ca17e4cf1 100644 --- a/src/osgText/Font.cpp +++ b/src/osgText/Font.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -26,6 +27,9 @@ using namespace osgText; using namespace std; +static osg::ApplicationUsageProxy Font_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_TEXT_INCREMENTAL_SUBLOADING ","ON | OFF"); + + std::string osgText::findFontFile(const std::string& str) { // try looking in OSGFILEPATH etc first for fonts. @@ -513,6 +517,12 @@ void Font::GlyphTexture::apply(osg::State& state) const // subloading bugs by loading all at once. s_subloadAllGlyphsTogether = true; } + + const char* str = getenv("OSG_TEXT_INCREMENTAL_SUBLOADING"); + if (str && (strcmp(str,"OFF")==0 || strcmp(str,"Off")==0 || strcmp(str,"Off")==0)) + { + s_subloadAllGlyphsTogether = true; + } } @@ -551,7 +561,7 @@ void Font::GlyphTexture::apply(osg::State& state) const } else { - //std::cout<<"all loading"<