Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3367 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jan 7, 2005, 1:51:16 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: updated screenloader with more generic functions

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

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

    r3365 r3367  
    2222using namespace std;
    2323
     24GLMenuImageScreen* GLMenuImageScreen::singletonRef = 0;
     25
     26GLMenuImageScreen* GLMenuImageScreen::getInstance()
     27{
     28  if( singletonRef == NULL)
     29    singletonRef = new GLMenuImageScreen ();
     30  return singletonRef;
     31}
    2432
    2533/**
     
    126134  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    127135
    128   // Screen Size.
     136  /* screen size */
    129137  int screenWidth = 640;
    130138  int screenHeight = 480;
    131139 
    132   // Set Image Size.
     140  /* set image size */
    133141  int imageWidth = 640;
    134142  int imageHeight = 480;
    135143 
    136   // Start pos of image.
     144  /* start pos of image */
    137145  int offsetX = (screenWidth - imageWidth)/2;
    138146  int offsetY = (screenHeight - imageHeight)/2;
    139147 
    140   glEnable(GL_BLEND);
    141   glEnable(GL_TEXTURE_2D);
    142 
    143   glPushAttrib(GL_LIGHTING_BIT | GL_TRANSFORM_BIT);
    144  
    145   glDisable(GL_LIGHTING);
     148  /* loadbar pos */
     149  int barX = 400;
     150  int barY = 50;
     151  int barWidth = 230;
     152  int barHeight = 30;
     153
    146154  glMatrixMode(GL_PROJECTION);
    147155  glPushMatrix();
     
    152160  glLoadIdentity();
    153161  glPushMatrix();
     162
    154163  glEnable(GL_BLEND);
    155 
     164  glPushAttrib(GL_LIGHTING_BIT | GL_TRANSFORM_BIT);
     165  glDisable(GL_LIGHTING);
     166
     167  glBegin(GL_QUADS);
     168  glColor3f(0.96, 0.84, 0.34);
     169  glVertex2i(barX, barY);
     170  glVertex2i(barX + barWidth, barY);
     171  glVertex2i(barX + barWidth, barY + barHeight);
     172  glVertex2i(barX, barY + barHeight);
     173  glColor3f(1.0, 1.0, 1.0);
     174  glEnd();
     175
     176  glEnable(GL_TEXTURE_2D);
    156177  glBegin(GL_QUADS);
    157178  glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY);
    158   glTexCoord2i(1, 0 ); glVertex2i(offsetX + imageWidth, offsetY);
    159   glTexCoord2i( 1, 1 ); glVertex2i(offsetX + imageWidth, offsetY + imageHeight);
    160   glTexCoord2i( 0, 1 ); glVertex2i(offsetX, offsetY + imageHeight);
     179  glTexCoord2i(1, 0); glVertex2i(offsetX + imageWidth, offsetY);
     180  glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY + imageHeight);
     181  glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY + imageHeight);
    161182  glEnd();
    162 
    163183  glDisable(GL_TEXTURE_2D);
    164 
    165   glBegin(GL_QUADS);
    166   glColor3f(1.0, 0.0, 0.0);
    167   glVertex2i(100, 100);
    168   glVertex2i(200, 100);
    169   glVertex2i(200, 150);
    170   glVertex2i(100, 150);
    171   glEnd();
    172 
    173184
    174185  glDisable(GL_BLEND);
     
    179190
    180191  SDL_GL_SwapBuffers();                   
    181   SDL_Delay(1000);
     192  SDL_Delay(5000);
    182193}
    183194 
  • orxonox/trunk/src/glmenu_imagescreen.h

    r3365 r3367  
    1717  GLMenuImageScreen ();
    1818  ~GLMenuImageScreen ();
     19
     20  static GLMenuImageScreen* getInstance();
     21
     22  static GLMenuImageScreen* singletonRef;
    1923
    2024  void init ();
Note: See TracChangeset for help on using the changeset viewer.