From c784f8a66915133a5cc9d8eff06427dc81cf4357 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 27 Mar 2003 10:58:20 +0000 Subject: [PATCH] Changed the background pixel colour to white, but kept the alpha value zero. This has been done to improve the quality of the mip mapping of text. --- src/osgPlugins/freetype/FreeTypeFont.cpp | 2 +- src/osgSim/LightPointDrawable.cpp | 2 ++ src/osgText/DefaultFont.cpp | 34 +++++++++++++++++------- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/osgPlugins/freetype/FreeTypeFont.cpp b/src/osgPlugins/freetype/FreeTypeFont.cpp index fa97c7b1e..d869b6342 100644 --- a/src/osgPlugins/freetype/FreeTypeFont.cpp +++ b/src/osgPlugins/freetype/FreeTypeFont.cpp @@ -85,7 +85,7 @@ osgText::Font::Glyph* FreeTypeFont::getGlyph(unsigned int charcode) // clear the image to zeros. - for(unsigned char* p=data;p!=data+dataSize;++p) *p = 0; + for(unsigned char* p=data;psetImage(width,height,1, GL_LUMINANCE_ALPHA, diff --git a/src/osgSim/LightPointDrawable.cpp b/src/osgSim/LightPointDrawable.cpp index caa3f754e..d87798595 100644 --- a/src/osgSim/LightPointDrawable.cpp +++ b/src/osgSim/LightPointDrawable.cpp @@ -162,6 +162,8 @@ void LightPointDrawable::drawImplementation(osg::State& state) const state.haveAppliedAttribute(osg::StateAttribute::POINT); + state.dirtyAllVertexArrays(); + // restore the state afterwards. state.apply(); diff --git a/src/osgText/DefaultFont.cpp b/src/osgText/DefaultFont.cpp index 8e21a0dc2..ff01a1544 100644 --- a/src/osgText/DefaultFont.cpp +++ b/src/osgText/DefaultFont.cpp @@ -209,7 +209,7 @@ void DefaultFont::constructGlyphs() unsigned char* data = new unsigned char[dataSize]; // clear the image to zeros. - for(unsigned char* p=data;p!=data+dataSize;++p) *p = 0; + for(unsigned char* p=data;psetImage(_width,_height,1, GL_LUMINANCE_ALPHA, @@ -229,21 +229,37 @@ void DefaultFont::constructGlyphs() for(unsigned int row=0;row