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

Added preliminary test code for OGLFT which might eventually replace FTGL (so...

Added preliminary test code for OGLFT which might eventually replace FTGL (so far FTGL seems to be the culprit that causes the nasty "HUD killing" bug)
parent fc51ac46
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,8 @@ BOINC_PREFIX ?= /home/oliver/development/aei/boinc
CXX ?= g++
# variables
LIBS = -L${BOINC_PREFIX}/lib -Bstatic $(shell sdl-config --static-libs) -lfreetype -lftgl -lboinc_api -lboinc -Wl,-Bdynamic -lGL -lGLU
CPPFLAGS = -I/usr/include $(shell sdl-config --cflags) $(shell pkg-config --cflags ftgl) -I${BOINC_PREFIX}/include/BOINC
LIBS = -L${BOINC_PREFIX}/lib -L${PWD}/oglft/lib -Bstatic $(shell sdl-config --static-libs) -lfreetype -lftgl -lOGLFT -lboinc_api -lboinc -Wl,-Bdynamic -lGL -lGLU
CPPFLAGS = -DOGLFT_NO_SOLID -DOGLFT_NO_QT -I/usr/include $(shell sdl-config --cflags) $(shell pkg-config --cflags ftgl) -I${BOINC_PREFIX}/include/BOINC
DEPS = Makefile
OBJS = starlist.o snr_list.o pulsar_list.o AbstractGraphicsEngine.o Starsphere.o WindowManager.o ${RESOURCESPEC}.o Resource.o ResourceFactory.o BOINCClientAdapter.o
DEBUGFLAGSCPP = -pg -ggdb -O0
......
......@@ -33,6 +33,7 @@ Starsphere::Starsphere() : AbstractGraphicsEngine()
Starsphere::~Starsphere()
{
if(m_PolygonFont) delete m_PolygonFont;
if(face) delete face;
}
/**
......@@ -511,6 +512,14 @@ 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 );
if ( face == 0 || !face->isValid() ) {
cerr << "Could not construct face" << endl;
}
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
face->setForegroundColor( 1., 0., 0. );
m_PolygonFont->CharMap(ft_encoding_unicode);
// m_PolygonFont->Depth(0.05);
m_PolygonFont->FaceSize(1);
......@@ -708,6 +717,7 @@ void Starsphere::render(const double timeOfDay)
glTranslatef(xStartPosLeft, yStartPosTop, 0);
glScalef(fontScaleLarge, fontScaleLarge, 1.0);
m_PolygonFont->Render("Einstein@Home");
face->draw(0.0, -20.0, "Einstein@Home");
glLoadIdentity();
glColor4f(1.0, 1.0, 1.0, 0.5);
......
......@@ -17,6 +17,8 @@
#include "AbstractGraphicsEngine.h"
#include "oglft/include/OGLFT.h"
/* SIN and COS take arguments in DEGREES */
#define PI 3.14159265
#define PI2 (2*PI)
......@@ -125,6 +127,7 @@ private:
// resource handling
FTFont *m_PolygonFont;
OGLFT::Outline* 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