Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3364 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jan 7, 2005, 12:58:44 AM (20 years ago)
Author:
patrick
Message:

orxonox/branches/parenting: extended draw function with some sort of bar. new picture added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/glmenu_imagescreen.cc

    r3363 r3364  
    7272  // Select Our VU Meter Background Texture
    7373  this->backTex = new Texture();
    74   this->backTex->loadImage("orx_tex.bmp");
     74  this->backTex->loadImage("load_screen.jpg");
    7575
    7676  // End of Background image code.
     
    127127
    128128  // Screen Size.
    129   int screen_width = 640;
    130   int screen_height = 480;
     129  int screenWidth = 640;
     130  int screenHeight = 480;
    131131 
    132132  // Set Image Size.
    133   int hud_width = 400;
    134   int hud_height = 400;
     133  int imageWidth = 640;
     134  int imageHeight = 480;
    135135 
    136136  // Start pos of image.
    137   int hud_x = 120;
    138   int hud_y = 40;
     137  int offsetX = (screenWidth - imageWidth)/2;
     138  int offsetY = (screenHeight - imageHeight)/2;
    139139 
    140140  glEnable(GL_BLEND);
     
    147147  glPushMatrix();
    148148  glLoadIdentity();
    149   glOrtho(0,screen_width,0,screen_height,-1,1); // Set Up An Ortho Screen
     149  /* set up an ortho screen */
     150  glOrtho(0, screenWidth, 0, screenHeight, -1, 1);
    150151  glMatrixMode(GL_MODELVIEW);
    151152  glLoadIdentity();
     
    154155
    155156  glBegin(GL_QUADS);
    156   glTexCoord2i(0, 0); glVertex2i(hud_x, hud_y);
    157   glTexCoord2i(1, 0 ); glVertex2i( hud_x+hud_width, hud_y );
    158   glTexCoord2i( 1, 1 ); glVertex2i( hud_x+hud_width, hud_y+hud_height );
    159   glTexCoord2i( 0, 1 ); glVertex2i( hud_x, hud_y+hud_height );
     157  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);
    160161  glEnd();
     162
     163  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
    161173
    162174  glDisable(GL_BLEND);
     
    165177  glPopMatrix();
    166178  glPopAttrib();
    167   glDisable(GL_TEXTURE_2D);
    168 
    169179
    170180  SDL_GL_SwapBuffers();                   
Note: See TracChangeset for help on using the changeset viewer.