From 89b2575ffee3391d8b575b1d5957c99b3c7fa68b Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Sun, 24 Nov 2002 00:23:47 +0000 Subject: [PATCH] Forced GLPixmapGlyph color to white rather than using glGetCurrentColor --- src/osgText/FTGLPixmapFont.cpp | 5 +++-- src/osgText/FTPixmapGlyph.cpp | 8 +++++--- src/osgText/FTPixmapGlyph.h | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/osgText/FTGLPixmapFont.cpp b/src/osgText/FTGLPixmapFont.cpp index 0417b150a..0ace582f5 100644 --- a/src/osgText/FTGLPixmapFont.cpp +++ b/src/osgText/FTGLPixmapFont.cpp @@ -42,13 +42,13 @@ void FTGLPixmapFont::render( const char* string,unsigned int renderContext) { glPushAttrib( GL_ENABLE_BIT | GL_PIXEL_MODE_BIT); + // Why is this modifying state here? - DB glEnable(GL_BLEND); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); FTFont::render( string,renderContext); glPopAttrib(); - } @@ -56,6 +56,7 @@ void FTGLPixmapFont::render( const wchar_t* string,unsigned int renderContext) { glPushAttrib( GL_ENABLE_BIT | GL_PIXEL_MODE_BIT); + // Why is this modifying state here? - DB glEnable(GL_BLEND); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/src/osgText/FTPixmapGlyph.cpp b/src/osgText/FTPixmapGlyph.cpp index cb9bfb428..df442a82b 100644 --- a/src/osgText/FTPixmapGlyph.cpp +++ b/src/osgText/FTPixmapGlyph.cpp @@ -34,7 +34,7 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph) } numGreys = source->num_grays; - pos.x = bitmap->left; + pos.x = bitmap->left; pos.y = srcHeight - bitmap->top; // FIXME What about dest alignment? @@ -44,8 +44,10 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph) data = osgNew unsigned char[destWidth * destHeight * 4]; // Get the current glColor. - float ftglColour[4]; - glGetFloatv( GL_CURRENT_COLOR, ftglColour); + float ftglColour[4] = { 1.0, 1.0, 1.0, 1.0 }; + // What if the current color is black... Nah. + //glGetFloatv( GL_CURRENT_COLOR, ftglColour); + for(int y = 0; y < srcHeight; ++y) { diff --git a/src/osgText/FTPixmapGlyph.h b/src/osgText/FTPixmapGlyph.h index d9f6249d2..9ce3d49c9 100644 --- a/src/osgText/FTPixmapGlyph.h +++ b/src/osgText/FTPixmapGlyph.h @@ -40,6 +40,8 @@ class FTGL_EXPORT FTPixmapGlyph : public FTGlyph virtual float Render( const FT_Vector& pen); // attributes + // + private: /**