Skip to content
Snippets Groups Projects
Commit 0cbdadcf authored by Oliver Bock's avatar Oliver Bock
Browse files

Refined OGLFT tests (all faces but "Filled" do work)

* Grayscale faces do need a backgorund color
* Texture faces do need enabled textures (oh well)
* Translucent faces need activated alpha blending (you guessed it)
parent a4b11916
No related branches found
No related tags found
No related merge requests found
......@@ -512,13 +512,17 @@ void Starsphere::initialize(const int width, const int height, const Resource *f
// create font instance using font resource (base address + size)
m_PolygonFont = new FTGLPolygonFont(&font->data()->at(0), font->data()->size());
// face = new OGLFT::Outline( "LiberationSans-Regular.ttf", 6, 72 );
face = new OGLFT::Outline(&font->data()->at(0), font->data()->size(), 6, 72 );
face = new OGLFT::TranslucentTexture( "LiberationSans-Regular.ttf", 17, 100 );
// face = new OGLFT::Outline(&font->data()->at(0), font->data()->size(), 6, 72 );
if ( face == 0 || !face->isValid() ) {
cerr << "Could not construct face" << endl;
}
#if defined( GL_RASTER_POSITION_UNCLIPPED_IBM )
glEnable( GL_RASTER_POSITION_UNCLIPPED_IBM );
#endif
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
face->setForegroundColor( 1., 0., 0. );
face->setForegroundColor( 1.0, 1.0, 0.0, 1.0 );
// face->setBackgroundColor( 0.0, 0.0, 0.0, 0.0 );
m_PolygonFont->CharMap(ft_encoding_unicode);
// m_PolygonFont->Depth(0.05);
......@@ -715,9 +719,14 @@ void Starsphere::render(const double timeOfDay)
glColor3f(1.0, 1.0, 0.0);
glTranslatef(xStartPosLeft, yStartPosTop, 0);
glScalef(fontScaleLarge, fontScaleLarge, 1.0);
m_PolygonFont->Render("Einstein@Home");
face->draw(0.0, -20.0, "Einstein@Home");
// glScalef(fontScaleLarge, fontScaleLarge, 1.0);
glScalef(0.001, 0.001, 1.0);
// m_PolygonFont->Render("Einstein@Home");
glEnable( GL_TEXTURE_2D );
glEnable(GL_DEPTH_TEST);
face->draw(0.0, -10.0, "Einstein@Home");
glDisable(GL_DEPTH_TEST);
glDisable( GL_TEXTURE_2D );
glLoadIdentity();
glColor4f(1.0, 1.0, 1.0, 0.5);
......
......@@ -127,7 +127,7 @@ private:
// resource handling
FTFont *m_PolygonFont;
OGLFT::Outline* face;
OGLFT::TranslucentTexture* face;
// local HUD contents
string m_UserName;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment