Commit 123fcd36 authored by Oliver Bock's avatar Oliver Bock
Browse files

Moved logo (text and subtitle) rendering to run-specific subclasses

* Note: required font initializations have been moved respectively (required for individual font sizes/colors)
* StarsphereS5R3 and StarsphereRadio now use different subtitles
parent 32e73d86
......@@ -659,31 +659,7 @@ void Starsphere::initialize(const int width, const int height, const Resource *f
}
else {
// create large font instances using font resource (base address + size)
m_FontLogo1 = new OGLFT::TranslucentTexture(
&m_FontResource->data()->at(0),
m_FontResource->data()->size(),
26, 78 );
if ( m_FontLogo1 == 0 || !m_FontLogo1->isValid() ) {
cerr << "Could not construct logo1 font face from in memory resource!" << endl;
return;
}
m_FontLogo1->setForegroundColor(1.0, 1.0, 0.0, 1.0);
// create medium font instances using font resource (base address + size)
m_FontLogo2 = new OGLFT::TranslucentTexture(
&m_FontResource->data()->at(0),
m_FontResource->data()->size(),
12, 72 );
if ( m_FontLogo2 == 0 || !m_FontLogo2->isValid() ) {
cerr << "Could not construct logo2 font face from in memory resource!" << endl;
return;
}
m_FontLogo2->setForegroundColor(0.75, 0.75, 0.75, 1.0);
// note: initialization of logo font instances is done in subclasses!
// create medium font instances using font resource (base address + size)
m_FontHeader = new OGLFT::TranslucentTexture(
......@@ -888,9 +864,8 @@ void Starsphere::render(const double timeOfDay)
glLoadIdentity();
if (isFeature(LOGO)) {
m_FontLogo1->draw(m_XStartPosLeft, m_YStartPosTop, "Einstein@Home");
m_FontLogo2->draw(m_XStartPosLeft + 25, m_YStartPosTop - m_YOffsetLarge, "World Year of Physics 2005");
m_FontLogo2->draw(m_XStartPosLeft, m_YStartPosTop - m_YOffsetLarge - 14, "International Year of Astronomy 2009");
// call subclass implementation
renderLogo();
}
if (isFeature(SEARCHINFO)) renderSearchInformation();
......
......@@ -138,6 +138,14 @@ protected:
*/
Starsphere(string sharedMemoryIdentifier);
/**
* \brief Render science run specific logo
*
* This abtract method is to be defined by derived classes implementing
* the science run specific logo rendering.
*/
inline virtual void renderLogo() = 0;
/**
* \brief Render science run specific search information
*
......
......@@ -72,6 +72,32 @@ void StarsphereRadio::initialize(const int width, const int height, const Resour
m_PowerSpectrumLabelYPos = m_PowerSpectrumYPos - m_PowerSpectrumLabelYOffset;
}
// create large font instances using font resource (base address + size)
m_FontLogo1 = new OGLFT::TranslucentTexture(
&m_FontResource->data()->at(0),
m_FontResource->data()->size(),
26, 78 );
if ( m_FontLogo1 == 0 || !m_FontLogo1->isValid() ) {
cerr << "Could not construct logo1 font face from in memory resource!" << endl;
return;
}
m_FontLogo1->setForegroundColor(1.0, 1.0, 0.0, 1.0);
// create medium font instances using font resource (base address + size)
m_FontLogo2 = new OGLFT::TranslucentTexture(
&m_FontResource->data()->at(0),
m_FontResource->data()->size(),
12, 72 );
if ( m_FontLogo2 == 0 || !m_FontLogo2->isValid() ) {
cerr << "Could not construct logo2 font face from in memory resource!" << endl;
return;
}
m_FontLogo2->setForegroundColor(0.75, 0.75, 0.75, 1.0);
// prepare power spectrum
generatePowerSpectrumCoordSystem(m_PowerSpectrumXPos, m_PowerSpectrumYPos);
......@@ -410,3 +436,9 @@ void StarsphereRadio::generateObservatories(float dimFactor)
glEndList();
}
void StarsphereRadio::renderLogo()
{
m_FontLogo1->draw(m_XStartPosLeft, m_YStartPosTop, "Einstein@Home");
m_FontLogo2->draw(m_XStartPosLeft, m_YStartPosTop - m_YOffsetLarge, "International Year of Astronomy 2009");
}
......@@ -100,6 +100,14 @@ public:
void refreshBOINCInformation();
private:
/**
* \brief Render science run specific logo
*
* This specific implementation shows the usual "Einstein@Home" logo combined
* with "International Year of Astronomy 2009" as subtitle
*/
inline void renderLogo();
/**
* \brief Render science run specific search information
*
......
......@@ -51,6 +51,32 @@ void StarsphereS5R3::initialize(const int width, const int height, const Resourc
m_Y4StartPosBottom = m_Y3StartPosBottom - m_YOffsetMedium;
}
// create large font instances using font resource (base address + size)
m_FontLogo1 = new OGLFT::TranslucentTexture(
&m_FontResource->data()->at(0),
m_FontResource->data()->size(),
24, 72 );
if ( m_FontLogo1 == 0 || !m_FontLogo1->isValid() ) {
cerr << "Could not construct logo1 font face from in memory resource!" << endl;
return;
}
m_FontLogo1->setForegroundColor(1.0, 1.0, 0.0, 1.0);
// create medium font instances using font resource (base address + size)
m_FontLogo2 = new OGLFT::TranslucentTexture(
&m_FontResource->data()->at(0),
m_FontResource->data()->size(),
13, 78 );
if ( m_FontLogo2 == 0 || !m_FontLogo2->isValid() ) {
cerr << "Could not construct logo2 font face from in memory resource!" << endl;
return;
}
m_FontLogo2->setForegroundColor(0.75, 0.75, 0.75, 1.0);
// prepare base class observatories (not dimmed)
generateObservatories(1.0);
}
......@@ -149,3 +175,9 @@ void StarsphereS5R3::generateObservatories(float dimFactor)
// we don't do anything special here, just call base class
Starsphere::generateObservatories(dimFactor);
}
void StarsphereS5R3::renderLogo()
{
m_FontLogo1->draw(m_XStartPosLeft, m_YStartPosTop, "Einstein@Home");
m_FontLogo2->draw(m_XStartPosLeft, m_YStartPosTop - m_YOffsetLarge, "World Year of Physics 2005");
}
......@@ -93,6 +93,14 @@ public:
void refreshBOINCInformation();
private:
/**
* \brief Render science run specific logo
*
* This specific implementation shows the usual "Einstein@Home" logo combined
* with "World Year of Physics 2005" as subtitle
*/
inline void renderLogo();
/**
* \brief Render science run specific search information
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment