Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3368 in orxonox.OLD for orxonox/trunk/src/glmenu_imagescreen.cc


Ignore:
Timestamp:
Jan 7, 2005, 2:44:22 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: finished implementing loadscreen. looks quite fancy… enjoy :))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/glmenu_imagescreen.cc

    r3367 r3368  
    8181  this->backTex = new Texture();
    8282  this->backTex->loadImage("load_screen.jpg");
     83
     84  this->maxValue = 10;
     85  this->currentValue = 0;
    8386
    8487  // End of Background image code.
     
    147150 
    148151  /* loadbar pos */
    149   int barX = 400;
     152  int barX = 390;
    150153  int barY = 50;
    151154  int barWidth = 230;
    152155  int barHeight = 30;
     156
     157  int val = ((float)this->currentValue/(float)this->maxValue) * barWidth;
    153158
    154159  glMatrixMode(GL_PROJECTION);
     
    168173  glColor3f(0.96, 0.84, 0.34);
    169174  glVertex2i(barX, barY);
     175  glVertex2i(barX + val, barY);
     176  glVertex2i(barX + val, barY + barHeight);
     177  glVertex2i(barX, barY + barHeight);
     178  glColor3f(1.0, 1.0, 1.0);
     179  glEnd();
     180
     181  glBegin(GL_QUADS);
     182  glColor3f(0.0, 0.0, 0.0);
     183  glVertex2i(barX, barY);
    170184  glVertex2i(barX + barWidth, barY);
    171185  glVertex2i(barX + barWidth, barY + barHeight);
    172186  glVertex2i(barX, barY + barHeight);
     187  glColor3f(1.0, 1.0, 1.0);
     188  glEnd();
     189
     190  /* draw black border */
     191  glBegin(GL_QUADS);
     192  glColor3f(0.0, 0.0, 0.0);
     193  glVertex2i(barX-1, barY-1);
     194  glVertex2i(barX + barWidth +1, barY-1);
     195  glVertex2i(barX + barWidth+1, barY + barHeight+1);
     196  glVertex2i(barX - 1, barY + barHeight +1);
     197  glColor3f(1.0, 1.0, 1.0);
     198  glEnd();
     199
     200  /* draw white border */
     201  glBegin(GL_QUADS);
     202  glColor3f(1.0, 1.0, 1.0);
     203  glVertex2i(barX-2, barY-2);
     204  glVertex2i(barX + barWidth +2, barY-2);
     205  glVertex2i(barX + barWidth+2, barY + barHeight+2);
     206  glVertex2i(barX - 2, barY + barHeight +2);
    173207  glColor3f(1.0, 1.0, 1.0);
    174208  glEnd();
     
    190224
    191225  SDL_GL_SwapBuffers();                   
    192   SDL_Delay(5000);
    193226}
    194227 
     
    224257   \param maximum of steps
    225258*/
    226 void GLMenuImageScreen::setMaximum(int maxStep)
    227 {
    228   this->maxStep = maxStep;
     259void GLMenuImageScreen::setMaximum(int maxValue)
     260{
     261  this->maxValue = maxValue;
    229262}
    230263
     
    235268int GLMenuImageScreen::getMaximum()
    236269{
    237   return this->maxStep;
     270  return this->maxValue;
    238271}
    239272
     
    267300{
    268301  this->currentValue++;
    269 }
     302  this->draw();
     303}
Note: See TracChangeset for help on using the changeset viewer.